From 7a25e8d6349907d34e82b8cc8595e8df2ffa25cd Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 14 Jan 2026 11:38:24 +0100 Subject: [PATCH] EgtCAM5 3.1a2 : - aggiunta toolbar per ReversePost - gestione protezione da licenza di Trimming e ReversePost - aggiunte info su Window, Trimming e ReversePost in AboutBox. --- AboutBoxWindow/AboutBoxView.xaml.vb | 18 +++++++++ Constants/ConstIni.vb | 5 +++ EgtCAM5.vbproj | 8 ++++ My Project/AssemblyInfo.vb | 4 +- OptionsWindow/OptionModule.vb | 2 + OptionsWindow/OptionWindowV.xaml | 15 ++++--- OptionsWindow/OptionWindowVM.vb | 22 +++++++++- Special-ReversePost/ReversePostPanelV.xaml | 22 ++++++++++ Special-ReversePost/ReversePostPanelV.xaml.vb | 3 ++ Special-ReversePost/ReversePostPanelVM.vb | 40 +++++++++++++++++++ TopTray/TopTrayV.xaml | 1 + Utility/Dictionary.xaml | 1 + Utility/IniFile.vb | 18 ++++++++- Utility/Map.vb | 5 +++ 14 files changed, 154 insertions(+), 10 deletions(-) create mode 100644 Special-ReversePost/ReversePostPanelV.xaml create mode 100644 Special-ReversePost/ReversePostPanelV.xaml.vb create mode 100644 Special-ReversePost/ReversePostPanelVM.vb diff --git a/AboutBoxWindow/AboutBoxView.xaml.vb b/AboutBoxWindow/AboutBoxView.xaml.vb index 15edfc9..f3735d6 100644 --- a/AboutBoxWindow/AboutBoxView.xaml.vb +++ b/AboutBoxWindow/AboutBoxView.xaml.vb @@ -70,6 +70,24 @@ Public Class AboutBoxWndV IniFile.GetSpecialLuaVersion( IniFile.m_sDoorsDirPath, sVersion) sInfo &= Environment.NewLine & "Doors ver. " & sVersion & " " & IniFile.m_sDoorsDirPath End If + If IniFile.IsActiveWindow() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sWindowDirPath, sVersion) + sInfo &= Environment.NewLine & "Window ver. " & sVersion & " " & IniFile.m_sWindowDirPath + End If + If IniFile.IsActiveTrimming() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sTrimmingDirPath, sVersion) + sInfo &= Environment.NewLine & "Trimming ver. " & sVersion & " " & IniFile.m_sTrimmingDirPath + End If + If IniFile.IsActiveReversePost() Then + bExtensions = True + Dim sVersion As String = "---" + IniFile.GetSpecialLuaVersion( IniFile.m_sReversePostDirPath, sVersion) + sInfo &= Environment.NewLine & "ReversePost ver. " & sVersion & " " & IniFile.m_sReversePostDirPath + End If If IniFile.IsActiveGunStock() Then bExtensions = True Dim sVersion As String = "---" diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 008ef2e..15f71fa 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -167,6 +167,11 @@ Module ConstIni Public Const K_TRIMMINGBASEDIR As String = "BaseDir" Public Const K_TRIMMINGBUTTON As String = "Button" + Public Const S_REVERSEPOST As String = "ReversePost" + Public Const K_REVERSEPOSTENABLE As String = "RevEnable" + Public Const K_REVERSEPOSTBASEDIR As String = "BaseDir" + Public Const K_REVERSEPOSTBUTTON As String = "Button" + Public Const S_GUNSTOCK As String = "GunStock" Public Const K_GUNSTOCKENABLE As String = "GsEnable" Public Const K_GUNSTOCKEXEC As String = "GsExec" diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj index 5d2fba5..6eda479 100644 --- a/EgtCAM5.vbproj +++ b/EgtCAM5.vbproj @@ -295,6 +295,10 @@ + + ReversePostPanelV.xaml + + TrimmingPanelV.xaml @@ -650,6 +654,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index b9b54a4..3e1b8c0 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,6 +70,6 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 09ce8d0..a449964 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -76,6 +76,7 @@ Friend Module OptionModule Friend m_bDoorsOn As Boolean Friend m_bWindowOn As Boolean Friend m_bTrimmingOn As Boolean + Friend m_bReversePostOn As Boolean Friend m_bGunstockOn As Boolean ' inizializzazione lettura variabili ad inizio programma @@ -188,6 +189,7 @@ Friend Module OptionModule m_bDoorsOn = (GetPrivateProfileInt(S_DOORS, K_DDFENABLE, 0) <> 0) m_bWindowOn = (GetPrivateProfileInt(S_WINDOW, K_WINDOWENABLE, 0) <> 0) m_bTrimmingOn = (GetPrivateProfileInt(S_TRIMMING, K_TRIMMINGENABLE, 0) <> 0) + m_bReversePostOn = (GetPrivateProfileInt(S_REVERSEPOST, K_REVERSEPOSTENABLE, 0) <> 0) m_bGunstockOn = (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0) End Sub diff --git a/OptionsWindow/OptionWindowV.xaml b/OptionsWindow/OptionWindowV.xaml index 72e4319..4feb645 100644 --- a/OptionsWindow/OptionWindowV.xaml +++ b/OptionsWindow/OptionWindowV.xaml @@ -447,6 +447,7 @@ + @@ -477,14 +478,18 @@ Grid.Row="4" Grid.Column="0" Margin="0,5,0,5"/> - - - - + + + diff --git a/OptionsWindow/OptionWindowVM.vb b/OptionsWindow/OptionWindowVM.vb index 51e4ce4..46d35a1 100644 --- a/OptionsWindow/OptionWindowVM.vb +++ b/OptionsWindow/OptionWindowVM.vb @@ -890,7 +890,7 @@ Public Class OptionWindowVM Public ReadOnly Property TrimmingEnabled As Boolean Get - Return true + Return (IniFile.m_nKeyOptions And KEY_OPT.TRIMMING) <> 0 End Get End Property Public Property TrimmingOn As Boolean @@ -903,6 +903,21 @@ Public Class OptionWindowVM End Set End Property + Public ReadOnly Property ReversePostEnabled As Boolean + Get + Return (IniFile.m_nKeyOptions And KEY_OPT.REVERSEPOST) <> 0 + End Get + End Property + Public Property ReversePostOn As Boolean + Get + Return OptionModule.m_bReversePostOn + End Get + Set(value As Boolean) + OptionModule.m_bReversePostOn = value + WritePrivateProfileString(S_REVERSEPOST, K_REVERSEPOSTENABLE, If(value, "1", "0")) + End Set + End Property + Public ReadOnly Property GunstockEnabled As Boolean Get Return (IniFile.m_nKeyOptions And KEY_OPT.GUNSTOCK) <> 0 @@ -1205,6 +1220,11 @@ Public Class OptionWindowVM Return "Trimming" End Get End Property + Public ReadOnly Property ReversePostMsg As String + Get + Return "ReversePost" + End Get + End Property Public ReadOnly Property GunstockMsg As String Get Return "Gunstock" diff --git a/Special-ReversePost/ReversePostPanelV.xaml b/Special-ReversePost/ReversePostPanelV.xaml new file mode 100644 index 0000000..4e82528 --- /dev/null +++ b/Special-ReversePost/ReversePostPanelV.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + diff --git a/Special-ReversePost/ReversePostPanelV.xaml.vb b/Special-ReversePost/ReversePostPanelV.xaml.vb new file mode 100644 index 0000000..104ba39 --- /dev/null +++ b/Special-ReversePost/ReversePostPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class ReversePostPanelV + +End Class diff --git a/Special-ReversePost/ReversePostPanelVM.vb b/Special-ReversePost/ReversePostPanelVM.vb new file mode 100644 index 0000000..158e429 --- /dev/null +++ b/Special-ReversePost/ReversePostPanelVM.vb @@ -0,0 +1,40 @@ +Imports System.IO +Imports EgtUILib + +Public Class ReversePostPanelVM + Inherits VMBase + + Private m_ButtonList As New List(Of ButtonItem) + Public ReadOnly Property ButtonList As List(Of ButtonItem) + Get + Return m_ButtonList + End Get + End Property + + Private m_ReversePostPanel_Visibility As Visibility + Public ReadOnly Property ReversePostPanel_Visibility As Visibility + Get + Return m_ReversePostPanel_Visibility + End Get + End Property + Friend Sub SetReversePostPanelVisibility(bValue As Boolean) + m_ReversePostPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed) + NotifyPropertyChanged(NameOf(ReversePostPanel_Visibility)) + End Sub + + Sub New() + ' Creo riferimento a questa classe in Map + Map.SetRefReversePostPanelVM(Me) + ' Se attivo, inizializzo i bottoni leggendoli da file ini + If IniFile.IsActiveReversePost() Then + ' Inizializzo i bottoni leggendoli da file ini + Dim BtnIndex As Integer = 1 + Dim CurrBtn As ButtonItem = Nothing + While GetPrivateProfileButton(S_REVERSEPOST, K_REVERSEPOSTBUTTON & BtnIndex, IniFile.m_sReversePostDirPath, CurrBtn) + m_ButtonList.Add(CurrBtn) + BtnIndex += 1 + End While + End If + End Sub + +End Class diff --git a/TopTray/TopTrayV.xaml b/TopTray/TopTrayV.xaml index c3bc17b..fccc465 100644 --- a/TopTray/TopTrayV.xaml +++ b/TopTray/TopTrayV.xaml @@ -32,6 +32,7 @@ + diff --git a/Utility/Dictionary.xaml b/Utility/Dictionary.xaml index 13abb99..f7abdc8 100644 --- a/Utility/Dictionary.xaml +++ b/Utility/Dictionary.xaml @@ -38,6 +38,7 @@ + diff --git a/Utility/IniFile.vb b/Utility/IniFile.vb index 131e31d..4959473 100644 --- a/Utility/IniFile.vb +++ b/Utility/IniFile.vb @@ -69,6 +69,8 @@ Public Module IniFile PLUGIN = 1024 ADVMACHINING = 2048 WINDOW = 4096 + TRIMMING = 8192 + REVERSEPOST = 16384 End Enum Friend m_sDataRoot As String Friend m_sConfigDir As String @@ -89,7 +91,9 @@ Public Module IniFile ' path della cartella WINDOW Friend m_sWindowDirPath As String ' path della cartella TRIMMING - Friend m_strimmingDirPath As String + Friend m_sTrimmingDirPath As String + ' path della cartella REVERSEPOST + Friend m_sReversePostDirPath As String ' path della cartella GUNSTOCK Friend m_sGunstockDirPath As String ' path della cartella Printing3d @@ -320,7 +324,7 @@ Public Module IniFile End Function Friend Function IsActiveTrimming() As Boolean - Dim bIsActive As Boolean = (GetPrivateProfileInt(S_TRIMMING, K_TRIMMINGENABLE, 0) <> 0) + Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.TRIMMING) <> 0 And (GetPrivateProfileInt(S_TRIMMING, K_TRIMMINGENABLE, 0) <> 0) If bIsActive Then Dim sTemp As String = "" GetPrivateProfileString(S_TRIMMING, K_TRIMMINGBASEDIR, "", sTemp) @@ -329,6 +333,16 @@ Public Module IniFile Return bIsActive End Function + Friend Function IsActiveReversePost() As Boolean + Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.REVERSEPOST) <> 0 And (GetPrivateProfileInt(S_REVERSEPOST, K_REVERSEPOSTENABLE, 0) <> 0) + If bIsActive Then + Dim sTemp As String = "" + GetPrivateProfileString(S_REVERSEPOST, K_REVERSEPOSTBASEDIR, "", sTemp) + m_sReversePostDirPath = sTemp.TrimEnd( "\"c) + End If + Return bIsActive + End Function + Friend Function IsActiveGunStock() As Boolean Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.GUNSTOCK) <> 0 And (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0) If bIsActive Then diff --git a/Utility/Map.vb b/Utility/Map.vb index 855bb7c..df05353 100644 --- a/Utility/Map.vb +++ b/Utility/Map.vb @@ -35,6 +35,7 @@ Module Map Private m_refBeamWallPanelVM As BeamWallPanelVM Private m_refWindowPanelVM As WindowPanelVM Private m_refTrimmingPanelVM As TrimmingPanelVM + Private m_refReversePostPanelVM As ReversePostPanelVM Private m_refGunStockPanelVM As GunStockPanelVM Private m_refMachiningParameterExpanderVM As MachiningParameterExpanderVM @@ -331,6 +332,10 @@ Module Map m_refTrimmingPanelVM = TrimmingPanelVM Return Not IsNothing(m_refTrimmingPanelVM) End Function + Friend Function SetRefReversePostPanelVM(ReversePostPanelVM As ReversePostPanelVM) As Boolean + m_refReversePostPanelVM = ReversePostPanelVM + Return Not IsNothing(m_refReversePostPanelVM) + End Function Friend Function SetRefGunStockPanelVM(GunStockPanelVM As GunStockPanelVM) As Boolean m_refGunStockPanelVM = GunStockPanelVM Return Not IsNothing(m_refGunStockPanelVM)