diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb index 3a6f6d5a..5ceff3b2 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 f8a2648d..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.2")] -[assembly: AssemblyFileVersion("3.1.6.2")] +[assembly: AssemblyVersion("3.1.6.4")] +[assembly: AssemblyFileVersion("3.1.6.4")] 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/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 4a28568e..6697bcbe 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 @@ -80,6 +81,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 +573,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 249324f0..f92759d4 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() @@ -1239,13 +1238,76 @@ Public Class BTLStructureVM End If End Sub + Public Sub RemovePart(BTLPartToDelete As BTLPartVM, bSelPrevious As Boolean) + ' verifico se ci sono già copie in grezzi + Dim nDuploCount As Integer = 0 + If EgtDuploCount(BTLPartToDelete.nPartId, nDuploCount) AndAlso nDuploCount > 0 Then + ' avviso che il pezzo non è cancellabile perchè in produzione + EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(61929), nDuploCount), EgtMsg(15003), MessageBoxButton.OK, MessageBoxImage.Warning) + Return + End If + ' verifico se rimuovere sezione dalla lista + If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToDelete AndAlso x.Section = BTLPartToDelete.Section) Then + Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToDelete.Section) + Map.refProjectVM.BTLStructureVM.SelSection = SectionXMaterial.Empty + End If + ' Eseguo cancellazione + EgtBeamSetPart(BTLPartToDelete.nPartId) + If Map.refProdManagerVM.ListProjAsseBase.Count > 0 Then RemoveScenePart(BTLPartToDelete) + ' seleziono elemento precedente + Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToDelete) + Dim FilteredIndex As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.IndexOf(BTLPartToDelete) + Map.refProjectVM.BTLStructureVM.SelBTLParts.Remove(BTLPartToDelete) + If EgtBeamErasePart() Then + If bSelPrevious Then + If FilteredIndex = 0 Then + If Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count > 1 Then + Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View(1)) + Else + Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing) + End If + ElseIf FilteredIndex = Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count - 1 Then + If Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count > 1 Then + Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count - 2)) + Else + Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing) + End If + Else + Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View(FilteredIndex - 1)) + End If + End If + ' rimuovo dalla lista pezzi + Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index) + End If + End Sub + + Private Sub RemoveScenePart(BTLPartToDelete As BTLPartVM) + ' Rimuovo pezzo dalla scena + Dim IdAsseBase As Integer = 0 + Dim DeletePartId As Integer = 0 + If Not Map.refProdManagerVM.ListProjAsseBase.TryGetValue(BTLPartToDelete.nPROJ, IdAsseBase) Then + Return + End If + ' Setto il nuovo contesto + EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx()) + If EgtBeamGetBuildingIsOn(IdAsseBase) Then EgtBeamShowBuilding(IdAsseBase, False) + If Map.refSceneShowBuldingVM.MapInfo.TryGetValue(BTLPartToDelete.nPartId, DeletePartId) Then + EgtErase(DeletePartId) + Map.refSceneShowBuldingVM.MapInfo.Remove(BTLPartToDelete.nPartId) + End If + EgtBeamShowBuilding(IdAsseBase, True) + EgtZoom(ZM.ALL) + ' Ritorno al contesto corrente + EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx()) + End Sub + #End Region ' Methods #Region "COMMANDS" #Region "DeletePart_Command" - Public ReadOnly Property DeletePart_Command As ICommand + Public ReadOnly Property DeletePart_Command() As ICommand Get If m_cmdDeletePart Is Nothing Then m_cmdDeletePart = New Command(AddressOf DeletePart) @@ -1255,7 +1317,17 @@ Public Class BTLStructureVM End Property Public Sub DeletePart() - Map.refBTLPartManagerVM.RemovePartCmd() + If IsNothing(ProjectManagerVM.CurrProd) Then Return + If EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(62573), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then + If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then + Dim CurrSelBTLParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() + For RemoveIndex = CurrSelBTLParts.Count - 1 To 0 Step -1 + RemovePart(CurrSelBTLParts(RemoveIndex), RemoveIndex = 0) + Next + End If + Else + Return + End If End Sub #End Region ' DeletePart_Command @@ -1272,7 +1344,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/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/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.Optimizer/ConfigurationPage/ConfigurationPageVM.vb index cd2d6253..77663dcf 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,9 @@ 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 @@ -198,17 +184,6 @@ Public Class ConfigurationPageVM End Set End Property - Private m_bGeneral_Visibility As Visibility = Visibility.Collapsed - Public ReadOnly Property General_Visibility As Visibility - Get - Return m_bGeneral_Visibility - End Get - End Property - Friend Sub SetGeneral_Visibility(value As Boolean) - m_bGeneral_Visibility = If(value, Visibility.Visible, Visibility.Collapsed) - NotifyPropertyChanged(NameOf(General_Visibility)) - End Sub - Private m_bStrategyManager_Visibility As Visibility = Visibility.Visible Public ReadOnly Property StrategyManager_Visibility As Visibility Get diff --git a/EgtBEAMWALL.Optimizer/ConfigurationPage/ConfigurationProgramV.xaml b/EgtBEAMWALL.Optimizer/ConfigurationPage/ConfigurationProgramV.xaml index 89642a99..44917fd2 100644 --- a/EgtBEAMWALL.Optimizer/ConfigurationPage/ConfigurationProgramV.xaml +++ b/EgtBEAMWALL.Optimizer/ConfigurationPage/ConfigurationProgramV.xaml @@ -24,7 +24,6 @@ Style="{StaticResource ConfigurationProgram_TextBlock}"/> - - - - - - + + + + + + + + + + + + + + + + + + - + 0 AndAlso Not String.IsNullOrWhiteSpace(sAutoMsgFilePath) Then + ' recupero nome del file messaggi dell'automatismo + sAutoMsgFilePath &= "\Messages\" & sMsgName + If File.Exists(sAutoMsgFilePath) Then + Dim OrigMsgFile As List(Of String) = File.ReadAllLines(sMsgFilePath).ToList() + ' elimino eventuali righe vuote o commento di fine + While String.IsNullOrWhiteSpace(OrigMsgFile.Last()) OrElse OrigMsgFile.Last().StartsWith("//") + OrigMsgFile.RemoveAt(OrigMsgFile.Count - 1) + End While + Dim AutoMsgFile As List(Of String) = File.ReadAllLines(sAutoMsgFilePath).ToList() + ' elimino eventuale riga di inizio file + If AutoMsgFile.Count > 2 AndAlso AutoMsgFile(0).StartsWith("//") AndAlso AutoMsgFile(1).StartsWith("0") Then + AutoMsgFile.RemoveAt(0) + AutoMsgFile.RemoveAt(0) + End If + OrigMsgFile.AddRange(AutoMsgFile) + Dim sNewMsgFilePath As String = sMsgDir & "\Complete" & sMsgName + Dim bNewMsgFile As Boolean = False + Try + File.WriteAllLines(sNewMsgFilePath, OrigMsgFile) + bNewMsgFile = True + Catch ex As Exception + End Try + If bNewMsgFile Then + sMsgFilePath = sNewMsgFilePath + End If + End If + End If If Not EgtLoadMessages(sMsgFilePath) Then EgtOutLog("Error in EgtLoadMessages") End If diff --git a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb index e7a484d1..e51b4498 100644 --- a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb @@ -51,6 +51,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/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb index 9bec1b8f..e8c816e1 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.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/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 d1f68a82..005d07ca 100644 --- a/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb +++ b/EgtBEAMWALL.Optimizer/ProdManager/ProdManagerVM.vb @@ -850,12 +850,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 @@ -1120,7 +1121,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 diff --git a/EgtBEAMWALL.Optimizer/Project/ProjectVM.vb b/EgtBEAMWALL.Optimizer/Project/ProjectVM.vb index 84e8da17..8b322b75 100644 --- a/EgtBEAMWALL.Optimizer/Project/ProjectVM.vb +++ b/EgtBEAMWALL.Optimizer/Project/ProjectVM.vb @@ -320,6 +320,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 @@ -329,6 +330,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/Resources/NewPage/VerifyAllR.png b/EgtBEAMWALL.Optimizer/Resources/NewPage/VerifyAllR.png deleted file mode 100644 index 6ef8ea6c..00000000 Binary files a/EgtBEAMWALL.Optimizer/Resources/NewPage/VerifyAllR.png and /dev/null differ diff --git a/EgtBEAMWALL.Optimizer/Resources/NewPage/VerifyAllRotation.png b/EgtBEAMWALL.Optimizer/Resources/NewPage/VerifyAllRotation.png new file mode 100644 index 00000000..5335bfd5 Binary files /dev/null and b/EgtBEAMWALL.Optimizer/Resources/NewPage/VerifyAllRotation.png differ diff --git a/EgtBEAMWALL.Optimizer/Resources/NewPage/arrow.png b/EgtBEAMWALL.Optimizer/Resources/NewPage/arrow.png new file mode 100644 index 00000000..16c922d9 Binary files /dev/null and b/EgtBEAMWALL.Optimizer/Resources/NewPage/arrow.png differ diff --git a/EgtBEAMWALL.Optimizer/Resources/NewPage/reset.png b/EgtBEAMWALL.Optimizer/Resources/NewPage/reset.png new file mode 100644 index 00000000..487a5774 Binary files /dev/null and b/EgtBEAMWALL.Optimizer/Resources/NewPage/reset.png differ diff --git a/EgtBEAMWALL.Optimizer/Statistics/PDFEditorVM.vb b/EgtBEAMWALL.Optimizer/Statistics/PDFEditorVM.vb index 80db8d38..faeda687 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/PDFEditorVM.vb +++ b/EgtBEAMWALL.Optimizer/Statistics/PDFEditorVM.vb @@ -199,7 +199,7 @@ Public Class PDFEditorVM SetWebAddress("") End Sub -#End Region ' CreatePreviewVis +#End Region ' ClosePreview #End Region ' Commands diff --git a/EgtBEAMWALL.Optimizer/StrategyManager/JsonAvailableStrategyHelper.vb b/EgtBEAMWALL.Optimizer/StrategyManager/JsonAvailableStrategyHelper.vb index 3bc1f3a0..c5c3a76d 100644 --- a/EgtBEAMWALL.Optimizer/StrategyManager/JsonAvailableStrategyHelper.vb +++ b/EgtBEAMWALL.Optimizer/StrategyManager/JsonAvailableStrategyHelper.vb @@ -1,9 +1,9 @@ -Imports EgtWPFLib5 -Imports EgtUILib -Imports Newtonsoft.Json -Imports System.Collections.ObjectModel +Imports System.Collections.ObjectModel Imports System.IO Imports EgtBEAMWALL.Core.ConstBeam +Imports EgtUILib +Imports EgtWPFLib5 +Imports Newtonsoft.Json '----------- Classe che fa riferimento alle Feature del file Json ----------- Public Class JsonAvailableStrategyFeature @@ -339,6 +339,28 @@ Public Class JsonDefaultStrategyParameter End Set End Property + Private m_idDescriptionShortMsg As Integer + Public Property idDescriptionShortMsg As Integer + Get + Return m_idDescriptionShortMsg + End Get + Set(value As Integer) + m_idDescriptionShortMsg = value + NotifyPropertyChanged(NameOf(idDescriptionShortMsg)) + End Set + End Property + + Private m_idDescriptionLongMsg As Integer + Public Property idDescriptionLongMsg As Integer + Get + Return m_idDescriptionLongMsg + End Get + Set(value As Integer) + m_idDescriptionLongMsg = value + NotifyPropertyChanged(NameOf(idDescriptionLongMsg)) + End Set + End Property + Private m_sType As String Public Property sType As String Get @@ -410,12 +432,14 @@ Public Class JsonDefaultStrategyParameter #Region "CONSTRUCTOR" - Sub New(sName As String, sNameNge As String, sValue As String, sDescriptionShort As String, sDescriptionLong As String, sType As String, sSource As String, sSubType As String, sMessageId As String, sMinUserLevel As Integer) + Sub New(sName As String, sNameNge As String, sValue As String, sDescriptionShort As String, sDescriptionLong As String, idDescriptionShortMsg As Integer, idDescriptionLongMsg As Integer, sType As String, sSource As String, sSubType As String, sMessageId As String, sMinUserLevel As Integer) m_sName = sName m_sNameNge = sNameNge m_sValue = sValue m_sDescriptionShort = sDescriptionShort m_sDescriptionLong = sDescriptionLong + m_idDescriptionShortMsg = idDescriptionShortMsg + m_idDescriptionLongMsg = idDescriptionLongMsg m_sType = sType m_sSource = sSource m_sSubType = sSubType @@ -442,6 +466,8 @@ Public Class JsonDefaultStrategyParameter m_sSubType = StrategyParameter.sSubType m_sDescriptionShort = StrategyParameter.sDescriptionShort m_sDescriptionLong = StrategyParameter.sDescriptionLong + m_idDescriptionShortMsg = StrategyParameter.idDescriptionShortMsg + m_idDescriptionLongMsg = StrategyParameter.idDescriptionLongMsg m_sMessageId = StrategyParameter.sMessageId m_sMinUserLevel = StrategyParameter.sMinUserLevel End Sub @@ -491,8 +517,18 @@ Public Class JsonDefaultStrategyParameter StrategyParameter.sName = m_sName StrategyParameter.sNameNge = m_sNameNge StrategyParameter.sSubType = m_sSubType - StrategyParameter.sDescriptionShort = m_sDescriptionShort - StrategyParameter.sDescriptionLong = m_sDescriptionLong + If m_idDescriptionShortMsg < 0 OrElse EgtMsg(m_idDescriptionShortMsg).StartsWith("Msg") Then + StrategyParameter.sDescriptionShort = m_sDescriptionShort + Else + StrategyParameter.sDescriptionShort = EgtMsg(m_idDescriptionShortMsg) + End If + If m_idDescriptionLongMsg < 0 OrElse EgtMsg(m_idDescriptionLongMsg).StartsWith("Msg") Then + StrategyParameter.sDescriptionLong = m_sDescriptionLong + Else + StrategyParameter.sDescriptionLong = EgtMsg(m_idDescriptionLongMsg) + End If + StrategyParameter.idDescriptionShortMsg = m_idDescriptionShortMsg + StrategyParameter.idDescriptionLongMsg = m_idDescriptionLongMsg StrategyParameter.sMessageId = m_sMessageId StrategyParameter.sMinUserLevel = m_sMinUserLevel Return StrategyParameter @@ -537,6 +573,28 @@ Public Class JsonDefaultComboParameter End Set End Property + Private m_idDescriptionShortMsg As Integer + Public Property idDescriptionShortMsg As Integer + Get + Return m_idDescriptionShortMsg + End Get + Set(value As Integer) + m_idDescriptionShortMsg = value + NotifyPropertyChanged(NameOf(idDescriptionShortMsg)) + End Set + End Property + + Private m_idDescriptionLongMsg As Integer + Public Property idDescriptionLongMsg As Integer + Get + Return m_idDescriptionLongMsg + End Get + Set(value As Integer) + m_idDescriptionLongMsg = value + NotifyPropertyChanged(NameOf(idDescriptionLongMsg)) + End Set + End Property + Private m_sMessageId As String Public Property sMessageId As String Get @@ -551,10 +609,12 @@ Public Class JsonDefaultComboParameter #Region "CONSTRUCTOR" - Sub New(sValue As String, sDescriptionShort As String, sDescriptionLong As String, sMessageId As String) + Sub New(sValue As String, sDescriptionShort As String, sDescriptionLong As String, idDescriptionShortMsg As Integer, idDescriptionLongMsg As Integer, sMessageId As String) m_sValue = sValue m_sDescriptionShort = sDescriptionShort m_sDescriptionLong = sDescriptionLong + m_idDescriptionShortMsg = idDescriptionShortMsg + m_idDescriptionLongMsg = idDescriptionLongMsg m_sMessageId = sMessageId End Sub @@ -562,6 +622,8 @@ Public Class JsonDefaultComboParameter m_sValue = ComboParameter.sValue m_sDescriptionShort = ComboParameter.sDescriptionShort m_sDescriptionLong = ComboParameter.sDescriptionLong + m_idDescriptionShortMsg = ComboParameter.idDescriptionShortMsg + m_idDescriptionLongMsg = ComboParameter.idDescriptionLongMsg m_sMessageId = ComboParameter.sMessageId End Sub diff --git a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerV.xaml b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerV.xaml index 0aa30e52..974960f7 100644 --- a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerV.xaml +++ b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerV.xaml @@ -97,8 +97,8 @@ - + @@ -122,7 +122,7 @@ - + @@ -142,10 +142,23 @@ - + - + + + + + + + + diff --git a/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb b/EgtBEAMWALL.Optimizer/StrategyManager/StrategyManagerVM.vb index b070041e..ee65396f 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 @@ -104,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 @@ -207,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 @@ -252,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 @@ -270,15 +286,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 +358,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" @@ -493,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 @@ -526,11 +571,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 @@ -599,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 @@ -990,10 +1103,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,13 +1122,16 @@ 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 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 As Strategy In mOrderStrategyList JsonTopology.StrategyList.Add(Strategy.Serialize()) Next Return JsonTopology @@ -1262,6 +1375,28 @@ Public MustInherit Class StrategyParameter End Set End Property + Private m_idDescriptionShortMsg As Integer + Public Property idDescriptionShortMsg As Integer + Get + Return m_idDescriptionShortMsg + End Get + Set(value As Integer) + m_idDescriptionShortMsg = value + NotifyPropertyChanged(NameOf(idDescriptionShortMsg)) + End Set + End Property + + Private m_idDescriptionLongMsg As Integer + Public Property idDescriptionLongMsg As Integer + Get + Return m_idDescriptionLongMsg + End Get + Set(value As Integer) + m_idDescriptionLongMsg = value + NotifyPropertyChanged(NameOf(idDescriptionLongMsg)) + End Set + End Property + Private m_sMessageId As String Public Property sMessageId As String Get @@ -1300,6 +1435,8 @@ Public MustInherit Class StrategyParameter m_sSubType = JsonGenericParameter.sSubType m_sDescriptionShort = JsonGenericParameter.sDescriptionShort m_sDescriptionLong = JsonGenericParameter.sDescriptionLong + m_idDescriptionShortMsg = JsonGenericParameter.idDescriptionShortMsg + m_idDescriptionLongMsg = JsonGenericParameter.idDescriptionLongMsg m_sMessageId = JsonGenericParameter.sMessageId m_sMinUserLevel = JsonGenericParameter.sMinUserLevel End Sub @@ -2022,6 +2159,28 @@ Public Class ComboParameter End Set End Property + Private m_idDescriptionShortMsg As Integer + Public Property idDescriptionShortMsg As Integer + Get + Return m_idDescriptionShortMsg + End Get + Set(value As Integer) + m_idDescriptionShortMsg = value + NotifyPropertyChanged(NameOf(idDescriptionShortMsg)) + End Set + End Property + + Private m_idDescriptionLongMsg As Integer + Public Property idDescriptionLongMsg As Integer + Get + Return m_idDescriptionLongMsg + End Get + Set(value As Integer) + m_idDescriptionLongMsg = value + NotifyPropertyChanged(NameOf(idDescriptionLongMsg)) + End Set + End Property + Private m_sMessageId As String Public Property sMessageId As String Get @@ -2046,6 +2205,8 @@ Public Class ComboParameter m_sValue = JsonChoiceParameter.sValue m_sDescriptionShort = JsonChoiceParameter.sDescriptionShort m_sDescriptionLong = JsonChoiceParameter.sDescriptionLong + m_idDescriptionShortMsg = JsonChoiceParameter.idDescriptionShortMsg + m_idDescriptionLongMsg = JsonChoiceParameter.idDescriptionLongMsg m_sMessageId = JsonChoiceParameter.sMessageId End If 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 @@ + +