From 2fda49f4efd1967f43921a9a47770d24baa00049 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 4 Jun 2026 07:27:21 +0200 Subject: [PATCH 01/10] -aggiunti controlli su BTLdataWnd e PartParamters --- .../BTLDataWnd/BTLDataWndV.xaml | 53 +++++-------- .../BTLDataWnd/BTLDataWndVM.vb | 10 ++- .../BTLViewModel/BTLStructureVM.vb | 2 +- .../PartParametersWnd/PartParametersWndV.xaml | 78 +++++++------------ .../ProdManager/ProdManagerVM.vb | 9 ++- 5 files changed, 59 insertions(+), 93 deletions(-) diff --git a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndV.xaml b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndV.xaml index cf81b6be..25902e6a 100644 --- a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndV.xaml +++ b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndV.xaml @@ -18,7 +18,7 @@ - + @@ -68,50 +68,42 @@ @@ -122,26 +114,22 @@ @@ -166,26 +154,22 @@ @@ -200,8 +184,7 @@ diff --git a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb index 8862e38c..81013789 100644 --- a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb +++ b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb @@ -80,6 +80,13 @@ Public Class BTLDataWndVM NotifyPropertyChanged(NameOf(ErrText)) End Sub + Private m_CurrBTLStructure As BTLStructureVM + Public ReadOnly Property CurrBTLStructure As BTLStructureVM + Get + Return m_CurrBTLStructure + End Get + End Property + #Region "Parametri generici" Public m_sPROJNUM As String @@ -565,8 +572,9 @@ Public Class BTLDataWndVM Map.refMainWindowVM.MainWindowM.GetDefaultConfigDirPath(nType, True) End Sub - Sub New() + Sub New(BTLStructure As BTLStructureVM) Map.SetRefBTLDataWndVM(Me) + m_CurrBTLStructure = BTLStructure SetIsBTLDataWnd(True) ' leggo parametri Btl ReadBtlParams() diff --git a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb index a7d1422b..f5f32808 100644 --- a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb +++ b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb @@ -1272,7 +1272,7 @@ Public Class BTLStructureVM End Property Friend Sub Data(nProjId As Integer) - Dim BTLDataWnd As New BTLDataWndV(Application.Current.MainWindow, New BTLDataWndVM()) + Dim BTLDataWnd As New BTLDataWndV(Application.Current.MainWindow, New BTLDataWndVM(Map.refProjectVM.BTLStructureVM)) BTLDataWnd.ShowDialog() End Sub diff --git a/EgtBEAMWALL.Optimizer/PartParametersWnd/PartParametersWndV.xaml b/EgtBEAMWALL.Optimizer/PartParametersWnd/PartParametersWndV.xaml index b2d862ee..5c4e2d97 100644 --- a/EgtBEAMWALL.Optimizer/PartParametersWnd/PartParametersWndV.xaml +++ b/EgtBEAMWALL.Optimizer/PartParametersWnd/PartParametersWndV.xaml @@ -25,62 +25,52 @@ @@ -113,8 +103,7 @@ Style="{StaticResource PartParam_TextBlock}"/> @@ -125,38 +114,32 @@ @@ -191,14 +174,12 @@ @@ -274,8 +255,7 @@ @@ -349,8 +328,7 @@ Style="{StaticResource PartParam_TextBlock}"/> @@ -382,8 +360,7 @@ Style="{StaticResource PartParam_TextBlock}"/> @@ -454,24 +431,21 @@ Style="{StaticResource PartParam_TextBlock}"/> diff --git a/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb b/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb index f2450648..27ba7b4b 100644 --- a/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb +++ b/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb @@ -851,12 +851,13 @@ Public Class ProdManagerVM GeneralParametersWndVM.SetbSaveGeneralParameters(True) GeneralParametersWndVM.SaveProjectParameters() - m_BTLDataWnd = New BTLDataWndVM() + ' leggo struttura BTL per liste + Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0)) + + m_BTLDataWnd = New BTLDataWndVM(Map.refProjectVM.BTLStructureVM) m_BTLDataWnd.Read(nType) m_BTLDataWnd.SaveInfoBTL(nType) - ' leggo struttura BTL per liste - Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0)) CopyBuilding() Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge" Dim bFirstPart As Boolean = EgtGetFirstPart() <> GDB_ID.NULL @@ -1112,7 +1113,7 @@ Public Class ProdManagerVM ' imposto progetto corrente Dim OldProd As ProdFileVM = ProjectManagerVM.CurrProd ProjectManagerVM.CurrProd = TempCurrProd - m_BTLDataWnd = New BTLDataWndVM() + m_BTLDataWnd = New BTLDataWndVM(Map.refProjectVM.BTLStructureVM) DbControllers.m_ProdController.LockByProdId(ProjectManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) ' recupero indice di modifica progetto quando caricato Dim CommIndex As Integer = -1 From 709ccc19dd4536e2f82840940fea14789efd959e Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 9 Jun 2026 08:41:13 +0200 Subject: [PATCH 02/10] EgtBEAMWALL 3.1.6.1: -cambio versione -aggiunto controllo su parametri generali --- EgtBEAMWALL.Core/My Project/AssemblyInfo.vb | 6 +++--- EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs | 4 ++-- .../GeneralParametersStrategyVM.vb | 1 + EgtBEAMWALL.Optimizer/MainWindow/MainWindowM.vb | 4 ++-- EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb | 4 ++-- EgtBEAMWALL.Supervisor/Comms/SIEMENSSharp7Comm.vb | 1 + EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb | 4 ++-- EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb | 4 ++-- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb index a7df1fac..d32dd49b 100644 --- a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb @@ -17,7 +17,7 @@ Imports System.Windows - + @@ -38,5 +38,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs index 3f080980..17cbe859 100644 --- a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs +++ b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.5.3")] -[assembly: AssemblyFileVersion("3.1.5.3")] +[assembly: AssemblyVersion("3.1.6.1")] +[assembly: AssemblyFileVersion("3.1.6.1")] diff --git a/EgtBEAMWALL.Optimizer/GeneralParametersStrategy/GeneralParametersStrategyVM.vb b/EgtBEAMWALL.Optimizer/GeneralParametersStrategy/GeneralParametersStrategyVM.vb index 2949f119..c74d385a 100644 --- a/EgtBEAMWALL.Optimizer/GeneralParametersStrategy/GeneralParametersStrategyVM.vb +++ b/EgtBEAMWALL.Optimizer/GeneralParametersStrategy/GeneralParametersStrategyVM.vb @@ -750,6 +750,7 @@ Public Class ComboGenericParameter End Property Friend Sub SetSelValue(sValue As String) m_SelValue = m_ComboList.FirstOrDefault(Function(x) x.sValue = sValue) + If IsNothing(m_SelValue) Then m_SelValue = m_ComboList(0) End Sub Private m_bComboBoxVisibility As Visibility = Visibility.Collapsed diff --git a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowM.vb b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowM.vb index f80fbca0..ba054e8d 100644 --- a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowM.vb +++ b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowM.vb @@ -269,8 +269,8 @@ Public Class MainWindowM EgtSetLockId(sLockId) End If ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(5327, 2701, 1, m_nKeyLevel) And - EgtGetKeyOptions(5327, 2701, 1, m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(5327, 3106, 1, m_nKeyLevel) And + EgtGetKeyOptions(5327, 3106, 1, m_nKeyOptions) ' Inizializzazione generale di EgtInterface m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) m_sLogFile = m_sTempDir & "\" & VWOPTGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) diff --git a/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb index 0373d2d4..a984e93b 100644 --- a/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb @@ -67,5 +67,5 @@ Imports System.Windows ' Revision ' - - + + diff --git a/EgtBEAMWALL.Supervisor/Comms/SIEMENSSharp7Comm.vb b/EgtBEAMWALL.Supervisor/Comms/SIEMENSSharp7Comm.vb index 155bb877..8f14c101 100644 --- a/EgtBEAMWALL.Supervisor/Comms/SIEMENSSharp7Comm.vb +++ b/EgtBEAMWALL.Supervisor/Comms/SIEMENSSharp7Comm.vb @@ -270,6 +270,7 @@ Public Class SIEMENSSharp7Comm End If Return bResult End Select + Return False End Function #End Region ' Read Variables diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb index 2c2fa9d5..8bb07b74 100644 --- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb +++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb @@ -252,8 +252,8 @@ Public Class MainWindowM EgtSetLockId( sLockId) End If ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(5327, 2701, 1, m_nKeyLevel) And - EgtGetKeyOptions(5327, 2701, 1, m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(5327, 3106, 1, m_nKeyLevel) And + EgtGetKeyOptions(5327, 3106, 1, m_nKeyOptions) ' Inizializzazione generale di EgtInterface m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) diff --git a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb index 0863e09e..34f7b2a0 100644 --- a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + From 9c907c96cedb5e14cd5b28bbd64455d8a292ba8d Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 9 Jun 2026 16:07:55 +0200 Subject: [PATCH 03/10] -ripristinato messagebox per errore licenza --- EgtBEAMWALL.Optimizer/SceneHost/MySceneHostVM.vb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/EgtBEAMWALL.Optimizer/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.Optimizer/SceneHost/MySceneHostVM.vb index f49bdf07..fd133730 100644 --- a/EgtBEAMWALL.Optimizer/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.Optimizer/SceneHost/MySceneHostVM.vb @@ -78,14 +78,15 @@ Public Class MySceneHostVM ' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore" Dim sText As String = EgtMsg(10102) & vbCrLf & EgtMsg(10103) Dim sTitle As String = EgtMsg(10101) - EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) ' Altrimenti manca la licenza Else EgtOutLog("Problems with Licence") ' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore" - Dim sText As String = EgtMsg(10105) & vbCrLf & EgtMsg(10106) + Dim sKeyInfo As String = "" : EgtGetKeyInfo(sKeyInfo) + Dim sText As String = sKeyInfo & vbCrLf & EgtMsg(10105) & vbCrLf & EgtMsg(10106) Dim sTitle As String = EgtMsg(10101) - If EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then + If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then ' Apro dialogo per richiesta file licenza Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With { .Title = EgtMsg(110026), From 29d68b3d21d26ab10cbafc3b8ad9c385c22b310f Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 12 Jun 2026 12:11:28 +0200 Subject: [PATCH 04/10] EgtBEAMWALL 3.1.6.2: -aggiornato tasto CANC per btlpart e selbtlfeature --- EgtBEAMWALL.Core/My Project/AssemblyInfo.vb | 4 +- EgtBEAMWALL.Core/Themes/Generic.xaml | 1 + .../Properties/AssemblyInfo.cs | 4 +- .../BTLPartManager/BTLPartManagerVM.vb | 2 - .../BTLViewModel/BTLStructureVM.vb | 77 ++++++++++++++++++- .../ItemParamList/BTLPartListV.xaml | 22 +++--- .../ItemParamList/BTLPartListV.xaml.vb | 31 ++++++++ .../My Project/AssemblyInfo.vb | 4 +- .../My Project/AssemblyInfo.vb | 4 +- 9 files changed, 125 insertions(+), 24 deletions(-) diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb index d32dd49b..3a6f6d5a 100644 --- a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb @@ -38,5 +38,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/EgtBEAMWALL.Core/Themes/Generic.xaml b/EgtBEAMWALL.Core/Themes/Generic.xaml index 6898b18c..00a42d9b 100644 --- a/EgtBEAMWALL.Core/Themes/Generic.xaml +++ b/EgtBEAMWALL.Core/Themes/Generic.xaml @@ -1921,6 +1921,7 @@ - - + + - - + + - + @@ -395,6 +392,7 @@ VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" ScrollViewer.CanContentScroll="True" + PreviewMouseDown="ListBox_PreviewMouseDown" Style="{StaticResource BTLPartList_ListBox}"> diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb index 509df953..e1e62e80 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb @@ -8,6 +8,8 @@ Public Class BTLPartListV Private m_isDraggingSelectionField As FieldInfo Private m_endDraggingMethod As MethodInfo + Private bSelOnFeature As Boolean = False + Sub New() ' This call is required by the designer. InitializeComponent() @@ -28,6 +30,8 @@ Public Class BTLPartListV Private Sub PartList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) If e.ChangedButton = MouseButton.Left Then If TypeOf sender Is DataGridRow Then + ' Metto la selezione della feature a false + bSelOnFeature = False If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count <> 1 Then Return Dim Row As DataGridRow = DirectCast(sender, DataGridRow) If TypeOf Row.DataContext IsNot BTLPartVM Then Return @@ -102,6 +106,33 @@ Public Class BTLPartListV Return Nothing End Function + Private Sub Root_PreviewKeyDown(sender As Object, e As KeyEventArgs) + If e.Key <> Key.Delete Then Return + + Dim BTLStructureVM As BTLStructureVM = TryCast(Me.Tag, BTLStructureVM) + If IsNothing(BTLStructureVM) Then Return + + Dim BTLPartVM As BTLPartVM = BTLStructureVM.SelBTLPart + Dim BTLFeatureVM As BTLFeatureVM = BTLPartVM?.SelBTLFeatureVM + + If bSelOnFeature AndAlso Not IsNothing(BTLFeatureVM) Then + If Not IsNothing(BTLFeatureVM.DeleteFeature_Command) AndAlso BTLFeatureVM.DeleteFeature_Command.CanExecute(Nothing) Then + BTLFeatureVM.DeleteFeature_Command.Execute(Nothing) + e.Handled = True + End If + Return + End If + + If Not IsNothing(BTLStructureVM.DeletePart_Command) AndAlso BTLStructureVM.DeletePart_Command.CanExecute(Nothing) Then + BTLStructureVM.DeletePart_Command.Execute(Nothing) + e.Handled = True + End If + End Sub + + Private Sub ListBox_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + bSelOnFeature = True + End Sub + End Class Public Class SettingsBtnVerticalOffsetMultiConverter diff --git a/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb index a984e93b..9bec1b8f 100644 --- a/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb @@ -67,5 +67,5 @@ Imports System.Windows ' Revision ' - - + + diff --git a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb index 34f7b2a0..e29976d3 100644 --- a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + From 4e42c09b82a23610fc0a00f088f68b645c85bb22 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 16 Jun 2026 09:37:42 +0200 Subject: [PATCH 05/10] -aggiunto messaggio di errore di chiusura software con cam5 aperto -aggiunto ordine strategie --- .../MainWindow/MainWindowV.xaml.vb | 5 +++++ .../StrategyManager/StrategyManagerVM.vb | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb index f1dcb384..2dd746a6 100644 --- a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb @@ -43,6 +43,11 @@ Public Class MainWindowV e.Cancel = True Return End If + If Map.refProjectVM.bCalcRunning Then + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(63047), EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error) + e.Cancel = True + Return + End If If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then e.Cancel = True Return diff --git a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb index 7827302c..d7e4be1f 100644 --- a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb +++ b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb @@ -493,11 +493,17 @@ Public Class StrategyManagerVM Dim IndexActiveStrategy As Integer = m_SelTreeItem.StrategyList.IndexOf(m_SelTreeItem.SelActiveStrategy) ' Recupero indice elemento selezionato in lista Dim NewIndexActiveStrategy As Integer = IndexActiveStrategy - 1 + ' Setto indice per capire che la strategia è stata spostata in StrategyList + m_SelTreeItem.SelActiveStrategy.nIndexInList = NewIndexActiveStrategy ' Se l'indice è maggiore di 0 If IndexActiveStrategy > 0 Then ' Muovo l'elemento selezionato sopra di 1 m_SelTreeItem.StrategyList.Move(IndexActiveStrategy, NewIndexActiveStrategy) End If + ' Riallinea tutti gli indici + For Index As Integer = 0 To m_SelTreeItem.StrategyList.Count - 1 + m_SelTreeItem.StrategyList(Index).nIndexInList = Index + Next ' Setto a true booleano per modifica SetbIsModifyStrategy(True) ' Aggiorno la lista @@ -526,11 +532,17 @@ Public Class StrategyManagerVM Dim IndexActiveStrategy As Integer = m_SelTreeItem.StrategyList.IndexOf(m_SelTreeItem.SelActiveStrategy) ' Recupero indice elemento selezionato in lista Dim NewIndexActiveStrategy As Integer = IndexActiveStrategy + 1 + ' Setto indice per capire che la strategia è stata spostata in StrategyList + m_SelTreeItem.SelActiveStrategy.nIndexInList = NewIndexActiveStrategy ' Se l'indice è maggiore di 0 If IndexActiveStrategy >= 0 Then ' Muovo l'elemento selezionato sopra di 1 m_SelTreeItem.StrategyList.Move(IndexActiveStrategy, NewIndexActiveStrategy) End If + ' Riallinea tutti gli indici + For Index As Integer = 0 To m_SelTreeItem.StrategyList.Count - 1 + m_SelTreeItem.StrategyList(Index).nIndexInList = Index + Next ' Setto a true booleano per modifica SetbIsModifyStrategy(True) ' Aggiorno la lista @@ -990,10 +1002,7 @@ Public Class Topology m_sName = JsonTopology.sName m_sImage = JsonTopology.sImage m_StrategyList = New ObservableCollection(Of Strategy)(JsonTopology.StrategyList.Select(Function(jsonStrategy) New Strategy(jsonStrategy))) - m_AvailableStrategyList_View = New ListCollectionView(StrategyList) - m_AvailableStrategyList_View.Filter = AddressOf AvailableStrategyFilter - m_ActiveStrategyList_View = New ListCollectionView(StrategyList) - m_ActiveStrategyList_View.Filter = AddressOf ActiveStrategyFilter + CreateStrategyViews() NotifyPropertyChanged(NameOf(StrategyList)) End Sub @@ -1012,8 +1021,10 @@ Public Class Topology Friend Sub CreateStrategyViews() m_AvailableStrategyList_View = New ListCollectionView(StrategyList) m_AvailableStrategyList_View.Filter = AddressOf AvailableStrategyFilter + m_AvailableStrategyList_View.SortDescriptions.Add(New SortDescription("nIndexInList", ListSortDirection.Ascending)) m_ActiveStrategyList_View = New ListCollectionView(StrategyList) m_ActiveStrategyList_View.Filter = AddressOf ActiveStrategyFilter + m_ActiveStrategyList_View.SortDescriptions.Add(New SortDescription("nIndexInList", ListSortDirection.Ascending)) End Sub Friend Function Serialize() As JsonTopology From 8b69683620071f74d43986a2806f9fae1f55c5e0 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 18 Jun 2026 11:28:18 +0200 Subject: [PATCH 06/10] -corretto salvataggio json strategie con ordinamento --- EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb index d7e4be1f..76806935 100644 --- a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb +++ b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb @@ -1029,7 +1029,8 @@ Public Class Topology Friend Function Serialize() As JsonTopology Dim JsonTopology As New JsonTopology(m_sName) - For Each Strategy In m_StrategyList + Dim mOrderStrategyList As IOrderedEnumerable(Of Strategy) = m_StrategyList.OrderBy(Function(s) s.nIndexInList) + For Each Strategy In mOrderStrategyList JsonTopology.StrategyList.Add(Strategy.Serialize()) Next Return JsonTopology From fb7a7fcb2aa3a13305dbb882afed1ceca4878413 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 19 Jun 2026 15:13:25 +0200 Subject: [PATCH 07/10] EgtBEAMWALL 3.1.6.3: -aggiunto ordinamento strategie per nIndexInList -ripristinato valori in tabelle --- EgtBEAMWALL.Core/My Project/AssemblyInfo.vb | 4 +- .../Properties/AssemblyInfo.cs | 4 +- .../BTLDataWnd/BTLDataWndV.xaml.vb | 1 + .../BTLDataWnd/BTLDataWndVM.vb | 1 + .../ConfigurationPage/ConfigurationPageVM.vb | 13 ----- .../ItemParamList/BTLPartListV.xaml | 2 + .../ItemParamList/RawPartListV.xaml | 4 +- .../MachGroupPanel/MyMachGroupVM.vb | 2 +- EgtBEAMWALL.Optimizer/MainMenu/MainMenuVM.vb | 8 +++- .../My Project/AssemblyInfo.vb | 4 +- .../Panel/RightPanelTopV.xaml.vb | 1 + EgtBEAMWALL.Optimizer/Project/ProjectVM.vb | 2 + .../StrategyManager/StrategyManagerVM.vb | 47 ++++++++++++++----- .../My Project/AssemblyInfo.vb | 4 +- 14 files changed, 61 insertions(+), 36 deletions(-) diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb index 3a6f6d5a..c42f229d 100644 --- a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb @@ -38,5 +38,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs index f8a2648d..feba8b6d 100644 --- a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs +++ b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.6.2")] -[assembly: AssemblyFileVersion("3.1.6.2")] +[assembly: AssemblyVersion("3.1.6.3")] +[assembly: AssemblyFileVersion("3.1.6.3")] diff --git a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndV.xaml.vb b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndV.xaml.vb index 133addef..83c9149a 100644 --- a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndV.xaml.vb @@ -20,6 +20,7 @@ If Not IsNothing(Map.refBTLDataWndVM.SelStrategySetup) AndAlso Map.refBTLDataWndVM.SelStrategySetup.Equals(SelStrategy.Content) Then Map.refStrategyManagerVM.SelStrategySetup.sName = SelStrategy.Content Map.refStrategyManagerVM.SelStrategySetup.Read() + Map.refStrategyManagerVM.OrderStrategyList(Map.refStrategyManagerVM.SelStrategySetup.StrategyFeatureList) Map.refBTLDataWndVM.ReadCustomGeneralParameters(SelStrategy.Content) Map.refBTLDataWndVM.SelStrategySetup = SelStrategy.Content End If diff --git a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb index 81013789..2a325287 100644 --- a/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb +++ b/EgtBEAMWALL.Optimizer/BTLDataWnd/BTLDataWndVM.vb @@ -33,6 +33,7 @@ Public Class BTLDataWndVM If m_SelStrategySetup <> value Then Map.refStrategyManagerVM.SelStrategySetup.sName = value Map.refStrategyManagerVM.SelStrategySetup.Read() + Map.refStrategyManagerVM.OrderStrategyList(Map.refStrategyManagerVM.SelStrategySetup.StrategyFeatureList) ReadCustomGeneralParameters(value) End If m_SelStrategySetup = value diff --git a/EgtBEAMWALL.Optimizer/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.Optimizer/ConfigurationPage/ConfigurationPageVM.vb index cd2d6253..acb1ce37 100644 --- a/EgtBEAMWALL.Optimizer/ConfigurationPage/ConfigurationPageVM.vb +++ b/EgtBEAMWALL.Optimizer/ConfigurationPage/ConfigurationPageVM.vb @@ -1,7 +1,6 @@ Imports System.Collections.ObjectModel Imports System.IO Imports System.IO.Compression -Imports System.Reflection Imports EgtBEAMWALL.Core Imports EgtUILib Imports EgtWPFLib5 @@ -25,22 +24,10 @@ Public Class ConfigurationPageVM Set(value As Integer) m_SelConfigSubPage = value If m_SelConfigSubPage = ConfigSubPages.GENERAL Then - ' Controllo se il file CustomConfig Json è stato modificato - If Map.refStrategyManagerVM.bIsModifyStrategy Then Map.refStrategyManagerVM.SaveCustomConfigJson() SetGeneral_Visibility(True) - SetStrategyManager_Visibility(False) - SetPDFEditor_Visibility(False) - ElseIf m_SelConfigSubPage = ConfigSubPages.MACHINE Then - ' Controllo se il file CustomConfig Json è stato modificato - If Map.refStrategyManagerVM.bIsModifyStrategy Then Map.refStrategyManagerVM.SaveCustomConfigJson() - SetGeneral_Visibility(False) - SetStrategyManager_Visibility(False) SetPDFEditor_Visibility(False) ElseIf m_SelConfigSubPage = ConfigSubPages.PDFEDITOR Then - ' Controllo se il file CustomConfig Json è stato modificato - If Map.refStrategyManagerVM.bIsModifyStrategy Then Map.refStrategyManagerVM.SaveCustomConfigJson() SetPDFEditor_Visibility(True) - SetGeneral_Visibility(False) SetStrategyManager_Visibility(False) End If End Set diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml index 48d73bdb..00e8b407 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml +++ b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml @@ -458,6 +458,7 @@ @@ -467,6 +468,7 @@ Style="{StaticResource CALC_ERR_Letter_TextBlock}"/> diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml b/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml index fb63b317..0cfeed91 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml +++ b/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml @@ -76,7 +76,8 @@ - - + + diff --git a/EgtBEAMWALL.Optimizer/Panel/RightPanelTopV.xaml.vb b/EgtBEAMWALL.Optimizer/Panel/RightPanelTopV.xaml.vb index 61d0cd54..6c8c7e51 100644 --- a/EgtBEAMWALL.Optimizer/Panel/RightPanelTopV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/Panel/RightPanelTopV.xaml.vb @@ -5,6 +5,7 @@ If Not IsNothing(Map.refProjectVM.SelStrategySetup) AndAlso Map.refProjectVM.SelStrategySetup.Equals(SelStrategy.Content) Then Map.refStrategyManagerVM.SelStrategySetup.sName = SelStrategy.Content Map.refStrategyManagerVM.SelStrategySetup.Read() + Map.refStrategyManagerVM.OrderStrategyList(Map.refStrategyManagerVM.SelStrategySetup.StrategyFeatureList) Map.refProjectVM.CustomGeneralParameters(SelStrategy.Content) Map.refProjectVM.SelStrategySetup = SelStrategy.Content End If diff --git a/EgtBEAMWALL.Optimizer/Project/ProjectVM.vb b/EgtBEAMWALL.Optimizer/Project/ProjectVM.vb index b3acb6b3..f20b598f 100644 --- a/EgtBEAMWALL.Optimizer/Project/ProjectVM.vb +++ b/EgtBEAMWALL.Optimizer/Project/ProjectVM.vb @@ -371,6 +371,7 @@ Public Class ProjectVM If Not IsNothing(value) Then Map.refStrategyManagerVM.SelStrategySetup.sName = value Map.refStrategyManagerVM.SelStrategySetup.Read() + Map.refStrategyManagerVM.OrderStrategyList(Map.refStrategyManagerVM.SelStrategySetup.StrategyFeatureList) CustomGeneralParameters(value) End If m_SelStrategySetup = value @@ -380,6 +381,7 @@ Public Class ProjectVM Friend Sub SetSelStrategy(value As String) m_SelStrategySetup = value Map.refStrategyManagerVM.SelStrategySetup.Read() + Map.refStrategyManagerVM.OrderStrategyList(Map.refStrategyManagerVM.SelStrategySetup.StrategyFeatureList) Map.refSceneHostVM.SaveProject() NotifyPropertyChanged(NameOf(SelStrategySetup)) End Sub diff --git a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb index 76806935..0e483706 100644 --- a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb +++ b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb @@ -66,8 +66,9 @@ Public Class StrategyManagerVM End If End If m_SelStrategySetup.Read() - End If - SetSaveImage(MODIFY_IMAGE) + OrderStrategyList(m_SelStrategySetup.StrategyFeatureList) + End If + SetSaveImage(MODIFY_IMAGE) NotifyPropertyChanged(NameOf(SelStrategySetup)) End Set End Property @@ -77,6 +78,7 @@ Public Class StrategyManagerVM ' Scrivo file defaultconfig nell'ini EgtUILib.WritePrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, m_SelStrategySetup.sName, Map.refMainWindowVM.MainWindowM.sDefaultConfig) m_SelStrategySetup.Read() + OrderStrategyList(m_SelStrategySetup.StrategyFeatureList) End If NotifyPropertyChanged(NameOf(SelStrategySetup)) End Sub @@ -270,15 +272,26 @@ Public Class StrategyManagerVM ''' ''' Funzione che salva il file customconfig se sono presenti modifiche - ''' - Friend Sub SaveCustomConfigJson() + ''' + Friend Function SaveCustomConfigJson() As Boolean ' Controlla se il file JSON è stato modificato - If Not m_bIsModifyStrategy Then Return - ' Chiede conferma per il salvataggio - If EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62580), EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then - m_SelStrategySetup.Write(Map.refGeneralParametersStrategyVM.GeneralParametersList, False) - End If - End Sub + If Not m_bIsModifyStrategy Then Return False + ' Chiedo conferma per il salvataggio + Select Case EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62580), EgtMsg(15003), MessageBoxButton.YesNoCancel, MessageBoxImage.Information) + Case MessageBoxResult.Yes + If IsNothing(Map.refGeneralParametersStrategyVM) Then + Dim GeneralParametersVM As New GeneralParametersStrategyVM() + Map.refGeneralParametersStrategyVM.GeneralParametersList = GeneralParametersVM.GeneralParametersList + End If + m_SelStrategySetup.Write(Map.refGeneralParametersStrategyVM.GeneralParametersList, False) + SetbIsModifyStrategy(False) + Case MessageBoxResult.No + Update() + Case MessageBoxResult.Cancel + Return False + End Select + Return True + End Function Friend Sub Update() m_StrategySetupList.Clear() @@ -331,6 +344,18 @@ Public Class StrategyManagerVM End If End Sub + Friend Sub OrderStrategyList(StrategyFeatureList As ObservableCollection(Of StrategyFeature)) + For Each StrategySetupItem As StrategyFeature In StrategyFeatureList + For Each StrategyFeatureItem As Topology In StrategySetupItem.TopologyList + Dim OrderStrategyList As List(Of Strategy) = StrategyFeatureItem.StrategyList.OrderBy(Function(s) s.nIndexInList).ToList() + StrategyFeatureItem.StrategyList.Clear() + For Each OrderStrategyItem As Strategy In OrderStrategyList + StrategyFeatureItem.StrategyList.Add(OrderStrategyItem) + Next + Next + Next + End Sub + #End Region ' Methods #Region "COMMANDS" @@ -1030,7 +1055,7 @@ Public Class Topology Friend Function Serialize() As JsonTopology Dim JsonTopology As New JsonTopology(m_sName) Dim mOrderStrategyList As IOrderedEnumerable(Of Strategy) = m_StrategyList.OrderBy(Function(s) s.nIndexInList) - For Each Strategy In mOrderStrategyList + For Each Strategy As Strategy In mOrderStrategyList JsonTopology.StrategyList.Add(Strategy.Serialize()) Next Return JsonTopology diff --git a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb index e29976d3..3bb553a5 100644 --- a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + From 15c919b0c61f4f93d949960e0a06924664ab20a2 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 24 Jun 2026 11:50:43 +0200 Subject: [PATCH 08/10] EgtBEAMWALL 3.1.6.4: -cambiato immagine bottone verifica tutti con rotazione -aggiunto pulsante aggiorna feature strategie in configurazione --- EgtBEAMWALL.Core/My Project/AssemblyInfo.vb | 4 +- .../Properties/AssemblyInfo.cs | 4 +- .../BTLViewModel/BTLStructureVM.vb | 1 - .../CALCPanel/CALCPanelVM.vb | 1 + .../EgtBEAMWALL.Optimizer.vbproj | 8 +- .../ItemParamList/BTLPartListV.xaml.vb | 1 + .../LeftPanel/LeftPanelV.xaml | 2 +- .../LeftPanel/LeftPanelVM.vb | 6 ++ .../MachGroupPanel/MyMachGroupPanelVM.vb | 2 +- .../My Project/AssemblyInfo.vb | 4 +- .../Resources/NewPage/VerifyAllR.png | Bin 1169 -> 0 bytes .../Resources/NewPage/VerifyAllRotation.png | Bin 0 -> 1870 bytes .../Resources/NewPage/arrow.png | Bin 0 -> 1307 bytes .../Resources/NewPage/reset.png | Bin 0 -> 2267 bytes .../Statistics/PDFEditorVM.vb | 2 +- .../StrategyManager/StrategyManagerV.xaml | 25 ++++-- .../StrategyManager/StrategyManagerVM.vb | 78 +++++++++++++++++- .../StrategyManager/StrategyV.xaml | 10 ++- .../Utility/Configuration.vb | 49 ----------- EgtBEAMWALL.Optimizer/Utility/Dictionary.xaml | 32 +++++-- .../My Project/AssemblyInfo.vb | 4 +- 21 files changed, 156 insertions(+), 77 deletions(-) delete mode 100644 EgtBEAMWALL.Optimizer/Resources/NewPage/VerifyAllR.png create mode 100644 EgtBEAMWALL.Optimizer/Resources/NewPage/VerifyAllRotation.png create mode 100644 EgtBEAMWALL.Optimizer/Resources/NewPage/arrow.png create mode 100644 EgtBEAMWALL.Optimizer/Resources/NewPage/reset.png diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb index c42f229d..3b4061eb 100644 --- a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb @@ -38,5 +38,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs index feba8b6d..acd949f7 100644 --- a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs +++ b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.6.3")] -[assembly: AssemblyFileVersion("3.1.6.3")] +[assembly: AssemblyVersion("3.1.6.4")] +[assembly: AssemblyFileVersion("3.1.6.4")] diff --git a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb index 80bf4cc8..6080533a 100644 --- a/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb +++ b/EgtBEAMWALL.Optimizer/BTLViewModel/BTLStructureVM.vb @@ -962,7 +962,6 @@ Public Class BTLStructureVM ' tolgo pezzo selezionato SelBTLPart.SelBTLFeatureVM = Nothing End If - ' mostro tutti i pezzi ' creo lista id presenti Dim BTLPartIdList As List(Of Integer) = (From Part In BTLPartVMList Select Part.nPartId).ToList() diff --git a/EgtBEAMWALL.Optimizer/CALCPanel/CALCPanelVM.vb b/EgtBEAMWALL.Optimizer/CALCPanel/CALCPanelVM.vb index 54b5bd9f..ef64df64 100644 --- a/EgtBEAMWALL.Optimizer/CALCPanel/CALCPanelVM.vb +++ b/EgtBEAMWALL.Optimizer/CALCPanel/CALCPanelVM.vb @@ -979,6 +979,7 @@ Public Class CALCPanelVM If Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count > 0 Then Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList(0)) End If + Map.refProjectVM.BTLStructureVM.LoadFilters() Map.refMyStatusBarVM.RefreshMachName() End Sub diff --git a/EgtBEAMWALL.Optimizer/EgtBEAMWALL.Optimizer.vbproj b/EgtBEAMWALL.Optimizer/EgtBEAMWALL.Optimizer.vbproj index 856046ca..b9410cc9 100644 --- a/EgtBEAMWALL.Optimizer/EgtBEAMWALL.Optimizer.vbproj +++ b/EgtBEAMWALL.Optimizer/EgtBEAMWALL.Optimizer.vbproj @@ -1228,7 +1228,13 @@ - + + + + + + + diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb index e1e62e80..eec5d44d 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb @@ -146,4 +146,5 @@ Public Class SettingsBtnVerticalOffsetMultiConverter Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack Throw New NotImplementedException() End Function + End Class \ No newline at end of file diff --git a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml index ec9fcd15..0fa30927 100644 --- a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml +++ b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml @@ -37,7 +37,7 @@ Style="{StaticResource BTLDataWnd_Image}"/> + + diff --git a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb index 0e483706..57b2b4de 100644 --- a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb +++ b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb @@ -106,6 +106,8 @@ Public Class StrategyManagerVM TmpImage = ImageRoot & Item.sImage Item.sImage = TmpImage End If + ' Gestisco visibilita' pulsante Update Feature + SetUpdate_Visibility(If(Item.sName <> "Feature", True, False)) m_SelTreeItem = Item NotifyPropertyChanged(NameOf(SelTreeItem)) End Sub @@ -209,6 +211,17 @@ Public Class StrategyManagerVM NotifyPropertyChanged(NameOf(DefaultConfig_IsChecked)) End Sub + Private m_bUpdate_Visibility As Visibility = Visibility.Collapsed + Public ReadOnly Property Update_Visibility As Visibility + Get + Return m_bUpdate_Visibility + End Get + End Property + Friend Sub SetUpdate_Visibility(value As Boolean) + m_bUpdate_Visibility = If(value, Visibility.Visible, Visibility.Collapsed) + NotifyPropertyChanged(NameOf(Update_Visibility)) + End Sub + #Region "Messages" Public ReadOnly Property SaveToolTip As String @@ -254,6 +267,7 @@ Public Class StrategyManagerVM Private m_cmdOk As ICommand Private m_cmdCancel As ICommand Private m_cmdConfigurationParametersCommand As ICommand + Private m_cmdUpdateFeatureCommand As ICommand #End Region ' Field & Properties @@ -636,6 +650,68 @@ Public Class StrategyManagerVM #End Region ' ConfigurationParametersCommand +#Region "UpdateFeatureCommand" + + Public ReadOnly Property UpdateFeatureCommand As ICommand + Get + If m_cmdUpdateFeatureCommand Is Nothing Then + m_cmdUpdateFeatureCommand = New Command(AddressOf UpdateFeature) + End If + Return m_cmdUpdateFeatureCommand + End Get + End Property + + Public Sub UpdateFeature() + Select Case EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62591) & " " & m_SelTreeItem.SelParamStrategy.sStrategyName & " " & EgtMsg(62592) & " " & m_SelTreeItem.sName & " ?", EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Information) + Case MessageBoxResult.Yes + For Each StrategyFeatureItem As StrategyFeature In m_SelStrategySetup.StrategyFeatureList + For Each TopologyItem As Topology In StrategyFeatureItem.TopologyList + If TopologyItem.sName = m_SelTreeItem.sName Then + For Each StrategyItem As Strategy In TopologyItem.StrategyList + Dim Strategy As Strategy = m_SelTreeItem.StrategyList.FirstOrDefault(Function(s) s.sStrategyId = StrategyItem.sStrategyId AndAlso s.sStrategyName = StrategyItem.sStrategyName) + If IsNothing(Strategy) Then Continue For + For Each ParamItem As StrategyParameter In StrategyItem.ParameterList + Dim StrategyParam As StrategyParameter = Strategy.ParameterList.FirstOrDefault(Function(p) p.sName = ParamItem.sName) + If IsNothing(StrategyParam) Then Continue For + Select Case ParamItem.GetType() + Case GetType(BooleanStrategyParameter) + Dim bValue As Boolean = DirectCast(StrategyParam, BooleanStrategyParameter).bValue + DirectCast(ParamItem, BooleanStrategyParameter).SetValue(bValue) + Case GetType(DoubleStrategyParameter) + Dim sValue As String = DirectCast(StrategyParam, DoubleStrategyParameter).sValue + DirectCast(ParamItem, DoubleStrategyParameter).SetValue(sValue) + Case GetType(ComboStrategyParameter) + Dim selValue As ComboParameter = Nothing + If IsNothing(DirectCast(StrategyParam, ComboStrategyParameter).SelValue) Then + selValue = DirectCast(ParamItem, ComboStrategyParameter).SelValue + Else + selValue = DirectCast(StrategyParam, ComboStrategyParameter).SelValue + End If + DirectCast(ParamItem, ComboStrategyParameter).SetSelValue(selValue.sValue) + Case GetType(StringStrategyParameter) + Dim sValue As String = DirectCast(StrategyParam, StringStrategyParameter).sValue + DirectCast(ParamItem, StringStrategyParameter).SetValue(sValue) + Case GetType(ListStrategyParameter) + For Each ToolParamItem In DirectCast(StrategyParam, ListStrategyParameter).ListValue + Dim NewToolParamItem As ToolParameter = DirectCast(ParamItem, ListStrategyParameter).ListValue.FirstOrDefault(Function(x) x.sName = ToolParamItem.sName) + NewToolParamItem.bIsActive = ToolParamItem.bIsActive + Next + DirectCast(ParamItem, ListStrategyParameter).SelValue = DirectCast(ParamItem, ListStrategyParameter).ListValue.FirstOrDefault(Function(x) x.bIsActive) + DirectCast(ParamItem, ListStrategyParameter).ActiveToolList_View.Refresh() + DirectCast(ParamItem, ListStrategyParameter).AvailableToolList_View.Refresh() + End Select + Next + Next + End If + Next + Next + Case MessageBoxResult.No + Return + End Select + End Sub + +#End Region ' UpdateFeatureCommand + #End Region ' Commands End Class @@ -1964,7 +2040,7 @@ Public Class ListStrategyParameter End Property Friend Sub CloseToolList() - SetAvailableToolListVisibility(True) + SetAvailableToolListVisibility(False) SetOpenToolListIsEnable(True) End Sub diff --git a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyV.xaml b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyV.xaml index 618c8023..05410960 100644 --- a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyV.xaml +++ b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyV.xaml @@ -4,7 +4,7 @@ xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer" Height="{Binding ActualHeight, ElementName=StrategyFeature_TreeView}" Style="{StaticResource Strategy_Grid}"> - + @@ -71,6 +71,14 @@ + +