EgtCAM5 :

- Migliorie SetUp.
- Migliorie simulazione.
This commit is contained in:
Emmanuele Sassi
2017-01-27 18:33:56 +00:00
parent 7747916f24
commit dffe9de64e
15 changed files with 493 additions and 327 deletions
@@ -1,4 +1,5 @@
Imports System.IO
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Namespace EgtCAM5
@@ -20,7 +21,25 @@ Namespace EgtCAM5
ST_STEP = 3
ST_PAUSE = 4
End Enum
Private m_nStatus As Integer = SIM_ST.ST_STOP
Private m_nStatus As SIM_ST = SIM_ST.ST_STOP
Private Property SimulationStatus As SIM_ST
Get
Return m_nStatus
End Get
Set(value As SIM_ST)
m_nStatus = value
If IniFile.m_nUserLevel >= 10 AndAlso (value = SIM_ST.ST_PAUSE OrElse value = SIM_ST.ST_STOP) Then
For Index = 0 To m_MachineAxisList.Count - 1
m_MachineAxisList(Index).IsReadOnlyAxesValue = False
Next
Else
For Index = 0 To m_MachineAxisList.Count - 1
m_MachineAxisList(Index).IsReadOnlyAxesValue = True
Next
End If
End Set
End Property
' Stato bottone Play
Private m_bShowPlay As Boolean = True
' Coefficiente per valore Slider
@@ -50,212 +69,12 @@ Namespace EgtCAM5
End Set
End Property
Private m_A1Name As String
Public Property A1Name As String
' lista degli assi
Private m_MachineAxisList As New ObservableCollection(Of MachineAxis)
Public ReadOnly Property MachineAxisList As ObservableCollection(Of MachineAxis)
Get
Return m_A1Name
Return m_MachineAxisList
End Get
Set(value As String)
If value <> m_A1Name Then
m_A1Name = value
OnPropertyChanged("A1Name")
End If
End Set
End Property
Private m_A1Value As String
Public Property A1Value As String
Get
Return m_A1Value
End Get
Set(value As String)
If value <> m_A1Value Then
m_A1Value = value
OnPropertyChanged("A1Value")
End If
End Set
End Property
Private m_A2Name As String
Public Property A2Name As String
Get
Return m_A2Name
End Get
Set(value As String)
If value <> m_A2Name Then
m_A2Name = value
OnPropertyChanged("A2Name")
End If
End Set
End Property
Private m_A2Value As String
Public Property A2Value As String
Get
Return m_A2Value
End Get
Set(value As String)
If value <> m_A2Value Then
m_A2Value = value
OnPropertyChanged("A2Value")
End If
End Set
End Property
Private m_A3Name As String
Public Property A3Name As String
Get
Return m_A3Name
End Get
Set(value As String)
If value <> m_A3Name Then
m_A3Name = value
OnPropertyChanged("A3Name")
End If
End Set
End Property
Private m_A3Value As String
Public Property A3Value As String
Get
Return m_A3Value
End Get
Set(value As String)
If value <> m_A3Value Then
m_A3Value = value
OnPropertyChanged("A3Value")
End If
End Set
End Property
Private m_A4Name As String
Public Property A4Name As String
Get
Return m_A4Name
End Get
Set(value As String)
If value <> m_A4Name Then
m_A4Name = value
OnPropertyChanged("A4Name")
End If
End Set
End Property
Private m_A4Value As String
Public Property A4Value As String
Get
Return m_A4Value
End Get
Set(value As String)
If value <> m_A4Value Then
m_A4Value = value
OnPropertyChanged("A4Value")
End If
End Set
End Property
Private m_A5Name As String
Public Property A5Name As String
Get
Return m_A5Name
End Get
Set(value As String)
If value <> m_A5Name Then
m_A5Name = value
OnPropertyChanged("A5Name")
End If
End Set
End Property
Private m_A5Value As String
Public Property A5Value As String
Get
Return m_A5Value
End Get
Set(value As String)
If value <> m_A5Value Then
m_A5Value = value
OnPropertyChanged("A5Value")
End If
End Set
End Property
Private m_A6Name As String
Public Property A6Name As String
Get
Return m_A6Name
End Get
Set(value As String)
If value <> m_A6Name Then
m_A6Name = value
OnPropertyChanged("A6Name")
End If
End Set
End Property
Private m_A6Value As String
Public Property A6Value As String
Get
Return m_A6Value
End Get
Set(value As String)
If value <> m_A6Value Then
m_A6Value = value
OnPropertyChanged("A6Value")
End If
End Set
End Property
Private m_A7Name As String
Public Property A7Name As String
Get
Return m_A7Name
End Get
Set(value As String)
If value <> m_A7Name Then
m_A7Name = value
OnPropertyChanged("A7Name")
End If
End Set
End Property
Private m_A7Value As String
Public Property A7Value As String
Get
Return m_A7Value
End Get
Set(value As String)
If value <> m_A7Value Then
m_A7Value = value
OnPropertyChanged("A7Value")
End If
End Set
End Property
Private m_A8Name As String
Public Property A8Name As String
Get
Return m_A8Name
End Get
Set(value As String)
If value <> m_A8Name Then
m_A8Name = value
OnPropertyChanged("A8Name")
End If
End Set
End Property
Private m_A8Value As String
Public Property A8Value As String
Get
Return m_A8Value
End Get
Set(value As String)
If value <> m_A8Value Then
m_A8Value = value
OnPropertyChanged("A8Value")
End If
End Set
End Property
Private m_GCode As String
@@ -421,7 +240,7 @@ Namespace EgtCAM5
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
SimulationStatus = SIM_ST.ST_STEP
' Aggiorno bottone
m_bShowPlay = False
OnPropertyChanged("PlayPauseImage")
@@ -431,7 +250,7 @@ Namespace EgtCAM5
OnPropertyChanged("PlayPauseImage")
' Alrimenti imposto solo il nuovo stato
Else
m_nStatus = SIM_ST.ST_STEP
SimulationStatus = SIM_ST.ST_STEP
' Aggiornamenti per bottone Play/Pause
m_bShowPlay = False
OnPropertyChanged("PlayPauseImage")
@@ -466,13 +285,13 @@ Namespace EgtCAM5
' Eseguo
If m_nStatus = SIM_ST.ST_STOP Then
' Lancio simulazione
m_nStatus = SIM_ST.ST_PLAY
SimulationStatus = SIM_ST.ST_PLAY
ExecSim()
' Aggiorno bottone
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
ElseIf m_nStatus = SIM_ST.ST_PAUSE Then
m_nStatus = SIM_ST.ST_PLAY
SimulationStatus = SIM_ST.ST_PLAY
End If
Else
' Aggiorno bottone
@@ -480,7 +299,7 @@ Namespace EgtCAM5
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
SimulationStatus = SIM_ST.ST_PAUSE
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 11)) ' Pausa
End If
End If
@@ -522,7 +341,7 @@ Namespace EgtCAM5
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
' Imposto il nuovo stato
m_nStatus = SIM_ST.ST_STOP
SimulationStatus = SIM_ST.ST_STOP
End Sub
@@ -569,7 +388,7 @@ Namespace EgtCAM5
' Costringo ad aggiornare UI
UpdateUI()
' Imposto stato corrente
m_nStatus = SIM_ST.ST_STOP
SimulationStatus = SIM_ST.ST_STOP
m_bShowPlay = True
m_SliderX = GetPrivateProfileDouble(S_SIMUL, K_SLIDERX, 1)
Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
@@ -589,7 +408,7 @@ Namespace EgtCAM5
Private Sub ResetSimulation()
' Termino la simulazione
m_nStatus = SIM_ST.ST_STOP
SimulationStatus = SIM_ST.ST_STOP
EgtSimStop()
' Salvo valore dello slider
Dim sVal As String = DoubleToString(SliderValue, 1)
@@ -613,7 +432,7 @@ Namespace EgtCAM5
If bMove Then
If m_nStatus = SIM_ST.ST_STEP And nMove = MCH_SIM.END_STEP Then
' Imposto stato Pausa
m_nStatus = SIM_ST.ST_PAUSE
SimulationStatus = SIM_ST.ST_PAUSE
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 11)) ' Pausa
' Aggiornamenti per bottone Play/Pause
m_bShowPlay = True
@@ -621,7 +440,7 @@ Namespace EgtCAM5
End If
' Se movimento non riuscito
Else
m_nStatus = SIM_ST.ST_STOP
SimulationStatus = SIM_ST.ST_STOP
' Aggiornamenti per bottone Play/Pause
m_bShowPlay = True
OnPropertyChanged("PlayPauseImage")
@@ -656,21 +475,43 @@ Namespace EgtCAM5
Private Sub ShowCncData()
' Assi
Dim nInd As Integer = 0
ShowAxisNameVal(nInd, A1Name, A1Value)
ShowAxisNameVal(nInd, A2Name, A2Value)
ShowAxisNameVal(nInd, A3Name, A3Value)
ShowAxisNameVal(nInd, A4Name, A4Value)
ShowAxisNameVal(nInd, A5Name, A5Value)
ShowAxisNameVal(nInd, A6Name, A6Value)
ShowAxisNameVal(nInd, A7Name, A7Value)
ShowAxisNameVal(nInd, A8Name, A8Value)
Dim nEgtIndex As Integer = 0
Dim nAxisIndex As Integer = 0
Dim sInfo As String = String.Empty
Dim bLinear As Boolean = True
Dim dVal As Double = 0
While EgtSimGetAxisInfoPos(nEgtIndex, sInfo, bLinear, dVal)
If sInfo <> "**" Then
IsValidAxisIndex(nAxisIndex)
m_MachineAxisList(nAxisIndex).Name = sInfo
m_MachineAxisList(nAxisIndex).Value = If(bLinear, LenToString(dVal, -3), DoubleToString(dVal, -3))
nAxisIndex += 1
End If
nEgtIndex += 1
End While
For ClearIndex = m_MachineAxisList.Count - 1 To nEgtIndex - 1
m_MachineAxisList.RemoveAt(ClearIndex)
Next
'ShowAxisNameVal(nInd, A1Name, A1Value)
'ShowAxisNameVal(nInd, A2Name, A2Value)
'ShowAxisNameVal(nInd, A3Name, A3Value)
'ShowAxisNameVal(nInd, A4Name, A4Value)
'ShowAxisNameVal(nInd, A5Name, A5Value)
'ShowAxisNameVal(nInd, A6Name, A6Value)
'ShowAxisNameVal(nInd, A7Name, A7Value)
'ShowAxisNameVal(nInd, A8Name, A8Value)
' Tipo di movimento e feed
ShowMoveTypeFeed()
' Nome utensile e speed
ShowToolNameSpeed()
End Sub
Private Sub IsValidAxisIndex(nIndex As Integer)
For Index = m_MachineAxisList.Count - 1 To nIndex
m_MachineAxisList.Add(New MachineAxis)
Next
End Sub
Private Function ShowAxisNameVal(ByRef nInd As Integer, ByRef sName As String, ByRef sVal As String) As Boolean
Dim sInfo As String = String.Empty
Dim bLinear As Boolean = True