EgtCAM5 1.6x5 :

- miglioramenti alla simulazione.
This commit is contained in:
Dario Sassi
2017-01-03 09:07:18 +00:00
parent 729a0e9099
commit fb4ebfd60c
5 changed files with 43 additions and 58 deletions
@@ -22,7 +22,7 @@ Namespace EgtCAM5
End Enum
Private m_nStatus As Integer = SIM_ST.ST_STOP
' Stato bottone Play
Private m_bPlay As Boolean = True
Private m_bShowPlay As Boolean = True
' Coefficiente per valore Slider
Private m_SliderX As Double = 1
@@ -313,14 +313,11 @@ Namespace EgtCAM5
Private m_PlayPauseImage As String
Public ReadOnly Property PlayPauseImage As String
Get
Select Case m_bPlay
Case False
Return "/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Pause.png"
Case True
Return "/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Play.png"
Case Else
Return ""
End Select
If m_bShowPlay Then
Return "/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Play.png"
Else
Return "/Resources/OptionPanel/MachiningOptionPanel/SimulationExpander/Pause.png"
End If
End Get
End Property
@@ -392,6 +389,11 @@ Namespace EgtCAM5
Application.Msn.Register(Application.SIMULATIONEXPANDER_SET_ISEXPANDED, Sub(bValue As Boolean)
IsExpanded = bValue
End Sub)
Application.Msn.Register(Application.SIMULATIONEXPANDER_UPDATE_CNCDATA, Sub()
If IsExpanded Then
ShowCncData()
End If
End Sub)
End Sub
#End Region
@@ -416,22 +418,23 @@ Namespace EgtCAM5
''' Creata the new tool. This method is invoked by the NewCommand.
''' </summary>
Public Sub StepCmd(ByVal param As Object)
'm_CurrProjPage.ClearMessage()
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, "")
' Se stato stop, devo avviare simulazione
If m_nStatus = SIM_ST.ST_STOP Then
m_nStatus = SIM_ST.ST_STEP
' Aggiorno bottone
m_bShowPlay = False
OnPropertyChanged("PlayPauseImage")
ExecSim()
' Aggiorno bottone
m_bPlay = True
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
'SetPlayPauseBtnToPlay()
' Alrimenti imposto solo il nuovo stato
' Alrimenti imposto solo il nuovo stato
Else
m_nStatus = SIM_ST.ST_STEP
' Aggiornamenti per bottone Play/Pause
m_bPlay = False
m_bShowPlay = False
OnPropertyChanged("PlayPauseImage")
'SetPlayPauseBtnToPause()
End If
End Sub
@@ -455,10 +458,10 @@ Namespace EgtCAM5
''' Creata the new tool. This method is invoked by the NewCommand.
''' </summary>
Public Sub PlayPause(ByVal param As Object)
'm_CurrProjPage.ClearMessage()
If m_bPlay Then
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, "")
If m_bShowPlay Then
' Aggiorno bottone
m_bPlay = False
m_bShowPlay = False
OnPropertyChanged("PlayPauseImage")
' Eseguo
If m_nStatus = SIM_ST.ST_STOP Then
@@ -466,18 +469,19 @@ Namespace EgtCAM5
m_nStatus = SIM_ST.ST_PLAY
ExecSim()
' Aggiorno bottone
m_bPlay = True
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
ElseIf m_nStatus = SIM_ST.ST_PAUSE Then
m_nStatus = SIM_ST.ST_PLAY
End If
Else
' Aggiorno bottone
m_bPlay = True
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
m_nStatus = SIM_ST.ST_PAUSE
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 11)) ' Pausa
End If
End If
End Sub
@@ -503,7 +507,7 @@ Namespace EgtCAM5
''' Creata the new tool. This method is invoked by the NewCommand.
''' </summary>
Public Sub StopCmd(ByVal param As Object)
'm_CurrProjPage.ClearMessage()
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, "")
' Se stato già stop, porto in home
If m_nStatus = SIM_ST.ST_STOP Then
' Vado in home
@@ -514,7 +518,12 @@ Namespace EgtCAM5
EgtDraw()
' Aggiorno dati CNC
ShowCncData()
Else
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 12)) ' Simulazione interrotta
End If
' Aggiorno bottone
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
' Imposto il nuovo stato
m_nStatus = SIM_ST.ST_STOP
End Sub
@@ -566,7 +575,7 @@ Namespace EgtCAM5
UpdateUI()
' Imposto stato corrente
m_nStatus = SIM_ST.ST_STOP
m_bPlay = True
m_bShowPlay = True
m_SliderX = GetPrivateProfileDouble(S_SIMUL, K_SLIDERX, 1)
Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
SliderValue = SliderVal
@@ -579,6 +588,7 @@ Namespace EgtCAM5
End Sub
Private Sub CloseSimulation()
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, "")
' Mi assicuro di terminare la simulazione
ResetSimulation()
EgtDraw()
@@ -612,19 +622,21 @@ Namespace EgtCAM5
If m_nStatus = SIM_ST.ST_STEP And nMove = MCH_SIM.END_STEP Then
' Imposto stato Pausa
m_nStatus = SIM_ST.ST_PAUSE
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 11)) ' Pausa
' Aggiornamenti per bottone Play/Pause
m_bPlay = True
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
End If
' Se movimento non riuscito
' Se movimento non riuscito
Else
m_nStatus = SIM_ST.ST_STOP
' Aggiornamenti per bottone Play/Pause
m_bPlay = True
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
Select Case nMove
Case MCH_SIM.END_
'MsgBox(EgtMsg(MSG_SIMULATION + 1)) 'Simulazione completata
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 1))
' MessageBox.Show(EgtMsg(MSG_SIMULATION + 1), "", MessageBoxButton.OK) 'Simulazione completata
Case MCH_SIM.OUTSTROKE
Dim sInfo As String = String.Empty
EgtGetOutstrokeInfo(sInfo)