827092686c
- revisione generale.
66 lines
2.5 KiB
VB.net
66 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 EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Module Doors
|
|
|
|
Function ExecDoors(ByRef scene As Scene, sFilePath As String, Optional bDraw As Boolean = True) As Boolean
|
|
' Scelta file DDF
|
|
Dim sFile As String
|
|
sFile = sFilePath
|
|
' Generazione porta
|
|
' Cursore attesa
|
|
scene.Cursor = System.Windows.Forms.Cursors.WaitCursor
|
|
' Creazione porta
|
|
Dim bOk As Boolean = CreateDoors(sFile, False, False)
|
|
' Scrivo il nome del file aperto in una variabile globale per averlo in caso di errore
|
|
IniFile.m_DDFFilePath = sFile
|
|
' se attiva modalità assemblato, calcolo posizioni dei Part
|
|
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
|
|
Map.refSceneManagerVM.ComposeAssembly(SceneManagerVM.nComposeAssembly)
|
|
End If
|
|
' Aggiorno la visualizzazione
|
|
If bDraw Then EgtZoom(ZM.ALL)
|
|
' Cursore standard
|
|
scene.Cursor = System.Windows.Forms.Cursors.Default
|
|
Return bOk
|
|
End Function
|
|
|
|
Function CreateDoors(ByRef sDdfFile As String, bNcGen As Boolean, bBatch As Boolean) As Boolean
|
|
' Carico il file
|
|
Dim sExecPath As String = String.Empty
|
|
Dim sExecName As String = String.Empty
|
|
GetMainPrivateProfileString(S_DOORS, K_DDFEXEC, "", sExecName)
|
|
sExecPath = IniFile.m_sDoorsDirPath & "\" & sExecName
|
|
If Not EgtLuaExecFile(sExecPath) Then Return False
|
|
' Lancio la creazione
|
|
EgtLuaSetGlobStringVar("DGD.FILE", sDdfFile)
|
|
EgtLuaSetGlobBoolVar("DGD.NCGEN", bNcGen)
|
|
EgtLuaSetGlobBoolVar("DGD.BATCH", bBatch)
|
|
EgtLuaSetGlobIntVar("DGD.MachEn", 0)
|
|
Dim sFunction As String = String.Empty
|
|
GetMainPrivateProfileString(S_DOORS, K_DDFFUNCTION, "", sFunction)
|
|
Dim bOk As Boolean = EgtLuaExecLine(sFunction)
|
|
Dim nErr As Integer = 999
|
|
If Not EgtLuaGetGlobIntVar("DGD.ERR", nErr) Or nErr <> 0 Then bOk = False
|
|
EgtOutLog("Doors Err=" & nErr.ToString())
|
|
' Cancello variabile globale
|
|
EgtLuaResetGlobVar("DGD")
|
|
Return bOk
|
|
End Function
|
|
|
|
End Module
|