From 22fe1e2c86eda548b0db1f3198ff228f7d6ef6d9 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Thu, 29 Sep 2022 11:20:05 +0200 Subject: [PATCH] - migliorata gestione ricalcolo generate - corretto errore per cui spariva la tavola dopo generazione - aggiunta possibilita' di cambiare modalita' modifica solo se non si stanno facendo operazioni --- .../ControllerInputPanelVM.vb | 2 +- Icarus/DispositionPanel/DispositionPanelVM.vb | 24 +++++++++++++------ Icarus/SliceManager/SliceManagerVM.vb | 18 ++++++++++---- Icarus/TopPanel/TopPanelVM.vb | 6 ++++- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/Icarus/ControllerInputPanel/ControllerInputPanelVM.vb b/Icarus/ControllerInputPanel/ControllerInputPanelVM.vb index 2441db9..34b3652 100644 --- a/Icarus/ControllerInputPanel/ControllerInputPanelVM.vb +++ b/Icarus/ControllerInputPanel/ControllerInputPanelVM.vb @@ -223,7 +223,7 @@ Public Class ControllerInputPanelVM Friend Sub PrepareInputBox(sTitle As String, sLabel As String, sCheckLabel As String, bShowCombo As Boolean, bShowBtn As Boolean) - If Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode = ModifyModes.DISPOSITION Then Return + 'If Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode = ModifyModes.DISPOSITION Then Return Title = sTitle If sLabel <> "" Then Message = sLabel diff --git a/Icarus/DispositionPanel/DispositionPanelVM.vb b/Icarus/DispositionPanel/DispositionPanelVM.vb index e15ae50..26d0073 100644 --- a/Icarus/DispositionPanel/DispositionPanelVM.vb +++ b/Icarus/DispositionPanel/DispositionPanelVM.vb @@ -134,10 +134,14 @@ Public Class DispositionPanelVM Return m_bMove_IsChecked End Get Set(value As Boolean) - m_bMove_IsChecked = value - If value Then - m_bRotate_IsChecked = False - NotifyPropertyChanged(NameOf(bRotate_IsChecked)) + If Map.refSceneHostVM.MainController.GetStep = 0 Then + m_bMove_IsChecked = value + If value Then + m_bRotate_IsChecked = False + NotifyPropertyChanged(NameOf(bRotate_IsChecked)) + End If + Else + NotifyPropertyChanged(NameOf(bMove_IsChecked)) End If End Set End Property @@ -148,9 +152,13 @@ Public Class DispositionPanelVM Return m_bRotate_IsChecked End Get Set(value As Boolean) - m_bRotate_IsChecked = value - If value Then - m_bMove_IsChecked = False + If Map.refSceneHostVM.MainController.GetStep = 0 Then + m_bRotate_IsChecked = value + If value Then + m_bMove_IsChecked = False + NotifyPropertyChanged(NameOf(bMove_IsChecked)) + End If + Else NotifyPropertyChanged(NameOf(bMove_IsChecked)) End If End Set @@ -222,6 +230,7 @@ Public Class DispositionPanelVM End Property Public Sub DragMove() + If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return InitCommand() Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.MOVE) End Sub @@ -240,6 +249,7 @@ Public Class DispositionPanelVM End Property Public Sub DragRotate() + If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return m_bRotating = True m_PrevGridOrigin = EgtGetGridFrame() InitCommand() diff --git a/Icarus/SliceManager/SliceManagerVM.vb b/Icarus/SliceManager/SliceManagerVM.vb index e805088..eb5251e 100644 --- a/Icarus/SliceManager/SliceManagerVM.vb +++ b/Icarus/SliceManager/SliceManagerVM.vb @@ -339,9 +339,17 @@ Public Class SliceManagerVM NotifyPropertyChanged(NameOf(ghTime)) Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC) EgtSetInfo(nLayTFSCalcId, "Ttot", m_dTime) - ' eseguo script di uscita da machgroup corrente - ExecExitMachScript() - If Not bOk Then + '' eseguo script di uscita da machgroup corrente + 'ExecExitMachScript() + ' se calcolo andato a buon fine, rimuovo flag richiesta ricalcolo + If bOk Then + Dim nPartId As Integer = EgtGetFirstPart() + While nPartId <> GDB_ID.NULL + ' eseguo rimozione flag + EgtRemoveInfo(nPartId, MAC_TORECALC_GENERATE) + nPartId = EgtGetNextPart(nPartId) + End While + Else MessageBox.Show("Error in NC code generation! See log file.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) End If End If @@ -360,8 +368,6 @@ Public Class SliceManagerVM End Function Friend Sub InitMachGroup(bGenerate As Boolean) - ' esecuzione script prima di inizio Mach - ExecInitMachScript() If bGenerate Then Dim nMachGroupId As Integer = EgtGetFirstMachGroup() While nMachGroupId <> GDB_ID.NULL @@ -382,6 +388,8 @@ Public Class SliceManagerVM Next EgtResetCurrMachGroup() Else + ' esecuzione script prima di inizio Mach + ExecInitMachScript() EgtSetCurrMachGroup(EgtGetFirstMachGroup()) End If End Sub diff --git a/Icarus/TopPanel/TopPanelVM.vb b/Icarus/TopPanel/TopPanelVM.vb index 1bf580e..c78a5d7 100644 --- a/Icarus/TopPanel/TopPanelVM.vb +++ b/Icarus/TopPanel/TopPanelVM.vb @@ -127,7 +127,11 @@ Public Class TopPanelVM Return m_bModify_IsChecked End Get Set(value As Boolean) - m_bModify_IsChecked = value + If Map.refSceneHostVM.MainController.GetStep = 0 Then + m_bModify_IsChecked = value + Else + NotifyPropertyChanged(NameOf(bModify_IsChecked)) + End If End Set End Property Friend Sub SetModifyIsChecked(value As Boolean)