EgtCAM5 1.9c2 :

- aggiunta attivazione/disattivazione Vmill da interfaccia simulazione, se attivata dalla macchina.
This commit is contained in:
Dario Sassi
2018-03-01 14:55:32 +00:00
parent b0497960ae
commit 22ace7cbe6
5 changed files with 89 additions and 115 deletions
@@ -201,6 +201,49 @@ Namespace EgtCAM5
End Set
End Property
Private m_VMillActive As Boolean = False
Public Property VMillActive As Boolean
Get
Return m_VMillActive
End Get
Set(value As Boolean)
m_VMillActive = value
OnPropertyChanged("VMillActive")
If m_VMillActive Then
EgtSetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_VM, m_VMillActive)
Else
EgtRemoveInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_VM)
End If
Application.Msn.NotifyColleagues(Application.EMITTITLE)
End Set
End Property
Public Sub SetVMillActive(value As Boolean)
m_VMillActive = value
OnPropertyChanged("VMillActive")
End Sub
Private m_VMill_Visibility As Visibility = Visibility.Collapsed
Public Property VMill_Visibility As Visibility
Get
Return m_VMill_Visibility
End Get
Set(value As Visibility)
m_VMill_Visibility = value
OnPropertyChanged("VMill_Visibility")
End Set
End Property
Private m_VMill_IsEnabled As Boolean = False
Public Property VMill_IsEnabled As Boolean
Get
Return m_VMill_IsEnabled
End Get
Set(value As Boolean)
m_VMill_IsEnabled = value
OnPropertyChanged("VMill_IsEnabled")
End Set
End Property
' Definizione comandi
Private m_cmdStep As ICommand
Private m_cmdPlayPause As ICommand
@@ -211,12 +254,19 @@ Namespace EgtCAM5
Public ReadOnly Property SimulationMsg As String
Get
Return EgtMsg(MSG_SIMULATION + 7)
Return EgtMsg(MSG_SIMULATION + 7) 'Simulazione
End Get
End Property
Public ReadOnly Property GenerateMsg As String
Get
Return EgtMsg(MSG_SIMULATION + 30)
Return EgtMsg(MSG_SIMULATION + 30) 'GENERA
End Get
End Property
Public ReadOnly Property VMillMsg As String
Get
Return EgtMsg(MSG_SIMULATION + 16) 'Virtual Milling
End Get
End Property
@@ -288,6 +338,8 @@ Namespace EgtCAM5
''' </summary>
Public Sub StepCmd(ByVal param As Object)
StatusMsg = ""
' 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
@@ -329,6 +381,8 @@ Namespace EgtCAM5
Public Sub PlayPause(ByVal param As Object)
StatusMsg = ""
If m_bShowPlay Then
' Disabilito check VMill
VMill_IsEnabled = False
' Aggiorno bottone
m_bShowPlay = False
OnPropertyChanged("PlayPauseImage")
@@ -377,6 +431,8 @@ Namespace EgtCAM5
''' </summary>
Public Sub StopCmd(ByVal param As Object)
StatusMsg = ""
' Abilito check VMill
VMill_IsEnabled = True
' Se stato già stop, porto in home
If m_nStatus = SIM_ST.ST_STOP Then
' Mi riporto all'inizio
@@ -499,6 +555,20 @@ Namespace EgtCAM5
m_SliderX = GetPrivateProfileDouble(S_SIMUL, K_SLIDERX, 1)
Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
SliderValue = SliderVal
' Gestione check VMill
If EgtUILib.GetPrivateProfileInt(S_VMILL, K_VM_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then
VMill_Visibility = Visibility.Visible
VMill_IsEnabled = True
Dim bVal As Boolean
SetVMillActive(EgtGetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_VM, bVal) And bVal)
Else
VMill_Visibility = Visibility.Collapsed
VMill_IsEnabled = False
' Disabilito Vmill, ma inibisco dichiarazione progetto modificato
EgtDisableModified()
VMillActive = False
EgtEnableModified()
End If
' Inizio simulazione
If Not EgtSimStart() Then
If EgtGetLastMachMgrErrorId() <> 0 Then
@@ -557,6 +627,8 @@ Namespace EgtCAM5
' Aggiornamenti per bottone Play/Pause
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
' Abilito check VMill
VMill_IsEnabled = True
Select Case nMove
Case MCH_SIM.END_
StatusMsg = EgtMsg(MSG_SIMULATION + 1) 'Simulazione completata