diff --git a/MainWindow/MainWindowV.xaml.vb b/MainWindow/MainWindowV.xaml.vb index 5877cda..d2c64a2 100644 --- a/MainWindow/MainWindowV.xaml.vb +++ b/MainWindow/MainWindowV.xaml.vb @@ -1,4 +1,5 @@ -Imports EgtWPFLib5 +Imports System.ComponentModel +Imports EgtWPFLib5 Class MainWindowV Inherits EgtCustomWindow diff --git a/MainWindow/MainWindowVM.vb b/MainWindow/MainWindowVM.vb index 9fc540a..58af8bd 100644 --- a/MainWindow/MainWindowVM.vb +++ b/MainWindow/MainWindowVM.vb @@ -151,8 +151,9 @@ Public Class MainWindowVM End If End If If IniFile.m_bSimulExecuting Then - ' Impossibile uscire ora. Prima fermare la simulazione o aspettarne la fine! - MessageBox.Show(EgtMsg(MSG_SIMULATION + 13), "", MessageBoxButton.OK, MessageBoxImage.Exclamation) + ' Avvio l'arresto della simulazione + refSimulationExpanderVM.SetStatus( MCH_SIM_ST.UI_STOP) + IniFile.m_bSimulEndExitApp = True Return End If ' Gestisco eventuale file corrente modificato @@ -179,6 +180,8 @@ Public Class MainWindowVM If Not IsNothing(m_objMutex) Then m_objMutex.Close() ' Chiudo la finestra principale del programma Application.Current.MainWindow.Close() + Else + IniFile.m_bSimulEndExitApp = False End If End Sub diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index f92df78..9258756 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/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderVM.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderVM.vb index 74b558f..41f0c34 100644 --- a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderVM.vb +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderVM.vb @@ -402,6 +402,7 @@ Public Class MachiningParameterExpanderVM End If ' Restart visualizzazione utensile If m_bPreviewTool Then + EgtPreparePreviewMachiningTool() m_nPtEntId = EgtPreviewMachiningTool(GDB_ID.NULL, MCH_PTM.AFTER) End If IsModified(False) ' NotifyPropertyChanged("UpdateMachiningBtn_Background") diff --git a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb index a08df5c..51aca4a 100644 --- a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb +++ b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb @@ -269,7 +269,7 @@ Public Class SimulationExpanderVM SetShowPlay(True) NotifyPropertyChanged("PlayPauseImage") End If - ' Se movimento con collisione + ' Se movimento con collisione ElseIf nMove = MCH_SIM.COLLISION Then ' Imposto stato Pausa SetSimulationStatus(MCH_SIM_ST.UI_PAUSE) @@ -279,7 +279,7 @@ Public Class SimulationExpanderVM NotifyPropertyChanged("PlayPauseImage") ' Messaggio MessageBox.Show(EgtMsg(MSG_SIMULATION + 19), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning) - ' Altrimenti movimento non riuscito + ' Altrimenti movimento non riuscito Else SetSimulationStatus(MCH_SIM_ST.UI_STOP) ' Aggiornamenti per bottone Play/Pause @@ -334,6 +334,9 @@ Public Class SimulationExpanderVM Map.refOperationParametersExpanderVM.OperParamsViewIsEnabled = True Map.refMachGroupPanelVM.SetMachGroupState(True) ' Map.refMachGroupPanelVM.MachGroupPanelIsEnabled = True Map.refEstimationsExpanderVM.NotifyPropertyChanged("Estimation_IsEnabled") + If IniFile.m_bSimulEndExitApp Then + refMainWindowVM.CloseApplication( Nothing) + End If End Sub Public Overrides Sub OnPostSetSimulationStatus(value As MCH_SIM_ST) diff --git a/Utility/IniFile.vb b/Utility/IniFile.vb index 174b914..2ce9e9e 100644 --- a/Utility/IniFile.vb +++ b/Utility/IniFile.vb @@ -114,6 +114,8 @@ Public Module IniFile Friend m_vtMachPartsPos As New Vector3d(Vector3d.NULL) ' Variabile che contiene stato simulazione per chiusura programma Friend m_bSimulExecuting As Boolean = False + ' Variabile che fa chiudere il programma al termine della simulazione + Friend m_bSimulEndExitApp As Boolean = False Public Function GetPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer Return EgtUILib.GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sIniFile)