490 lines
21 KiB
VB.net
490 lines
21 KiB
VB.net
Imports EgtUILib
|
|
Imports EgtWPFLib
|
|
|
|
Public Class DirectCutPageUC
|
|
|
|
' Dichiarazione delle Page UserControl
|
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
|
Friend m_MachineButtons As MachineButtonsUC
|
|
Friend m_ManualAxesMove As ManualAxesMoveUC
|
|
|
|
Friend m_ControlsMachineButton As ControlsMachineButtonUC
|
|
Friend m_VacuumMachineButton As VacuumMachineButtonUC
|
|
Friend m_ControlsDirectCutUC As ControlsDirectCutUC
|
|
Friend m_ControlsDirectCutUC1 As ControlsDirectCutUC1
|
|
|
|
Friend m_ActiveControl As Controls
|
|
Enum Controls
|
|
DirectCutUC
|
|
DirectCutUC1
|
|
MachineButtonUC
|
|
VacuumButtonUC
|
|
End Enum
|
|
|
|
|
|
' Stato di visualizzazione della macchina
|
|
Friend m_bShowMachine As Boolean = False
|
|
Friend m_nMachLook As Integer = MCH_LOOK.ALL
|
|
' Dati generali CN
|
|
Friend m_CN As CN_generico
|
|
Private m_bFirst As Boolean = True
|
|
' Variabili che indicano attivazione paginette con bottoni macchina
|
|
Private m_ControlsBtn_IsActive As Boolean
|
|
|
|
Public Shared m_dZSafe As Double = 52
|
|
|
|
' Variabile che indica se sono attivi i bottoni macchina nuovi o vecchi
|
|
Friend m_NewMachineButtonsType As Boolean
|
|
' Indica che la finestra del talio Singolo deve essere di tipo manuale
|
|
Friend m_bManulaCut As Boolean = False
|
|
|
|
' elenco dei nuovi bottoni
|
|
Private m_ButtonJogList As New List(Of MachineButton)
|
|
|
|
|
|
Private Sub DirectCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
|
'Creazione delle Page UserControl
|
|
m_MachineButtons = New MachineButtonsUC
|
|
m_ManualAxesMove = New ManualAxesMoveUC
|
|
m_ControlsMachineButton = New ControlsMachineButtonUC
|
|
m_VacuumMachineButton = New VacuumMachineButtonUC
|
|
m_ControlsDirectCutUC = New ControlsDirectCutUC
|
|
m_ControlsDirectCutUC1 = New ControlsDirectCutUC1
|
|
|
|
'Posizionemento nella griglia delle Page UserControl
|
|
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
|
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, m_MachineButtons.nCountButton)
|
|
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
|
|
|
m_ControlsDirectCutUC.SetValue(Grid.RowProperty, 1)
|
|
m_ControlsDirectCutUC1.SetValue(Grid.RowProperty, 1)
|
|
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
|
m_VacuumMachineButton.SetValue(Grid.RowProperty, 1)
|
|
|
|
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [ControlMachButtons])
|
|
Dim bCollapsedNewBottonsConsole As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons("JogButtons", "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
|
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
|
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [VacuumMachButtons])
|
|
Dim bCollapsedVacuumButton As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_VACUUMMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
|
If Not m_NewMachineButtonsType Then
|
|
'Assegno MachineButtons alla pagina
|
|
LowerButtonGrid.Children.Add(m_MachineButtons)
|
|
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
|
|
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
|
End If
|
|
' se non sono configurate le ventose allora nascondo il comando
|
|
If m_NewMachineButtonsType AndAlso bCollapsedVacuumButton Then
|
|
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
|
End If
|
|
|
|
' nuovi bottoni 20/05/2021 - modifica specifiche 04/08/2021
|
|
' leggo il numero di assi attivi nella macchina
|
|
Dim AxesNumber = GetPrivateProfileInt(S_AXES, K_AXESNUM, 5, m_MainWindow.GetMachIniFile())
|
|
|
|
End Sub
|
|
|
|
Private Sub DirectCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
|
'------ INIZIO NUOVI BOTTONI ----------
|
|
' Lettura configurazione bottoni (per impostare l'uso del Joystick) da Ini di macchina
|
|
m_ButtonJogList.Clear()
|
|
Dim m_nCount As Integer = 1
|
|
Dim bFoundBtn As Boolean = True
|
|
While bFoundBtn
|
|
Dim sNameBtn As String = K_BUTTON & (m_nCount).ToString()
|
|
Dim sMachineButtonType As String = String.Empty
|
|
Dim sTImageName As String = String.Empty
|
|
Dim sTLuaScriptName As String = String.Empty
|
|
Dim sFImageName As String = String.Empty
|
|
Dim sFLuaScriptName As String = String.Empty
|
|
Dim sStateFlag As String = String.Empty
|
|
bFoundBtn = m_ControlsMachineButton.GetPrivateProfileMachineButtons("JogButtons", sNameBtn, sMachineButtonType, sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag, m_MainWindow.GetMachIniFile())
|
|
If bFoundBtn Then
|
|
m_nCount += 1
|
|
Dim ButtonToAdd As MachineButton = Nothing
|
|
' la selezione dei comandi si trova nella pagina m_ControlsMachineButton.MachineButtonType (tipo Enum)
|
|
Select Case sMachineButtonType
|
|
Case 1
|
|
ButtonToAdd = New NoStateButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
|
Case 2
|
|
ButtonToAdd = New TwoStateButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
|
Case 3
|
|
ButtonToAdd = New ThreeStateButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
|
Case 4
|
|
ButtonToAdd = New DoubleCommandButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
|
Case 5
|
|
ButtonToAdd = New PressedCommandButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
|
End Select
|
|
If Not IsNothing(ButtonToAdd) Then
|
|
m_ButtonJogList.Add(ButtonToAdd)
|
|
End If
|
|
End If
|
|
End While
|
|
' attivo la visualizzazione dei comandi
|
|
SetVisibilityJogButtuns()
|
|
' lo stato di questi comandi vieni carico dalla lettura del PLC (refresh)
|
|
'----------- FINE NUOVI BOTTONI------------
|
|
|
|
LoadLastDirectCutControls()
|
|
|
|
' Se macchina fotografica abilitata
|
|
PhotoBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO)
|
|
' aggiorno la visualizzazione dei parametri
|
|
ReloadParam()
|
|
|
|
' Nascondo i pezzi in parcheggio
|
|
HideParkedParts()
|
|
EgtZoom(ZM.ALL)
|
|
|
|
End Sub
|
|
|
|
Public Sub ReloadParam()
|
|
Dim sCurrSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
|
Dim sCurrSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
|
Dim bSaw As Boolean = False
|
|
|
|
' se esiste una lavorazione di lama corrente vuol dire che deve essere preferita
|
|
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
|
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
|
End If
|
|
If Not bSaw Then
|
|
EgtOutLog(" WARNING! Impossible to get point from SAW, there isn't SAW or SAWING! It's available only by DRAW")
|
|
End If
|
|
m_ControlsDirectCutUC.m_SingleCut.SetEnableParam(bSaw)
|
|
m_ControlsDirectCutUC.m_MultipleCut.SetEnableParam(bSaw)
|
|
m_ControlsDirectCutUC.m_GridCut.SetEnableParam(bSaw)
|
|
End Sub
|
|
|
|
Private Sub SetVisibilityJogButtuns()
|
|
XYBtn.Visibility = Visibility.Collapsed
|
|
ZCBtn.Visibility = Visibility.Collapsed
|
|
ZBBtn.Visibility = Visibility.Collapsed
|
|
RemoteBtn.Visibility = Visibility.Collapsed
|
|
ParkingBtn.Visibility = Visibility.Collapsed
|
|
|
|
Dim Item As MachineButton = Nothing
|
|
For Each Item In m_ButtonJogList
|
|
Select Case Item.StateFlag.Trim
|
|
Case K_XYJOG
|
|
XYBtn.Visibility = Visibility.Visible
|
|
XYBtn.Foreground = Brushes.White
|
|
XYBtn.ToolTip = "X - Y"
|
|
Case K_ZCJOG
|
|
ZCBtn.Visibility = Visibility.Visible
|
|
ZCBtn.Foreground = Brushes.White
|
|
ZCBtn.ToolTip = "Z - C"
|
|
Case K_ZBJOG
|
|
ZBBtn.Visibility = Visibility.Visible
|
|
ZBBtn.Foreground = Brushes.White
|
|
ZBBtn.ToolTip = "Z - B"
|
|
Case K_REMOTE
|
|
RemoteBtn.Visibility = Visibility.Visible
|
|
RemoteBtn.Foreground = Brushes.White
|
|
RemoteBtn.Content = EgtMsg(90262) 'Remote
|
|
Case K_PARKING
|
|
ParkingBtn.Visibility = Visibility.Visible
|
|
ParkingBtn.Foreground = Brushes.White
|
|
ParkingBtn.ToolTip = EgtMsg(90263) 'Parking
|
|
End Select
|
|
Next
|
|
End Sub
|
|
|
|
Private Sub PhotoBtn_Click(sender As Object, e As RoutedEventArgs) Handles PhotoBtn.Click
|
|
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
|
' Se macchina fotografica collegata, faccio una foto
|
|
If m_MainWindow.m_Camera.GetCameraLink() Then
|
|
If Not m_MainWindow.m_Camera.CameraClick() Then
|
|
m_MainWindow.m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(90313)) 'Fotografia non riuscita
|
|
End If
|
|
' Altrimenti lancio browser di immagini
|
|
Else
|
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PhotoPage)
|
|
m_MainWindow.m_ActivePage = MainWindow.Pages.Photo
|
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub RawPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawPartBtn.Click
|
|
m_MainWindow.m_CurrentProjectPageUC.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
|
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me)
|
|
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_RawPartPage)
|
|
m_MainWindow.m_ActivePage = MainWindow.Pages.RawPart
|
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
|
End Sub
|
|
|
|
Private Sub ControlsMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles ControlsMachineBtn.Click
|
|
If ControlsMachineBtn.IsChecked Then
|
|
m_ControlsMachineButton = New ControlsMachineButtonUC
|
|
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
|
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
|
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
|
|
m_ActiveControl = Controls.MachineButtonUC
|
|
If VacuumMachineBtn.IsChecked Then
|
|
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
|
VacuumMachineBtn.IsChecked = False
|
|
End If
|
|
Else
|
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
|
|
If VacuumMachineBtn.IsChecked Then
|
|
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
|
|
m_ActiveControl = Controls.VacuumButtonUC
|
|
If ControlsMachineBtn.IsChecked Then
|
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
|
ControlsMachineBtn.IsChecked = False
|
|
End If
|
|
Else
|
|
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
|
End If
|
|
End Sub
|
|
|
|
Friend Sub LoadDirectCutUC()
|
|
ManageControls()
|
|
m_ActiveControl = Controls.DirectCutUC
|
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC)
|
|
End Sub
|
|
|
|
Friend Sub LoadDirectCutUC1()
|
|
ManageControls()
|
|
m_ActiveControl = Controls.DirectCutUC1
|
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC1)
|
|
End Sub
|
|
|
|
|
|
#Region "[JogButtons]"
|
|
|
|
Private Sub XYBtn_Click(sender As Object, e As RoutedEventArgs) Handles XYBtn.Click
|
|
' riverco in elenco il bottone XYJog
|
|
Dim XYJogButton As MachineButton = Nothing
|
|
Dim ItemButton As MachineButton = Nothing
|
|
For Each ItemButton In m_ButtonJogList
|
|
If ItemButton.StateFlag = K_XYJOG Then
|
|
XYJogButton = ItemButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If IsNothing(XYJogButton) Then Return
|
|
' eseguo lo script lua associato
|
|
XYJogButton.ExecuteMDICommand(XYJogButton.TLuaScriptName)
|
|
' che comunica al PLC di cambiare lo stato, la modifica dello stato è intercettata dalla funzione Refresh che avvia il metodo Changed
|
|
End Sub
|
|
|
|
Friend Sub XYJogChanged(bXYAxes As Boolean)
|
|
' devo decodificare il tipo di pulsante, quindi eseguire la conversione...
|
|
Dim XYJogButton As TwoStateButton = Nothing
|
|
For Each MachineButton As MachineButton In m_ButtonJogList
|
|
' elimino gli spazi ad inizio e fine della stringa
|
|
If MachineButton.StateFlag.Trim = K_XYJOG Then
|
|
XYJogButton = MachineButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If Not IsNothing(XYJogButton) Then
|
|
XYJogButton.SetIsChecked(bXYAxes)
|
|
XYBtn.IsChecked = bXYAxes
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ZCBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZCBtn.Click
|
|
' riverco in elenco il bottone ZCYJog
|
|
Dim ZJogButton As MachineButton = Nothing
|
|
Dim ItemButton As MachineButton = Nothing
|
|
For Each ItemButton In m_ButtonJogList
|
|
If ItemButton.StateFlag = K_ZCJOG Then
|
|
ZJogButton = ItemButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If IsNothing(ZJogButton) Then Return
|
|
' eseguo lo script lua associato
|
|
ZJogButton.ExecuteMDICommand(ZJogButton.TLuaScriptName)
|
|
End Sub
|
|
|
|
Friend Sub ZCJogChanged(bZAxes As Boolean)
|
|
' devo decodificare il tipo di pulsante, quindi eseguire la conversione...
|
|
Dim ZJogButton As TwoStateButton = Nothing
|
|
For Each MachineButton As MachineButton In m_ButtonJogList
|
|
If MachineButton.StateFlag.Trim = K_ZCJOG Then
|
|
ZJogButton = MachineButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If Not IsNothing(ZJogButton) Then
|
|
ZJogButton.SetIsChecked(bZAxes)
|
|
ZCBtn.IsChecked = bZAxes
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ZBBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZBBtn.Click
|
|
' riverco in elenco il bottone ZCYJog
|
|
Dim ZBJogButton As MachineButton = Nothing
|
|
Dim ItemButton As MachineButton = Nothing
|
|
For Each ItemButton In m_ButtonJogList
|
|
If ItemButton.StateFlag = K_ZBJOG Then
|
|
ZBJogButton = ItemButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If IsNothing(ZBJogButton) Then Return
|
|
' eseguo lo script lua associato
|
|
ZBJogButton.ExecuteMDICommand(ZBJogButton.TLuaScriptName)
|
|
End Sub
|
|
|
|
Friend Sub ZBJogChanged(bBCAxes As Boolean)
|
|
' devo decodificare il tipo di pulsante, quindi eseguire la conversione...
|
|
Dim BCJogButton As TwoStateButton = Nothing
|
|
For Each MachineButton As MachineButton In m_ButtonJogList
|
|
If MachineButton.StateFlag.Trim = K_ZBJOG Then
|
|
BCJogButton = MachineButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If Not IsNothing(BCJogButton) Then
|
|
BCJogButton.SetIsChecked(bBCAxes)
|
|
ZBBtn.IsChecked = bBCAxes
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub RemoteBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemoteBtn.Click
|
|
Dim RemoteButton As MachineButton = Nothing
|
|
Dim ItemButton As MachineButton = Nothing
|
|
For Each ItemButton In m_ButtonJogList
|
|
If ItemButton.StateFlag = K_REMOTE Then
|
|
RemoteButton = ItemButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If IsNothing(RemoteButton) Then Return
|
|
' eseguo lo script lua associato
|
|
Dim CurrentBtn As Primitives.ToggleButton = e.Source
|
|
Dim sLuaFileName As String = String.Empty
|
|
' verifico lo stato del bottone per avviare il giusto script
|
|
If CurrentBtn.IsChecked() Then
|
|
sLuaFileName = RemoteButton.TLuaScriptName
|
|
Else
|
|
sLuaFileName = RemoteButton.FLuaScriptName
|
|
End If
|
|
RemoteButton.ExecuteMDICommand(sLuaFileName)
|
|
End Sub
|
|
|
|
Friend Sub RemoteChanged(bRemote As Boolean)
|
|
' devo decodificare il tipo di pulsante, quindi eseguire la conversione...
|
|
Dim RemoteButton As TwoStateButton = Nothing
|
|
For Each MachineButton As MachineButton In m_ButtonJogList
|
|
If MachineButton.StateFlag.Trim = K_REMOTE Then
|
|
RemoteButton = MachineButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If Not IsNothing(RemoteButton) Then
|
|
RemoteButton.SetIsChecked(bRemote)
|
|
RemoteBtn.IsChecked = bRemote
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ParkingBtn_Click(sender As Object, e As RoutedEventArgs) Handles ParkingBtn.Click
|
|
Dim ParkingButton As MachineButton = Nothing
|
|
Dim ItemButton As MachineButton = Nothing
|
|
For Each ItemButton In m_ButtonJogList
|
|
If ItemButton.StateFlag = K_PARKING Then
|
|
ParkingButton = ItemButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If IsNothing(ParkingButton) Then Return
|
|
' eseguo lo script lua associato
|
|
Dim CurrentBtn As Primitives.ToggleButton = e.Source
|
|
Dim sLuaFileName As String = String.Empty
|
|
' verifico lo stato del bottone per avviare il giusto script
|
|
If CurrentBtn.IsChecked() Then
|
|
sLuaFileName = ParkingButton.TLuaScriptName
|
|
Else
|
|
sLuaFileName = ParkingButton.FLuaScriptName
|
|
End If
|
|
ParkingButton.ExecuteMDICommand(sLuaFileName)
|
|
End Sub
|
|
|
|
Friend Sub ParkingStateChanged(bParkingState As Boolean)
|
|
' devo decodificare il tipo di pulsante, quindi eseguire la conversione...
|
|
Dim ParkingButton As TwoStateButton = Nothing
|
|
For Each MachineButton As MachineButton In m_ButtonJogList
|
|
If MachineButton.StateFlag.Trim = K_PARKING Then
|
|
ParkingButton = MachineButton
|
|
Exit For
|
|
End If
|
|
Next
|
|
If Not IsNothing(ParkingButton) Then
|
|
ParkingButton.SetIsChecked(bParkingState)
|
|
ParkingButton.IsChecked = bParkingState
|
|
End If
|
|
End Sub
|
|
|
|
#End Region '[JogButtons]
|
|
|
|
Private Sub MachViewModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachViewModeBtn.Click
|
|
If m_bShowMachine Then
|
|
' aggiorno lo stato
|
|
Select Case m_nMachLook
|
|
Case MCH_LOOK.ALL
|
|
m_nMachLook = MCH_LOOK.TAB_HEAD
|
|
Case MCH_LOOK.TAB_HEAD
|
|
m_nMachLook = MCH_LOOK.TAB_TOOL
|
|
Case MCH_LOOK.TAB_TOOL
|
|
m_nMachLook = MCH_LOOK.TAB
|
|
Case Else
|
|
m_nMachLook = MCH_LOOK.ALL
|
|
End Select
|
|
' aggiorno lo stato della macchina e la sua visualizzazione
|
|
EgtSetMachineLook(m_nMachLook)
|
|
EgtDraw()
|
|
End If
|
|
End Sub
|
|
|
|
Friend Sub DirectCutPage_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
|
ManageControls()
|
|
End Sub
|
|
|
|
Friend Sub ManageControls()
|
|
Select Case m_ActiveControl
|
|
Case Controls.DirectCutUC
|
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
|
m_ControlsDirectCutUC.DirectCutPage_Unloaded(Nothing, Nothing)
|
|
Case Controls.DirectCutUC1
|
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC1)
|
|
m_ControlsDirectCutUC1.DirectCutPage_Unloaded(Nothing, Nothing)
|
|
Case Controls.MachineButtonUC
|
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC1)
|
|
ControlsMachineBtn.IsChecked = False
|
|
Case Controls.VacuumButtonUC
|
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
|
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
|
VacuumMachineBtn.IsChecked = False
|
|
End Select
|
|
End Sub
|
|
|
|
Friend Sub LoadLastDirectCutControls()
|
|
Select Case m_ActiveControl
|
|
Case Controls.DirectCutUC
|
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC)
|
|
Case Controls.DirectCutUC1
|
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC1)
|
|
Case Else
|
|
m_ActiveControl = Controls.DirectCutUC
|
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC)
|
|
End Select
|
|
End Sub
|
|
|
|
Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click
|
|
' Imposto modalità manuale della macchina
|
|
Dim nResult As Short = m_MainWindow.m_DirectCutPageUC.m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
|
|
|
End Sub
|
|
|
|
End Class
|