OmagCUT :
- Introduzione materiali e spessori nelle lavorazioni. - Scelta delle lavorazioni che tiene conto di materiali e spessori impostati in Db lavorazioni. - Bottoni macchina singoli a stati invece che doppi on/off. - Miglioramenti vari durante prove in macchina.
This commit is contained in:
+160
-88
@@ -42,106 +42,132 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Grid.ColumnSpan="3" Grid.RowSpan="1" Header="Utensili"
|
||||
<Grid Grid.ColumnSpan="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.75*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="SetUpGpBx" Grid.ColumnSpan="3" Grid.RowSpan="9"
|
||||
Style="{StaticResource OmagCut_GroupBox}">
|
||||
|
||||
<Grid Name="CurrToolsGrid" Grid.ColumnSpan="2">
|
||||
<Grid Name="CurrToolsGrid" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="CurrSawTxBl" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<ComboBox x:Name="CurrSawCmBx" Grid.Column="1" Grid.Row="1">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="AuxiliaryToolTxBl" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
Visibility="Hidden"/>
|
||||
<ComboBox Name="AuxiliaryToolCmBx" Grid.Column="1" Grid.Row="3" Visibility="Hidden">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding sName}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="CurrDrillTxBl" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
Visibility="Hidden"/>
|
||||
<ComboBox Name="CurrDrillCmBx" Grid.Column="1" Grid.Row="3" Visibility="Hidden">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="CurrMillTxBl" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
Visibility="Hidden"/>
|
||||
<ComboBox Name="CurrMillCmBx" Grid.Column="1" Grid.Row="5" Visibility="Hidden">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<Button Name="SetUpBtn" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2" Visibility="Hidden" Content="Attrezzaggio"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
<GroupBox Name="HolesGpBx" Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="3"
|
||||
Style="{StaticResource OmagCut_GroupBox}">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="CurrSawTxBl" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<ComboBox x:Name="CurrSawCmBx" Grid.Column="1" Grid.Row="1">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBlock Name="HolesOffsetTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOffsetTxBx" Grid.Column="1" Grid.Row="0" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="AuxiliaryToolTxBl" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
Visibility="Hidden"/>
|
||||
<ComboBox Name="AuxiliaryToolCmBx" Grid.Column="1" Grid.Row="3" Visibility="Hidden">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding sName}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBlock Name="HolesOverlapTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOverlapTxBx" Grid.Column="1" Grid.Row="1" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="CurrDrillTxBl" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
Visibility="Hidden"/>
|
||||
<ComboBox Name="CurrDrillCmBx" Grid.Column="1" Grid.Row="3" Visibility="Hidden">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="CurrMillTxBl" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
Visibility="Hidden"/>
|
||||
<ComboBox Name="CurrMillCmBx" Grid.Column="1" Grid.Row="5" Visibility="Hidden">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<Button Name="SetUpBtn" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2" Visibility="Hidden" Content="Attrezzaggio"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<TextBlock Name="HolesToleranceTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesToleranceTxBx" Grid.Column="1" Grid.Row="2" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<TextBlock Name="HolesOffsetTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOffsetTxBx" Grid.Column="1" Grid.Row="1" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="HolesOverlapTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOverlapTxBx" Grid.Column="1" Grid.Row="2" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="HolesToleranceTxBl" Grid.Column="0" Grid.Row="3"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesToleranceTxBx" Grid.Column="1" Grid.Row="3" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="CutExtraLenTxBl" Grid.Column="0" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="CutExtraLenTxBx" Grid.Column="1" Grid.Row="4" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="AngleCutExtraLenTxBl" Grid.Column="0" Grid.Row="5"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="AngleCutExtraLenTxBx" Grid.Column="1" Grid.Row="5" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
|
||||
<CheckBox Name="CompleteCutsChBx" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2" Height="40" Width="307"
|
||||
HorizontalAlignment="Center" FlowDirection="RightToLeft">
|
||||
<TextBlock Name="CompleteCutsTxBl" Style="{StaticResource OmagCut_ToolsDBTextBlock}" Margin="0"
|
||||
Width="262" FlowDirection="LeftToRight"/>
|
||||
</CheckBox>
|
||||
<TextBlock Name="CompleteCutsTxBl" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}" />
|
||||
<CheckBox Name="CompleteCutsChBx" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2" Height="40" Width="40"
|
||||
HorizontalAlignment="Right" Margin="0,0,11,0"/>
|
||||
|
||||
<TextBlock Name="SafeZTxBl" Grid.Column="0" Grid.Row="7" FontSize="20"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
@@ -149,18 +175,64 @@
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--<TextBlock Name="NCErrorMessages" Grid.ColumnSpan="2" FontSize="22"
|
||||
TextWrapping="Wrap" Margin="32,417,140,69" Grid.Column="1"/>
|
||||
<TextBlock Name="PLCErrorMessages" Grid.ColumnSpan="3" FontSize="22" Height="35" Width="1000" Margin="136,590,136,51"/>-->
|
||||
<ListBox Name="ErrorLstBx" Grid.Column="1"
|
||||
Margin="0,0,0,281" >
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<GroupBox Name="ErrorLstGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.Row="1">
|
||||
<ListBox Name="ErrorLstBx">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="MaterialsGpBx" Style="{StaticResource OmagCut_GroupBox}">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ListBox Name="MaterialsLstBx" Grid.RowSpan="2">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding sName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="MatNameTxBx" Grid.Row="1" Width="240" Visibility="Hidden"
|
||||
Style="{StaticResource OmagCut_KeyboardTextBox}" />
|
||||
|
||||
<UniformGrid Grid.Row="2" Columns="2">
|
||||
<Button Name="NewMatBtn" Grid.Column="1" Content="Nuovo"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="RemoveMatBtn" Grid.Column="1" Content="Elimina"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
+68
-5
@@ -29,6 +29,9 @@ Public Class AlarmsPageUC
|
||||
CurrMillCmBx.ItemsSource = m_MillList
|
||||
AuxiliaryToolCmBx.ItemsSource = m_AuxToolTypeList
|
||||
|
||||
' Assegno lista ad elenco materiali
|
||||
MaterialsLstBx.ItemsSource = m_MainWindow.m_CurrentMachine.Materials
|
||||
|
||||
'Imposto i messaggi letti dal file dei messaggi
|
||||
CurrSawTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 1)
|
||||
AuxiliaryToolTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 2)
|
||||
@@ -41,16 +44,42 @@ Public Class AlarmsPageUC
|
||||
AngleCutExtraLenTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 7)
|
||||
CompleteCutsTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 8)
|
||||
SafeZTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 5)
|
||||
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
|
||||
MaterialsGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 13)
|
||||
NewMatBtn.Content = EgtMsg(MSG_ALARMSPAGEUC + 14)
|
||||
RemoveMatBtn.Content = EgtMsg(MSG_ALARMSPAGEUC + 15)
|
||||
SetUpGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 16)
|
||||
HolesGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 17)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub AlarmsPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
' Variabile che accorcia il riferimento alla macchina corrente
|
||||
m_CurrentMachine = m_MainWindow.m_CurrentMachine
|
||||
If m_bFirst Then
|
||||
|
||||
If Not m_MainWindow.m_bNCLink = 0 Then
|
||||
'ErrorLstBx.ItemsSource = m_CN.sz_NC_error_messages
|
||||
' Variabile che accorcia il riferimento alla macchina corrente
|
||||
m_CurrentMachine = m_MainWindow.m_CurrentMachine
|
||||
|
||||
' Verifico la configurazione della macchina per creare i combobox
|
||||
Select Case m_CurrentMachine.MountedToolConfig
|
||||
Case CurrentMachine.MountedToolConfigs.SAW
|
||||
' Elimino le righe inutili e riduco il groupbox utensili correnti
|
||||
For Index = 7 - 1 To 2 Step -1
|
||||
CurrToolsGrid.RowDefinitions.RemoveAt(Index)
|
||||
Next
|
||||
Dim EndRow As New RowDefinition
|
||||
EndRow.Height = New GridLength(0.25, GridUnitType.Star)
|
||||
CurrToolsGrid.RowDefinitions.Add(EndRow)
|
||||
SetUpGpBx.SetValue(Grid.RowSpanProperty, 1)
|
||||
' Disattivo il gruppo dei parametri fori
|
||||
HolesGpBx.Visibility = Windows.Visibility.Hidden
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
|
||||
'Non faccio alcunchè
|
||||
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
|
||||
'Da implementare
|
||||
End Select
|
||||
|
||||
m_bFirst = False
|
||||
End If
|
||||
|
||||
' Aggiorno lista delle lame per pagina macchina in cui scegliere quella corrente
|
||||
@@ -61,7 +90,7 @@ Public Class AlarmsPageUC
|
||||
' Verifico la configurazione della macchina per creare i combobox
|
||||
Select Case m_CurrentMachine.MountedToolConfig
|
||||
Case CurrentMachine.MountedToolConfigs.SAW
|
||||
'Non eseguo alcuna azione
|
||||
' Non compio alcuna azione
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
|
||||
If m_CurrentMachine.bDrilling Then
|
||||
m_AuxToolTypeList.Add(New StringIdCmBx(2, EgtMsg(MSG_ALARMSPAGEUC + 22)))
|
||||
@@ -317,4 +346,38 @@ Public Class AlarmsPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub NewMatBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewMatBtn.Click
|
||||
' Mostro textbox per il nome
|
||||
MatNameTxBx.Text = String.Empty
|
||||
MatNameTxBx.Visibility = Windows.Visibility.Visible
|
||||
MaterialsLstBx.SetValue(Grid.RowSpanProperty, 1)
|
||||
End Sub
|
||||
|
||||
Private Sub MatNameTxBx_EgtClosed(sender As Object, e As EventArgs) Handles MatNameTxBx.EgtClosed
|
||||
' Verifico che il nome non sia vuoto
|
||||
If Not String.IsNullOrWhiteSpace(MatNameTxBx.Text) Then
|
||||
' Verifico che il nome non sia già utilizzato
|
||||
Dim bNameExist As Boolean = False
|
||||
For Each Material In m_CurrentMachine.Materials
|
||||
If Material.sName = MatNameTxBx.Text Then
|
||||
bNameExist = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bNameExist Then
|
||||
m_CurrentMachine.AddMaterial(New Material(MatNameTxBx.Text, m_CurrentMachine.Materials))
|
||||
End If
|
||||
End If
|
||||
' Nascondo textbox per il nome
|
||||
MaterialsLstBx.SetValue(Grid.RowSpanProperty, 2)
|
||||
MatNameTxBx.Visibility = Windows.Visibility.Hidden
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveMatBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemoveMatBtn.Click
|
||||
Dim SelectedMat As Material = MaterialsLstBx.SelectedItem
|
||||
If Not IsNothing(SelectedMat) Then
|
||||
m_CurrentMachine.RemoveMaterial(SelectedMat)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
+14
-5
@@ -15,7 +15,7 @@ Public Class CNCommunication
|
||||
Friend m_nNCType As Integer
|
||||
|
||||
' Variabile che indica il Mode corrente
|
||||
Private m_nCurrMode As Integer
|
||||
Private m_nCurrMode As Integer = -1
|
||||
|
||||
' Oggetto CN
|
||||
Public WithEvents m_CN As CN_generico
|
||||
@@ -251,10 +251,19 @@ Public Class CNCommunication
|
||||
'FrmMain.LblToolComp.Text = cn.Tools(0).comp_num.ToString
|
||||
End If
|
||||
|
||||
If m_CN.read_active_mode() <> m_nCurrMode Then
|
||||
m_nCurrMode = m_CN.read_active_mode()
|
||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
End If
|
||||
Select m_nNCType
|
||||
Case 1
|
||||
If m_CN.read_active_mode() <> m_nCurrMode Then
|
||||
m_nCurrMode = m_CN.read_active_mode()
|
||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
End If
|
||||
Case 2
|
||||
If m_CN.nMachineMode <> m_nCurrMode Then
|
||||
m_nCurrMode = m_CN.nMachineMode
|
||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
End If
|
||||
End Select
|
||||
|
||||
|
||||
If m_CN.b_NC_error Then
|
||||
ErrorList.Clear()
|
||||
|
||||
+83
-81
@@ -4,12 +4,12 @@ Public MustInherit Class CN_generico
|
||||
|
||||
#Region " Constants"
|
||||
|
||||
Public Const MAX_AXES As Short = 10
|
||||
Public Const MAX_VAR As Short = 100
|
||||
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
|
||||
Public Const MAX_TOOLS As Short = 100
|
||||
Public Const MAX_AXES As Short = 10
|
||||
Public Const MAX_VAR As Short = 100
|
||||
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
|
||||
Public Const MAX_TOOLS As Short = 100
|
||||
Public Const NUM_DATA = 11 ' Numero di dati del CN (Speed,Feed,...)
|
||||
Public Enum CnData
|
||||
Public Enum CnData
|
||||
Mode = 0
|
||||
JogIncr = 1
|
||||
Feed = 2
|
||||
@@ -21,77 +21,77 @@ Public MustInherit Class CN_generico
|
||||
Coolant = 8
|
||||
Laser = 9
|
||||
PowerOvr = 10
|
||||
End Enum
|
||||
End Enum
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " Struct"
|
||||
|
||||
Public Structure ToolStructure
|
||||
Public type As Char
|
||||
Public lenght As Double
|
||||
Public radius As Double
|
||||
Public tip As Double
|
||||
Public D_lenght As Double
|
||||
Public D_radius As Double
|
||||
Public nose_dir As String
|
||||
Public comp_num As Short
|
||||
End Structure
|
||||
Public Structure ToolStructure
|
||||
Public type As Char
|
||||
Public lenght As Double
|
||||
Public radius As Double
|
||||
Public tip As Double
|
||||
Public D_lenght As Double
|
||||
Public D_radius As Double
|
||||
Public nose_dir As String
|
||||
Public comp_num As Short
|
||||
End Structure
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " Interface"
|
||||
|
||||
Public IsFlexiumPlus As Boolean = False
|
||||
Public sz_CncFxIdentifier As String = ""
|
||||
Public IsFlexiumPlus As Boolean = False
|
||||
Public sz_CncFxIdentifier As String = ""
|
||||
|
||||
Public d_LinearAxisPrecision As Double
|
||||
Public d_LinearAxisPrecision As Double
|
||||
|
||||
Public sz_ServerInitStatus As String
|
||||
Public sz_ServerReinitStatus As String
|
||||
Public sz_ManualDataInput As String
|
||||
Public sz_ServerInitStatus As String
|
||||
Public sz_ServerReinitStatus As String
|
||||
Public sz_ManualDataInput As String
|
||||
|
||||
Public sz_versionRTS As String
|
||||
Public sz_ConnectionAddress As String
|
||||
Public sz_AffaireNumber As String
|
||||
Public sz_versionRTS As String
|
||||
Public sz_ConnectionAddress As String
|
||||
Public sz_AffaireNumber As String
|
||||
|
||||
Public n_state As Short = 0
|
||||
Public n_validaxes As Short
|
||||
Public n_state As Short = 0
|
||||
Public n_validaxes As Short
|
||||
|
||||
Public b_axis_events_enable As Boolean = False
|
||||
Public d_axis_position(MAX_AXES) As Double
|
||||
Public d_axis_delta(MAX_AXES) As Double
|
||||
Public b_axis_valid(MAX_AXES) As Boolean
|
||||
Public b_axis_events_enable As Boolean = False
|
||||
Public d_axis_position(MAX_AXES) As Double
|
||||
Public d_axis_delta(MAX_AXES) As Double
|
||||
Public b_axis_valid(MAX_AXES) As Boolean
|
||||
|
||||
Public d_DReadELS_value As Double
|
||||
Public n_DReadELS_handle As Short
|
||||
Public d_DReadELS_value As Double
|
||||
Public n_DReadELS_handle As Short
|
||||
|
||||
Public d_Dvariable_values(MAX_VAR) As Double
|
||||
Public b_Dvariable_changed As Boolean = False
|
||||
Public d_Dvariable_values(MAX_VAR) As Double
|
||||
Public b_Dvariable_changed As Boolean = False
|
||||
|
||||
Public d_DInterpo_values(MAX_AXES) As Double
|
||||
Public d_DInterpo_Prog_Feed As Double
|
||||
Public d_DInterpo_Feed_override As Double
|
||||
Public l_channel_override(MAX_VALUES) As Long
|
||||
Public b_feed_changed As Boolean = False
|
||||
Public d_DInterpo_values(MAX_AXES) As Double
|
||||
Public d_DInterpo_Prog_Feed As Double
|
||||
Public d_DInterpo_Feed_override As Double
|
||||
Public l_channel_override(MAX_VALUES) As Long
|
||||
Public b_feed_changed As Boolean = False
|
||||
|
||||
Public n_activate_error_code As Short
|
||||
Public n_activate_error_code As Short
|
||||
|
||||
Public d_spindle_prog(MAX_VALUES) As Double
|
||||
Public d_spindle_eff(MAX_VALUES) As Double
|
||||
Public n_spindle_override(MAX_VALUES) As Short
|
||||
Public b_spindle_data_changed As Boolean = False
|
||||
Public d_spindle_prog(MAX_VALUES) As Double
|
||||
Public d_spindle_eff(MAX_VALUES) As Double
|
||||
Public n_spindle_override(MAX_VALUES) As Short
|
||||
Public b_spindle_data_changed As Boolean = False
|
||||
|
||||
Public d_spindle_power As Double
|
||||
Public b_spindle_power_changed As Boolean = False
|
||||
Public d_spindle_power As Double
|
||||
Public b_spindle_power_changed As Boolean = False
|
||||
|
||||
Public Tools(MAX_TOOLS) As ToolStructure
|
||||
Public b_Tool_data_changed As Boolean = False
|
||||
Public Tools(MAX_TOOLS) As ToolStructure
|
||||
Public b_Tool_data_changed As Boolean = False
|
||||
|
||||
Public sz_PLC_error_messages As String
|
||||
Public sz_PLC_error_messages As String
|
||||
Public sz_NC_error_messages As List(Of String)
|
||||
Public b_PLC_error As Boolean
|
||||
Public b_NC_error As Boolean
|
||||
Public b_PLC_error As Boolean
|
||||
Public b_NC_error As Boolean
|
||||
Public bIsErrorMessage As Boolean = True
|
||||
|
||||
Public bSpindleState As Boolean
|
||||
@@ -99,59 +99,61 @@ Public MustInherit Class CN_generico
|
||||
Public bLaserState As Boolean
|
||||
Public bPowerOvr As Double
|
||||
|
||||
Public m_szCnDataVar(NUM_DATA - 1) As String
|
||||
Public nMachineMode As Integer
|
||||
|
||||
Public Event NewPositionData(ByVal sender As Object)
|
||||
Public Event NewPosDeltaData(ByVal sender As Object)
|
||||
Public Event NewVarChanged(ByVal sender As Object)
|
||||
Public m_szCnDataVar(NUM_DATA - 1) As String
|
||||
|
||||
Protected Overridable Sub OnNewPositionData()
|
||||
RaiseEvent NewPositionData(0)
|
||||
End Sub
|
||||
Protected Overridable Sub OnNewPosDeltaData()
|
||||
RaiseEvent NewPosDeltaData(0)
|
||||
End Sub
|
||||
Protected Overridable Sub OnNewVarChanged()
|
||||
RaiseEvent NewVarChanged(0)
|
||||
End Sub
|
||||
Public Event NewPositionData(ByVal sender As Object)
|
||||
Public Event NewPosDeltaData(ByVal sender As Object)
|
||||
Public Event NewVarChanged(ByVal sender As Object)
|
||||
|
||||
Protected Overridable Sub OnNewPositionData()
|
||||
RaiseEvent NewPositionData(0)
|
||||
End Sub
|
||||
Protected Overridable Sub OnNewPosDeltaData()
|
||||
RaiseEvent NewPosDeltaData(0)
|
||||
End Sub
|
||||
Protected Overridable Sub OnNewVarChanged()
|
||||
RaiseEvent NewVarChanged(0)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " Metodi pubblici"
|
||||
|
||||
Public MustOverride Function Init() As boolean
|
||||
Public MustOverride Function Init() As Boolean
|
||||
|
||||
Public MustOverride Sub ReadEls_Add_Parameter(sz_var As String, n_par As Short)
|
||||
Public MustOverride Sub ReadEls_Add_Parameter(sz_var As String, n_par As Short)
|
||||
|
||||
Public MustOverride Sub DVariables_WriteVariables(sz_parameters As String, sz_values As String)
|
||||
Public MustOverride Sub DVariables_WriteVariables(sz_parameters As String, sz_values As String)
|
||||
|
||||
Public MustOverride Sub DVariables_WriteVariables2(sz_parameters As String, sz_values As String)
|
||||
Public MustOverride Sub DVariables_WriteVariables2(sz_parameters As String, sz_values As String)
|
||||
|
||||
Public MustOverride Function MDI_command() As Short
|
||||
|
||||
Public MustOverride Function ActivateProgram(n_part_program As Integer) As Int16
|
||||
Public MustOverride Function ActivateProgram(n_part_program As Integer) As Int16
|
||||
|
||||
Public MustOverride Sub set_OP_OM(n As Short)
|
||||
Public MustOverride Sub set_OP_OM(n As Short)
|
||||
|
||||
Public MustOverride Function DPOsition_ReadOnce() As Short
|
||||
Public MustOverride Function DPOsition_ReadOnce() As Short
|
||||
|
||||
Public MustOverride Function DGeneralFunctions_CycleStart() As Int16
|
||||
Public MustOverride Function DGeneralFunctions_CycleStart() As Int16
|
||||
|
||||
Public MustOverride Function DGeneralFunctions_FeedHold() As Int16
|
||||
Public MustOverride Function DGeneralFunctions_FeedHold() As Int16
|
||||
|
||||
Public MustOverride Function DGeneralFunctions_Reset() As Int16
|
||||
Public MustOverride Function DGeneralFunctions_Reset() As Int16
|
||||
|
||||
Public MustOverride Function DGeneralFunctions_WriteCncMode(nmode As Short) As Int16
|
||||
Public MustOverride Function DGeneralFunctions_WriteCncMode(nmode As Short) As Int16
|
||||
|
||||
Public MustOverride Function Write_var_1(sz_par As String, lvalue As Long) As Int16
|
||||
Public MustOverride Function Write_var_1(sz_par As String, lvalue As Long) As Int16
|
||||
|
||||
Public MustOverride Function Download_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||
Public MustOverride Function Download_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||
|
||||
Public MustOverride Function Upload_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||
Public MustOverride Function Upload_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||
|
||||
Public MustOverride Function Delete_NC_prog(sz_NC_filename As String) As Int16
|
||||
Public MustOverride Function Delete_NC_prog(sz_NC_filename As String) As Int16
|
||||
|
||||
Public MustOverride Function DTool_set_read_range(n_start As Short, n_stop As Short) As Short
|
||||
Public MustOverride Function DTool_set_read_range(n_start As Short, n_stop As Short) As Short
|
||||
|
||||
Public MustOverride Function DTool_write_tool(n_tool_number As Short, Length_X As Double, Radius As Double, TipRadius_Z As Double, _
|
||||
DLength_X As Double, DTipRadius_Z As Double, _
|
||||
|
||||
+60
-7
@@ -52,10 +52,26 @@ Public Class ChooseMachining
|
||||
'Creo lista lavorazioni froretto e fresa
|
||||
If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
|
||||
CreateMachiningList(MCH_MY.DRILLING, m_CurrentMachine.sCurrDrill, m_DrillingList)
|
||||
' Se la lista è vuota cancello la lavorazione corrente di questo tipo
|
||||
If m_DrillingList.Count = 0 Then
|
||||
m_CurrentMachine.sCurrDrilling = String.Empty
|
||||
End If
|
||||
CreateMachiningList(MCH_MY.MILLING, m_CurrentMachine.sCurrMill, m_MillingList)
|
||||
' Se la lista è vuota cancello la lavorazione corrente di questo tipo
|
||||
If m_MillingList.Count = 0 Then
|
||||
m_CurrentMachine.sCurrMilling = String.Empty
|
||||
End If
|
||||
ElseIf m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
|
||||
CreateMachiningList(MCH_MY.DRILLING, m_DrillingList)
|
||||
' Se la lista è vuota cancello la lavorazione corrente di questo tipo
|
||||
If m_DrillingList.Count = 0 Then
|
||||
m_CurrentMachine.sCurrDrilling = String.Empty
|
||||
End If
|
||||
CreateMachiningList(MCH_MY.MILLING, m_MillingList)
|
||||
' Se la lista è vuota cancello la lavorazione corrente di questo tipo
|
||||
If m_MillingList.Count = 0 Then
|
||||
m_CurrentMachine.sCurrMilling = String.Empty
|
||||
End If
|
||||
End If
|
||||
' Definizione di due righe della tabella con la giusta altezza
|
||||
For Index = 0 To 1
|
||||
@@ -71,7 +87,11 @@ Public Class ChooseMachining
|
||||
Me.Height = 341.2
|
||||
m_RowNumber += 2
|
||||
End Select
|
||||
CurrSawingCmBx.SelectedItem = If(Not IsNothing(m_SawingList(0)), m_SawingList(0), Nothing)
|
||||
If m_SawingList.Count > 0 Then
|
||||
CurrSawingCmBx.SelectedItem = m_SawingList(0)
|
||||
Else
|
||||
m_MainWindow.m_CurrentMachine.sCurrSawing = String.Empty
|
||||
End If
|
||||
|
||||
If Not m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAW Then
|
||||
If m_CurrentMachine.bDrilling Then
|
||||
@@ -114,13 +134,13 @@ Public Class ChooseMachining
|
||||
If EgtMdbGetFirstMachining(MachiningType, MachiningName) Then
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, MachiningTool)
|
||||
If MachiningTool = CurrTool Then
|
||||
If MachiningTool = CurrTool And VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
While EgtMdbGetNextMachining(MachiningType, MachiningName)
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, MachiningTool)
|
||||
If MachiningTool = CurrTool Then
|
||||
If MachiningTool = CurrTool And VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
End While
|
||||
@@ -128,6 +148,31 @@ Public Class ChooseMachining
|
||||
|
||||
End Sub
|
||||
|
||||
'Funzione che data la stringa di materiali e spessori della lavorazione, e i dati del grezzo corrente, restituisce se la lavorazione è valida oppure no
|
||||
Private Function VerifyMatThickCompatibility() As Boolean
|
||||
If Not IsNothing(m_CurrentMachine.CurrMat) Then
|
||||
Dim SysNotes As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
||||
If SysNotes <> String.Empty Then
|
||||
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
|
||||
SysNotes = String.Empty
|
||||
For Each Material In MachiningMaterials
|
||||
Dim Param() As String = Material.Split(",".ToCharArray)
|
||||
If Param(0) = m_CurrentMachine.CurrMat.nId.ToString Then
|
||||
If m_MainWindow.m_RawPartPage.GetRawHeight > Param(1) And m_MainWindow.m_RawPartPage.GetRawHeight < Param(2) Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub CreateMachiningList(MachiningType As Integer, MachiningList As List(Of String))
|
||||
'Cerco tutte le lavorazioni che utilizzano un utensile presente nel portautensile e le aggiungo alla lista
|
||||
Dim MachiningTool As String = String.Empty
|
||||
@@ -138,7 +183,9 @@ Public Class ChooseMachining
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, MachiningTool)
|
||||
For Each ToolChangerPos In m_CurrentMachine.ToolChanger
|
||||
If MachiningTool = ToolChangerPos.sTool Then
|
||||
MachiningList.Add(MachiningName)
|
||||
If VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
ToolFound = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -146,7 +193,9 @@ Public Class ChooseMachining
|
||||
If Not ToolFound Then
|
||||
For Each ToolChangerPos In m_CurrentMachine.ManualToolChanger
|
||||
If MachiningTool = ToolChangerPos.sTool Then
|
||||
MachiningList.Add(MachiningName)
|
||||
If VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
@@ -157,7 +206,9 @@ Public Class ChooseMachining
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, MachiningTool)
|
||||
For Each ToolChangerPos In m_CurrentMachine.ToolChanger
|
||||
If MachiningTool = ToolChangerPos.sTool Then
|
||||
MachiningList.Add(MachiningName)
|
||||
If VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
ToolFound = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -165,7 +216,9 @@ Public Class ChooseMachining
|
||||
If Not ToolFound Then
|
||||
For Each ToolChangerPos In m_CurrentMachine.ManualToolChanger
|
||||
If MachiningTool = ToolChangerPos.sTool Then
|
||||
MachiningList.Add(MachiningName)
|
||||
If VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
+208
-14
@@ -1,4 +1,5 @@
|
||||
Imports EgtUILib
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class CurrentMachine
|
||||
|
||||
@@ -54,6 +55,15 @@ Public Class CurrentMachine
|
||||
' Lista portautensili
|
||||
Private m_ManualToolChanger As New List(Of ToolChangerPos)
|
||||
|
||||
' Lista dei materiali
|
||||
Private m_Materials As New observablecollection(Of Material)
|
||||
|
||||
' Massimo id della lista materiali nel file ini
|
||||
Private m_MaxIdMat As Integer
|
||||
|
||||
' Materiale correntemente attivo (dell'ultimo grezzo impostato)
|
||||
Private m_CurrMat As Material
|
||||
|
||||
Friend Enum MountedToolConfigs As Integer
|
||||
SAW = 0
|
||||
SAWANDAUXTOOL = 1
|
||||
@@ -138,7 +148,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSaw(0)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRSAW, value, m_MainWindow.GetIniFile()) Then
|
||||
If WritePrivateProfileString(S_MACH, K_CURRSAW, value, sMachIniFile) Then
|
||||
m_sCurrSaw(0) = value
|
||||
m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = value
|
||||
End If
|
||||
@@ -150,7 +160,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrDrill(0)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRDRILL, value, m_MainWindow.GetIniFile()) Then
|
||||
If WritePrivateProfileString(S_MACH, K_CURRDRILL, value, sMachIniFile) Then
|
||||
m_sCurrDrill(0) = value
|
||||
End If
|
||||
End Set
|
||||
@@ -161,7 +171,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrMill(0)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRMILL, value, m_MainWindow.GetIniFile()) Then
|
||||
If WritePrivateProfileString(S_MACH, K_CURRMILL, value, sMachIniFile) Then
|
||||
m_sCurrMill(0) = value
|
||||
End If
|
||||
End Set
|
||||
@@ -172,7 +182,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSawing
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRSAWING, value, m_MainWindow.GetIniFile()) Then
|
||||
If WritePrivateProfileString(S_MACH, K_CURRSAWING, value, sMachIniFile) Then
|
||||
m_sCurrSawing = value
|
||||
End If
|
||||
End Set
|
||||
@@ -183,7 +193,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrDrilling
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRDRILLING, value, m_MainWindow.GetIniFile()) Then
|
||||
If WritePrivateProfileString(S_MACH, K_CURRDRILLING, value, sMachIniFile) Then
|
||||
m_sCurrDrilling = value
|
||||
End If
|
||||
End Set
|
||||
@@ -194,7 +204,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrMilling
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRMILLING, value, m_MainWindow.GetIniFile()) Then
|
||||
If WritePrivateProfileString(S_MACH, K_CURRMILLING, value, sMachIniFile) Then
|
||||
m_sCurrMilling = value
|
||||
End If
|
||||
End Set
|
||||
@@ -273,6 +283,98 @@ Public Class CurrentMachine
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property Materials As ObservableCollection(Of Material)
|
||||
Get
|
||||
Return m_Materials
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Sub AddMaterial(value As Material)
|
||||
For Each Material In Materials
|
||||
If Material.nId = value.nId Then
|
||||
Exit Sub
|
||||
End If
|
||||
Next
|
||||
WritePrivateProfileMaterial(S_MATERIALS, K_MATERIAL & m_MaxIdMat + 1, value, sMachIniFile)
|
||||
m_MaxIdMat += 1
|
||||
Materials.Add(value)
|
||||
End Sub
|
||||
|
||||
Friend Sub RemoveMaterial(value As Material)
|
||||
' Se è il materiale corrente lo tolgo
|
||||
If Not IsNothing(CurrMat) AndAlso CurrMat.nId = value.nId Then
|
||||
CurrMat = Nothing
|
||||
End If
|
||||
' Rimuovo il materiale dall'elenco
|
||||
Dim Index As Integer
|
||||
For Index = 0 To Materials.Count - 1
|
||||
If Materials(Index).nId = value.nId Then
|
||||
m_Materials.Remove(Materials(Index))
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Dim TempMat As Material = Nothing
|
||||
For I = Index To m_MaxIdMat - 1
|
||||
GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & I + 2, TempMat, sMachIniFile)
|
||||
WritePrivateProfileMaterial(S_MATERIALS, K_MATERIAL & I + 1, TempMat, sMachIniFile)
|
||||
Next
|
||||
WritePrivateProfileMaterial(S_MATERIALS, K_MATERIAL & m_MaxIdMat, Nothing, sMachIniFile)
|
||||
m_MaxIdMat -= 1
|
||||
' Rimuovo il materiale dall'elenco di tutte le lavorazioni
|
||||
Dim MachiningName As String = String.Empty
|
||||
Dim bFound As Boolean = EgtMdbGetFirstMachining(MCH_MY.SAWING, MachiningName)
|
||||
While bFound
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
SearchAndRemoveMat(value.nId)
|
||||
bFound = EgtMdbGetNextMachining(MCH_MY.SAWING, MachiningName)
|
||||
End While
|
||||
bFound = EgtMdbGetFirstMachining(MCH_MY.DRILLING, MachiningName)
|
||||
While bFound
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
SearchAndRemoveMat(value.nId)
|
||||
bFound = EgtMdbGetNextMachining(MCH_MY.DRILLING, MachiningName)
|
||||
End While
|
||||
bFound = EgtMdbGetFirstMachining(MCH_MY.MILLING, MachiningName)
|
||||
While bFound
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
SearchAndRemoveMat(value.nId)
|
||||
bFound = EgtMdbGetNextMachining(MCH_MY.DRILLING, MachiningName)
|
||||
End While
|
||||
|
||||
End Sub
|
||||
|
||||
' Funzione che dato l'Id di un materiale lo rimuove dalla lavorazione corrente
|
||||
Friend Sub SearchAndRemoveMat(valueId As Integer)
|
||||
Dim SysNotes As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
||||
If SysNotes <> String.Empty Then
|
||||
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
|
||||
SysNotes = String.Empty
|
||||
For Each Material In MachiningMaterials
|
||||
Dim Param() As String = Material.Split(",".ToCharArray)
|
||||
If Param(0) <> valueId.ToString Then
|
||||
SysNotes &= Material & ";"
|
||||
End If
|
||||
Next
|
||||
If SysNotes(SysNotes.Length - 1) = ";" Then
|
||||
SysNotes = SysNotes.Substring(0, SysNotes.Length - 1)
|
||||
End If
|
||||
EgtMdbSetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
||||
End If
|
||||
EgtMdbSaveCurrMachining()
|
||||
End Sub
|
||||
|
||||
Friend Property CurrMat As Material
|
||||
Get
|
||||
Return m_CurrMat
|
||||
End Get
|
||||
Set(value As Material)
|
||||
Dim CurrMatId As String = If(Not IsNothing(value), value.nId.ToString, "")
|
||||
WritePrivateProfileString(S_MATERIALS, K_CURRMATERIAL, CurrMatId, sMachIniFile)
|
||||
m_CurrMat = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Sub New()
|
||||
@@ -324,19 +426,19 @@ Public Class CurrentMachine
|
||||
|
||||
' Leggo utensili correnti
|
||||
' lama
|
||||
GetPrivateProfileString(S_MACH, K_CURRSAW, Nothing, m_sCurrSaw(0), m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_MACH, K_CURRSAW, Nothing, m_sCurrSaw(0), sMachIniFile)
|
||||
' foretto
|
||||
GetPrivateProfileString(S_MACH, K_CURRDRILL, Nothing, m_sCurrDrill(0), m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_MACH, K_CURRDRILL, Nothing, m_sCurrDrill(0), sMachIniFile)
|
||||
' fresa
|
||||
GetPrivateProfileString(S_MACH, K_CURRMILL, Nothing, m_sCurrMill(0), m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_MACH, K_CURRMILL, Nothing, m_sCurrMill(0), sMachIniFile)
|
||||
|
||||
' Leggo lavorazioni correnti
|
||||
' lama
|
||||
GetPrivateProfileString(S_MACH, K_CURRSAWING, Nothing, m_sCurrSawing, m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_MACH, K_CURRSAWING, Nothing, m_sCurrSawing, sMachIniFile)
|
||||
' foretto
|
||||
GetPrivateProfileString(S_MACH, K_CURRDRILLING, Nothing, m_sCurrDrilling, m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_MACH, K_CURRDRILLING, Nothing, m_sCurrDrilling, sMachIniFile)
|
||||
' fresa
|
||||
GetPrivateProfileString(S_MACH, K_CURRMILLING, Nothing, m_sCurrMilling, m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_MACH, K_CURRMILLING, Nothing, m_sCurrMilling, sMachIniFile)
|
||||
|
||||
' Leggo numero di portautensili
|
||||
m_ToolChangerNum = GetPrivateProfileInt(S_TOOLCHANGER, K_NUMBER, 0, sMachIniFile)
|
||||
@@ -361,8 +463,62 @@ Public Class CurrentMachine
|
||||
m_ManualToolChanger.Add(New ToolChangerPos(Index, sName, sTool))
|
||||
Next
|
||||
|
||||
'Creo materiale di default e lo aggiungo alla lista
|
||||
'm_Materials.Add(New Material(0, "Generico"))
|
||||
' Leggo la lista dei materiali
|
||||
Dim Material As Material = Nothing
|
||||
Dim nIndex As Integer = 1
|
||||
While (GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & nIndex, Material, sMachIniFile))
|
||||
m_Materials.Add(Material)
|
||||
nIndex += 1
|
||||
End While
|
||||
' Salvo massimo indice a cui sono arrivato per usarlo quando devo aggiungere nuovi elementi alla lista
|
||||
m_MaxIdMat = nIndex - 1
|
||||
|
||||
' Leggo materiale correntemente attivo
|
||||
Dim CurrMatId As Integer = GetPrivateProfileInt(S_MATERIALS, K_CURRMATERIAL, 0, sMachIniFile)
|
||||
For Each Material In Materials
|
||||
If Material.nId = CurrMatId Then
|
||||
m_CurrMat = Material
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Function GetPrivateProfileMaterial(
|
||||
ByVal lpAppName As String,
|
||||
ByVal lpKeyName As String,
|
||||
ByRef Material As Material,
|
||||
ByVal lpFileName As String) As Boolean
|
||||
|
||||
Dim sVal As String = String.Empty
|
||||
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
If sItems.Count() = 2 Then
|
||||
Material = New Material(sItems(0), sItems(1))
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
|
||||
End Function
|
||||
|
||||
Friend Function WritePrivateProfileMaterial(
|
||||
ByVal lpAppName As String,
|
||||
ByVal lpKeyName As String,
|
||||
ByVal Material As Material,
|
||||
ByVal lpFileName As String) As Boolean
|
||||
|
||||
Dim MatStr As String = Nothing
|
||||
If Not IsNothing(Material) Then
|
||||
MatStr = Material.nId.ToString & "," & Material.sName
|
||||
End If
|
||||
If WritePrivateProfileString(lpAppName, lpKeyName, MatStr, sMachIniFile) Then
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Class ToolChangerPos
|
||||
@@ -398,4 +554,42 @@ Class ToolChangerPos
|
||||
m_sTool = sTool
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
End Class
|
||||
|
||||
Friend Class Material
|
||||
|
||||
Private m_nId As Integer
|
||||
Private m_sName As String
|
||||
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sName As String, MaterialList As ObservableCollection(Of Material))
|
||||
Dim nMaxId As Integer = 0
|
||||
For Each Material In MaterialList
|
||||
If Material.nId > nMaxId Then
|
||||
nMaxId = Material.nId
|
||||
End If
|
||||
Next
|
||||
m_nId = nMaxId + 1
|
||||
m_sName = sName
|
||||
End Sub
|
||||
|
||||
Sub New(nId As Integer, sName As String)
|
||||
m_nId = nId
|
||||
m_sName = sName
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -119,7 +119,7 @@ Public Class CurrentProjectPageUC
|
||||
NewProject()
|
||||
End If
|
||||
EgtResetModified()
|
||||
' Altrimenti ne imposto uno nuovo
|
||||
' Altrimenti ne imposto uno nuovo
|
||||
Else
|
||||
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
|
||||
NewProject()
|
||||
@@ -136,11 +136,10 @@ Public Class CurrentProjectPageUC
|
||||
' inibisco selezione diretta da Scene
|
||||
CurrentProjectScene.SetStatusNull()
|
||||
' Imposto dati progetto
|
||||
If m_MainWindow.m_nCurrentMaterial >= 0 And
|
||||
m_MainWindow.m_nCurrentMaterial < m_MainWindow.m_MaterialsList.Count() Then
|
||||
MaterialTxBx.Text = m_MainWindow.m_MaterialsList(m_MainWindow.m_nCurrentMaterial).Name
|
||||
If Not IsNothing(m_MainWindow.m_CurrentMachine.CurrMat) Then
|
||||
MaterialTxBx.Text = m_MainWindow.m_CurrentMachine.CurrMat.sName
|
||||
Else
|
||||
MaterialTxBx.Text = ""
|
||||
MaterialTxBx.Text = "Non definito"
|
||||
End If
|
||||
|
||||
Dim sCurrMach As String = String.Empty
|
||||
|
||||
@@ -71,6 +71,11 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="ManualModeBtn" Grid.Column="2"
|
||||
Style="{StaticResource OmagCut_YellowGradientYellowIconButton}">
|
||||
<Image Source="Resources/Manual.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -52,8 +52,6 @@ Public Class DirectCutPageUC
|
||||
|
||||
Private Sub DirectCutPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
m_ActiveDirectCutPage = DirectCutPages.DirectCut
|
||||
' Imposto modalità manuale della macchina
|
||||
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||
End Sub
|
||||
|
||||
Private Sub ManualBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualBtn.Click
|
||||
@@ -103,4 +101,9 @@ Public Class DirectCutPageUC
|
||||
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_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -970,7 +970,7 @@ Namespace Num
|
||||
|
||||
Select Case m_nCnDataVarInd(ni)
|
||||
Case CnData.Mode ' (0) modo 0:AUTO;1:SEQ;2:MDI;3:RAPIDO;4:SERCH;5:EDIT;6:TEST;7:MANUALE;
|
||||
' ...
|
||||
nMachineMode = CInt(values(n))
|
||||
Case CnData.JogIncr ' (1) Tipo man. 0:0.1 u; 1:1 u; 2:10 u; 3:100 u; 4:1 mm; 5:10 mm; 6:ILL; 8:HANDWEEL; 9:0.01 u; 10:0.001 u;
|
||||
' ...
|
||||
Case CnData.Feed ' (2)
|
||||
|
||||
+1
-1
@@ -999,7 +999,7 @@ Namespace Num
|
||||
|
||||
If b_int_NC_error Then
|
||||
|
||||
RemoveAll(sz_NC_error_messages)
|
||||
sz_NC_error_messages.Clear()
|
||||
|
||||
nErrorLineNum = 0
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ Public Class MachineButtonsUC
|
||||
|
||||
' Se modalità Debug metto immaginette fisse e tolgo bottoni in eccesso
|
||||
If Not m_MainWindow.m_bNCLink Then
|
||||
For nIndex = 0 To 4
|
||||
For nIndex = 0 To 2
|
||||
Try
|
||||
Dim s As String = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayN(nIndex)
|
||||
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
|
||||
@@ -115,13 +115,15 @@ Public Class MachineButtonsUC
|
||||
EgtOutLog("Error loading image " & ImageArrayN(nIndex + 1))
|
||||
End Try
|
||||
Next
|
||||
Try
|
||||
Dim s As String = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(3)
|
||||
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
|
||||
GetImage(4).Source = sButtonImageSource
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error loading image " & ImageArrayN(nIndex + 1))
|
||||
End Try
|
||||
For nIndex = 3 To 4
|
||||
Try
|
||||
Dim s As String = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(nIndex)
|
||||
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
|
||||
GetImage(nIndex + 1).Source = sButtonImageSource
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error loading image " & ImageArrayN(nIndex + 1))
|
||||
End Try
|
||||
Next
|
||||
For I = 6 To 10
|
||||
GetToggleButton(I).Visibility = Windows.Visibility.Hidden
|
||||
Next
|
||||
@@ -140,7 +142,11 @@ Public Class MachineButtonsUC
|
||||
If CurrentBtn.IsChecked Then
|
||||
EgtLuaExecFile(m_MainWindow.GetMachinesRootDir() & "\" & m_MainWindow.GetCurrMachine() & "\DirectCmd\" & CommandArrayY(GetToggleButtonIndex(CurrentBtn) - 1))
|
||||
Else
|
||||
EgtLuaExecFile(m_MainWindow.GetMachinesRootDir() & "\" & m_MainWindow.GetCurrMachine() & "\DirectCmd\" & CommandArrayN(GetToggleButtonIndex(CurrentBtn) - 1))
|
||||
If Not (StateFlagArray(GetToggleButtonIndex(CurrentBtn) - 1) = "ThreeAxis" Or StateFlagArray(GetToggleButtonIndex(CurrentBtn) - 1) = "FiveAxis") Then
|
||||
EgtLuaExecFile(m_MainWindow.GetMachinesRootDir() & "\" & m_MainWindow.GetCurrMachine() & "\DirectCmd\" & CommandArrayN(GetToggleButtonIndex(CurrentBtn) - 1))
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
StringToDouble(m_DirectCutPage.m_ManualAxesMove.FeedTxBx.Text, dTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.F", dTemp)
|
||||
|
||||
+11
-1
@@ -501,7 +501,17 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ListBox Name="MaterialsList" Grid.ColumnSpan="4" Margin="5,5,5,0"
|
||||
ItemTemplate="{DynamicResource NameIdLsBxItem}"/>
|
||||
ItemTemplate="{DynamicResource NameIdLsBxItem}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_LightGray}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock Name="MinThicknessTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports OmagCUT.TreeViewItem
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
@@ -346,13 +347,14 @@ Public Class MachiningDbPageUC
|
||||
' SawTool.Add("")
|
||||
' ToolCmBx.SelectedItem = ""
|
||||
End If
|
||||
|
||||
' Pulisco lista materiali
|
||||
m_MaterialsList.Clear()
|
||||
' Creo lista materiali
|
||||
For Each Material In m_MainWindow.m_MaterialsList
|
||||
m_MaterialsList.Add(New MachiningMaterial(Material.Id, Material.Name))
|
||||
For Each Material In m_MainWindow.m_CurrentMachine.Materials
|
||||
m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName))
|
||||
Next
|
||||
Dim b As Boolean = EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, ToolString)
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, ToolString)
|
||||
If ToolString <> String.Empty Then
|
||||
Dim sItems() = ToolString.Split(";".ToCharArray)
|
||||
Dim Index As Integer = 0
|
||||
@@ -423,7 +425,7 @@ Public Class MachiningDbPageUC
|
||||
sMaterialString += Material.nId.ToString & "," & DoubleToString(Material.dMinThickness, 0) & "," & DoubleToString(Material.dMaxThickness, 0) & ";"
|
||||
End If
|
||||
Next
|
||||
Dim b As Boolean = EgtMdbSetCurrMachiningParam(MCH_MP.SYSNOTES, sMaterialString)
|
||||
EgtMdbSetCurrMachiningParam(MCH_MP.SYSNOTES, sMaterialString)
|
||||
End Sub
|
||||
|
||||
Private Sub ViewMachiningParams()
|
||||
@@ -649,6 +651,7 @@ Public Class MachiningDbPageUC
|
||||
End Class
|
||||
|
||||
Class MachiningMaterial
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
@@ -670,6 +673,7 @@ Class MachiningMaterial
|
||||
Return m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property dMinThickness As Double
|
||||
Get
|
||||
Return m_dMinThickness
|
||||
@@ -693,7 +697,10 @@ Class MachiningMaterial
|
||||
Return m_bIsActive
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsActive = value
|
||||
If value <> m_bIsActive Then
|
||||
m_bIsActive = value
|
||||
NotifyPropertyChanged("bIsActive")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -705,4 +712,10 @@ Class MachiningMaterial
|
||||
m_bIsActive = False
|
||||
End Sub
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
+1
-53
@@ -63,10 +63,6 @@ Class MainWindow
|
||||
Friend m_OpenItemList As New ObservableCollection(Of IconListBoxItem)
|
||||
Friend m_PhotoItemList As New ObservableCollection(Of IconListBoxItem)
|
||||
|
||||
' Dichiarazione lista materiali e materiale corrente
|
||||
Friend m_MaterialsList As New List(Of Material)
|
||||
Friend m_nCurrentMaterial As Integer = 0
|
||||
|
||||
' Riferimento alla pagina correntemente attiva
|
||||
Friend m_ActivePage As Pages
|
||||
|
||||
@@ -270,23 +266,7 @@ Class MainWindow
|
||||
'Disabilita la possibilità di imitare il click del tasto destro del mouse tenendo premuto il dito sul touch
|
||||
'NB: Se abilitato impedisce di utilizzare lo stato Pressed dei Button che quindi non si evidenziano quando premuti
|
||||
Stylus.SetIsPressAndHoldEnabled(Me, False)
|
||||
' Leggo lista materiali da file ini
|
||||
Dim index As Integer = 1
|
||||
Dim sMaterial As String = String.Empty
|
||||
While GetPrivateProfileString(S_MATERIALS, K_MATERIAL & index, "", sMaterial, GetIniFile) > 0
|
||||
Dim cMaterial As New Material(sMaterial)
|
||||
m_MaterialsList.Add(cMaterial)
|
||||
index += 1
|
||||
End While
|
||||
' Leggo materiale corrente da file ini
|
||||
Dim sCurrentMaterial As String = String.Empty
|
||||
GetPrivateProfileString(S_MATERIALS, K_CURRMATERIAL, "", sCurrentMaterial, GetIniFile)
|
||||
For i As Integer = 0 To m_MaterialsList.Count - 1
|
||||
If sCurrentMaterial = m_MaterialsList(i).Name Then
|
||||
m_nCurrentMaterial = i
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
' Imposto i messaggi letti dal file dei messaggi
|
||||
WorkInProgressBtn.Content = EgtMsg(MSG_GENERAL + 1)
|
||||
DirectCutBtn.Content = EgtMsg(MSG_GENERAL + 2)
|
||||
@@ -744,9 +724,6 @@ Class MainWindow
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindow_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
If m_nCurrentMaterial >= 0 And m_nCurrentMaterial < m_MaterialsList.Count() Then
|
||||
WritePrivateProfileString(S_MATERIALS, K_CURRMATERIAL, m_MaterialsList(m_nCurrentMaterial).Name, GetIniFile())
|
||||
End If
|
||||
' Chiudo il gestore della macchina fotografica
|
||||
m_CadCutPageUC.m_Camera.Close()
|
||||
' Terminazione generale di EgtInterface
|
||||
@@ -783,33 +760,4 @@ Class MainWindow
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Friend Class Material
|
||||
|
||||
Private Shared pId As Integer = 0
|
||||
Private m_iId As Integer
|
||||
Private m_sName As String
|
||||
|
||||
Public ReadOnly Property Id As Integer
|
||||
Get
|
||||
Return m_iId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sName As String)
|
||||
m_iId = pId
|
||||
Name = sName
|
||||
pId += 1
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
+34
-18
@@ -22,8 +22,7 @@
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
@@ -31,30 +30,47 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock x:Name="FeedTxBl" Grid.Column="0" Grid.Row="0"
|
||||
|
||||
<ToggleButton x:Name="G0Btn" Grid.Row="0" Height="60" Width="60"
|
||||
Style="{StaticResource OmagCut_BlueIconToggleButton}">
|
||||
<TextBlock Name="G0TxBl" Text="G0" FontSize="29"/>
|
||||
</ToggleButton>
|
||||
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock x:Name="FeedTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{StaticResource OmagCut_SingleUpperCaseCharacterTextBlock}" />
|
||||
<EgtWPFLib:EgtTextBox Name="FeedTxBx" Grid.Column="1" Width="150"
|
||||
<EgtWPFLib:EgtTextBox Name="FeedTxBx" Grid.Column="1" Margin="10.5,0,10.5,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<TextBlock x:Name="SpeedTxBl" Grid.Column="0" Grid.Row="1"
|
||||
<TextBlock x:Name="SpeedTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{StaticResource OmagCut_SingleUpperCaseCharacterTextBlock}" />
|
||||
<EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1" Grid.Row="1" Width="150"
|
||||
<EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1" Grid.Row="1" Margin="10.5,0,10.5,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<Button x:Name="L1Btn" Grid.Row="2" Height="60" Width="60" Style="{StaticResource OmagCut_BlueTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="L1TxBx" Grid.Column="1" Grid.Row="2" Width="150"
|
||||
|
||||
</Grid>
|
||||
|
||||
<Button x:Name="L1Btn" Grid.Row="1" Height="60" Width="60" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="L1TxBx" Grid.Column="1" Grid.Row="1" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<Button x:Name="L2Btn" Grid.Row="3" Height="60" Width="60" Style="{StaticResource OmagCut_BlueTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox x:Name="L2TxBx" Grid.Column="1" Grid.Row="3" Width="150"
|
||||
<Button x:Name="L2Btn" Grid.Row="2" Height="60" Width="60" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox x:Name="L2TxBx" Grid.Column="1" Grid.Row="2" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<Button x:Name="L3Btn" Grid.Row="4" Height="60" Width="60" Style="{StaticResource OmagCut_BlueTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox x:Name="L3TxBx" Grid.Column="1" Grid.Row="4" Width="150"
|
||||
<Button x:Name="L3Btn" Grid.Row="3" Height="60" Width="60" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox x:Name="L3TxBx" Grid.Column="1" Grid.Row="3" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<Button x:Name="R1Btn" Grid.Row="5" Height="60" Width="60" Style="{StaticResource OmagCut_BlueTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox x:Name="R1TxBx" Grid.Column="1" Grid.Row="5" Width="150"
|
||||
<Button x:Name="R1Btn" Grid.Row="4" Height="60" Width="60" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox x:Name="R1TxBx" Grid.Column="1" Grid.Row="4" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<Button x:Name="R2Btn" Grid.Row="6" Height="60" Width="60" Style="{StaticResource OmagCut_BlueTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox x:Name="R2TxBx" Grid.Column="1" Grid.Row="6" Width="150"
|
||||
<Button x:Name="R2Btn" Grid.Row="5" Height="60" Width="60" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox x:Name="R2TxBx" Grid.Column="1" Grid.Row="5" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<Grid Grid.Row="7" Grid.ColumnSpan="2">
|
||||
|
||||
@@ -7,6 +7,9 @@ Public Class ManualAxesMoveUC
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
Friend m_CN As CN_generico
|
||||
|
||||
' Modalità di movimento (G0 o G1)
|
||||
Private m_bG0Active As Boolean
|
||||
|
||||
' Timer per aggiornamento nomi assi
|
||||
Private m_Timer As New DispatcherTimer
|
||||
|
||||
@@ -39,6 +42,8 @@ Public Class ManualAxesMoveUC
|
||||
' Lancio timer per aggiornamento interfaccia
|
||||
m_Timer.Interval = TimeSpan.FromMilliseconds(200)
|
||||
m_Timer.Start()
|
||||
'Imposto movimenti in rapido
|
||||
G0Btn.IsChecked = True
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateAxesNames()
|
||||
@@ -71,6 +76,7 @@ Public Class ManualAxesMoveUC
|
||||
Dim dTemp As Double = 0
|
||||
Dim CmdString As String = String.Empty
|
||||
EgtLuaExecFile(m_MainWindow.GetMachinesRootDir() & "\" & m_MainWindow.GetCurrMachine() & "\DirectCmd\AxesMove.lua")
|
||||
EgtLuaSetGlobBoolVar("CMD.G0", m_bG0Active)
|
||||
StringToLen(FeedTxBx.Text, dTemp)
|
||||
EgtLuaSetGlobNumVar("CMD.F", dTemp)
|
||||
StringToDouble(SpeedTxBx.Text, dTemp)
|
||||
@@ -151,4 +157,40 @@ Public Class ManualAxesMoveUC
|
||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
||||
End Sub
|
||||
|
||||
'Private Sub G0Btn_Click(sender As Object, e As RoutedEventArgs) Handles G0Btn.Click
|
||||
' If G0Btn.IsChecked Then
|
||||
' m_bG0Active = True
|
||||
' G0TxBl.Foreground = Application.Current.FindResource("OmagCut_Blue")
|
||||
' FeedTxBl.Foreground = Application.Current.FindResource("OmagCut_Gray")
|
||||
' FeedTxBx.IsEnabled = False
|
||||
' SpeedTxBl.Foreground = Application.Current.FindResource("OmagCut_Gray")
|
||||
' SpeedTxBx.IsEnabled = False
|
||||
' Else
|
||||
' m_bG0Active = False
|
||||
' G0TxBl.Foreground = Application.Current.FindResource("OmagCut_Gray")
|
||||
' FeedTxBl.Foreground = Brushes.Black
|
||||
' FeedTxBx.IsEnabled = True
|
||||
' SpeedTxBl.Foreground = Brushes.Black
|
||||
' SpeedTxBx.IsEnabled = True
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Private Sub G0Btn_Checked(sender As Object, e As RoutedEventArgs) Handles G0Btn.Checked
|
||||
m_bG0Active = True
|
||||
G0TxBl.Foreground = Application.Current.FindResource("OmagCut_Blue")
|
||||
FeedTxBl.Foreground = Application.Current.FindResource("OmagCut_Gray")
|
||||
FeedTxBx.IsEnabled = False
|
||||
SpeedTxBl.Foreground = Application.Current.FindResource("OmagCut_Gray")
|
||||
SpeedTxBx.IsEnabled = False
|
||||
End Sub
|
||||
|
||||
Private Sub G0Btn_Unchecked(sender As Object, e As RoutedEventArgs) Handles G0Btn.Unchecked
|
||||
m_bG0Active = False
|
||||
G0TxBl.Foreground = Application.Current.FindResource("OmagCut_Gray")
|
||||
FeedTxBl.Foreground = Brushes.Black
|
||||
FeedTxBx.IsEnabled = True
|
||||
SpeedTxBl.Foreground = Brushes.Black
|
||||
SpeedTxBx.IsEnabled = True
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -523,6 +523,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ToolChangerPos.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Manual.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||
|
||||
+10
-1
@@ -397,7 +397,6 @@
|
||||
<Setter Property="KeyboardDimension" Value="300"/>
|
||||
</Style>
|
||||
|
||||
|
||||
<Style x:Key="OmagCut_FixedTextBox" TargetType="{x:Type EgtWPFLib:EgtTextBox}" BasedOn="{StaticResource OmagCut_TextBox}">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Gray}"/>
|
||||
<Setter Property="IsReadOnly" Value="True"/>
|
||||
@@ -442,6 +441,16 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OmagCut_BlueIconTransparentToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource OmagCut_ToggleButton}">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Blue}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="ToggleButton.Background" Value="{StaticResource OmagCut_Yellow}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OmagCut_YellowToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource OmagCut_ToggleButton_Wrap}">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Yellow}"/>
|
||||
<Setter Property="Background" Value="{StaticResource OmagCut_LightGray}"/>
|
||||
|
||||
+6
-5
@@ -14,11 +14,12 @@
|
||||
<ColumnDefinition Width="7*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="0.75*"/>
|
||||
<RowDefinition Height="7.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="LanguageGpBx" Style="{StaticResource OmagCut_GroupBox}">
|
||||
<GroupBox Name="LanguageGpBx" Grid.RowSpan="2" Style="{StaticResource OmagCut_GroupBox}">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
@@ -26,7 +27,7 @@
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
@@ -53,9 +54,9 @@
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ComboBox Name="UnitsOfMeasureCmBx" Grid.Column="1" Grid.Row="1">
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@
|
||||
Background="LightGray" >
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding Name}" FontSize="20" />
|
||||
<Label Content="{Binding sName}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
@@ -32,7 +32,7 @@ Public Class RawPartPageUC
|
||||
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
'Associazione della lista materiali alla combobox
|
||||
MaterialsCmbx.ItemsSource = m_MainWindow.m_MaterialsList
|
||||
MaterialsCmbx.ItemsSource = m_MainWindow.m_CurrentMachine.Materials
|
||||
|
||||
'Associazione tag textbox e label per visualizzare nome nella calcolatrice
|
||||
LengthTxBx.Tag = LengthTxBl
|
||||
@@ -116,7 +116,7 @@ Public Class RawPartPageUC
|
||||
' Aggiorno grezzo
|
||||
UpdateRawPart()
|
||||
' Imposto il materiale corrente nella combobox
|
||||
MaterialsCmbx.SelectedIndex = m_MainWindow.m_nCurrentMaterial
|
||||
MaterialsCmbx.SelectedItem = m_MainWindow.m_CurrentMachine.CurrMat
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||
@@ -259,8 +259,13 @@ Public Class RawPartPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub MaterialsCmbx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MaterialsCmbx.SelectionChanged
|
||||
m_MainWindow.m_nCurrentMaterial = MaterialsCmbx.SelectedIndex
|
||||
m_CurrProjPage.MaterialTxBx.Text = m_MainWindow.m_MaterialsList(m_MainWindow.m_nCurrentMaterial).Name
|
||||
If Not IsNothing(MaterialsCmbx.SelectedItem) Then
|
||||
m_MainWindow.m_CurrentMachine.CurrMat = MaterialsCmbx.SelectedItem
|
||||
m_CurrProjPage.MaterialTxBx.Text = m_MainWindow.m_CurrentMachine.CurrMat.sName
|
||||
Else
|
||||
m_MainWindow.m_CurrentMachine.CurrMat = Nothing
|
||||
m_CurrProjPage.MaterialTxBx.Text = "Non definito"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
+3
-3
@@ -374,7 +374,7 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<Border Name="AbsorptionBrd" Grid.Column="0" Grid.Row="23" Grid.ColumnSpan="4" Grid.RowSpan="3"
|
||||
<Border Name="AbsorptionBrd" Grid.Column="0" Grid.Row="23" Grid.ColumnSpan="4" Grid.RowSpan="4"
|
||||
Style="{StaticResource OmagCut_NoNameGroupBorder}" Margin="0,2,0,0">
|
||||
|
||||
<Grid>
|
||||
@@ -398,9 +398,9 @@
|
||||
|
||||
</Border>
|
||||
|
||||
<TextBlock Name="MaxMatTxBl" Grid.Column="0" Grid.Row="26" Grid.RowSpan="3"
|
||||
<TextBlock Name="MaxMatTxBl" Grid.Column="0" Grid.Row="27" Grid.RowSpan="3"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="MaxMatTxBx" Grid.Column="1" Grid.Row="26" Grid.RowSpan="3" Width="150"
|
||||
<EgtWPFLib:EgtTextBox Name="MaxMatTxBx" Grid.Column="1" Grid.Row="27" Grid.RowSpan="3" Width="150"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -133,12 +133,4 @@ Module Utility
|
||||
|
||||
End Function
|
||||
|
||||
'Funzione che permette di svuotare una ObservableCollection aggiornando il bind, perchè Clear non lo fa
|
||||
Public Sub RemoveAll(list As IList)
|
||||
Dim nListCount As Integer = list.Count
|
||||
For Index = 0 To nListCount - 1
|
||||
list.RemoveAt(Index)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="MachViewModeBtn" Grid.Column="1" Content="MHT"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}" Height="84" Margin="1,1,1,0" VerticalAlignment="Top"/>
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user