TestEIn 1.6r11 :

- migliorata gestione DDF.
This commit is contained in:
Dario Sassi
2016-07-01 05:37:52 +00:00
parent 6bd5018ddf
commit e1f9b932ec
4 changed files with 54 additions and 24 deletions
+1
View File
@@ -87,6 +87,7 @@ Public Const S_DOORS As String = "Doors"
Public Const K_DDFEXEC As String = "DdfExec"
Public Const K_DDFFUNCTION As String = "DdfFun"
Public Const K_DDFDIR As String = "DdfDir"
Public Const K_DDFDEFAULTDIR As String = "DdfDefaultDir"
Public Const S_MACH As String = "Mach"
Public Const K_MACHINESDIR As String = "MachinesDir"
+21 -14
View File
@@ -36,20 +36,8 @@ Public Module Doors
' Generazione porta
' Cursore attesa
scene.Cursor = Cursors.WaitCursor
' Carico il file
Dim sExecPath As String = String.Empty
GetPrivateProfileString(S_DOORS, K_DDFEXEC, "", sExecPath, Form1.GetIniFile())
If Not EgtLuaExecFile(sExecPath) Then Return False
' Lancio la generazione
EgtLuaSetGlobStringVar("DGD.FILE", sFile)
Dim sFunction As String = String.Empty
GetPrivateProfileString(S_DOORS, K_DDFFUNCTION, "", sFunction, Form1.GetIniFile())
Dim bOk As Boolean = EgtLuaExecLine(sFunction)
Dim nErr As Integer = 999
If Not EgtLuaGetGlobIntVar("DGD.ERR", nErr) Or nErr <> 0 Then bOk = False
EgtOutLog("Err=" & nErr.ToString())
' Cancello variabile globale
EgtLuaResetGlobVar("DGD")
' Creazione porta
Dim bOk As Boolean = CreateDoors(sFile, False)
' Aggiorno la visualizzazione
EgtZoom(ZM.ALL)
' Cursore standard
@@ -58,4 +46,23 @@ Public Module Doors
Return bOk
End Function
Function CreateDoors(ByRef sDdfFile As String, bNcGen As Boolean) As Boolean
' Carico il file
Dim sExecPath As String = String.Empty
GetPrivateProfileString(S_DOORS, K_DDFEXEC, "", sExecPath, Form1.GetIniFile())
If Not EgtLuaExecFile(sExecPath) Then Return False
' Lancio la creazione
EgtLuaSetGlobStringVar("DGD.FILE", sDdfFile)
EgtLuaSetGlobBoolVar("DGD.NCGEN", bNcGen)
Dim sFunction As String = String.Empty
GetPrivateProfileString(S_DOORS, K_DDFFUNCTION, "", sFunction, Form1.GetIniFile())
Dim bOk As Boolean = EgtLuaExecLine(sFunction)
Dim nErr As Integer = 999
If Not EgtLuaGetGlobIntVar("DGD.ERR", nErr) Or nErr <> 0 Then bOk = False
EgtOutLog("Err=" & nErr.ToString())
' Cancello variabile globale
EgtLuaResetGlobVar("DGD")
Return bOk
End Function
End Module
+30 -8
View File
@@ -355,23 +355,45 @@ Public Class Form1
FormTimer.Stop()
' Recupero eventuali parametri da linea di comando
Dim bOpen As Boolean = False
For Each s As String In My.Application.CommandLineArgs
If Not String.IsNullOrWhiteSpace(s) Then
Dim nFileType As Integer = EgtGetFileType(s)
If My.Application.CommandLineArgs.Count() > 0 Then
Dim sFile As String = My.Application.CommandLineArgs(0)
If Not String.IsNullOrWhiteSpace(sFile) Then
Dim nFileType As Integer = EgtGetFileType(sFile)
Select Case nFileType
Case FT.NGE, FT.NFE
m_Controller.OpenProject(s, False)
m_Controller.OpenProject(sFile, False)
bOpen = True
Case FT.DXF, FT.STL, FT.CNC, FT.CSF, FT.BTL
m_Controller.ImportProject(s, False)
m_Controller.ImportProject(sFile, False)
bOpen = True
Case FT.TSC, FT.LUA
m_Controller.Exec(s, False)
m_Controller.Exec(sFile, False)
bOpen = True
End Select
Exit For
If IO.Path.GetExtension(sFile).ToLower() = ".ddf" Then
' Se manca direttorio uso quello di default
If String.IsNullOrWhiteSpace(IO.Path.GetDirectoryName(sFile)) Then
Dim sDefDir As String = String.Empty
GetPrivateProfileString(S_DOORS, K_DDFDEFAULTDIR, "", sDefDir, m_sIniFile)
sFile = sDefDir & "\" & sFile
End If
' Ricoscimento flag
Dim nPar2 As Integer = 0
If My.Application.CommandLineArgs.Count() > 1 Then
nPar2 = CInt(My.Application.CommandLineArgs(1))
End If
Dim bNcGen As Boolean = (nPar2 >= 1)
' Esecuzione
CreateDoors(sFile, bNcGen)
EgtZoom(ZM.ALL)
' Se richiesta uscita immediata
Dim bExit As Boolean = (nPar2 >= 2)
If bExit Then
Close()
End If
End If
End If
Next
End If
End Sub
Private Sub Form1_DragEnter(sender As System.Object, e As System.Windows.Forms.DragEventArgs) Handles Me.DragEnter
+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.6.18.10")>
<Assembly: AssemblyFileVersion("1.6.18.10")>
<Assembly: AssemblyVersion("1.6.18.11")>
<Assembly: AssemblyFileVersion("1.6.18.11")>