diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index a280da1..6f9431c 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -184,6 +184,7 @@ Module ConstIni Public Const K_MACHININGGROUP As String = "MachiningGroup" Public Const K_SHOWONLYTABLE As String = "ShowOnlyTable" Public Const K_MOVETHROUGHDISPS As String = "MoveThroughDisps" + Public Const K_AUTOUPDATEALLMACHININGS As String = "AutoUpdateAllMachinings" Public Const S_SIMUL As String = "Simul" Public Const K_SLIDERX As String = "SliderX" diff --git a/OptionPanel/MachiningOptionPanel/EstimationsExpander/EstimationsExpander.vb b/OptionPanel/MachiningOptionPanel/EstimationsExpander/EstimationsExpander.vb index 0075179..005caa7 100644 --- a/OptionPanel/MachiningOptionPanel/EstimationsExpander/EstimationsExpander.vb +++ b/OptionPanel/MachiningOptionPanel/EstimationsExpander/EstimationsExpander.vb @@ -107,24 +107,6 @@ Public Class EstimationsExpanderVM Return True End Function - - Private Function UpdateAllMachinings() As Boolean - ' Eseguo ricalcolo - Dim bModified As Boolean = EgtGetModified() - Dim sErr As String = String.Empty - Dim bOk As Boolean = EgtApplyAllMachinings(False, False, sErr) - ' In caso di errori, li segnalo - If Not bOk Then - If Not String.IsNullOrEmpty(sErr) Then - MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) - Else - MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) - End If - End If - If Not bModified Then EgtResetModified() - Return bOk - End Function - Public Overrides Function GetEstimationFileName(bAskSave As Boolean, ByRef sEstFile As String, ByRef sInfo As String) As Boolean Dim bOk As Boolean = True ' Recupero e verifico la path del progetto corrente @@ -177,7 +159,7 @@ Public Class EstimationsExpanderVM ' Recupero la fase corrente Dim nPhase As Integer = EgtGetCurrPhase() ' Aggiorno le lavorazioni - If Not UpdateAllMachinings() Then + If Not Map.refSimulationExpanderVM.UpdateAllMachinings() Then EgtSetCurrPhase(If(nPhase = 0, 1, nPhase), True) Return False End If diff --git a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb index 9f73a88..6098616 100644 --- a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb +++ b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb @@ -176,7 +176,9 @@ Public Class SimulationExpanderVM Return True End Function - Private Function UpdateAllMachinings() As Boolean + Friend Function UpdateAllMachinings() As Boolean + ' Se disabilitato, esco + If GetPrivateProfileInt( S_MACH, K_AUTOUPDATEALLMACHININGS, 1) = 0 Then Return True ' Eseguo ricalcolo Dim bModified As Boolean = EgtGetModified() Dim sErr As String = String.Empty