From cc5954abbf1a4c8dcd6af063be60889afa5be830 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 2 Jan 2021 09:25:55 +0000 Subject: [PATCH] EgtCAM5 : - nella gestione di Beam e Wall gli script per eseguire file bwe sono stati distinti da quelli per eseguire file btl. --- Constants/ConstIni.vb | 6 +- Project/ProjectVM.vb | 243 +++++++++++++++++++-------------------- Special-BeamWall/Beam.vb | 4 +- Special-BeamWall/Wall.vb | 4 +- 4 files changed, 129 insertions(+), 128 deletions(-) diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 1724e1e..b46bf12 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -116,14 +116,16 @@ Module ConstIni Public Const S_BEAM As String = "Beam" Public Const K_BEAMENABLE As String = "BtlEnable" Public Const K_BEAMBASEDIR As String = "BaseDir" - Public Const K_BEAMEXEC As String = "BtlExec" + Public Const K_BEAMBTLEXEC As String = "BtlExec" + Public Const K_BEAMBWEEXEC As String = "BweExec" Public Const K_BEAMMACHINES As String = "Machines" Public Const K_BEAMBUTTON As String = "Button" Public Const S_WALL As String = "Wall" Public Const K_WALLENABLE As String = "BtlEnable" Public Const K_WALLBASEDIR As String = "BaseDir" - Public Const K_WALLEXEC As String = "BtlExec" + Public Const K_WALLBTLEXEC As String = "BtlExec" + Public Const K_WALLBWEEXEC As String = "BweExec" Public Const K_WALLBUTTON As String = "Button" Public Const S_BEAMWALL As String = "BeamWall" diff --git a/Project/ProjectVM.vb b/Project/ProjectVM.vb index 4daf724..b0de5b4 100644 --- a/Project/ProjectVM.vb +++ b/Project/ProjectVM.vb @@ -186,122 +186,121 @@ Public Class ProjectVM #Region "METHODS" - Private Sub PreInitializeScene() - ' imposto colore di default - Dim DefColor As New Color3d(0, 0, 0) - GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor) - m_ProjectScene.SetDefaultMaterial(DefColor) - ' imposto colori sfondo - Dim BackTopColor As New Color3d(192, 192, 192) - GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor) - Dim BackBotColor As New Color3d(BackTopColor) - GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor) - m_ProjectScene.SetViewBackground(BackTopColor, BackBotColor) - ' imposto spessore linee - Dim nLineWidth As Integer = 1 - nLineWidth = GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, nLineWidth) - m_ProjectScene.SetLineWidth(nLineWidth) - ' imposto colore di evidenziazione - Dim MarkColor As New Color3d(255, 255, 0) - GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor) - m_ProjectScene.SetMarkMaterial(MarkColor) - ' imposto colore per superfici selezionate - Dim SelSurfColor As New Color3d(255, 255, 192) - GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor) - m_ProjectScene.SetSelSurfMaterial(SelSurfColor) - ' imposto tipo e colore del rettangolo di zoom - Dim bOutline As Boolean = True - Dim ZwColor As New Color3d(0, 0, 0) - GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor) - m_ProjectScene.SetZoomWinAttribs(bOutline, ZwColor) - ' imposto colore della linea di distanza - Dim DstLnColor As New Color3d(255, 0, 0) - GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor) - m_ProjectScene.SetDistLineMaterial(DstLnColor) - ' imposto parametri OpenGL - Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3) - Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0) - Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32) - Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32) - m_ProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits) - End Sub - - Private Sub PostInitializeScene() - ' Impostazioni Controller - m_Controller.SetScene(m_ProjectScene) - Dim bLuaReg As Boolean = (GetPrivateProfileInt(S_GENERAL, K_COMMANDLOG, 0) <> 0) - Dim sCmdLogFile As String = CMDLOG_FILE_NAME.Replace("#", IniFile.m_nInstance.ToString()) - If Not m_Controller.SetCommandLog(bLuaReg, m_sTempDir, sCmdLogFile) Then - EgtOutLog("Command log not started") - If Environment.GetCommandLineArgs.Count() <= 1 Then - MessageBox.Show("Command log not started", "EgtCAM5 Warning", - MessageBoxButton.OK, MessageBoxImage.Warning) - End If - End If - m_Controller.SetSurfTmTolerance(OptionModule.m_dGeometryTolerance) - m_Controller.SetUseCustomColors(True, S_SCENE, K_CUSTOMCOLORS) - ' imposto unità di misura per interfaccia utente - IniFile.m_bMmUnits = (GetPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0) - Map.refStatusBarVM.UpdateStatusUnits(IniFile.m_bMmUnits) - ' imposto visualizzazione riferimento globale - Dim bShowGlobFrame As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWGFRAME, 1) <> 0) - EgtSetGlobFrameShow(bShowGlobFrame) - ' imposto i dati della griglia - LoadGridData() - ' imposto stato di visualizzazione della griglia - IniFile.m_bDrawShowGrid = (GetPrivateProfileInt(S_GRID, K_DRAWSHOWGRID, 1) <> 0) - IniFile.m_bMachiningShowGrid = (GetPrivateProfileInt(S_GRID, K_MACHININGSHOWGRID, 1) <> 0) - IniFile.m_bShowGridFrame = (GetPrivateProfileInt(S_GRID, K_SHOWFRAME, 1) <> 0) - Map.refStatusBarVM.UpdateStatusGrid(New UpdateStatusGridParam(IniFile.m_bDrawShowGrid, IniFile.m_bShowGridFrame)) - ' imposto tipo coordinate - m_bCPlaneTypePos = True - Map.refStatusBarVM.StatusCurrPosTypeText("GRID") - m_ProjectScene.SetGridCursorPos(m_bCPlaneTypePos) - ' modo di visualizzazione - Dim nShowMode As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING) - Map.refShowPanelVM.ShowModeState(nShowMode) - ' visualizzazione direzione curve - Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0) - Map.refShowPanelVM.ShowCurveDir(nShowCurveDir) - ' visualizzazione avanzata dei triangoli costituenti le superfici - Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0) - EgtSetShowTriaAdv(bShowTriaAdv) - ' tipo visualizzazione per Zmap - Dim nShowZmap As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1) - EgtSetShowZmap(nShowZmap, False) - ' dimensione lineare max in pixel delle textures - Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096) - EgtSetTextureMaxLinPixels(nTxrMaxLinPix) - ' stile corrente delle quotature - OptionModule.m_dExtLineLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_EXTLINELEN, 5) - OptionModule.m_dArrowLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_ARROWLEN, 5) - OptionModule.m_dTextDist = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTDIST, 2) - OptionModule.m_nLenIsMM = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_LENISMM, 2) - OptionModule.m_nDecDigit = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_DECDIGIT, -2) - OptionModule.m_sFont = "" : GetPrivateProfileStringUtf8(S_DIMENSIONSTYLE, K_DIMFONT, "ModernPropS.Nfe", m_sFont) - OptionModule.m_dTextHeight = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTHEIGHT, 2) - EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight) - ' lettura da ini della variabile che abilita i gruppi di lavorazione - IniFile.m_bMachiningGroup = (GetPrivateProfileInt(S_MACH, K_MACHININGGROUP, 0) <> 0) - Map.refTopCommandBarVM.DrawMode_IsChecked() - ' lettura flag visualizzazione solo tavola in definizione lavorazioni - IniFile.m_bShowOnlyTable = (GetPrivateProfileInt(S_MACH, K_SHOWONLYTABLE, 1) <> 0) - ' ObjTree non selezionato - Map.refManageLayerExpanderVM.UpdateObjTreeOldId(GDB_ID.NULL) - ' nascondo input box - Map.refInputExpanderVM.ResetInputBox() - ' Imposto stato filtro selezione - m_ProjectScene.GetObjFilterForSel(m_bSelZeroDim, m_bSelCurve, m_bSelSurf, m_bSelVolume, m_bSelExtra) - m_Controller.MouseSetObjFilterForSelect(m_bSelZeroDim, m_bSelCurve, m_bSelSurf, m_bSelVolume, m_bSelExtra) - ' Imposto default per import - m_Controller.SetScaleForDxfImport(OptionModule.m_dDxfScaleFactor) - m_Controller.SetScaleForStlImport(OptionModule.m_dStlScaleFactor) - m_Controller.SetScaleForImageImport(OptionModule.m_dImgScaleFactor) - ' Imposto default per export - m_Controller.SetDefaultForDxfExport(OptionModule.m_nExportDxfFlag) - m_Controller.SetDefaultForImageExport(OptionModule.m_nImgWidth, OptionModule.m_nImgHeight) - End Sub + Private Sub PreInitializeScene() + ' imposto colore di default + Dim DefColor As New Color3d(0, 0, 0) + GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor) + m_ProjectScene.SetDefaultMaterial(DefColor) + ' imposto colori sfondo + Dim BackTopColor As New Color3d(192, 192, 192) + GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor) + Dim BackBotColor As New Color3d(BackTopColor) + GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor) + m_ProjectScene.SetViewBackground(BackTopColor, BackBotColor) + ' imposto spessore linee + Dim nLineWidth As Integer = 1 + nLineWidth = GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, nLineWidth) + m_ProjectScene.SetLineWidth(nLineWidth) + ' imposto colore di evidenziazione + Dim MarkColor As New Color3d(255, 255, 0) + GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor) + m_ProjectScene.SetMarkMaterial(MarkColor) + ' imposto colore per superfici selezionate + Dim SelSurfColor As New Color3d(255, 255, 192) + GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor) + m_ProjectScene.SetSelSurfMaterial(SelSurfColor) + ' imposto tipo e colore del rettangolo di zoom + Dim bOutline As Boolean = True + Dim ZwColor As New Color3d(0, 0, 0) + GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor) + m_ProjectScene.SetZoomWinAttribs(bOutline, ZwColor) + ' imposto colore della linea di distanza + Dim DstLnColor As New Color3d(255, 0, 0) + GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor) + m_ProjectScene.SetDistLineMaterial(DstLnColor) + ' imposto parametri OpenGL + Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3) + Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0) + Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32) + Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32) + m_ProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits) + End Sub + Private Sub PostInitializeScene() + ' Impostazioni Controller + m_Controller.SetScene(m_ProjectScene) + Dim bLuaReg As Boolean = (GetPrivateProfileInt(S_GENERAL, K_COMMANDLOG, 0) <> 0) + Dim sCmdLogFile As String = CMDLOG_FILE_NAME.Replace("#", IniFile.m_nInstance.ToString()) + If Not m_Controller.SetCommandLog(bLuaReg, m_sTempDir, sCmdLogFile) Then + EgtOutLog("Command log not started") + If Environment.GetCommandLineArgs.Count() <= 1 Then + MessageBox.Show("Command log not started", "EgtCAM5 Warning", + MessageBoxButton.OK, MessageBoxImage.Warning) + End If + End If + m_Controller.SetSurfTmTolerance(OptionModule.m_dGeometryTolerance) + m_Controller.SetUseCustomColors(True, S_SCENE, K_CUSTOMCOLORS) + ' imposto unità di misura per interfaccia utente + IniFile.m_bMmUnits = (GetPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0) + Map.refStatusBarVM.UpdateStatusUnits(IniFile.m_bMmUnits) + ' imposto visualizzazione riferimento globale + Dim bShowGlobFrame As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWGFRAME, 1) <> 0) + EgtSetGlobFrameShow(bShowGlobFrame) + ' imposto i dati della griglia + LoadGridData() + ' imposto stato di visualizzazione della griglia + IniFile.m_bDrawShowGrid = (GetPrivateProfileInt(S_GRID, K_DRAWSHOWGRID, 1) <> 0) + IniFile.m_bMachiningShowGrid = (GetPrivateProfileInt(S_GRID, K_MACHININGSHOWGRID, 1) <> 0) + IniFile.m_bShowGridFrame = (GetPrivateProfileInt(S_GRID, K_SHOWFRAME, 1) <> 0) + Map.refStatusBarVM.UpdateStatusGrid(New UpdateStatusGridParam(IniFile.m_bDrawShowGrid, IniFile.m_bShowGridFrame)) + ' imposto tipo coordinate + m_bCPlaneTypePos = True + Map.refStatusBarVM.StatusCurrPosTypeText("GRID") + m_ProjectScene.SetGridCursorPos(m_bCPlaneTypePos) + ' modo di visualizzazione + Dim nShowMode As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING) + Map.refShowPanelVM.ShowModeState(nShowMode) + ' visualizzazione direzione curve + Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0) + Map.refShowPanelVM.ShowCurveDir(nShowCurveDir) + ' visualizzazione avanzata dei triangoli costituenti le superfici + Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0) + EgtSetShowTriaAdv(bShowTriaAdv) + ' tipo visualizzazione per Zmap + Dim nShowZmap As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1) + EgtSetShowZmap(nShowZmap, False) + ' dimensione lineare max in pixel delle textures + Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096) + EgtSetTextureMaxLinPixels(nTxrMaxLinPix) + ' stile corrente delle quotature + OptionModule.m_dExtLineLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_EXTLINELEN, 5) + OptionModule.m_dArrowLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_ARROWLEN, 5) + OptionModule.m_dTextDist = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTDIST, 2) + OptionModule.m_nLenIsMM = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_LENISMM, 2) + OptionModule.m_nDecDigit = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_DECDIGIT, -2) + OptionModule.m_sFont = "" : GetPrivateProfileStringUtf8(S_DIMENSIONSTYLE, K_DIMFONT, "ModernPropS.Nfe", m_sFont) + OptionModule.m_dTextHeight = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTHEIGHT, 2) + EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight) + ' lettura da ini della variabile che abilita i gruppi di lavorazione + IniFile.m_bMachiningGroup = (GetPrivateProfileInt(S_MACH, K_MACHININGGROUP, 0) <> 0) + Map.refTopCommandBarVM.DrawMode_IsChecked() + ' lettura flag visualizzazione solo tavola in definizione lavorazioni + IniFile.m_bShowOnlyTable = (GetPrivateProfileInt(S_MACH, K_SHOWONLYTABLE, 1) <> 0) + ' ObjTree non selezionato + Map.refManageLayerExpanderVM.UpdateObjTreeOldId(GDB_ID.NULL) + ' nascondo input box + Map.refInputExpanderVM.ResetInputBox() + ' Imposto stato filtro selezione + m_ProjectScene.GetObjFilterForSel(m_bSelZeroDim, m_bSelCurve, m_bSelSurf, m_bSelVolume, m_bSelExtra) + m_Controller.MouseSetObjFilterForSelect(m_bSelZeroDim, m_bSelCurve, m_bSelSurf, m_bSelVolume, m_bSelExtra) + ' Imposto default per import + m_Controller.SetScaleForDxfImport(OptionModule.m_dDxfScaleFactor) + m_Controller.SetScaleForStlImport(OptionModule.m_dStlScaleFactor) + m_Controller.SetScaleForImageImport(OptionModule.m_dImgScaleFactor) + ' Imposto default per export + m_Controller.SetDefaultForDxfExport(OptionModule.m_nExportDxfFlag) + m_Controller.SetDefaultForImageExport(OptionModule.m_nImgWidth, OptionModule.m_nImgHeight) + End Sub Friend Shared Function GetAppToShow() As Boolean ' Se non ci sono veri parametri su linea di comando, visualizzazione standard @@ -355,8 +354,8 @@ Public Class ProjectVM Return End If ' Esecuzione - bOk = ExecBeam(sFile, sMachine, nFlag) - ' altrimenti pareti + bOk = ExecBeam(sFile, sMachine, nFlag, true) + ' altrimenti pareti Else ' Verifica abilitazione elaborazione pareti If Not VerifyWall(sFile, sMachine, nFlag) Then @@ -364,7 +363,7 @@ Public Class ProjectVM Return End If ' Esecuzione - bOk = ExecWall(sFile, sMachine, nFlag) + bOk = ExecWall(sFile, sMachine, nFlag, true) End If ' Se richiesta uscita immediata If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Then @@ -428,7 +427,7 @@ Public Class ProjectVM Return End If ' Se file bwe, gestione file da calcolare per Beam&Wall - If sExt = ".bwe" Then + If sExt = ".bwe" And Environment.GetCommandLineArgs.Count() > 2 Then ' recupero tipo di progetto : 1 = travi, 2 = pareti, 3 = sandwich Dim nBWType As Integer = 0 If Environment.GetCommandLineArgs.Count() > 2 Then Integer.TryParse(Environment.GetCommandLineArgs(2), nBWType) @@ -446,8 +445,8 @@ Public Class ProjectVM Return End If ' Esecuzione - bOk = ExecBeam(sFile, sMachine, nFlag) - ' altrimenti pareti + bOk = ExecBeam(sFile, sMachine, nFlag, false) + ' altrimenti pareti ElseIf nBWType = 2 Then ' Verifica abilitazione elaborazione pareti If Not VerifyWall(sFile, sMachine, nFlag) Then @@ -455,7 +454,7 @@ Public Class ProjectVM Return End If ' Esecuzione - bOk = ExecWall(sFile, sMachine, nFlag) + bOk = ExecWall(sFile, sMachine, nFlag, false) End If ' Se richiesta uscita immediata If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Then diff --git a/Special-BeamWall/Beam.vb b/Special-BeamWall/Beam.vb index 5a30847..c200310 100644 --- a/Special-BeamWall/Beam.vb +++ b/Special-BeamWall/Beam.vb @@ -17,12 +17,12 @@ Module Beam Return False End Function - Friend Function ExecBeam(sFile As String, sMachine As String, nFlag As Integer) As Boolean + Friend Function ExecBeam(sFile As String, sMachine As String, nFlag As Integer, bBtl As Boolean) As Boolean EgtOutLog("-- Start ExecBeam --") ' Recupero lo script da eseguire Dim sExecPath As String = "" Dim sExecName As String = "" - GetPrivateProfileString(S_BEAM, K_BEAMEXEC, "", sExecName) + GetPrivateProfileString(S_BEAM, If( bBtl, K_BEAMBTLEXEC, K_BEAMBWEEXEC), "", sExecName) sExecPath = (IniFile.m_sBeamDirPath & "\" & sExecName).TrimEnd({"\"c}) If Not My.Computer.FileSystem.FileExists(sExecPath) Then EgtOutLog("Not found BeamExec script " & sExecPath) diff --git a/Special-BeamWall/Wall.vb b/Special-BeamWall/Wall.vb index dbbf593..2441796 100644 --- a/Special-BeamWall/Wall.vb +++ b/Special-BeamWall/Wall.vb @@ -17,12 +17,12 @@ Module Wall Return False End Function - Friend Function ExecWall(sFile As String, sMachine As String, nFlag As Integer) As Boolean + Friend Function ExecWall(sFile As String, sMachine As String, nFlag As Integer, bBtl As Boolean) As Boolean EgtOutLog("-- Start ExecWall --") ' Recupero lo script da eseguire Dim sExecPath As String = "" Dim sExecName As String = "" - GetPrivateProfileString(S_WALL, K_WALLEXEC, "", sExecName) + GetPrivateProfileString(S_WALL, If( bBtl, K_WALLBTLEXEC, K_WALLBWEEXEC), "", sExecName) sExecPath = (IniFile.m_sWallDirPath & "\" & sExecName).TrimEnd({"\"c}) If Not My.Computer.FileSystem.FileExists(sExecPath) Then EgtOutLog("Not found WallExec script " & sExecPath)