e1f9b932ec
- migliorata gestione DDF.
69 lines
2.5 KiB
VB.net
69 lines
2.5 KiB
VB.net
'----------------------------------------------------------------------------
|
|
' EgalTech 2016-2016
|
|
'----------------------------------------------------------------------------
|
|
' File : Doors.vb Data : 22.06.16 Versione : 1.6r10
|
|
' Contenuto : Classe Doors (interfaccia per script Porte).
|
|
'
|
|
'
|
|
'
|
|
' Modifiche : 22.06.16 DS Creazione modulo.
|
|
'
|
|
'
|
|
'----------------------------------------------------------------------------
|
|
|
|
Imports Microsoft.VisualBasic
|
|
Imports TestEIn.EgtInterface
|
|
|
|
Public Module Doors
|
|
|
|
Function ExecDoors(ByRef scene As Scene) As Boolean
|
|
' Direttorio corrente per file DDF
|
|
Dim sDir As String = String.Empty
|
|
GetPrivateProfileString(S_DOORS, K_DDFDIR, "", sDir, Form1.GetIniFile())
|
|
' Scelta file DDF
|
|
Dim OpenFileDialog As New OpenFileDialog
|
|
OpenFileDialog.Title = "Open DDF file"
|
|
OpenFileDialog.Filter = "Door Description Format(*.ddf)|*.ddf"
|
|
OpenFileDialog.FilterIndex = 1
|
|
OpenFileDialog.InitialDirectory = sDir
|
|
If OpenFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then
|
|
Return True
|
|
End If
|
|
Dim sFile As String = OpenFileDialog.FileName
|
|
System.IO.Path.GetDirectoryName(sFile)
|
|
WritePrivateProfileString(S_DOORS, K_DDFDIR, System.IO.Path.GetDirectoryName(sFile), Form1.GetIniFile())
|
|
|
|
' Generazione porta
|
|
' Cursore attesa
|
|
scene.Cursor = Cursors.WaitCursor
|
|
' Creazione porta
|
|
Dim bOk As Boolean = CreateDoors(sFile, False)
|
|
' Aggiorno la visualizzazione
|
|
EgtZoom(ZM.ALL)
|
|
' Cursore standard
|
|
scene.Cursor = Cursors.Default
|
|
|
|
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
|