EgtCAM5 :
- miglioramenti a simulazione.
This commit is contained in:
+15
-15
@@ -105,7 +105,7 @@ Public Class SimulationExpanderVM
|
||||
Private m_Estimation_IsEnabled As Boolean = False
|
||||
Public Property Estimation_IsEnabled As Boolean
|
||||
Get
|
||||
Return m_Estimation_IsEnabled
|
||||
Return m_Estimation_IsEnabled And Not m_bSimExecuting
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Estimation_IsEnabled = value
|
||||
@@ -220,7 +220,7 @@ Public Class SimulationExpanderVM
|
||||
Return m_SliderValue
|
||||
End Get
|
||||
Set(value As Double)
|
||||
If value <> m_SliderValue Then
|
||||
If Math.Abs(value - m_SliderValue) > EPS_SMALL Then
|
||||
m_SliderValue = value
|
||||
EgtSimSetStep(value * m_SliderX)
|
||||
OnPropertyChanged("SliderValue")
|
||||
@@ -659,6 +659,15 @@ Public Class SimulationExpanderVM
|
||||
If Not UpdateAllMachinings() Then EgtSetCurrPhase(If(nPhase = 0, 1, nPhase), True)
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Inizio simulazione
|
||||
If Not EgtSimInit() OrElse Not EgtSimStart() Then
|
||||
If EgtGetLastMachMgrErrorId() <> 0 Then
|
||||
Dim sErr As String = EgtGetLastMachMgrErrorString()
|
||||
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
|
||||
End If
|
||||
End If
|
||||
' Imposto stato corrente
|
||||
SimulationStatus = MCH_SIM_ST.UI_STOP
|
||||
m_bShowPlay = True
|
||||
@@ -679,15 +688,6 @@ Public Class SimulationExpanderVM
|
||||
VMillActive = False
|
||||
EgtEnableModified()
|
||||
End If
|
||||
' Inizio simulazione
|
||||
If Not EgtSimStart() Then
|
||||
If EgtGetLastMachMgrErrorId() <> 0 Then
|
||||
Dim sErr As String = EgtGetLastMachMgrErrorString()
|
||||
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
|
||||
End If
|
||||
End If
|
||||
' Aggiorno visualizzazione dati macchina
|
||||
ShowCncData()
|
||||
StatusMsg = EgtMsg(MSG_SIMULATION + 14) ' Home
|
||||
@@ -702,7 +702,7 @@ Public Class SimulationExpanderVM
|
||||
Private Sub ResetSimulation()
|
||||
' Termino la simulazione
|
||||
SimulationStatus = MCH_SIM_ST.UI_STOP
|
||||
EgtSimStop()
|
||||
EgtSimExit()
|
||||
' Salvo valore dello slider
|
||||
Dim sVal As String = DoubleToString(SliderValue, 1)
|
||||
WritePrivateProfileString(S_SIMUL, K_SLIDERVAL, sVal)
|
||||
@@ -716,9 +716,8 @@ Public Class SimulationExpanderVM
|
||||
Application.Msn.NotifyColleagues(Application.SETDRAWISENABLED, False)
|
||||
Application.Msn.NotifyColleagues(Application.OPERATIONVIEWEXPANDERISENABLED, False)
|
||||
Application.Msn.NotifyColleagues(Application.MACHGROUPSISENABLED, False)
|
||||
OnPropertyChanged("Estimation_IsEnabled")
|
||||
EgtSimStart(False)
|
||||
EgtSimSetStep(SliderValue * m_SliderX)
|
||||
EgtSimSetUiStatus(m_nStatus)
|
||||
Dim nShowDataCounter As Integer = 0
|
||||
While m_nStatus <> MCH_SIM_ST.UI_STOP
|
||||
' Se simulazione in svolgimento
|
||||
@@ -736,7 +735,7 @@ Public Class SimulationExpanderVM
|
||||
m_bShowPlay = True
|
||||
OnPropertyChanged("PlayPauseImage")
|
||||
End If
|
||||
' Se movimento non riuscito
|
||||
' Se movimento non riuscito
|
||||
Else
|
||||
SimulationStatus = MCH_SIM_ST.UI_STOP
|
||||
' Aggiornamenti per bottone Play/Pause
|
||||
@@ -782,6 +781,7 @@ Public Class SimulationExpanderVM
|
||||
Application.Msn.NotifyColleagues(Application.SETDRAWISENABLED, True)
|
||||
Application.Msn.NotifyColleagues(Application.OPERATIONVIEWEXPANDERISENABLED, True)
|
||||
Application.Msn.NotifyColleagues(Application.MACHGROUPSISENABLED, True)
|
||||
OnPropertyChanged("Estimation_IsEnabled")
|
||||
End Sub
|
||||
|
||||
Private Sub ShowCncData()
|
||||
|
||||
Reference in New Issue
Block a user