EgtCam5 1.9h2 :

- modifiche a simulazione.
This commit is contained in:
Dario Sassi
2018-08-16 07:42:38 +00:00
parent 527c899090
commit 5dc101ef0d
2 changed files with 26 additions and 32 deletions
@@ -12,21 +12,14 @@ Public Class SimulationExpanderVM
Private m_nMachLook As Integer = MCH_LOOK.ALL
' Utensile corrente
Private m_sCurrTool As String = String.Empty
' Stato e comando correnti
Public Enum SIM_ST As Integer
ST_STOP = 1
ST_PLAY = 2
ST_STEP = 3
ST_PAUSE = 4
End Enum
Private m_nStatus As SIM_ST = SIM_ST.ST_STOP
Private Property SimulationStatus As SIM_ST
Private m_nStatus As MCH_SIM_ST = MCH_SIM_ST.UI_STOP
Private Property SimulationStatus As MCH_SIM_ST
Get
Return m_nStatus
End Get
Set(value As SIM_ST)
Set(value As MCH_SIM_ST)
m_nStatus = value
If IniFile.m_nUserLevel >= 5 AndAlso (value = SIM_ST.ST_PAUSE OrElse value = SIM_ST.ST_STOP) Then
If IniFile.m_nUserLevel >= 5 AndAlso (value = MCH_SIM_ST.UI_PAUSE OrElse value = MCH_SIM_ST.UI_STOP) Then
For Index = 0 To m_MachineAxisList.Count - 1
m_MachineAxisList(Index).IsReadOnlyAxesValue = False
Next
@@ -423,8 +416,8 @@ Public Class SimulationExpanderVM
' Disabilito check VMill
VMill_IsEnabled = False
' Se stato stop, devo avviare simulazione
If m_nStatus = SIM_ST.ST_STOP Then
SimulationStatus = SIM_ST.ST_STEP
If m_nStatus = MCH_SIM_ST.UI_STOP Then
SimulationStatus = MCH_SIM_ST.UI_STEP
' Aggiorno bottone
m_bShowPlay = False
OnPropertyChanged("PlayPauseImage")
@@ -434,7 +427,7 @@ Public Class SimulationExpanderVM
OnPropertyChanged("PlayPauseImage")
' Alrimenti imposto solo il nuovo stato
Else
SimulationStatus = SIM_ST.ST_STEP
SimulationStatus = MCH_SIM_ST.UI_STEP
' Aggiornamenti per bottone Play/Pause
m_bShowPlay = False
OnPropertyChanged("PlayPauseImage")
@@ -469,23 +462,23 @@ Public Class SimulationExpanderVM
m_bShowPlay = False
OnPropertyChanged("PlayPauseImage")
' Eseguo
If m_nStatus = SIM_ST.ST_STOP Then
If m_nStatus = MCH_SIM_ST.UI_STOP Then
' Lancio simulazione
SimulationStatus = SIM_ST.ST_PLAY
SimulationStatus = MCH_SIM_ST.UI_PLAY
ExecSim()
' Aggiorno bottone
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
ElseIf m_nStatus = SIM_ST.ST_PAUSE Then
SimulationStatus = SIM_ST.ST_PLAY
ElseIf m_nStatus = MCH_SIM_ST.UI_PAUSE Then
SimulationStatus = MCH_SIM_ST.UI_PLAY
End If
Else
' Aggiorno bottone
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
' Se play o step, imposto stato pausa
If m_nStatus = SIM_ST.ST_PLAY Or m_nStatus = SIM_ST.ST_STEP Then
SimulationStatus = SIM_ST.ST_PAUSE
If m_nStatus = MCH_SIM_ST.UI_PLAY Or m_nStatus = MCH_SIM_ST.UI_STEP Then
SimulationStatus = MCH_SIM_ST.UI_PAUSE
StatusMsg = EgtMsg(MSG_SIMULATION + 11) ' Pausa
End If
End If
@@ -516,7 +509,7 @@ Public Class SimulationExpanderVM
' Abilito check VMill
VMill_IsEnabled = True
' Se stato già stop, porto in home
If m_nStatus = SIM_ST.ST_STOP Then
If m_nStatus = MCH_SIM_ST.UI_STOP Then
' Mi riporto all'inizio
EgtSimStart()
EgtDraw()
@@ -530,7 +523,7 @@ Public Class SimulationExpanderVM
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
' Imposto il nuovo stato
SimulationStatus = SIM_ST.ST_STOP
SimulationStatus = MCH_SIM_ST.UI_STOP
End Sub
@@ -667,7 +660,7 @@ Public Class SimulationExpanderVM
' Costringo ad aggiornare UI
UpdateUI()
' Imposto stato corrente
SimulationStatus = SIM_ST.ST_STOP
SimulationStatus = MCH_SIM_ST.UI_STOP
m_bShowPlay = True
m_SliderX = GetPrivateProfileDouble(S_SIMUL, K_SLIDERX, 1)
Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
@@ -708,7 +701,7 @@ Public Class SimulationExpanderVM
Private Sub ResetSimulation()
' Termino la simulazione
SimulationStatus = SIM_ST.ST_STOP
SimulationStatus = MCH_SIM_ST.UI_STOP
EgtSimStop()
' Salvo valore dello slider
Dim sVal As String = DoubleToString(SliderValue, 1)
@@ -725,18 +718,19 @@ Public Class SimulationExpanderVM
Application.Msn.NotifyColleagues(Application.MACHGROUPSISENABLED, False)
EgtSimStart(False)
EgtSimSetStep(SliderValue * m_SliderX)
EgtSimSetUiStatus(m_nStatus)
Dim nShowDataCounter As Integer = 0
While m_nStatus <> SIM_ST.ST_STOP
While m_nStatus <> MCH_SIM_ST.UI_STOP
' Se simulazione in svolgimento
If m_nStatus = SIM_ST.ST_PLAY Or m_nStatus = SIM_ST.ST_STEP Then
If m_nStatus = MCH_SIM_ST.UI_PLAY Or m_nStatus = MCH_SIM_ST.UI_STEP Then
' Eseguo movimento
Dim nMove As Integer
Dim bMove As Boolean = EgtSimMove(nMove)
' Se arrivato a fine step e sono in step
If bMove Then
If m_nStatus = SIM_ST.ST_STEP And nMove = MCH_SIM.END_STEP Then
If m_nStatus = MCH_SIM_ST.UI_STEP And nMove = MCH_SIM.END_STEP Then
' Imposto stato Pausa
SimulationStatus = SIM_ST.ST_PAUSE
SimulationStatus = MCH_SIM_ST.UI_PAUSE
StatusMsg = EgtMsg(MSG_SIMULATION + 11) ' Pausa
' Aggiornamenti per bottone Play/Pause
m_bShowPlay = True
@@ -744,7 +738,7 @@ Public Class SimulationExpanderVM
End If
' Se movimento non riuscito
Else
SimulationStatus = SIM_ST.ST_STOP
SimulationStatus = MCH_SIM_ST.UI_STOP
' Aggiornamenti per bottone Play/Pause
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
@@ -768,7 +762,7 @@ Public Class SimulationExpanderVM
' Aggiorno visualizzazione
EgtDraw()
' Aggiorno dati CNC
If nShowDataCounter = 5 Or SimulationStatus = SIM_ST.ST_PAUSE Or SimulationStatus = SIM_ST.ST_STOP Then
If nShowDataCounter = 5 Or SimulationStatus = MCH_SIM_ST.UI_PAUSE Or SimulationStatus = MCH_SIM_ST.UI_STOP Then
ShowCncData()
nShowDataCounter = 0
ElseIf nShowDataCounter > 5 Then