fcc59469f8
- Correzioni varie. - Implementata gestione CN da pagina Macchina.
72 lines
2.8 KiB
VB.net
72 lines
2.8 KiB
VB.net
Imports EgtUILib
|
|
|
|
Public Class SimulationPageUC
|
|
|
|
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
|
|
Dim m_CurrProjPage As CurrentProjectPageUC
|
|
|
|
'Dichiarazione delle Page UserControl
|
|
Friend m_SceneButtons As SceneButtonsUC
|
|
|
|
'Dichiarazione flag PlayPauseBtn
|
|
Private m_bPlay As Boolean = False
|
|
|
|
Private Sub SimulationPage_Initialized(sender As Object, e As EventArgs)
|
|
|
|
'Creazione del UserCOntrol SceneButtons
|
|
m_SceneButtons = New SceneButtonsUC
|
|
|
|
'Posizionemento nella griglia del UserControl SceneButtons
|
|
m_SceneButtons.SetValue(Grid.ColumnProperty, 1)
|
|
UpperButtonGrid.Children.Add(m_SceneButtons)
|
|
|
|
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Play.png", UriKind.Relative))
|
|
|
|
End Sub
|
|
|
|
Private Sub SimulationPage_Loaded(sender As Object, e As RoutedEventArgs)
|
|
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
|
' Nascondo eventuali pezzi in parcheggio
|
|
Dim nPartId As Integer = EgtGetFirstPart()
|
|
While nPartId <> GDB_ID.NULL
|
|
EgtSetStatus(nPartId, GDB_ST.OFF)
|
|
nPartId = EgtGetNextPart(nPartId)
|
|
End While
|
|
' Visualizzo tutta la macchina
|
|
EgtShowOnlyTable(False)
|
|
EgtSetView(VT.ISO_SE, False)
|
|
EgtZoom(ZM.ALL)
|
|
End Sub
|
|
|
|
Private Sub PlayPauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PlayPauseBtn.Click
|
|
If m_bPlay Then
|
|
'Metto in pausa
|
|
m_bPlay = False
|
|
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Play.png", UriKind.Relative))
|
|
Else
|
|
'Metto in play
|
|
m_bPlay = True
|
|
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Pause.png", UriKind.Relative))
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ExitBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
|
' Ripristino visualizzazione di eventuali pezzi in parcheggio
|
|
Dim nPartId As Integer = EgtGetFirstPart()
|
|
While nPartId <> GDB_ID.NULL
|
|
EgtSetStatus(nPartId, GDB_ST.ON_)
|
|
nPartId = EgtGetNextPart(nPartId)
|
|
End While
|
|
' Ripristino visualizzazione della sola tavola
|
|
EgtShowOnlyTable(True)
|
|
EgtSetView(VT.TOP, False)
|
|
EgtZoom(ZM.ALL)
|
|
' Esco dalla pagina
|
|
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me)
|
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Visible
|
|
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
|
|
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
|
End Sub
|
|
|
|
End Class
|