c5afe8df93
- aggiunta possibilità di minimizzare il programma - migliorata lettura parametri modificabili da Options - aggiunti anticipi accensione/spegnimento colla.
146 lines
8.2 KiB
VB.net
146 lines
8.2 KiB
VB.net
Imports EgtUILib
|
|
|
|
Public Class OptionsPageUC
|
|
|
|
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
|
|
|
|
Private Sub OptionsPage_Initialized(sender As Object, e As EventArgs)
|
|
|
|
'Associazione della lista materiali alla combobox
|
|
LanguageCmBx.ItemsSource = m_MainWindow.m_LanguagesList
|
|
|
|
'Imposto la lingua corrente
|
|
LanguageCmBx.SelectedItem = m_MainWindow.m_CurrLanguage
|
|
|
|
' Imposto i messaggi letti dal file dei messaggi
|
|
MachineOptionsLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 1) 'Machine options - Opzioni macchina
|
|
GlueingParametersLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 2) 'Glueing parameters - Caratteristiche incollaggio
|
|
ExtraRawPartXLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 3) 'X Extra Raw - Extra grezzo in X
|
|
ExtraRawPartYLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 4) 'Y Extra Raw - Extra grezzo in Y
|
|
ExtraGlueLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 5) 'Extra glue - Extra colla
|
|
PlankParametersLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 6) 'Plank parameters - Caratteristiche tavole
|
|
PlankWidthLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 7) 'Plank width - Larghezza tavola
|
|
PlankNumForLayerLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 8) 'Table count in a layer - N° tavole in un piano
|
|
GantriesStateLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 9) '
|
|
GlueTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 10) '
|
|
PlankTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 11) '
|
|
SoftwareOptionsLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 21) 'Software options - Opzioni software
|
|
LanguageLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 22) 'Language selection - Selezione lingua
|
|
LanguageMsgLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 23) 'The new language become the current one from the next software run - La nuova lingua diventerà corrente dal prossimo avvio del programma
|
|
ProjectNumberLbl.Content = EgtMsg(MSG_OPTIONSPAGEUC + 24) 'Language selection - Numero progetti da salvare
|
|
PlankOnHolesTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 25)
|
|
OnAdvanceLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 26)
|
|
OffAdvanceLbl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 27)
|
|
|
|
' Associo TextBox e Label
|
|
Dim TempLabel1 As New Label
|
|
TempLabel1.Content = ExtraRawPartXLbl.Text
|
|
ExtraRawPartXTxBx.Tag = TempLabel1
|
|
Dim TempLabel2 As New Label
|
|
TempLabel2.Content = ExtraRawPartYLbl.Text
|
|
ExtraRawPartYTxBx.Tag = TempLabel2
|
|
Dim TempLabel3 As New Label
|
|
TempLabel3.Content = ExtraGlueLbl.Text
|
|
ExtraGlueTxBx.Tag = TempLabel3
|
|
Dim TempLabel4 As New Label
|
|
TempLabel4.Content = PlankWidthLbl.Text
|
|
PlankWidthTxBx.Tag = TempLabel4
|
|
Dim TempLabel5 As New Label
|
|
TempLabel5.Content = PlankNumForLayerLbl.Text
|
|
PlankNumForLayerTxBx.Tag = TempLabel5
|
|
Dim TempLabel6 As New Label
|
|
TempLabel6.Content = OnAdvanceLbl.Text
|
|
OnAdvanceTxBx.Tag = TempLabel6
|
|
Dim TempLabel7 As New Label
|
|
TempLabel7.Content = OffAdvanceLbl.Text
|
|
OffAdvanceTxBx.Tag = TempLabel7
|
|
|
|
End Sub
|
|
|
|
Private Sub LanguageCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles LanguageCmBx.SelectionChanged
|
|
m_MainWindow.m_CurrLanguage = LanguageCmBx.SelectedItem
|
|
End Sub
|
|
|
|
Private Sub OptionsPage_Loaded(sender As Object, e As RoutedEventArgs)
|
|
Dim dExtraRawX As Double = GetPrivateProfileDouble(S_MACHINE, K_OFFSETX, 0, m_MainWindow.GetIniFile())
|
|
ExtraRawPartXTxBx.Text = dExtraRawX
|
|
Dim dExtraRawY As Double = GetPrivateProfileDouble(S_MACHINE, K_OFFSETY, 0, m_MainWindow.GetIniFile())
|
|
ExtraRawPartYTxBx.Text = dExtraRawY
|
|
Dim dExtraGlue As Double = GetPrivateProfileDouble(S_MACHINE, K_OFFSETGLUE, 0, m_MainWindow.GetIniFile())
|
|
ExtraGlueTxBx.Text = dExtraGlue
|
|
Dim dOnAdvance As Double = GetPrivateProfileDouble(S_MACHINE, K_ONADVANCE, 0, m_MainWindow.GetIniFile())
|
|
OnAdvanceTxBx.Text = dOnAdvance
|
|
Dim dOffAdvance As Double = GetPrivateProfileDouble(S_MACHINE, K_OFFADVANCE, 0, m_MainWindow.GetIniFile())
|
|
OffAdvanceTxBx.Text = dOffAdvance
|
|
Dim dPlankWidth As Double = GetPrivateProfileDouble(S_MACHINE, K_PLANKX, 0, m_MainWindow.GetIniFile())
|
|
PlankWidthTxBx.Text = dPlankWidth
|
|
Dim nPlankNumForLayer As Integer = GetPrivateProfileInt(S_MACHINE, K_PLANKNUMINLAYER, 0, m_MainWindow.GetIniFile())
|
|
PlankNumForLayerTxBx.Text = nPlankNumForLayer
|
|
Dim nGantries As Integer = GetPrivateProfileInt(S_MACHINE, K_GANTRIES, 3, m_MainWindow.GetIniFile())
|
|
Select Case nGantries
|
|
Case 0
|
|
GlueChBx.IsChecked = False
|
|
PlankChBx.IsChecked = False
|
|
Case 1
|
|
GlueChBx.IsChecked = True
|
|
PlankChBx.IsChecked = False
|
|
Case 2
|
|
GlueChBx.IsChecked = False
|
|
PlankChBx.IsChecked = True
|
|
Case Else
|
|
GlueChBx.IsChecked = True
|
|
PlankChBx.IsChecked = True
|
|
End Select
|
|
Dim nMaxProj As Integer = GetPrivateProfileInt(S_GENERAL, K_MAXPROJ, 10, m_MainWindow.GetIniFile())
|
|
ProjectNumberTxBx.Text = nMaxProj
|
|
Dim nPlankOnHoles As Integer = GetPrivateProfileInt(S_MACHINE, K_PLANKONHOLES, 1, m_MainWindow.GetIniFile())
|
|
If nPlankOnHoles = 0 Then
|
|
PlankOnHolesChBx.IsChecked = False
|
|
Else
|
|
PlankOnHolesChBx.IsChecked = True
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
|
' Istruzioni per chiudere OptionsPageUC e aprire PlacePage UC
|
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OptionsPageUC)
|
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PlacePageUC)
|
|
m_MainWindow.m_ActivePage = MainWindow.Pages.Place
|
|
m_MainWindow.OptionsBtn.IsChecked = False
|
|
m_MainWindow.PlaceBtn.IsChecked = True
|
|
End Sub
|
|
|
|
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
|
' Salvo i dati introdotti
|
|
WritePrivateProfileString(S_MACHINE, K_OFFSETX, ExtraRawPartXTxBx.Text, m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_MACHINE, K_OFFSETY, ExtraRawPartYTxBx.Text, m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_MACHINE, K_OFFSETGLUE, ExtraGlueTxBx.Text, m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_MACHINE, K_ONADVANCE, OnAdvanceTxBx.Text, m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_MACHINE, K_OFFADVANCE, OffAdvanceTxBx.Text, m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_MACHINE, K_PLANKX, PlankWidthTxBx.Text, m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_MACHINE, K_PLANKNUMINLAYER, PlankNumForLayerTxBx.Text, m_MainWindow.GetIniFile())
|
|
Dim nGantries As Integer = 0
|
|
If GlueChBx.IsChecked Then
|
|
nGantries += 1
|
|
End If
|
|
If PlankChBx.IsChecked Then
|
|
nGantries += 2
|
|
End If
|
|
WritePrivateProfileString(S_MACHINE, K_GANTRIES, nGantries.ToString(), m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_GENERAL, K_MESSAGES, m_MainWindow.m_CurrLanguage.LanguageName, m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_GENERAL, K_MAXPROJ, ProjectNumberTxBx.Text, m_MainWindow.GetIniFile())
|
|
If PlankOnHolesChBx.IsChecked Then
|
|
WritePrivateProfileString(S_MACHINE, K_PLANKONHOLES, 1, m_MainWindow.GetIniFile())
|
|
Else
|
|
WritePrivateProfileString(S_MACHINE, K_PLANKONHOLES, 0, m_MainWindow.GetIniFile())
|
|
End If
|
|
' Istruzioni per chiudere OptionsPageUC e aprire PlacePage UC
|
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OptionsPageUC)
|
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PlacePageUC)
|
|
m_MainWindow.m_ActivePage = MainWindow.Pages.Place
|
|
m_MainWindow.OptionsBtn.IsChecked = False
|
|
m_MainWindow.PlaceBtn.IsChecked = True
|
|
End Sub
|
|
|
|
End Class
|