diff --git a/AboutBoxWindow/AboutBoxView.xaml.vb b/AboutBoxWindow/AboutBoxView.xaml.vb index f1ff566..6488d62 100644 --- a/AboutBoxWindow/AboutBoxView.xaml.vb +++ b/AboutBoxWindow/AboutBoxView.xaml.vb @@ -28,7 +28,6 @@ Public Class AboutBoxWndV Else sInfo &= "Only Draw Mode" & Environment.NewLine End If - If IniFile.IsActiveDoors() Then sInfo &= "Doors " & IniFile.m_sDoorsDirPath & Environment.NewLine Dim sOpSys As String = String.Empty EgtGetOsInfo( sOpSys) sInfo &= sOpSys & Environment.NewLine @@ -41,6 +40,34 @@ Public Class AboutBoxWndV Dim sScene As String = String.Empty EgtGetSceneInfo(sScene) sInfo &= sScene + ' Extensions + sInfo &= Environment.NewLine & "Extensions :" + Dim bExtensions As Boolean = False + If IniFile.IsActiveBeam() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sBeamDirPath, sVersion) + sInfo &= Environment.NewLine & "Beam ver. " & sVersion & " " & IniFile.m_sBeamDirPath + End If + If IniFile.IsActiveWall() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sWallDirPath, sVersion) + sInfo &= Environment.NewLine & "Wall ver. " & sVersion & " " & IniFile.m_sWallDirPath + End If + If IniFile.IsActiveDoors() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sDoorsDirPath, sVersion) + sInfo &= Environment.NewLine & "Doors ver. " & sVersion & " " & IniFile.m_sDoorsDirPath + End If + If IniFile.IsActiveGunStock() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sGunstockDirPath, sVersion) + sInfo &= Environment.NewLine & "Gunstock ver. " & sVersion & " " & IniFile.m_sGunstockDirPath + End If + If Not bExtensions Then sInfo &= Environment.NewLine & "---" InfoLbl.Text = sInfo ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok End Sub diff --git a/Project/ProjectVM.vb b/Project/ProjectVM.vb index 74e5e75..7d8c705 100644 --- a/Project/ProjectVM.vb +++ b/Project/ProjectVM.vb @@ -133,6 +133,38 @@ Public Class ProjectVM Dim nFlag As Integer = GetPrivateProfileInt( S_IMPORT, K_BTLFLAG, EIB_FL.NONE) EgtInitBeamMgr( nFlag) End If + ' Log di eventuali estensioni + EgtOutLog( "Extensions :") + Dim bExtensions As Boolean = False + If IniFile.IsActiveBeam() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sBeamDirPath, sVersion) + Dim sOut As String = "Beam ver. " & sVersion & " " & IniFile.m_sBeamDirPath + EgtOutLog( sOut) + End If + If IniFile.IsActiveWall() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sWallDirPath, sVersion) + Dim sOut As String = "Wall ver. " & sVersion & " " & IniFile.m_sWallDirPath + EgtOutLog( sOut) + End If + If IniFile.IsActiveDoors() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sDoorsDirPath, sVersion) + Dim sOut As String = "Doors ver. " & sVersion & " " & IniFile.m_sDoorsDirPath + EgtOutLog( sOut) + End If + If IniFile.IsActiveGunStock() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sGunstockDirPath, sVersion) + Dim sOut As String = "Gunstock ver. " & sVersion & " " & IniFile.m_sGunstockDirPath + EgtOutLog( sOut) + End If + If Not bExtensions Then EgtOutLog( "---") ' Apro progetto vuoto Map.refTopCommandBarVM.NewCmd() ' Seleziono la macchina impostata nel file ini diff --git a/Special-BeamWall/Beam.vb b/Special-BeamWall/Beam.vb index 542d100..cb1f2f1 100644 --- a/Special-BeamWall/Beam.vb +++ b/Special-BeamWall/Beam.vb @@ -21,10 +21,9 @@ Module Beam 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, If(bBtl, K_BEAMBTLEXEC, K_BEAMBWEEXEC), "", sExecName) - sExecPath = (IniFile.m_sBeamDirPath & "\" & sExecName).TrimEnd({"\"c}) + Dim sExecPath As String = (IniFile.m_sBeamDirPath & "\" & sExecName).TrimEnd({"\"c}) If Not My.Computer.FileSystem.FileExists(sExecPath) Then EgtOutLog("Not found BeamExec script " & sExecPath) Return False diff --git a/Utility/IniFile.vb b/Utility/IniFile.vb index c916905..0e5cc3b 100644 --- a/Utility/IniFile.vb +++ b/Utility/IniFile.vb @@ -1,4 +1,5 @@ Imports System.Collections.ObjectModel +Imports System.IO Imports EgtUILib Public Module IniFile @@ -64,10 +65,12 @@ Public Module IniFile Friend m_sBeamDirPath As String ' path della cartella WALL Friend m_sWallDirPath As String - ' path della cartella BEALWALL + ' path della cartella BEAMWALL Friend m_sBeamWallDirPath As String ' path della cartella DOORS Friend m_sDoorsDirPath As String + ' path della cartella GUNSTOCK + Friend m_sGunstockDirPath As String ' path della cartella Printing3d Friend m_sPrinting3dDirPath As String @@ -289,7 +292,13 @@ Public Module IniFile End Function Friend Function IsActiveGunStock() As Boolean - Return (IniFile.m_nKeyOptions And KEY_OPT.GUNSTOCK) <> 0 And (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0) + Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.GUNSTOCK) <> 0 And (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0) + If bIsActive Then + Dim sTemp As String = "" + GetPrivateProfileString(S_GUNSTOCK, K_GUNSTOCKEXEC, "", sTemp) + m_sGunstockDirPath = Path.GetDirectoryName( sTemp) + End If + Return bIsActive End Function Friend Function IsKeyEnabledVirtualMilling() As Boolean @@ -301,4 +310,12 @@ Public Module IniFile Return GetPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0 AndAlso GetPrivateProfileButton(S_SPECIAL, K_BUTTON & "1", "", btDummy) End Function + Friend Function GetSpecialLuaVersion( sSpecialLuaDir As String, ByRef sVersion As String) As Boolean + Dim sExecPath As String = (sSpecialLuaDir & "\Version.lua") + If Not EgtLuaExecFile(sExecPath, False) Then Return False + If Not EgtLuaGetGlobStringVar("VERSION", sVersion) Then Return False + EgtLuaResetGlobVar("VERSION") + Return True + End Function + End Module