TestEIn 1.8l3 :

- aggiornamento.
This commit is contained in:
Dario Sassi
2017-12-27 17:44:45 +00:00
parent afa8d6e8b1
commit 02b0ccdf5a
3 changed files with 64 additions and 12 deletions
+21 -5
View File
@@ -277,6 +277,7 @@ Public Class Controller
.Filter = "New geometry EgalTech(*.nge)|*.nge" &
"|Drawing Exchange Fmt(*.dxf)|*.dxf" &
"|Stereolithography (*.stl)|*.stl" &
"|Images (*.png;*.jpg;*.jpeg;*.bmp)|*.png;*.jpg;*.jpeg;*.bmp" &
"|New font EgalTech(*.nfe)|*.nfe" &
"|All Files (*.*)|*.*",
.FilterIndex = 1,
@@ -296,12 +297,12 @@ Public Class Controller
bOk = EgtImportDxf(sFile, 1)
ElseIf nFileType = FT.STL Then
bOk = EgtImportStl(sFile, 1)
ElseIf nFileType = FT.IMG Then
bOk = ImportPicture(sFile, 1)
Else
bOk = EgtInsertFile(sFile)
End If
If GetCurrLayer() = GDB_ID.NULL Then
EgtResetCurrPartLayer()
End If
If GetCurrLayer() = GDB_ID.NULL Then EgtResetCurrPartLayer()
DisableCommandLog()
' Aggiornamento
RaiseEvent UpdateUI(Me, True)
@@ -434,9 +435,10 @@ Public Class Controller
"|Stereolithography (*.stl)|*.stl" &
"|Building parts (*.btl)|*.btl" &
"|Part program ISO (*.cnc;*.xpi;*.mpf)|*.cnc;*.xpi;*.mpf" &
"|Images (*.png;*.jpg;*.jpeg;*.bmp)|*.png;*.jpg;*.jpeg;*.bmp" &
"|Cms file format (*.hed;*.ent;*.ens)|*.hed;*.ent;*.ens" &
"|All Files (*.*)|*.*",
.FilterIndex = 6,
.FilterIndex = 7,
.InitialDirectory = sDir
}
If OpenFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then
@@ -447,7 +449,7 @@ Public Class Controller
'Riconoscimento tipo file
Dim nFileType As Integer = EgtGetFileType(sFile)
Dim bOkType = (nFileType = FT.DXF Or nFileType = FT.STL Or nFileType = FT.CNC Or
nFileType = FT.CSF Or nFileType = FT.BTL)
nFileType = FT.CSF Or nFileType = FT.BTL Or nFileType = FT.IMG)
If Not bOkType Then nFileType = FT.NULL
'Prima del caricamento
Dim nFlag As Integer = 0
@@ -468,6 +470,8 @@ Public Class Controller
bOk = bOk And EgtImportCsf(sFile)
ElseIf nFileType = FT.BTL Then
bOk = bOk And EgtImportBtl(sFile, nFlag)
ElseIf nFileType = FT.IMG Then
bOk = bOk And ImportPicture(sFile, 1)
End If
EgtResetCurrPartLayer()
DisableCommandLog()
@@ -479,6 +483,18 @@ Public Class Controller
Return bOk
End Function
Private Function ImportPicture(sFile As String, dScaleFactor As Double) As Boolean
' Creo pezzo e layer
Dim nLayId As Integer = EgtCreateGroup(EgtCreateGroup(GDB_ID.ROOT))
If nLayId = GDB_ID.NULL Then Return False
' Recupero dimensioni immagine
Dim nPixelX, nPixelY As Integer
If Not EgtGetImagePixels(sFile, nPixelX, nPixelY) Then Return False
' Inserisco immagine
Dim sName As String = "Pic" + (nLayId + 1).ToString()
Return EgtAddPicture(nLayId, sName, sFile, dScaleFactor * nPixelX, dScaleFactor * nPixelY) <> GDB_ID.NULL
End Function
Public Function ExportProject(Optional ByVal sFile As String = "") As Boolean
'Assegnazione nome file con dialogo
Dim SaveFileDialog As New SaveFileDialog With {
+41 -5
View File
@@ -9339,18 +9339,18 @@ End Function
End Function
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtApplyAllMachinings"), SuppressUnmanagedCodeSecurity()>
Private Function EgtApplyAllMachinings_32(bStopOnFirstErr As Boolean, ByRef psErrList As IntPtr) As Boolean
Private Function EgtApplyAllMachinings_32(bRecalc As Boolean, bStopOnFirstErr As Boolean, ByRef psErrList As IntPtr) As Boolean
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtApplyAllMachinings"), SuppressUnmanagedCodeSecurity()>
Private Function EgtApplyAllMachinings_64(bStopOnFirstErr As Boolean, ByRef psErrList As IntPtr) As Boolean
Private Function EgtApplyAllMachinings_64(bRecalc As Boolean, bStopOnFirstErr As Boolean, ByRef psErrList As IntPtr) As Boolean
End Function
Public Function EgtApplyAllMachinings(bStopOnFirstErr As Boolean, ByRef sErrList As String) As Boolean
Public Function EgtApplyAllMachinings(bRecalc As Boolean, bStopOnFirstErr As Boolean, ByRef sErrList As String) As Boolean
Dim psErrList As IntPtr
Dim bOk As Boolean
If IntPtr.Size = 4 Then
bOk = EgtApplyAllMachinings_32(bStopOnFirstErr, psErrList)
bOk = EgtApplyAllMachinings_32(bRecalc, bStopOnFirstErr, psErrList)
Else
bOk = EgtApplyAllMachinings_64(bStopOnFirstErr, psErrList)
bOk = EgtApplyAllMachinings_64(bRecalc, bStopOnFirstErr, psErrList)
End If
If Not IsNothing(psErrList) Then
sErrList = Marshal.PtrToStringUni(psErrList)
@@ -10712,6 +10712,23 @@ Public Function EgtGetImage(nShowMode As SM, ByRef colTop As Color3d, ByRef colB
End Function
'---------- Image --------------------------------------------------------------
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetImagePixels"), SuppressUnmanagedCodeSecurity()>
Private Function EgtGetImagePixels_32(sFile As String, ByRef nPixelX As Integer, ByRef nPixelY As Integer) As Boolean
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetImagePixels"), SuppressUnmanagedCodeSecurity()>
Private Function EgtGetImagePixels_64(sFile As String, ByRef nPixelX As Integer, ByRef nPixelY As Integer) As Boolean
End Function
Public Function EgtGetImagePixels(sFile As String, ByRef nPixelX As Integer, ByRef nPixelY As Integer) As Boolean
If IntPtr.Size = 4 Then
Return EgtGetImagePixels_32(sFile, nPixelX, nPixelY)
Else
Return EgtGetImagePixels_64(sFile, nPixelX, nPixelY)
End If
End Function
'---------- Photo --------------------------------------------------------------
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtAddPhoto"), SuppressUnmanagedCodeSecurity()>
Private Function EgtAddPhoto_32(sName As String, sFile As String,
@@ -10889,6 +10906,25 @@ Public Function EgtGetPhotoImagePixels(nId As Integer, ByRef nPixelX As Integer,
End Function
'---------- Picture ------------------------------------------------------------
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtAddPicture"), SuppressUnmanagedCodeSecurity()>
Private Function EgtAddPicture_32(nParentId As Integer, sName As String, sFile As String,
dDimX As Double, dDimY As Double, nRefType As GDB_RT) As Integer
End Function
<DllImport(EgtIntDll64, CharSet:=CharSet.Unicode, EntryPoint:="EgtAddPicture"), SuppressUnmanagedCodeSecurity()>
Private Function EgtAddPicture_64(nParentId As Integer, sName As String, sFile As String,
dDimX As Double, dDimY As Double, nRefType As GDB_RT) As Integer
End Function
Public Function EgtAddPicture(nParentId As Integer, sName As String, sFile As String,
dDimX As Double, dDimY As Double, Optional nRefType As GDB_RT = GDB_RT.LOC) As Integer
If IntPtr.Size = 4 Then
Return EgtAddPicture_32(nParentId, sName, sFile, dDimX, dDimY, nRefType)
Else
Return EgtAddPicture_64(nParentId, sName, sFile, dDimX, dDimY, nRefType)
End If
End Function
'---------- Geo Base -----------------------------------------------------------
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtVectorNormalize"), SuppressUnmanagedCodeSecurity()>
Private Function EgtVectorNormalize_32(ByRef X As Double, ByRef Y As Double, ByRef Z As Double,
+2 -2
View File
@@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices
' utilizzando l'asterisco (*) come descritto di seguito:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.8.11.4")>
<Assembly: AssemblyFileVersion("1.8.11.4")>
<Assembly: AssemblyVersion("1.8.12.3")>
<Assembly: AssemblyFileVersion("1.8.12.3")>