'---------------------------------------------------------------------------- ' 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 ' Cursore attesa scene.Cursor = System.Windows.Forms.Cursors.WaitCursor ' Scrivo il nome del file aperto in una variabile globale per averlo in caso di errore IniFile.m_DDFFilePath = sFilePath ' Creazione porta Dim bOk As Boolean = CreateDoors(sFilePath, False, False) ' 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 EgtDraw() ' 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 EgtLuaCreateGlobTable("DGD") EgtLuaSetGlobStringVar("DGD.BASEDIR", IniFile.m_sDoorsDirPath & "\") If Not EgtLuaExecFile(sExecPath) Then Return False ' Setto variabili per quotatura Lua For Each HardwareDimension In Map.refDimensioningPanelVM.HardwareDimensionList Dim IsHardwareDimActive As Boolean = False If Not Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage Then IsHardwareDimActive = HardwareDimension.SelectedLayer End If EgtLuaSetGlobBoolVar("DGD." & HardwareDimension.NameLayer(), IsHardwareDimActive) Next ' 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