Creazione del controllo WaterJet in nella pagina MACCHINA
This commit is contained in:
@@ -24,9 +24,10 @@
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ToggleButton Name="AlarmsBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
@@ -41,10 +42,13 @@
|
||||
<ToggleButton Name="PolishingsBtn" Grid.Column="3" Style="{DynamicResource OmagCut_BlueIconToggleButton}">
|
||||
<!--<Image Source="{DynamicResource LucidaturaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>-->
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="TestingPageBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<ToggleButton Name="WaterJetBtn" Grid.Column="4" Style="{DynamicResource OmagCut_BlueIconToggleButton}">
|
||||
<!--<Image Source="{DynamicResource WaterJetImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>-->
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="TestingPageBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource MacchinaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="StatisticsBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowToggleButton}">
|
||||
<ToggleButton Name="StatisticsBtn" Grid.Column="6" Style="{DynamicResource OmagCut_YellowToggleButton}">
|
||||
|
||||
</ToggleButton>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ Public Class MachinePageUC
|
||||
Friend m_ToolsDbPageUC As ToolsDbPageUC
|
||||
Friend m_MachiningDbPageUC As MachiningDbPageUC
|
||||
Friend m_PolishingsPageUC As PolishingsPageUC
|
||||
Friend m_WaterJetPageUC As WaterJetPageUC
|
||||
Friend m_MachineCNPageUC As MachineCNPageUC
|
||||
Friend m_StatisticsPageUC As StatisticsPageUC
|
||||
|
||||
@@ -21,6 +22,7 @@ Public Class MachinePageUC
|
||||
ToolsDb
|
||||
MachiningDb
|
||||
Polishings
|
||||
WaterJet
|
||||
MachineCN
|
||||
Statistics
|
||||
End Enum
|
||||
@@ -32,6 +34,7 @@ Public Class MachinePageUC
|
||||
m_ToolsDbPageUC = New ToolsDbPageUC
|
||||
m_MachiningDbPageUC = New MachiningDbPageUC
|
||||
m_PolishingsPageUC = New PolishingsPageUC
|
||||
m_WaterJetPageUC = New WaterJetPageUC
|
||||
m_MachineCNPageUC = New MachineCNPageUC
|
||||
m_StatisticsPageUC = New StatisticsPageUC
|
||||
|
||||
@@ -40,6 +43,7 @@ Public Class MachinePageUC
|
||||
m_ToolsDbPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_MachiningDbPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_PolishingsPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_WaterJetPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_MachineCNPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_StatisticsPageUC.SetValue(Grid.RowProperty, 1)
|
||||
|
||||
@@ -47,6 +51,7 @@ Public Class MachinePageUC
|
||||
ToolsDBBtn.ToolTip = EgtMsg(MSG_MACHINEPAGEUC + 6)
|
||||
MachiningDBBtn.ToolTip = EgtMsg(MSG_MACHINEPAGEUC + 7)
|
||||
PolishingsBtn.Content = EgtMsg(91090)
|
||||
WaterJetBtn.Content = "WaterJet"
|
||||
TestingPageBtn.ToolTip = EgtMsg(MSG_MACHINEPAGEUC + 8)
|
||||
StatisticsBtn.Content = EgtMsg(90709)
|
||||
|
||||
@@ -55,10 +60,14 @@ Public Class MachinePageUC
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
|
||||
' Se lucidature non abilitate, disattivo la pagina DB lucidature
|
||||
If Not m_MainWindow.m_CurrentMachine.bPolishing Then
|
||||
If Not m_MainWindow.m_CurrentMachine.bPolishing Then
|
||||
PolishingsBtn.IsEnabled = False
|
||||
End If
|
||||
|
||||
If Not m_MainWindow.m_CurrentMachine.bWaterJetting Then
|
||||
WaterJetBtn.IsEnabled = False
|
||||
End If
|
||||
|
||||
' Se controllo numerico 0, disattivo la pagina macchina
|
||||
If GetPrivateProfileInt(S_NUMERICALCONTROL, K_TYPE, 0, m_MainWindow.GetMachIniFile()) = 0 Then
|
||||
TestingPageBtn.IsEnabled = False
|
||||
@@ -134,6 +143,19 @@ Public Class MachinePageUC
|
||||
MachinePageGrid.Children.Remove(m_PolishingsPageUC)
|
||||
MachinePageGrid.Children.Add(m_AlarmsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
Case MachinePages.WaterJet
|
||||
' Verifica ed eventuale salvataggio Lucidatura corrente
|
||||
'If Not m_PolishingsPageUC.SaveKit() Then
|
||||
' AlarmsBtn.IsChecked = False
|
||||
' PolishingsBtn.IsChecked = True
|
||||
' Return
|
||||
'End If
|
||||
' passo alla pagina Dati Macchina
|
||||
AlarmsBtn.IsChecked = True
|
||||
WaterJetBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_WaterJetPageUC)
|
||||
MachinePageGrid.Children.Add(m_AlarmsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
Case MachinePages.MachineCN
|
||||
AlarmsBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
@@ -188,6 +210,19 @@ Public Class MachinePageUC
|
||||
MachinePageGrid.Children.Remove(m_PolishingsPageUC)
|
||||
MachinePageGrid.Children.Add(m_ToolsDbPageUC)
|
||||
m_ActiveMachinePage = MachinePages.ToolsDb
|
||||
Case MachinePages.WaterJet
|
||||
' Verifica ed eventuale salvataggio Lucidatura corrente
|
||||
'If Not m_PolishingsPageUC.SaveKit() Then
|
||||
' AlarmsBtn.IsChecked = False
|
||||
' PolishingsBtn.IsChecked = True
|
||||
' Return
|
||||
'End If
|
||||
' passo alla pagina Dati Macchina
|
||||
ToolsDBBtn.IsChecked = True
|
||||
WaterJetBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_WaterJetPageUC)
|
||||
MachinePageGrid.Children.Add(m_ToolsDbPageUC)
|
||||
m_ActiveMachinePage = MachinePages.ToolsDb
|
||||
Case MachinePages.MachineCN
|
||||
ToolsDBBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
@@ -242,6 +277,19 @@ Public Class MachinePageUC
|
||||
MachinePageGrid.Children.Remove(m_PolishingsPageUC)
|
||||
MachinePageGrid.Children.Add(m_MachiningDbPageUC)
|
||||
m_ActiveMachinePage = MachinePages.MachiningDb
|
||||
Case MachinePages.WaterJet
|
||||
' Verifica ed eventuale salvataggio Lucidatura corrente
|
||||
'If Not m_PolishingsPageUC.SaveKit() Then
|
||||
' AlarmsBtn.IsChecked = False
|
||||
' PolishingsBtn.IsChecked = True
|
||||
' Return
|
||||
'End If
|
||||
' passo alla pagina Dati Macchina
|
||||
MachiningDBBtn.IsChecked = True
|
||||
WaterJetBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_WaterJetPageUC)
|
||||
MachinePageGrid.Children.Add(m_MachiningDbPageUC)
|
||||
m_ActiveMachinePage = MachinePages.MachiningDb
|
||||
Case MachinePages.MachineCN
|
||||
MachiningDBBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
@@ -299,6 +347,19 @@ Public Class MachinePageUC
|
||||
m_ActiveMachinePage = MachinePages.Polishings
|
||||
Case MachinePages.Polishings
|
||||
PolishingsBtn.IsChecked = True
|
||||
Case MachinePages.WaterJet
|
||||
' Verifica ed eventuale salvataggio Lucidatura corrente
|
||||
'If Not m_PolishingsPageUC.SaveKit() Then
|
||||
' AlarmsBtn.IsChecked = False
|
||||
' PolishingsBtn.IsChecked = True
|
||||
' Return
|
||||
'End If
|
||||
' passo alla pagina Dati Macchina
|
||||
PolishingsBtn.IsChecked = True
|
||||
WaterJetBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_WaterJetPageUC)
|
||||
MachinePageGrid.Children.Add(m_PolishingsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Polishings
|
||||
Case MachinePages.MachineCN
|
||||
PolishingsBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
@@ -314,6 +375,76 @@ Public Class MachinePageUC
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub WaterJetBtn_Click(sender As Object, e As RoutedEventArgs) Handles WaterJetBtn.Click
|
||||
Select Case m_ActiveMachinePage
|
||||
Case MachinePages.Alarms
|
||||
AlarmsBtn.IsChecked = False
|
||||
WaterJetBtn.IsChecked = True
|
||||
MachinePageGrid.Children.Remove(m_AlarmsPageUC)
|
||||
MachinePageGrid.Children.Add(m_WaterJetPageUC)
|
||||
m_ActiveMachinePage = MachinePages.WaterJet
|
||||
Case MachinePages.ToolsDb
|
||||
' Verifica ed eventuale salvataggio utensile corrente
|
||||
If Not m_ToolsDbPageUC.SaveCurrTool() Then
|
||||
PolishingsBtn.IsChecked = False
|
||||
ToolsDBBtn.IsChecked = True
|
||||
Return
|
||||
End If
|
||||
' salvo il DB utensili
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
EgtTdbSave()
|
||||
' passo alla pagina Lucidature
|
||||
WaterJetBtn.IsChecked = True
|
||||
ToolsDBBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_ToolsDbPageUC)
|
||||
MachinePageGrid.Children.Add(m_WaterJetPageUC)
|
||||
m_ActiveMachinePage = MachinePages.WaterJet
|
||||
Case MachinePages.MachiningDb
|
||||
' Verifica ed eventuale salvataggio lavorazione corrente
|
||||
If Not m_MachiningDbPageUC.SaveCurrMachining() Then
|
||||
WaterJetBtn.IsChecked = False
|
||||
MachiningDBBtn.IsChecked = True
|
||||
Return
|
||||
End If
|
||||
' salvo il DB lavorazioni
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
EgtMdbSave()
|
||||
' passo alla pagina Lucidature
|
||||
WaterJetBtn.IsChecked = True
|
||||
MachiningDBBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_MachiningDbPageUC)
|
||||
MachinePageGrid.Children.Add(m_WaterJetPageUC)
|
||||
m_ActiveMachinePage = MachinePages.WaterJet
|
||||
Case MachinePages.Polishings
|
||||
'Verifica ed eventuale salvataggio Lucidatura corrente
|
||||
If Not m_PolishingsPageUC.SaveKit() Then
|
||||
WaterJetBtn.IsChecked = False
|
||||
PolishingsBtn.IsChecked = True
|
||||
Return
|
||||
End If
|
||||
'passo alla pagina WaterJet
|
||||
WaterJetBtn.IsChecked = True
|
||||
PolishingsBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_PolishingsPageUC)
|
||||
MachinePageGrid.Children.Add(m_WaterJetPageUC)
|
||||
m_ActiveMachinePage = MachinePages.WaterJet
|
||||
Case MachinePages.WaterJet
|
||||
WaterJetBtn.IsChecked = True
|
||||
Case MachinePages.MachineCN
|
||||
WaterJetBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_MachineCNPageUC)
|
||||
MachinePageGrid.Children.Add(m_WaterJetPageUC)
|
||||
m_ActiveMachinePage = MachinePages.WaterJet
|
||||
Case MachinePages.Statistics
|
||||
WaterJetBtn.IsChecked = True
|
||||
StatisticsBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_StatisticsPageUC)
|
||||
MachinePageGrid.Children.Add(m_WaterJetPageUC)
|
||||
m_ActiveMachinePage = MachinePages.WaterJet
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub TestingPageBtn_Checked(sender As Object, e As RoutedEventArgs) Handles TestingPageBtn.Checked
|
||||
Select Case m_ActiveMachinePage
|
||||
Case MachinePages.Alarms
|
||||
@@ -367,6 +498,19 @@ Public Class MachinePageUC
|
||||
MachinePageGrid.Children.Remove(m_PolishingsPageUC)
|
||||
MachinePageGrid.Children.Add(m_MachineCNPageUC)
|
||||
m_ActiveMachinePage = MachinePages.MachineCN
|
||||
Case MachinePages.WaterJet
|
||||
' Verifica ed eventuale salvataggio Lucidatura corrente
|
||||
'If Not m_PolishingsPageUC.SaveKit() Then
|
||||
' AlarmsBtn.IsChecked = False
|
||||
' PolishingsBtn.IsChecked = True
|
||||
' Return
|
||||
'End If
|
||||
' passo alla pagina Dati Macchina
|
||||
TestingPageBtn.IsChecked = True
|
||||
WaterJetBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_WaterJetPageUC)
|
||||
MachinePageGrid.Children.Add(m_MachineCNPageUC)
|
||||
m_ActiveMachinePage = MachinePages.MachineCN
|
||||
Case MachinePages.MachineCN
|
||||
TestingPageBtn.IsChecked = True
|
||||
Case MachinePages.Statistics
|
||||
@@ -431,6 +575,19 @@ Public Class MachinePageUC
|
||||
MachinePageGrid.Children.Remove(m_PolishingsPageUC)
|
||||
MachinePageGrid.Children.Add(m_StatisticsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Statistics
|
||||
Case MachinePages.WaterJet
|
||||
' Verifica ed eventuale salvataggio Lucidatura corrente
|
||||
'If Not m_PolishingsPageUC.SaveKit() Then
|
||||
' AlarmsBtn.IsChecked = False
|
||||
' PolishingsBtn.IsChecked = True
|
||||
' Return
|
||||
'End If
|
||||
' passo alla pagina Dati Macchina
|
||||
TestingPageBtn.IsChecked = True
|
||||
WaterJetBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_WaterJetPageUC)
|
||||
MachinePageGrid.Children.Add(m_StatisticsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Statistics
|
||||
Case MachinePages.MachineCN
|
||||
StatisticsBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
@@ -467,6 +624,19 @@ Public Class MachinePageUC
|
||||
MachinePageGrid.Children.Remove(m_PolishingsPageUC)
|
||||
MachinePageGrid.Children.Add(m_AlarmsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
Case MachinePages.WaterJet
|
||||
' Verifica ed eventuale salvataggio Lucidatura corrente
|
||||
'If Not m_PolishingsPageUC.SaveKit() Then
|
||||
' AlarmsBtn.IsChecked = False
|
||||
' PolishingsBtn.IsChecked = True
|
||||
' Return
|
||||
'End If
|
||||
' passo alla pagina Dati Macchina
|
||||
AlarmsBtn.IsChecked = True
|
||||
WaterJetBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_WaterJetPageUC)
|
||||
MachinePageGrid.Children.Add(m_AlarmsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
Case MachinePages.MachineCN
|
||||
AlarmsBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
<UserControl x:Class="WaterJetPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:self="clr-namespace:OmagCUT.TreeViewItem"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="768" d:DesignWidth="1280" Initialized="WaterJetPage_Initialized" Loaded="WaterJetPage_Loaded">
|
||||
|
||||
<!-- Definizione della PolishingsPage -->
|
||||
<Border Style="{DynamicResource OmagCut_PageBorder}">
|
||||
|
||||
<Grid Name="PolishingsPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="8*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="KitsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0"
|
||||
Grid.Row="0" BorderThickness="0">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="7*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ListBox Name="KitsLstBx" Grid.RowSpan="2">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding sName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="KitNameTxBx" Grid.Row="1" Width="240" Visibility="Hidden"
|
||||
Style="{DynamicResource OmagCut_KeyboardTextBox}" />
|
||||
|
||||
<UniformGrid Grid.Row="2" Columns="3">
|
||||
<Button Name="NewKitBtn" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="SaveKitBtn" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="RemoveKitBtn" Grid.Column="2"
|
||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<Border Style="{DynamicResource OmagCut_Border}" Grid.Column="1"
|
||||
Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="1">
|
||||
|
||||
<Grid Name="KitParamGrd" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="KitMachsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0"
|
||||
Grid.Row="0" Grid.ColumnSpan="1" Grid.RowSpan="8" BorderThickness="0">
|
||||
|
||||
<!-- Definizione della Grid dei parametri delle lavorazioni -->
|
||||
<Grid Name="KitMachGrd" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.8*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ListBox Name="KitMachsLstBx" Grid.RowSpan="7" Grid.ColumnSpan="4">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="15"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding nId}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}" Grid.Column="0"/>
|
||||
<CheckBox Name="ActiveChBx" IsChecked="{Binding Path=bActive, Mode=TwoWay}" Grid.Column="1" Click="CheckBox_Click" GotFocus="ActiveChBx_GotFocus"/>
|
||||
<ComboBox Name="ToolCmBx" Grid.Column="2"
|
||||
ItemsSource="{Binding Path=ToolList}"
|
||||
SelectedIndex="{Binding Path=SelTool}"
|
||||
Style="{StaticResource OmagCut_MachToolLeftComboBoxNoBorder}"
|
||||
SelectionChanged="ToolCmBx_SelectionChanged"
|
||||
GotFocus="ToolCmBx_GotFocus">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="KitMachNameTxBx" Grid.Row="1" Width="240" Visibility="Hidden"
|
||||
Style="{DynamicResource OmagCut_KeyboardTextBox}" />
|
||||
|
||||
<UniformGrid Grid.Row="13" Columns="4" Grid.ColumnSpan="4">
|
||||
<Button Name="NewKitMachBtn" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="RemoveKitMachBtn" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="KitMachParamsGpBx" Style="{DynamicResource OmagCut_GroupBox}"
|
||||
Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Grid.RowSpan="8">
|
||||
|
||||
<!-- Definizione della Grid dei parametri delle lavorazioni -->
|
||||
<Grid Name="KitMachParamGrd" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="1" Margin="10">
|
||||
<Image Source="../Resources/Contour.png" Stretch="Uniform"/>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Grid.Column="1" Margin="10">
|
||||
<Image Source="../Resources/ZigZagX.png" Stretch="Uniform"/>
|
||||
</Border>
|
||||
<Border Grid.Row="3" Grid.Column="1" Margin="10">
|
||||
<Image Source="../Resources/ZigZagY.png" Stretch="Uniform"/>
|
||||
</Border>
|
||||
|
||||
<TextBlock Name="MotionTxBl" Grid.Row="0" Grid.Column="1" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="30,0" HorizontalAlignment="Center"/>
|
||||
<TextBlock Name="RepeatTxBl" Grid.Row="0" Grid.Column="2" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="30,0" HorizontalAlignment="Center"/>
|
||||
<TextBlock Name="StepTxBl" Grid.Row="0" Grid.Column="3" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="30,0" HorizontalAlignment="Center"/>
|
||||
<TextBlock Name="OffSetTxBl" Grid.Row="0" Grid.Column="4" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="30,0" HorizontalAlignment="Center"/>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="ContourTxBx" Grid.Row="1" Grid.Column="2" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OffContourTxBx" Grid.Row="1" Grid.Column="4" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="ZigZagXTxBx" Grid.Row="2" Grid.Column="2" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="StepXTxBx" Grid.Row="2" Grid.Column="3" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OffZigZagXTxBx" Grid.Row="2" Grid.Column="4" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="ZigZagYTxBx" Grid.Row="3" Grid.Column="2" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="StepYTxBx" Grid.Row="3" Grid.Column="3" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OffZigZagYTxBx" Grid.Row="3" Grid.Column="4" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
|
||||
<GroupBox Name="LiLoGpBx" Grid.Row="4" Grid.Column="1" Grid.RowSpan="2" Grid.ColumnSpan="3" Style="{DynamicResource OmagCut_GroupBox}">
|
||||
<Grid Name="LiLoGrd">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="LiLenTxBl" Grid.Row="1" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="LiLenTxBx" Grid.Row="1" Grid.Column="1" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
<TextBlock Name="LiHeightTxBl" Grid.Row="1" Grid.Column="2" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="LiHeightTxBx" Grid.Row="1" Grid.Column="3" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
<TextBlock Name="LiLoadTxBl" Grid.Row="3" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="LiLoadTxBx" Grid.Row="3" Grid.Column="1" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="30,0"/>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,731 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
|
||||
Public Class WaterJetPageUC
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
' Variabile che conserva la lucidatura precedentemente selezionata, usata nel caso si selezioni annulla quando si cambia lucidatura selezionata
|
||||
Private m_OldItem As Object
|
||||
|
||||
' File kits di lucidatura
|
||||
Private m_sKitFile As String = String.Empty
|
||||
|
||||
Private m_KitList As New ObservableCollection(Of Kit)
|
||||
|
||||
Private m_KitMachList As New ObservableCollection(Of KitMach)
|
||||
|
||||
' Lista che contiene gli utensili disponibili (per Combobox in ciascun KitMachItem)
|
||||
Private m_ToolList As New ObservableCollection(Of String)
|
||||
|
||||
' Lista che contiene gli UUID degli utensili disponibili nello stesso ordine della lista dei nomi (ComboBox) per la scrittura degli stessi sull'INI
|
||||
Private m_ToolUuidList As New ObservableCollection(Of String)
|
||||
|
||||
Private m_PreviousSelectedKitIndex As Integer = 0
|
||||
|
||||
Private m_PreviousSelectedKitMachIndex As Integer = 0
|
||||
|
||||
Public ReadOnly Property ToolList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_ToolList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ToolUuidList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_ToolUuidList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Sub WaterJetPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
' Impostazione Path KitIni file
|
||||
m_sKitFile = m_MainWindow.GetKitsFile()
|
||||
|
||||
' Imposto i messaggi letti dal file dei messaggi
|
||||
NewKitBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 16)
|
||||
SaveKitBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 17)
|
||||
RemoveKitBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 18)
|
||||
|
||||
NewKitMachBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 16)
|
||||
RemoveKitMachBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 18)
|
||||
MoveUpKitMachBtn.Content = EgtMsg(91098)
|
||||
MoveDownKitMachBtn.Content = EgtMsg(91099)
|
||||
|
||||
KitsGpBx.Header = EgtMsg(91091) ' Lucidature
|
||||
KitMachsGpBx.Header = EgtMsg(91096) ' Lista utensili
|
||||
MotionTxBl.Text = EgtMsg(91092) ' Movimento
|
||||
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
|
||||
StepTxBl.Text = EgtMsg(90787) ' Passo
|
||||
OffSetTxBl.Text = EgtMsg(91089) ' Offset
|
||||
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
|
||||
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
|
||||
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
|
||||
LiLoadTxBl.Text = EgtMsg(91100) ' Precarico
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub WaterJetPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
|
||||
LoadPage()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadPage()
|
||||
|
||||
' Leggo utensili dal Db
|
||||
m_ToolList.Clear()
|
||||
Dim sToolName As String = String.Empty
|
||||
Dim nType As Integer = MCH_TY.NONE
|
||||
Dim bOk As Boolean = EgtTdbGetFirstTool(MCH_TF.MILL, sToolName, nType)
|
||||
While bOk
|
||||
If nType = MCH_TY.MILL_POLISHING Then
|
||||
m_ToolList.Add(sToolName)
|
||||
' Recupero l'UUID dell' utensile
|
||||
EgtTdbSetCurrTool(sToolName)
|
||||
Dim sToolUuid As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.UUID, sToolUuid)
|
||||
ToolUuidList.Add(sToolUuid)
|
||||
End If
|
||||
' Passo al successivo
|
||||
bOk = EgtTdbGetNextTool(MCH_TF.MILL, sToolName, nType)
|
||||
End While
|
||||
|
||||
' Leggo la lista dei kit
|
||||
m_KitList.Clear()
|
||||
m_KitMachList.Clear()
|
||||
Dim Kit As Kit = Nothing
|
||||
Dim nKitIndex As Integer = 1
|
||||
While ReadKit(nKitIndex, False, Kit)
|
||||
m_KitList.Add(Kit)
|
||||
nKitIndex += 1
|
||||
End While
|
||||
|
||||
KitsLstBx.ItemsSource = m_KitList
|
||||
|
||||
KitMachsLstBx.ItemsSource = m_KitMachList
|
||||
|
||||
KitMach.m_ToolList = ToolList.ToList()
|
||||
|
||||
' Recupero nome utensile tramite UUID
|
||||
Dim ToolString As String = String.Empty
|
||||
For Each KitItem As Kit In m_KitList
|
||||
For Each KitMachItem As KitMach In KitItem.KitMachList
|
||||
Dim selToolIndex As Integer = 0
|
||||
EgtTdbGetToolFromUUID(KitMachItem.sToolUUID, ToolString)
|
||||
Dim bToolExist As Boolean = False
|
||||
For Each CurrTool As String In ToolList
|
||||
If CurrTool.ToString() = ToolString Then
|
||||
bToolExist = True
|
||||
Exit For
|
||||
End If
|
||||
selToolIndex += 1
|
||||
Next
|
||||
If bToolExist Then
|
||||
KitMachItem.SelTool = selToolIndex
|
||||
Else
|
||||
KitMachItem.SelTool = -1
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
If KitsLstBx.Items.Count > 0 Then
|
||||
' seleziono il primo elemento della lista dei Kit
|
||||
KitsLstBx.SelectedItem = m_KitList(m_PreviousSelectedKitIndex)
|
||||
m_OldItem = KitsLstBx.SelectedItem
|
||||
|
||||
' carico la lista dei KitMach relativi al Kit selezionato
|
||||
For Each kmItem As KitMach In KitsLstBx.SelectedItem.KitMachList
|
||||
Dim KitMachItem = New KitMach(kmItem)
|
||||
m_KitMachList.Add(KitMachItem)
|
||||
Next
|
||||
' Verifico che l'indice del KitMach da selezionare rientri nell'intervallo degli indici esistenti altrimenti lo setto a 0
|
||||
Dim kitMachIndex As Integer = m_PreviousSelectedKitMachIndex
|
||||
If kitMachIndex > KitMachsLstBx.Items.Count Then
|
||||
kitMachIndex = 0
|
||||
End If
|
||||
KitMachsLstBx.SelectedItem = m_KitMachList(kitMachIndex)
|
||||
' visualizzo i parametri relativi al KitMach selezionato
|
||||
ShowKitMach(m_KitMachList(kitMachIndex))
|
||||
End If
|
||||
|
||||
If KitMachsLstBx.Items.Count = 0 Then RemoveKitMachBtn.IsEnabled = False
|
||||
If KitsLstBx.Items.Count = 0 Then RemoveKitBtn.IsEnabled = False
|
||||
|
||||
IsModifiedReset()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub NewKitBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewKitBtn.Click
|
||||
' Se ci sono state modifiche chiedo se si desidera salvarle
|
||||
If Not SaveKit() Then
|
||||
KitsLstBx.SelectedItem = m_OldItem
|
||||
Exit Sub
|
||||
End If
|
||||
' Mostro textbox per il nome
|
||||
KitNameTxBx.Text = String.Empty
|
||||
KitNameTxBx.Visibility = Windows.Visibility.Visible
|
||||
KitsLstBx.SetValue(Grid.RowSpanProperty, 1)
|
||||
End Sub
|
||||
|
||||
Private Sub KitNameTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KitNameTxBx.EgtClosed
|
||||
' Verifico che il nome non sia vuoto
|
||||
If Not String.IsNullOrWhiteSpace(KitNameTxBx.Text) Then
|
||||
' Verifico che il nome non sia già utilizzato
|
||||
Dim bNameExist As Boolean = False
|
||||
For Each Kit As Kit In m_KitList
|
||||
If Kit.sName = KitNameTxBx.Text Then
|
||||
bNameExist = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bNameExist Then
|
||||
' Aggiungo un Kit con Id uguale al numero di Kit già presenti + 1 e nome appena immesso
|
||||
AddKit(KitNameTxBx.Text, m_PreviousSelectedKitIndex)
|
||||
End If
|
||||
End If
|
||||
|
||||
RemoveKitBtn.IsEnabled = True
|
||||
RemoveKitMachBtn.IsEnabled = True
|
||||
|
||||
m_PreviousSelectedKitIndex = m_KitList.Count - 1
|
||||
|
||||
LoadPage()
|
||||
|
||||
' Nascondo textbox per il nome
|
||||
KitsLstBx.SetValue(Grid.RowSpanProperty, 2)
|
||||
KitNameTxBx.Visibility = Windows.Visibility.Hidden
|
||||
End Sub
|
||||
|
||||
Private Sub SaveBtn_Click(sender As Object, e As RoutedEventArgs) Handles SaveKitBtn.Click
|
||||
If IsNothing(KitsLstBx.SelectedItem) Then Return
|
||||
' Salvo il Kit correntemente selezionato
|
||||
Save(KitsLstBx.SelectedItem.nId)
|
||||
End Sub
|
||||
|
||||
Private Sub Save(nKitIndex As Integer)
|
||||
|
||||
Dim kitCurr = m_KitList(nKitIndex - 1)
|
||||
|
||||
' Salvo e scrivo tutti i KitMach del Kit che ha Id uguale all'argomento passato alla funzione Save
|
||||
Dim nKitMachIndex As Integer = 1
|
||||
For Each kmlbCurr As Object In KitMachsLstBx.Items
|
||||
' Recupero i dati
|
||||
Dim kmCurr As KitMach = kitCurr.KitMachList(nKitMachIndex - 1)
|
||||
kmCurr.SelTool = kmlbCurr.SelTool
|
||||
If kmCurr.SelTool >= 0 Then
|
||||
kmCurr.sToolName = ToolList(kmCurr.SelTool)
|
||||
kmCurr.sToolUUID = ToolUuidList(kmCurr.SelTool)
|
||||
Else
|
||||
kmCurr.sToolName = "---"
|
||||
kmCurr.sToolUUID = "---"
|
||||
End If
|
||||
kmCurr.bActive = kmlbCurr.bActive
|
||||
kmCurr.nContour = kmlbCurr.nContour
|
||||
kmCurr.nZigZagX = kmlbCurr.nZigZagX
|
||||
kmCurr.dStepX = kmlbCurr.dStepX
|
||||
kmCurr.nZigZagY = kmlbCurr.nZigZagY
|
||||
kmCurr.dStepY = kmlbCurr.dStepY
|
||||
kmCurr.dLiLen = kmlbCurr.dLiLen
|
||||
kmCurr.dLiHeight = kmlbCurr.dLiHeight
|
||||
' Salvo i dati
|
||||
WriteKitMach(kitCurr.nId, nKitMachIndex, kmCurr)
|
||||
nKitMachIndex += 1
|
||||
Next
|
||||
|
||||
IsModifiedReset()
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveKitBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemoveKitBtn.Click
|
||||
If IsNothing(KitsLstBx.SelectedItem) Then Return
|
||||
' Rimuovo il Kit correntemente selezionato
|
||||
RemoveKit(KitsLstBx.SelectedItem.nId)
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveKitMachBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemoveKitMachBtn.Click
|
||||
Dim SelectedKit As Kit = DirectCast(KitsLstBx.SelectedItem, Kit)
|
||||
Dim SelectedKitMach As KitMach = DirectCast(KitMachsLstBx.SelectedItem, KitMach)
|
||||
' Se sono presenti più di 1 KitMach elimina quello selezionato altrimenti elimina l'intero Kit
|
||||
If KitMachsLstBx.Items.Count > 1 Then
|
||||
If Not IsNothing(SelectedKitMach) Then
|
||||
RemoveKitMach(SelectedKit, SelectedKitMach.nId)
|
||||
End If
|
||||
Else
|
||||
RemoveKit(SelectedKit.nId)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub NewKitMachBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewKitMachBtn.Click
|
||||
' Se ci sono state modifiche chiedo se si desidera salvarle
|
||||
If Not SaveKit() Then
|
||||
KitsLstBx.SelectedItem = m_OldItem
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not IsNothing(KitsLstBx.SelectedItem) Then
|
||||
' Scrivo nuova lavorazione
|
||||
Dim nKitIdx As Integer = m_KitList(KitsLstBx.SelectedIndex).nId
|
||||
Dim nMachKitIdx As Integer = m_KitMachList.Count + 1
|
||||
WriteKitMach(nKitIdx, nMachKitIdx, New KitMach(nMachKitIdx))
|
||||
' Ricarico
|
||||
m_PreviousSelectedKitIndex = KitsLstBx.SelectedItem.nId - 1
|
||||
LoadPage()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AddKit(sNewKitName As String, nCurrKitIndex As Integer)
|
||||
Dim kitNew As Kit = Nothing
|
||||
If nCurrKitIndex >= 0 And nCurrKitIndex < m_KitList.Count() Then
|
||||
' Creo il Kit come copia di quello corrente
|
||||
kitNew = New Kit(m_KitList.Count + 1, sNewKitName, m_KitList(nCurrKitIndex))
|
||||
Else
|
||||
' Creo il Kit e aggiungo un KitMach vuoto
|
||||
kitNew = New Kit(m_KitList.Count + 1, sNewKitName)
|
||||
kitNew.KitMachList.Add(New KitMach(1))
|
||||
End If
|
||||
' Inserisco in lista
|
||||
m_KitList.Add(kitNew)
|
||||
' Eseguo il salvataggio
|
||||
WriteKitName(kitNew.nId, kitNew.sName)
|
||||
For Each kmCurr As KitMach In kitNew.KitMachList
|
||||
WriteKitMach(kitNew.nId, kmCurr.nId, kmCurr)
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveKit(nKitIndex As Integer)
|
||||
' Rimuovo il Kit dall'elenco
|
||||
For Index As Integer = 0 To m_KitList.Count - 1
|
||||
If m_KitList(Index).nId = nKitIndex Then
|
||||
m_KitList.RemoveAt(Index)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' Tolgo il kit dal file
|
||||
EraseKit(nKitIndex)
|
||||
|
||||
' Ricarico tutto
|
||||
m_PreviousSelectedKitIndex = 0
|
||||
LoadPage()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub RemoveKitMach(KitValue As Kit, nKitMachIndex As Integer)
|
||||
' Rimuovo il Kit dall'elenco
|
||||
Dim Index As Integer
|
||||
For Index = 0 To m_KitMachList.Count - 1
|
||||
If m_KitMachList(Index).nId = nKitMachIndex Then
|
||||
m_KitMachList.RemoveAt(Index)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
KitValue.KitMachList.RemoveAt(Index)
|
||||
|
||||
' Tolgo la lavorazione dal file
|
||||
EraseKitMach(KitValue.nId, nKitMachIndex)
|
||||
|
||||
' Ricarico tutto
|
||||
m_PreviousSelectedKitIndex = KitsLstBx.SelectedItem.nId - 1
|
||||
m_PreviousSelectedKitMachIndex = 0
|
||||
LoadPage()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub KitsLstBx_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles KitsLstBx.PreviewMouseUp
|
||||
|
||||
If Not SaveKit() Then
|
||||
KitsLstBx.SelectedItem = m_OldItem
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim SelectedKit As Kit = KitsLstBx.SelectedItem
|
||||
If Not IsNothing(SelectedKit) Then
|
||||
' resetto la lista
|
||||
m_KitMachList.Clear()
|
||||
' carico la lista dei KitMach relativi al Kit selezionato
|
||||
For Each kmItem As KitMach In KitsLstBx.SelectedItem.KitMachList
|
||||
Dim KitMachItem = New KitMach(kmItem)
|
||||
m_KitMachList.Add(KitMachItem)
|
||||
Next
|
||||
' seleziono il primo elemento della lista dei Kit
|
||||
KitMachsLstBx.SelectedItem = m_KitMachList(0)
|
||||
' visualizzo i parametri relativi al KitMach selezionato
|
||||
ShowKitMach(m_KitMachList(0))
|
||||
|
||||
m_OldItem = KitsLstBx.SelectedItem
|
||||
|
||||
IsModifiedReset()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Function SaveKit() As Boolean
|
||||
' Se non modificato non va fatto alcunché
|
||||
If Not IsModified() Then Return True
|
||||
' Chiedo cosa fare ed eseguo
|
||||
Dim SaveCurrKitWnd As New EgtMsgBox(m_MainWindow, "", EgtMsg(91124), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL)
|
||||
Select Case SaveCurrKitWnd.m_nPressedBtn
|
||||
Case 1 ' Si
|
||||
Save(m_OldItem.nId)
|
||||
Return True
|
||||
Case 2 ' No
|
||||
m_PreviousSelectedKitIndex = KitsLstBx.SelectedItem.nId - 1
|
||||
LoadPage()
|
||||
Return True
|
||||
Case Else ' Annulla
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private ReadOnly Property IsModified() As Boolean
|
||||
Get
|
||||
If Not IsNothing(m_OldItem) Then
|
||||
Dim nKitIndex As Integer = m_OldItem.nId
|
||||
If nKitIndex <= m_KitList.Count Then
|
||||
For Each KitMachItem As KitMach In m_KitList(nKitIndex - 1).KitMachList
|
||||
If KitMachItem.m_IsModifiedId OrElse KitMachItem.m_IsModifiedToolUUID OrElse KitMachItem.m_IsModifiedToolName OrElse KitMachItem.m_IsModifiedSelTool OrElse
|
||||
KitMachItem.m_IsModifiedActive OrElse KitMachItem.m_IsModifiedContour OrElse KitMachItem.m_IsModifiedOffCnt OrElse KitMachItem.m_IsModifiedZigZagX OrElse
|
||||
KitMachItem.m_IsModifiedOffZigZagX OrElse KitMachItem.m_IsModifiedZigZagY OrElse KitMachItem.m_IsModifiedStepX OrElse KitMachItem.m_IsModifiedStepY OrElse
|
||||
KitMachItem.m_IsModifiedOffZigZagY OrElse KitMachItem.m_IsModifiedLiLen OrElse KitMachItem.m_IsModifiedLiHeight OrElse KitMachItem.m_IsModifiedLiLoad Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Sub IsModifiedReset()
|
||||
If IsNothing(m_OldItem) Then Return
|
||||
Dim nKitIndex As Integer = m_OldItem.nId
|
||||
If nKitIndex <= m_KitList.Count Then
|
||||
For Each KitMachItem As KitMach In m_KitList(nKitIndex - 1).KitMachList
|
||||
KitMachItem.m_IsModifiedId = False
|
||||
KitMachItem.m_IsModifiedToolUUID = False
|
||||
KitMachItem.m_IsModifiedToolName = False
|
||||
KitMachItem.m_IsModifiedSelTool = False
|
||||
KitMachItem.m_IsModifiedActive = False
|
||||
KitMachItem.m_IsModifiedContour = False
|
||||
KitMachItem.m_IsModifiedOffCnt = False
|
||||
KitMachItem.m_IsModifiedZigZagX = False
|
||||
KitMachItem.m_IsModifiedOffZigZagX = False
|
||||
KitMachItem.m_IsModifiedZigZagY = False
|
||||
KitMachItem.m_IsModifiedOffZigZagY = False
|
||||
KitMachItem.m_IsModifiedStepX = False
|
||||
KitMachItem.m_IsModifiedStepY = False
|
||||
KitMachItem.m_IsModifiedLiLen = False
|
||||
KitMachItem.m_IsModifiedLiHeight = False
|
||||
KitMachItem.m_IsModifiedLiLoad = False
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ShowKitMach(kmShow As KitMach)
|
||||
' visualizzo i parametri del KitMach
|
||||
ContourTxBx.Text = kmShow.nContour.ToString()
|
||||
OffContourTxBx.Text = LenToString(kmShow.dOffsetCnt, 3)
|
||||
ZigZagXTxBx.Text = kmShow.nZigZagX.ToString()
|
||||
OffZigZagXTxBx.Text = LenToString(kmShow.dOffZigZagX, 3)
|
||||
StepXTxBx.Text = LenToString(kmShow.dStepX, 3)
|
||||
ZigZagYTxBx.Text = kmShow.nZigZagY.ToString()
|
||||
OffZigZagYTxBx.Text = LenToString(kmShow.dOffZigZagY, 3)
|
||||
StepYTxBx.Text = LenToString(kmShow.dStepY, 3)
|
||||
LiLenTxBx.Text = LenToString(kmShow.dLiLen, 3)
|
||||
LiHeightTxBx.Text = LenToString(kmShow.dLiHeight, 3)
|
||||
LiLoadTxBx.Text = LenToString(kmShow.dLiLoad, 3)
|
||||
End Sub
|
||||
|
||||
Private Sub KitMachsLstBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles KitMachsLstBx.SelectionChanged
|
||||
Dim SelectedKitMach As KitMach = KitMachsLstBx.SelectedItem
|
||||
If Not IsNothing(SelectedKitMach) Then
|
||||
' visualizzo i parametri relativi al KitMach selezionato
|
||||
ShowKitMach(SelectedKitMach)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ContourTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ContourTxBx.EgtClosed
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
nTemp = ContourTxBx.Text
|
||||
KitMachsLstBx.SelectedItem.nContour = nTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).nContour = nTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OffContourTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffContourTxBx.EgtClosed
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
nTemp = OffContourTxBx.Text
|
||||
KitMachsLstBx.SelectedItem.dOffsetCnt = nTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).dOffsetCnt = nTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ZigZagXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ZigZagXTxBx.EgtClosed
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
nTemp = ZigZagXTxBx.Text
|
||||
KitMachsLstBx.SelectedItem.nZigZagX = nTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).nZigZagX = nTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OffZigZagXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffZigZagXTxBx.EgtClosed
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
nTemp = OffZigZagXTxBx.Text
|
||||
KitMachsLstBx.SelectedItem.dOffZigZagX = nTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).dOffZigZagX = nTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub StepXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepXTxBx.EgtClosed
|
||||
Dim dTemp As Double = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
StringToLen(StepXTxBx.Text, dTemp)
|
||||
KitMachsLstBx.SelectedItem.dStepX = dTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).dStepX = dTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ZigZagYTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ZigZagYTxBx.EgtClosed
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
nTemp = ZigZagYTxBx.Text
|
||||
KitMachsLstBx.SelectedItem.nZigZagY = nTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).nZigZagY = nTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OffZigZagYTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffZigZagYTxBx.EgtClosed
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
nTemp = OffZigZagYTxBx.Text
|
||||
KitMachsLstBx.SelectedItem.dOffZigZagY = nTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).dOffZigZagY = nTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub StepYTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepYTxBx.EgtClosed
|
||||
Dim dTemp As Double = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
StringToLen(StepYTxBx.Text, dTemp)
|
||||
KitMachsLstBx.SelectedItem.dStepY = dTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).dStepY = dTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LiLenTxBx_EgtClosed(sender As Object, e As EventArgs) Handles LiLenTxBx.EgtClosed
|
||||
Dim dTemp As Double = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
StringToLen(LiLenTxBx.Text, dTemp)
|
||||
KitMachsLstBx.SelectedItem.dLiLen = dTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).dLiLen = dTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LiHeightTxBx_EgtClosed(sender As Object, e As EventArgs) Handles LiHeightTxBx.EgtClosed
|
||||
Dim dTemp As Double = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
StringToLen(LiHeightTxBx.Text, dTemp)
|
||||
KitMachsLstBx.SelectedItem.dLiHeight = dTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).dLiHeight = dTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LiLoadTxBx_EgtClosed(sender As Object, e As EventArgs) Handles LiLoadTxBx.EgtClosed
|
||||
Dim dTemp As Double = 0
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
StringToLen(LiLoadTxBx.Text, dTemp)
|
||||
KitMachsLstBx.SelectedItem.dLiLoad = dTemp
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).dLiLoad = dTemp
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox_Click(sender As Object, e As RoutedEventArgs)
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).bActive = KitMachsLstBx.SelectedItem.bActive
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ToolCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||
If Not IsNothing(KitMachsLstBx.SelectedItem) Then
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).SelTool = KitMachsLstBx.SelectedItem.SelTool
|
||||
If KitMachsLstBx.SelectedItem.SelTool >= 0 Then
|
||||
KitMachsLstBx.SelectedItem.sToolName = m_ToolList(KitMachsLstBx.SelectedItem.SelTool)
|
||||
KitMachsLstBx.SelectedItem.sToolUUID = m_ToolUuidList(KitMachsLstBx.SelectedItem.SelTool)
|
||||
Else
|
||||
KitMachsLstBx.SelectedItem.sToolName = "---"
|
||||
KitMachsLstBx.SelectedItem.sToolUUID = "---"
|
||||
End If
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).sToolName = KitMachsLstBx.SelectedItem.sToolName
|
||||
m_OldItem.KitMachList(KitMachsLstBx.SelectedItem.nId - 1).sToolUUID = KitMachsLstBx.SelectedItem.sToolUUID
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ReadKitName(nKitIndex As Integer) As String
|
||||
' Leggo il nome del kit
|
||||
Dim sKey As String = K_KIT & nKitIndex.ToString("D2")
|
||||
Dim sName As String = ""
|
||||
GetPrivateProfileString(S_HEADER, sKey, "", sName, m_sKitFile)
|
||||
Return sName
|
||||
End Function
|
||||
|
||||
Private Function ReadKit(nKitIndex As Integer, removeFlag As Boolean, ByRef Kit As Kit) As Boolean
|
||||
' Leggo il nome del kit
|
||||
Dim sName As String = ReadKitName(nKitIndex)
|
||||
If String.IsNullOrWhiteSpace(sName) Then Return False
|
||||
' Creo il kit
|
||||
Kit = New Kit(If(removeFlag, nKitIndex - 1, nKitIndex), sName)
|
||||
' Leggo le sue lavorazioni
|
||||
For nkitMachIndex As Integer = 1 To 100
|
||||
Dim kmItem As KitMach = Nothing
|
||||
If ReadKitMach(sName, nkitMachIndex, kmItem) Then
|
||||
Kit.AddKitMach(kmItem)
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' Se non sono state trovate lavorazioni, ne aggiungo una standard
|
||||
If Kit.KitMachList.Count() = 0 Then
|
||||
Kit.AddKitMach(New KitMach(1))
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function ReadKitMach(sKitName As String, nKitMachIndex As Integer, ByRef kmItem As KitMach) As Boolean
|
||||
' Verifico esistenza lavorazione del kit
|
||||
Dim sSect As String = S_KIT & "." & sKitName
|
||||
Dim sKeyInd As String = nKitMachIndex.ToString("D2") & "."
|
||||
Dim sName As String = ""
|
||||
If GetPrivateProfileString(sSect, sKeyInd & K_TOOLNAME, "", sName, m_sKitFile) = 0 Then Return False
|
||||
' Lettura completa
|
||||
kmItem = New KitMach
|
||||
kmItem.sToolName = sName
|
||||
kmItem.nId = nKitMachIndex
|
||||
GetPrivateProfileString(sSect, sKeyInd & K_TOOL, "", kmItem.sToolUUID, m_sKitFile)
|
||||
kmItem.bActive = (GetPrivateProfileInt(sSect, sKeyInd & K_ACTIVE, 0, m_sKitFile) = 1)
|
||||
kmItem.nContour = GetPrivateProfileInt(sSect, sKeyInd & K_CONTOUR, 0, m_sKitFile)
|
||||
kmItem.dOffsetCnt = GetPrivateProfileInt(sSect, sKeyInd & K_OFFSETCNT, 0, m_sKitFile)
|
||||
kmItem.nZigZagX = GetPrivateProfileInt(sSect, sKeyInd & K_ZIGZAGX, 0, m_sKitFile)
|
||||
kmItem.dOffZigZagX = GetPrivateProfileInt(sSect, sKeyInd & K_OFFZIGZAGX, 0, m_sKitFile)
|
||||
kmItem.dStepX = GetPrivateProfileDouble(sSect, sKeyInd & K_STEPX, 0, m_sKitFile)
|
||||
kmItem.nZigZagY = GetPrivateProfileInt(sSect, sKeyInd & K_ZIGZAGY, 0, m_sKitFile)
|
||||
kmItem.dOffZigZagY = GetPrivateProfileInt(sSect, sKeyInd & K_OFFZIGZAGY, 0, m_sKitFile)
|
||||
kmItem.dStepY = GetPrivateProfileDouble(sSect, sKeyInd & K_STEPY, 0, m_sKitFile)
|
||||
kmItem.dLiLen = GetPrivateProfileDouble(sSect, sKeyInd & K_LILEN, 0, m_sKitFile)
|
||||
kmItem.dLiHeight = GetPrivateProfileDouble(sSect, sKeyInd & K_LIHEIGHT, 0, m_sKitFile)
|
||||
kmItem.dLiLoad = GetPrivateProfileDouble(sSect, sKeyInd & K_LILOAD, 0, m_sKitFile)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function WriteKitName(nKitIndex As Integer, sKitName As String) As Boolean
|
||||
Dim sKey As String = K_KIT & nKitIndex.ToString("D2")
|
||||
Return WritePrivateProfileString(S_HEADER, sKey, sKitName, m_sKitFile)
|
||||
End Function
|
||||
|
||||
Private Function WriteKitMach(nKitIndex As Integer, nKitMachIndex As Integer, kmItem As KitMach) As Boolean
|
||||
' Leggo il nome del kit
|
||||
Dim sKitName As String = ReadKitName(nKitIndex)
|
||||
If String.IsNullOrWhiteSpace(sKitName) Then Return False
|
||||
' Sezione
|
||||
Dim sSect As String = S_KIT & "." & sKitName
|
||||
' Indice
|
||||
Dim sKeyInd As String = nKitMachIndex.ToString("D2") & "."
|
||||
' Scrivo i dati della lavorazione
|
||||
If Not IsNothing(kmItem) Then
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_TOOL, kmItem.sToolUUID, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_TOOLNAME, kmItem.sToolName, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_ACTIVE, If(kmItem.bActive, "1", "0"), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_CONTOUR, kmItem.nContour.ToString(), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_OFFSETCNT, kmItem.dOffsetCnt.ToString(), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_ZIGZAGX, kmItem.nZigZagX.ToString(), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_OFFZIGZAGX, kmItem.dOffZigZagX.ToString(), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_STEPX, DoubleToString(kmItem.dStepX, 3), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_ZIGZAGY, kmItem.nZigZagY.ToString(), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_OFFZIGZAGY, kmItem.dOffZigZagY.ToString(), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_STEPY, DoubleToString(kmItem.dStepY, 3), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_LILEN, DoubleToString(kmItem.dLiLen, 3), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_LIHEIGHT, DoubleToString(kmItem.dLiHeight, 3), m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_LILOAD, DoubleToString(kmItem.dLiLoad, 3), m_sKitFile)
|
||||
Else
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_TOOL, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_TOOLNAME, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_ACTIVE, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_CONTOUR, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_OFFSETCNT, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_ZIGZAGX, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_OFFZIGZAGX, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_STEPX, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_ZIGZAGY, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_OFFZIGZAGY, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_STEPY, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_LILEN, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_LIHEIGHT, Nothing, m_sKitFile)
|
||||
WritePrivateProfileString(sSect, sKeyInd & K_LILOAD, Nothing, m_sKitFile)
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function EraseKit(nKitIndex As Integer) As Boolean
|
||||
' Leggo il nome del kit
|
||||
Dim sKitName As String = ReadKitName(nKitIndex)
|
||||
If String.IsNullOrWhiteSpace(sKitName) Then Return False
|
||||
' Lo elimino dalla lista dei kit scalando tutti di una posizione e eliminando l'ultimo
|
||||
Dim nNextKitIndex As Integer = nKitIndex + 1
|
||||
Dim sNextKitName As String = ReadKitName(nNextKitIndex)
|
||||
While Not String.IsNullOrWhiteSpace(sNextKitName)
|
||||
WriteKitName(nNextKitIndex - 1, sNextKitName)
|
||||
nNextKitIndex += 1
|
||||
sNextKitName = ReadKitName(nNextKitIndex)
|
||||
End While
|
||||
WriteKitName(nNextKitIndex - 1, Nothing)
|
||||
' Sezione
|
||||
Dim sSect As String = S_KIT & "." & sKitName
|
||||
' Cancello tutte le lavorazioni del kit
|
||||
WritePrivateProfileString(sSect, Nothing, Nothing, m_sKitFile)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function EraseKitMach(nKitIndex As Integer, nKitMachIndex As Integer) As Boolean
|
||||
' Leggo il nome del kit
|
||||
Dim sKitName As String = ReadKitName(nKitIndex)
|
||||
If String.IsNullOrWhiteSpace(sKitName) Then Return False
|
||||
' Lo elimino dali KitMach scalando tutti di una posizione e eliminando l'ultimo
|
||||
Dim kmCurr As KitMach = Nothing
|
||||
Dim nNextKitMachIndex As Integer = nKitMachIndex + 1
|
||||
While ReadKitMach(sKitName, nNextKitMachIndex, kmCurr)
|
||||
kmCurr.nId = nNextKitMachIndex - 1
|
||||
WriteKitMach(nKitIndex, nNextKitMachIndex - 1, kmCurr)
|
||||
nNextKitMachIndex += 1
|
||||
End While
|
||||
WriteKitMach(nKitIndex, nNextKitMachIndex - 1, Nothing)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub ActiveChBx_GotFocus(sender As Object, e As RoutedEventArgs)
|
||||
Dim myCheckBox As CheckBox = sender
|
||||
Dim Parent As DependencyObject = VisualTreeHelper.GetParent(myCheckBox)
|
||||
While (Not (TypeOf (Parent) Is ListBoxItem))
|
||||
Parent = VisualTreeHelper.GetParent(Parent)
|
||||
End While
|
||||
Dim myListBoxItem As ListBoxItem = Parent
|
||||
myListBoxItem.IsSelected = True
|
||||
End Sub
|
||||
|
||||
Private Sub ToolCmBx_GotFocus(sender As Object, e As RoutedEventArgs)
|
||||
Dim myComboBox As ComboBox = sender
|
||||
Dim Parent As DependencyObject = VisualTreeHelper.GetParent(myComboBox)
|
||||
While (Not (TypeOf (Parent) Is ListBoxItem))
|
||||
Parent = VisualTreeHelper.GetParent(Parent)
|
||||
End While
|
||||
Dim myListBoxItem As ListBoxItem = Parent
|
||||
myListBoxItem.IsSelected = True
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -199,6 +199,9 @@
|
||||
<Compile Include="Machine\ImportExportToolWD.xaml.vb">
|
||||
<DependentUpon>ImportExportToolWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
|
||||
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Project\StartLauncheWD.xaml.vb">
|
||||
<DependentUpon>StartLauncheWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -437,6 +440,10 @@
|
||||
<Page Include="Machine\ImportExportToolWD.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Machine\WaterJetPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Project\StartLauncheWD.xaml">
|
||||
</Page>
|
||||
<Page Include="Project\CicloStartWD.xaml">
|
||||
|
||||
Reference in New Issue
Block a user