EgtCAM5 :
- Migliorie SetUp. - Migliorie simulazione.
This commit is contained in:
@@ -46,5 +46,7 @@
|
||||
Public Const S_FIXTURES As String = "Fixtures"
|
||||
|
||||
Public Const S_SETUP As String = "SetUp"
|
||||
Public Const K_ACTIVEDEFAULT As String = "ActiveDefault"
|
||||
Public Const K_DEFAULT As String = "Default"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
<Compile Include="Internals\MruList.vb" />
|
||||
<Compile Include="MachineModel.vb" />
|
||||
<Compile Include="MachiningsDbWindow\MachiningTreeView.vb" />
|
||||
<Compile Include="MachOptionsWindow\MachOptionModule.vb" />
|
||||
<Compile Include="MachOptionsWindow\MachOptionsView.xaml.vb">
|
||||
<DependentUpon>MachOptionsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -222,6 +223,7 @@
|
||||
<DependentUpon>MachiningParameterExpanderView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectPage\OptionPanel\MachiningOptionPanel\OperationExpander\OperationListBoxItem\OperationListBoxItem.vb" />
|
||||
<Compile Include="ProjectPage\OptionPanel\MachiningOptionPanel\SimulationExpander\MachineAxis.vb" />
|
||||
<Compile Include="ProjectPage\PopUpGridPanel\PopUpGridPanelView.xaml.vb">
|
||||
<DependentUpon>PopUpGridPanelView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -484,6 +484,10 @@
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToolsComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter Property="Margin" Value="0,0,5,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="GridViewPanelRadioButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="30"/>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Module MachOptionModule
|
||||
|
||||
' Parametro che indica se è attivo l'attrezzaggio di default
|
||||
Friend m_bIsActiveDefaultSetUp As Boolean
|
||||
' Parametro che indica quale è l'attrezzaggio di default correntemente selezionato
|
||||
Friend m_sSelectedDefaultSetUp As String
|
||||
|
||||
End Module
|
||||
@@ -8,13 +8,13 @@
|
||||
BorderBrush="{StaticResource EgaltechBlue1}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||
CloseCommand="{Binding CloseMachOptionsCommand, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
CloseCommand="{Binding CloseMachOptionsCommand, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" SizeToContent="WidthAndHeight">
|
||||
|
||||
<EgtWPFLib5:EgtCustomWindow.Resources>
|
||||
<local:SplitArcTypeConverter x:Key="SplitArcTypeConverter"/>
|
||||
</EgtWPFLib5:EgtCustomWindow.Resources>
|
||||
|
||||
<Grid Margin="3">
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -22,18 +22,21 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<UniformGrid Columns="2">
|
||||
<TextBlock Text="{Binding SafeZMsg}" VerticalAlignment="Center" Margin="5,0,0,0"/>
|
||||
<TextBox Text="{Binding SafeZ}" Height="25" Margin="5"/>
|
||||
<UniformGrid Columns="2" Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding SafeZMsg}" VerticalAlignment="Center"/>
|
||||
<TextBox Text="{Binding SafeZ}" Height="25" Margin="5,0,0,0"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Row="1" Columns="2">
|
||||
<TextBlock Text="{Binding SplitArcsMsg}" VerticalAlignment="Center" Margin="5,0,0,0"/>
|
||||
<ComboBox ItemsSource="{Binding SplitArcsList}" Height="25" Margin="5,0,5,0"
|
||||
|
||||
<UniformGrid Grid.Row="1" Columns="2" Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding SplitArcsMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding SplitArcsList}" Height="25" Margin="5,0,0,0"
|
||||
SelectedItem="{Binding SelectedSplitArcs}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -42,6 +45,22 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</UniformGrid>
|
||||
|
||||
<Grid Grid.Row="2" Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding ActivateDefaultSetUpMsg}" VerticalAlignment="Center"/>
|
||||
<CheckBox IsChecked="{Binding IsActiveDefaultSetUp}" Grid.Column="1" Margin="5,0,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<UniformGrid Grid.Row="3" Columns="2">
|
||||
<TextBlock Text="{Binding DefaultSetUpMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding ArchivedSetUpList}" Height="25" Margin="5,0,0,0"
|
||||
SelectedItem="{Binding SelectedDefaultSetUp}" IsEnabled="{Binding IsActiveDefaultSetUp}"/>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
Imports EgtUILib
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Namespace EgtCAM5
|
||||
|
||||
Public Class MachOptionsViewModel
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdCloseMachOptions As ICommand
|
||||
|
||||
Private m_dSafeZ As String
|
||||
Public Property SafeZ As String
|
||||
Get
|
||||
@@ -40,6 +38,36 @@ Namespace EgtCAM5
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property IsActiveDefaultSetUp As Boolean
|
||||
Get
|
||||
Return MachOptionModule.m_bIsActiveDefaultSetUp
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
MachOptionModule.m_bIsActiveDefaultSetUp = value
|
||||
EgtUILib.WritePrivateProfileString(S_SETUP, K_ACTIVEDEFAULT, If(value, 1, 0).ToString, IniFile.m_sCurrMachIniFilePath)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ArchivedSetUpList As New List(Of String)
|
||||
Public Property ArchivedSetUpList As List(Of String)
|
||||
Get
|
||||
Return m_ArchivedSetUpList
|
||||
End Get
|
||||
Set(value As List(Of String))
|
||||
m_ArchivedSetUpList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SelectedDefaultSetUp As String
|
||||
Get
|
||||
Return MachOptionModule.m_sSelectedDefaultSetUp
|
||||
End Get
|
||||
Set(value As String)
|
||||
MachOptionModule.m_sSelectedDefaultSetUp = value
|
||||
EgtUILib.WritePrivateProfileString(S_SETUP, K_DEFAULT, If(Not IsNothing(value), value & ".stu", String.Empty), IniFile.m_sCurrMachIniFilePath)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property SafeZMsg As String
|
||||
@@ -52,9 +80,22 @@ Namespace EgtCAM5
|
||||
Return EgtMsg(MSG_MACHININGOPTIONPAGE + 2)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ActivateDefaultSetUpMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_MACHININGOPTIONPAGE + 7)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DefaultSetUpMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_MACHININGOPTIONPAGE + 8)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdCloseMachOptions As ICommand
|
||||
|
||||
Sub New()
|
||||
' Leggo distanza di sicurezza
|
||||
Dim dVal As Double = 0
|
||||
@@ -64,6 +105,19 @@ Namespace EgtCAM5
|
||||
Dim nVal As Integer = 0
|
||||
EgtMdbGetGeneralParam(MCH_GP.SPLITARCS, nVal)
|
||||
m_SelectedSplitArcs = DirectCast(nVal, MCH_SA)
|
||||
' Riempio lista attrezzaggi salvati
|
||||
Dim SetUpFileNames() As String = Directory.GetFiles(IniFile.m_sCurrMachSetUpDirPath)
|
||||
For FileIndex = 0 To SetUpFileNames.Count - 1
|
||||
If Path.GetExtension(SetUpFileNames(FileIndex)).ToLower = ".stu" Then
|
||||
m_ArchivedSetUpList.Add(Path.GetFileNameWithoutExtension(SetUpFileNames(FileIndex)))
|
||||
End If
|
||||
Next
|
||||
' Leggo se attivo attrezzaggio predefinito
|
||||
m_bIsActiveDefaultSetUp = EgtUILib.GetPrivateProfileInt(S_SETUP, K_ACTIVEDEFAULT, 0, IniFile.m_sCurrMachIniFilePath) <> 0
|
||||
' Leggo attrezzaggio predefinito
|
||||
If EgtUILib.GetPrivateProfileString(S_SETUP, K_DEFAULT, "", m_sSelectedDefaultSetUp, IniFile.m_sCurrMachIniFilePath) <= 0 Then
|
||||
m_sSelectedDefaultSetUp = Nothing
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
@@ -121,8 +121,8 @@ Namespace EgtCAM5
|
||||
''' </summary>
|
||||
Public Sub MachOptions(ByVal param As Object)
|
||||
Dim MachOptionWindow As New MachOptionsView
|
||||
MachOptionWindow.Height = 614
|
||||
MachOptionWindow.Width = 1024
|
||||
'MachOptionWindow.Height = 614
|
||||
'MachOptionWindow.Width = 256
|
||||
MachOptionWindow.DataContext = New MachOptionsViewModel
|
||||
MachOptionWindow.Owner = Application.Current.MainWindow
|
||||
MachOptionWindow.ShowDialog()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Namespace EgtCAM5
|
||||
@@ -81,14 +82,27 @@ Namespace EgtCAM5
|
||||
EgtGetMachGroupNewName(sNewMachName)
|
||||
Dim bOk As Boolean = (EgtAddMachGroup(sNewMachName) <> GDB_ID.NULL)
|
||||
Dim sInitScriptPath As String = String.Empty
|
||||
Dim sDefaultSetUpPath As String = String.Empty
|
||||
' leggo nome script di disposizione automatica
|
||||
EgtUILib.GetPrivateProfileString(S_DISPOSITION, K_INITSCRIPT, "", sInitScriptPath, IniFile.m_sCurrMachIniFilePath)
|
||||
' leggo nome attrezzaggio di default
|
||||
EgtUILib.GetPrivateProfileString(S_DISPOSITION, K_ACTIVEDEFAULT, "", sDefaultSetUpPath, IniFile.m_sCurrMachIniFilePath)
|
||||
' se è attivo, uso lo script di disposizione
|
||||
If bOk AndAlso OptionModule.m_bUseDispositionScript And Not String.IsNullOrEmpty(sInitScriptPath) Then
|
||||
sInitScriptPath = IniFile.m_sCurrMachScriptsDirPath & "\" & sInitScriptPath
|
||||
If Not EgtLuaExecFile(sInitScriptPath) Then
|
||||
If Not File.Exists(sInitScriptPath) AndAlso Not EgtLuaExecFile(sInitScriptPath) Then
|
||||
EgtOutLog("Error executing disposition init script " & sInitScriptPath)
|
||||
MessageBox.Show(EgtMsg(MSG_DISPOSITIONERRORS + 1), EgtMsg(MSG_DISPOSITIONERRORS + 2) & " " & sInitScriptPath, MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
End If
|
||||
End If
|
||||
' se è attiva l'opzione, rendo corrente l'attrezzaggio di default
|
||||
If bOk AndAlso MachOptionModule.m_bIsActiveDefaultSetUp And Not String.IsNullOrEmpty(sInitScriptPath) Then
|
||||
sDefaultSetUpPath = IniFile.m_sCurrMachScriptsDirPath & "\" & sDefaultSetUpPath
|
||||
'If Not File.Exists(sDefaultSetUpPath) AndAlso Not EgtLuaExecFile(sInitScriptPath) Then
|
||||
' EgtOutLog("Error executing disposition init script " & sInitScriptPath)
|
||||
' MessageBox.Show(EgtMsg(MSG_DISPOSITIONERRORS + 1), EgtMsg(MSG_DISPOSITIONERRORS + 2) & " " & sInitScriptPath, MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
'End If
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MachineAxis
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_IsReadOnlyAxesValue As Boolean
|
||||
Public Property IsReadOnlyAxesValue As Boolean
|
||||
Get
|
||||
NotifyPropertyChanged("IsEnabledAxesValue")
|
||||
Return m_IsReadOnlyAxesValue
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnlyAxesValue = value
|
||||
NotifyPropertyChanged("IsReadOnlyAxesValue")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsEnabledAxesValue As Boolean
|
||||
Get
|
||||
Return Not m_IsReadOnlyAxesValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdManualAxisModify As ICommand
|
||||
|
||||
Private m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
NotifyPropertyChanged("Name")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Value As String
|
||||
Public Property Value As String
|
||||
Get
|
||||
Return m_Value
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Value = value
|
||||
NotifyPropertyChanged("Value")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "ManualAxisModifyCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that create a new tool.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ManualAxisModifyCommand As ICommand
|
||||
Get
|
||||
If m_cmdManualAxisModify Is Nothing Then
|
||||
m_cmdManualAxisModify = New Command(AddressOf ManualAxisModify)
|
||||
End If
|
||||
Return m_cmdManualAxisModify
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Creata the new tool. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Public Sub ManualAxisModify(ByVal param As Object)
|
||||
Dim dVal As Double
|
||||
StringToDouble(m_Value, dVal)
|
||||
EgtSetAxisPos(m_Name, dVal)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' ManualAxisModifyCommand
|
||||
|
||||
#End Region
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
+44
-45
@@ -1,11 +1,50 @@
|
||||
<UserControl x:Class="SimulationExpanderView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
|
||||
|
||||
<UserControl.Resources>
|
||||
<sys:String x:Key="A1">A1</sys:String>
|
||||
<sys:String x:Key="A2">A2</sys:String>
|
||||
<sys:String x:Key="A3">A3</sys:String>
|
||||
<sys:String x:Key="A4">A4</sys:String>
|
||||
<sys:String x:Key="A5">A5</sys:String>
|
||||
<sys:String x:Key="A6">A6</sys:String>
|
||||
<sys:String x:Key="A7">A7</sys:String>
|
||||
<sys:String x:Key="A8">A8</sys:String>
|
||||
</UserControl.Resources>
|
||||
|
||||
<StackPanel>
|
||||
<Expander Header="{Binding SimulationMsg}" IsExpanded="{Binding IsExpanded}" Style="{StaticResource ExpanderStyle}">
|
||||
<StackPanel >
|
||||
<StackPanel>
|
||||
|
||||
<ItemsControl Grid.Row="10" ItemsSource="{Binding MachineAxisList}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="5,1,10,1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding Name}" FontSize="15"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
<TextBox Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1"
|
||||
IsReadOnly="{Binding IsReadOnlyAxesValue}"
|
||||
IsEnabled="{Binding IsEnabledAxesValue}"
|
||||
TextAlignment="Right">
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding ManualAxisModifyCommand}"/>
|
||||
</TextBox.InputBindings>
|
||||
</TextBox>
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -15,55 +54,15 @@
|
||||
<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*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding A1Name}" Grid.Column="0" Grid.Row="0" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding A1Value}" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
Width="120" TextAlignment="Right" Style="{StaticResource EgtCAM5_SimulationTextBox}"/>
|
||||
<TextBlock Text="{Binding A2Name}" Grid.Column="0" Grid.Row="1" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding A2Value}" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Width="120" TextAlignment="Right" Style="{StaticResource EgtCAM5_SimulationTextBox}"/>
|
||||
<TextBlock Text="{Binding A3Name}" Grid.Column="0" Grid.Row="2" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding A3Value}" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2"
|
||||
Width="120" TextAlignment="Right" Style="{StaticResource EgtCAM5_SimulationTextBox}"/>
|
||||
<TextBlock Text="{Binding A4Name}" Grid.Column="0" Grid.Row="3" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding A4Value}" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2"
|
||||
Width="120" TextAlignment="Right" Style="{StaticResource EgtCAM5_SimulationTextBox}"/>
|
||||
<TextBlock Text="{Binding A5Name}" Grid.Column="0" Grid.Row="4" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding A5Value}" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2"
|
||||
Width="120" TextAlignment="Right" Style="{StaticResource EgtCAM5_SimulationTextBox}"/>
|
||||
<TextBlock Text="{Binding A6Name}" Grid.Column="0" Grid.Row="5" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding A6Value}" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="2"
|
||||
Width="120" TextAlignment="Right" Style="{StaticResource EgtCAM5_SimulationTextBox}"/>
|
||||
<TextBlock Text="{Binding A7Name}" Grid.Column="0" Grid.Row="6" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding A7Value}" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="2"
|
||||
Width="120" TextAlignment="Right" Style="{StaticResource EgtCAM5_SimulationTextBox}"/>
|
||||
<TextBlock Text="{Binding A8Name}" Grid.Column="0" Grid.Row="7" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding A8Value}" Grid.Column="1" Grid.Row="7" Grid.ColumnSpan="2"
|
||||
Width="120" TextAlignment="Right" Style="{StaticResource EgtCAM5_SimulationTextBox}"/>
|
||||
<TextBlock Text="{Binding GCode}" Grid.Column="0" Grid.Row="8" FontSize="15" HorizontalAlignment="Center"
|
||||
<TextBlock Text="{Binding GCode}" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" Margin="5,5,5,0" Grid.ColumnSpan="2" />
|
||||
<TextBlock Text="{Binding FValue}" Grid.Column="2" Grid.Row="8" FontSize="15" HorizontalAlignment="Center"
|
||||
<TextBlock Text="{Binding FValue}" Grid.Column="2" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,5,5,5" />
|
||||
<TextBlock Text="{Binding TName}" Grid.Column="0" Grid.Row="9" FontSize="15" HorizontalAlignment="Center"
|
||||
<TextBlock Text="{Binding TName}" Grid.Row="1" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Center" Margin="5,5,5,0" Grid.ColumnSpan="2" />
|
||||
<TextBlock Text="{Binding SValue}" Grid.Column="2" Grid.Row="9" FontSize="15" HorizontalAlignment="Center"
|
||||
<TextBlock Text="{Binding SValue}" Grid.Column="2" Grid.Row="1" FontSize="15" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" TextAlignment="Right" Margin="0,5,5,5" />
|
||||
|
||||
</Grid>
|
||||
|
||||
+66
-225
@@ -1,4 +1,5 @@
|
||||
Imports System.IO
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Namespace EgtCAM5
|
||||
@@ -20,7 +21,25 @@ Namespace EgtCAM5
|
||||
ST_STEP = 3
|
||||
ST_PAUSE = 4
|
||||
End Enum
|
||||
Private m_nStatus As Integer = SIM_ST.ST_STOP
|
||||
Private m_nStatus As SIM_ST = SIM_ST.ST_STOP
|
||||
Private Property SimulationStatus As SIM_ST
|
||||
Get
|
||||
Return m_nStatus
|
||||
End Get
|
||||
Set(value As SIM_ST)
|
||||
m_nStatus = value
|
||||
If IniFile.m_nUserLevel >= 10 AndAlso (value = SIM_ST.ST_PAUSE OrElse value = SIM_ST.ST_STOP) Then
|
||||
For Index = 0 To m_MachineAxisList.Count - 1
|
||||
m_MachineAxisList(Index).IsReadOnlyAxesValue = False
|
||||
Next
|
||||
Else
|
||||
For Index = 0 To m_MachineAxisList.Count - 1
|
||||
m_MachineAxisList(Index).IsReadOnlyAxesValue = True
|
||||
Next
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Stato bottone Play
|
||||
Private m_bShowPlay As Boolean = True
|
||||
' Coefficiente per valore Slider
|
||||
@@ -50,212 +69,12 @@ Namespace EgtCAM5
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A1Name As String
|
||||
Public Property A1Name As String
|
||||
' lista degli assi
|
||||
Private m_MachineAxisList As New ObservableCollection(Of MachineAxis)
|
||||
Public ReadOnly Property MachineAxisList As ObservableCollection(Of MachineAxis)
|
||||
Get
|
||||
Return m_A1Name
|
||||
Return m_MachineAxisList
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A1Name Then
|
||||
m_A1Name = value
|
||||
OnPropertyChanged("A1Name")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A1Value As String
|
||||
Public Property A1Value As String
|
||||
Get
|
||||
Return m_A1Value
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A1Value Then
|
||||
m_A1Value = value
|
||||
OnPropertyChanged("A1Value")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A2Name As String
|
||||
Public Property A2Name As String
|
||||
Get
|
||||
Return m_A2Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A2Name Then
|
||||
m_A2Name = value
|
||||
OnPropertyChanged("A2Name")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A2Value As String
|
||||
Public Property A2Value As String
|
||||
Get
|
||||
Return m_A2Value
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A2Value Then
|
||||
m_A2Value = value
|
||||
OnPropertyChanged("A2Value")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A3Name As String
|
||||
Public Property A3Name As String
|
||||
Get
|
||||
Return m_A3Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A3Name Then
|
||||
m_A3Name = value
|
||||
OnPropertyChanged("A3Name")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A3Value As String
|
||||
Public Property A3Value As String
|
||||
Get
|
||||
Return m_A3Value
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A3Value Then
|
||||
m_A3Value = value
|
||||
OnPropertyChanged("A3Value")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A4Name As String
|
||||
Public Property A4Name As String
|
||||
Get
|
||||
Return m_A4Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A4Name Then
|
||||
m_A4Name = value
|
||||
OnPropertyChanged("A4Name")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A4Value As String
|
||||
Public Property A4Value As String
|
||||
Get
|
||||
Return m_A4Value
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A4Value Then
|
||||
m_A4Value = value
|
||||
OnPropertyChanged("A4Value")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A5Name As String
|
||||
Public Property A5Name As String
|
||||
Get
|
||||
Return m_A5Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A5Name Then
|
||||
m_A5Name = value
|
||||
OnPropertyChanged("A5Name")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A5Value As String
|
||||
Public Property A5Value As String
|
||||
Get
|
||||
Return m_A5Value
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A5Value Then
|
||||
m_A5Value = value
|
||||
OnPropertyChanged("A5Value")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A6Name As String
|
||||
Public Property A6Name As String
|
||||
Get
|
||||
Return m_A6Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A6Name Then
|
||||
m_A6Name = value
|
||||
OnPropertyChanged("A6Name")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A6Value As String
|
||||
Public Property A6Value As String
|
||||
Get
|
||||
Return m_A6Value
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A6Value Then
|
||||
m_A6Value = value
|
||||
OnPropertyChanged("A6Value")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A7Name As String
|
||||
Public Property A7Name As String
|
||||
Get
|
||||
Return m_A7Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A7Name Then
|
||||
m_A7Name = value
|
||||
OnPropertyChanged("A7Name")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A7Value As String
|
||||
Public Property A7Value As String
|
||||
Get
|
||||
Return m_A7Value
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A7Value Then
|
||||
m_A7Value = value
|
||||
OnPropertyChanged("A7Value")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A8Name As String
|
||||
Public Property A8Name As String
|
||||
Get
|
||||
Return m_A8Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A8Name Then
|
||||
m_A8Name = value
|
||||
OnPropertyChanged("A8Name")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_A8Value As String
|
||||
Public Property A8Value As String
|
||||
Get
|
||||
Return m_A8Value
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_A8Value Then
|
||||
m_A8Value = value
|
||||
OnPropertyChanged("A8Value")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_GCode As String
|
||||
@@ -421,7 +240,7 @@ Namespace EgtCAM5
|
||||
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, "")
|
||||
' Se stato stop, devo avviare simulazione
|
||||
If m_nStatus = SIM_ST.ST_STOP Then
|
||||
m_nStatus = SIM_ST.ST_STEP
|
||||
SimulationStatus = SIM_ST.ST_STEP
|
||||
' Aggiorno bottone
|
||||
m_bShowPlay = False
|
||||
OnPropertyChanged("PlayPauseImage")
|
||||
@@ -431,7 +250,7 @@ Namespace EgtCAM5
|
||||
OnPropertyChanged("PlayPauseImage")
|
||||
' Alrimenti imposto solo il nuovo stato
|
||||
Else
|
||||
m_nStatus = SIM_ST.ST_STEP
|
||||
SimulationStatus = SIM_ST.ST_STEP
|
||||
' Aggiornamenti per bottone Play/Pause
|
||||
m_bShowPlay = False
|
||||
OnPropertyChanged("PlayPauseImage")
|
||||
@@ -466,13 +285,13 @@ Namespace EgtCAM5
|
||||
' Eseguo
|
||||
If m_nStatus = SIM_ST.ST_STOP Then
|
||||
' Lancio simulazione
|
||||
m_nStatus = SIM_ST.ST_PLAY
|
||||
SimulationStatus = SIM_ST.ST_PLAY
|
||||
ExecSim()
|
||||
' Aggiorno bottone
|
||||
m_bShowPlay = True
|
||||
OnPropertyChanged("PlayPauseImage")
|
||||
ElseIf m_nStatus = SIM_ST.ST_PAUSE Then
|
||||
m_nStatus = SIM_ST.ST_PLAY
|
||||
SimulationStatus = SIM_ST.ST_PLAY
|
||||
End If
|
||||
Else
|
||||
' Aggiorno bottone
|
||||
@@ -480,7 +299,7 @@ Namespace EgtCAM5
|
||||
OnPropertyChanged("PlayPauseImage")
|
||||
' Se play o step, imposto stato pausa
|
||||
If m_nStatus = SIM_ST.ST_PLAY Or m_nStatus = SIM_ST.ST_STEP Then
|
||||
m_nStatus = SIM_ST.ST_PAUSE
|
||||
SimulationStatus = SIM_ST.ST_PAUSE
|
||||
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 11)) ' Pausa
|
||||
End If
|
||||
End If
|
||||
@@ -522,7 +341,7 @@ Namespace EgtCAM5
|
||||
m_bShowPlay = True
|
||||
OnPropertyChanged("PlayPauseImage")
|
||||
' Imposto il nuovo stato
|
||||
m_nStatus = SIM_ST.ST_STOP
|
||||
SimulationStatus = SIM_ST.ST_STOP
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -569,7 +388,7 @@ Namespace EgtCAM5
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Imposto stato corrente
|
||||
m_nStatus = SIM_ST.ST_STOP
|
||||
SimulationStatus = SIM_ST.ST_STOP
|
||||
m_bShowPlay = True
|
||||
m_SliderX = GetPrivateProfileDouble(S_SIMUL, K_SLIDERX, 1)
|
||||
Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
|
||||
@@ -589,7 +408,7 @@ Namespace EgtCAM5
|
||||
|
||||
Private Sub ResetSimulation()
|
||||
' Termino la simulazione
|
||||
m_nStatus = SIM_ST.ST_STOP
|
||||
SimulationStatus = SIM_ST.ST_STOP
|
||||
EgtSimStop()
|
||||
' Salvo valore dello slider
|
||||
Dim sVal As String = DoubleToString(SliderValue, 1)
|
||||
@@ -613,7 +432,7 @@ Namespace EgtCAM5
|
||||
If bMove Then
|
||||
If m_nStatus = SIM_ST.ST_STEP And nMove = MCH_SIM.END_STEP Then
|
||||
' Imposto stato Pausa
|
||||
m_nStatus = SIM_ST.ST_PAUSE
|
||||
SimulationStatus = SIM_ST.ST_PAUSE
|
||||
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 11)) ' Pausa
|
||||
' Aggiornamenti per bottone Play/Pause
|
||||
m_bShowPlay = True
|
||||
@@ -621,7 +440,7 @@ Namespace EgtCAM5
|
||||
End If
|
||||
' Se movimento non riuscito
|
||||
Else
|
||||
m_nStatus = SIM_ST.ST_STOP
|
||||
SimulationStatus = SIM_ST.ST_STOP
|
||||
' Aggiornamenti per bottone Play/Pause
|
||||
m_bShowPlay = True
|
||||
OnPropertyChanged("PlayPauseImage")
|
||||
@@ -656,21 +475,43 @@ Namespace EgtCAM5
|
||||
|
||||
Private Sub ShowCncData()
|
||||
' Assi
|
||||
Dim nInd As Integer = 0
|
||||
ShowAxisNameVal(nInd, A1Name, A1Value)
|
||||
ShowAxisNameVal(nInd, A2Name, A2Value)
|
||||
ShowAxisNameVal(nInd, A3Name, A3Value)
|
||||
ShowAxisNameVal(nInd, A4Name, A4Value)
|
||||
ShowAxisNameVal(nInd, A5Name, A5Value)
|
||||
ShowAxisNameVal(nInd, A6Name, A6Value)
|
||||
ShowAxisNameVal(nInd, A7Name, A7Value)
|
||||
ShowAxisNameVal(nInd, A8Name, A8Value)
|
||||
Dim nEgtIndex As Integer = 0
|
||||
Dim nAxisIndex As Integer = 0
|
||||
Dim sInfo As String = String.Empty
|
||||
Dim bLinear As Boolean = True
|
||||
Dim dVal As Double = 0
|
||||
While EgtSimGetAxisInfoPos(nEgtIndex, sInfo, bLinear, dVal)
|
||||
If sInfo <> "**" Then
|
||||
IsValidAxisIndex(nAxisIndex)
|
||||
m_MachineAxisList(nAxisIndex).Name = sInfo
|
||||
m_MachineAxisList(nAxisIndex).Value = If(bLinear, LenToString(dVal, -3), DoubleToString(dVal, -3))
|
||||
nAxisIndex += 1
|
||||
End If
|
||||
nEgtIndex += 1
|
||||
End While
|
||||
For ClearIndex = m_MachineAxisList.Count - 1 To nEgtIndex - 1
|
||||
m_MachineAxisList.RemoveAt(ClearIndex)
|
||||
Next
|
||||
'ShowAxisNameVal(nInd, A1Name, A1Value)
|
||||
'ShowAxisNameVal(nInd, A2Name, A2Value)
|
||||
'ShowAxisNameVal(nInd, A3Name, A3Value)
|
||||
'ShowAxisNameVal(nInd, A4Name, A4Value)
|
||||
'ShowAxisNameVal(nInd, A5Name, A5Value)
|
||||
'ShowAxisNameVal(nInd, A6Name, A6Value)
|
||||
'ShowAxisNameVal(nInd, A7Name, A7Value)
|
||||
'ShowAxisNameVal(nInd, A8Name, A8Value)
|
||||
' Tipo di movimento e feed
|
||||
ShowMoveTypeFeed()
|
||||
' Nome utensile e speed
|
||||
ShowToolNameSpeed()
|
||||
End Sub
|
||||
|
||||
Private Sub IsValidAxisIndex(nIndex As Integer)
|
||||
For Index = m_MachineAxisList.Count - 1 To nIndex
|
||||
m_MachineAxisList.Add(New MachineAxis)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Function ShowAxisNameVal(ByRef nInd As Integer, ByRef sName As String, ByRef sVal As String) As Boolean
|
||||
Dim sInfo As String = String.Empty
|
||||
Dim bLinear As Boolean = True
|
||||
|
||||
+136
-27
@@ -211,6 +211,30 @@ Namespace EgtCAM5
|
||||
Private Sub LoadMachinePositions()
|
||||
' recupero il gruppo del setup
|
||||
Dim nSetUpGroup As Integer = EgtGetCurrSetup()
|
||||
' '' leggo l'attrezzaggio del progetto
|
||||
''Dim sPosition As String = String.Empty
|
||||
''Dim IniIndex As Integer = 1
|
||||
' '' recupero stringa di ogni posizione
|
||||
''While EgtGetInfo(nSetUpGroup, K_POS & IniIndex, sPosition)
|
||||
'' ReadPositionString(IniIndex, sPosition)
|
||||
'' IniIndex += 1
|
||||
''End While
|
||||
' '' altrimenti
|
||||
''Dim bFound As Boolean = False
|
||||
''For GroupIndex = 0 To m_PositionGroupList.Count - 1
|
||||
'' If m_PositionGroupList(GroupIndex).PositionList.Count > 0 Then
|
||||
'' bFound = True
|
||||
'' Exit For
|
||||
'' End If
|
||||
''Next
|
||||
''If Not bFound Then
|
||||
' ne genero uno nuovo dalla configurazione nel file ini della macchina
|
||||
Dim Index As Integer = 1
|
||||
While CreateStdPosFromPosIndex(Index)
|
||||
Index += 1
|
||||
End While
|
||||
''End If
|
||||
|
||||
' leggo l'attrezzaggio del progetto
|
||||
Dim sPosition As String = String.Empty
|
||||
Dim IniIndex As Integer = 1
|
||||
@@ -219,21 +243,6 @@ Namespace EgtCAM5
|
||||
ReadPositionString(IniIndex, sPosition)
|
||||
IniIndex += 1
|
||||
End While
|
||||
' altrimenti
|
||||
Dim bFound As Boolean = False
|
||||
For GroupIndex = 0 To m_PositionGroupList.Count - 1
|
||||
If m_PositionGroupList(GroupIndex).PositionList.Count > 0 Then
|
||||
bFound = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bFound Then
|
||||
' ne genero uno nuovo dalla configurazione nel file ini della macchina
|
||||
Dim Index As Integer = 1
|
||||
While CreateStdPosFromPosIndex(Index)
|
||||
Index += 1
|
||||
End While
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -305,7 +314,7 @@ Namespace EgtCAM5
|
||||
' se ci sono almeno due elementi sono sicuro che ci sia la H
|
||||
If sItems.Count >= 2 Then
|
||||
sHead = sItems(1)
|
||||
m_PositionGroupList(nGroup - 1).PositionList.Add(New Position(sTcPos, sHead, EgtGetHeadExitCount(sHead)))
|
||||
''m_PositionGroupList(nGroup - 1).PositionList.Add(New Position(sTcPos, sHead, EgtGetHeadExitCount(sHead)))
|
||||
' se ci sono almeno tre elementi sono sicuro che ci sia almeno un'uscita attrezzata
|
||||
If sItems.Count >= 3 Then
|
||||
' separo le uscite divise dalla ,
|
||||
@@ -341,14 +350,20 @@ Namespace EgtCAM5
|
||||
' se lo trovo
|
||||
If bFound Then
|
||||
' cerco la relativa uscita
|
||||
For ExitIndex = 0 To m_PositionGroupList(nGroup - 1).PositionList(m_PositionGroupList(nGroup - 1).PositionList.Count - 1).ExitToolAssociationList.Count - 1
|
||||
Dim CurrExitToolAss As ExitToolAssociation = m_PositionGroupList(nGroup - 1).PositionList(m_PositionGroupList(nGroup - 1).PositionList.Count - 1).ExitToolAssociationList(ExitIndex)
|
||||
If CurrExitToolAss.ExitPar = sExitList(ToolIndex) Then
|
||||
' vi metto l'utensile e segno l'uscita come occupata
|
||||
CurrExitToolAss.Tool = TempTool
|
||||
CurrExitToolAss.IsOccupied = True
|
||||
' lo metto anche come utensile originale
|
||||
CurrExitToolAss.OrigTool = TempTool
|
||||
For PositionIndex = 0 To m_PositionGroupList(nGroup - 1).PositionList.Count - 1
|
||||
Dim TempPosition As Position = m_PositionGroupList(nGroup - 1).PositionList(PositionIndex)
|
||||
If TempPosition.TcPos = sTcPos Then
|
||||
For ExitIndex = 0 To TempPosition.ExitToolAssociationList.Count - 1
|
||||
Dim CurrExitToolAss As ExitToolAssociation = TempPosition.ExitToolAssociationList(ExitIndex)
|
||||
If CurrExitToolAss.ExitPar = sExitList(ToolIndex) Then
|
||||
' vi metto l'utensile e segno l'uscita come occupata
|
||||
CurrExitToolAss.Tool = TempTool
|
||||
CurrExitToolAss.IsOccupied = True
|
||||
' lo metto anche come utensile originale
|
||||
CurrExitToolAss.OrigTool = TempTool
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
@@ -363,12 +378,100 @@ Namespace EgtCAM5
|
||||
End If
|
||||
' non è presente la H, quindi la recupero dal modello delle posizioni nel file MachIni
|
||||
Else
|
||||
CreateStdPosFromPosIndex(nIndex)
|
||||
''CreateStdPosFromPosIndex(nIndex)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
'' Funzione che dati l'indice della posizione e la sua stringa di attrezzaggio, carica l'attrezzaggio descritto
|
||||
'Private Sub ReadPositionString(nIndex As Integer, sPosition As String)
|
||||
' Dim sTcPos As String = String.Empty
|
||||
' Dim sHead As String = String.Empty
|
||||
' Dim sExitList As New List(Of String)
|
||||
' Dim sToolList As New List(Of String)
|
||||
' ' la spezzo sui ;
|
||||
' Dim sItems() As String = sPosition.Split(";".ToCharArray)
|
||||
' ' se c'è almeno un elemento sono sicuro che ci sia la T
|
||||
' If sItems.Count() >= 1 Then
|
||||
' Dim nGroup As Integer = 0
|
||||
' sTcPos = sItems(0)
|
||||
' ' recupero il suo gruppo
|
||||
' If Not GetGroupFromTcPos(sTcPos, nGroup) Then
|
||||
' ' se non lo trovo lo metto nel primo
|
||||
' nGroup = 1
|
||||
' End If
|
||||
' If Not VerifyIndexValidity(nGroup) Then
|
||||
' ' se mi viene passato un indice non valido, lo metto nel primo
|
||||
' nGroup = 1
|
||||
' End If
|
||||
' ' se ci sono almeno due elementi sono sicuro che ci sia la H
|
||||
' If sItems.Count >= 2 Then
|
||||
' sHead = sItems(1)
|
||||
' m_PositionGroupList(nGroup - 1).PositionList.Add(New Position(sTcPos, sHead, EgtGetHeadExitCount(sHead)))
|
||||
' ' se ci sono almeno tre elementi sono sicuro che ci sia almeno un'uscita attrezzata
|
||||
' If sItems.Count >= 3 Then
|
||||
' ' separo le uscite divise dalla ,
|
||||
' Dim sExitToolAssList() As String = sItems(2).Split(",".ToCharArray)
|
||||
' sExitList.Clear()
|
||||
' sToolList.Clear()
|
||||
' ' creo le liste di uscite e utensili attrezzati ricavati
|
||||
' For AssIndex = 0 To sExitToolAssList.Count() - 1
|
||||
' Dim sExitToolAssItem() As String = sExitToolAssList(AssIndex).Split("/".ToCharArray)
|
||||
' If sExitToolAssItem.Count > 1 Then
|
||||
' sExitList.Add(sExitToolAssItem(0))
|
||||
' sToolList.Add(sExitToolAssItem(1))
|
||||
' End If
|
||||
' Next
|
||||
' ' analizzo la lista di utensili attrezzati
|
||||
' For ToolIndex = 0 To sToolList.Count - 1
|
||||
' If Not String.IsNullOrEmpty(sToolList(ToolIndex)) Then
|
||||
' Dim TempTool As ToolItem = Nothing
|
||||
' Dim bFound As Boolean = False
|
||||
' ' cerco l'utensile attrezzato nella lista utensili
|
||||
' For FamilyListIndex = 0 To m_ToolsList.Count - 1
|
||||
' For ToolListIndex = 0 To m_ToolsList(FamilyListIndex).Items.Count - 1
|
||||
' TempTool = DirectCast(m_ToolsList(FamilyListIndex).Items(ToolListIndex), ToolItem)
|
||||
' If TempTool.Uuid = sToolList(ToolIndex) Then
|
||||
' ' lo salvo in una variabile temporanea e lo tolgo dalla lista
|
||||
' m_ToolsList(FamilyListIndex).Items.Remove(m_ToolsList(FamilyListIndex).Items(ToolListIndex))
|
||||
' bFound = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
' If bFound Then Exit For
|
||||
' Next
|
||||
' ' se lo trovo
|
||||
' If bFound Then
|
||||
' ' cerco la relativa uscita
|
||||
' For ExitIndex = 0 To m_PositionGroupList(nGroup - 1).PositionList(m_PositionGroupList(nGroup - 1).PositionList.Count - 1).ExitToolAssociationList.Count - 1
|
||||
' Dim CurrExitToolAss As ExitToolAssociation = m_PositionGroupList(nGroup - 1).PositionList(m_PositionGroupList(nGroup - 1).PositionList.Count - 1).ExitToolAssociationList(ExitIndex)
|
||||
' If CurrExitToolAss.ExitPar = sExitList(ToolIndex) Then
|
||||
' ' vi metto l'utensile e segno l'uscita come occupata
|
||||
' CurrExitToolAss.Tool = TempTool
|
||||
' CurrExitToolAss.IsOccupied = True
|
||||
' ' lo metto anche come utensile originale
|
||||
' CurrExitToolAss.OrigTool = TempTool
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
' ' altrimenti, se non l'ho trovato
|
||||
' Else
|
||||
' Dim sSearchedTool As String = String.Empty
|
||||
' EgtTdbGetToolFromUUID(sToolList(ToolIndex), sSearchedTool)
|
||||
' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 3) & " " & sSearchedTool & " " & EgtMsg(MSG_SETUPERRORS + 4), EgtMsg(MSG_SETUPERRORS + 2), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
' ' non è presente la H, quindi la recupero dal modello delle posizioni nel file MachIni
|
||||
' Else
|
||||
' CreateStdPosFromPosIndex(nIndex)
|
||||
' End If
|
||||
' End If
|
||||
|
||||
'End Sub
|
||||
|
||||
' Funzione che data una T restituisce il gruppo a cui appartiene
|
||||
Private Function GetGroupFromTcPos(sTcPos As String, ByRef nGroup As Integer) As Boolean
|
||||
Dim sGroup As String = String.Empty
|
||||
@@ -571,6 +674,11 @@ Namespace EgtCAM5
|
||||
' resetto lista utensili e posizioni
|
||||
m_ToolsList.Clear()
|
||||
m_PositionGroupList.Clear()
|
||||
' genero una nuova lista delle posizioni dalla configurazione nel file ini della macchina
|
||||
Dim Index As Integer = 1
|
||||
While CreateStdPosFromPosIndex(Index)
|
||||
Index += 1
|
||||
End While
|
||||
'ricarico lista utensili
|
||||
LoadMachineTools()
|
||||
' leggo l'attrezzaggio dal file scelto
|
||||
@@ -665,7 +773,8 @@ Namespace EgtCAM5
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
' aggiorno lo stato del bottone applica
|
||||
IsEnabledBtns()
|
||||
End Sub
|
||||
|
||||
#End Region ' AutomaticCommand
|
||||
@@ -712,7 +821,7 @@ Namespace EgtCAM5
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CloseSetUpCommand
|
||||
#End Region ' CloseSetUpCommand
|
||||
|
||||
#Region "ToolDoubleClickCommand"
|
||||
|
||||
|
||||
@@ -804,23 +804,30 @@ Public Class ToolTreeViewItem
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Shared m_TcPosList As New List(Of String)
|
||||
Public ReadOnly Property TcPosList As List(Of String)
|
||||
Get
|
||||
Return m_TcPosList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedTcPos As Boolean = False
|
||||
Private m_TcPos As String
|
||||
Private m_SelectedTcPos As String
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Tc Pos
|
||||
''' </summary>
|
||||
Public Property TcPos As String
|
||||
Public Property SelectedTcPos As String
|
||||
Get
|
||||
Return m_TcPos
|
||||
Return m_SelectedTcPos
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value = String.Empty Or value <> m_TcPos Then
|
||||
If value = String.Empty Or value <> m_SelectedTcPos Then
|
||||
Dim DbTcPos As String = String.Empty
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, DbTcPos)
|
||||
m_IsModifiedTcPos = If(value <> DbTcPos, True, False)
|
||||
m_TcPos = value
|
||||
NotifyPropertyChanged("TcPos")
|
||||
m_SelectedTcPos = value
|
||||
NotifyPropertyChanged("SelectedTcPos")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -910,7 +917,7 @@ Public Class ToolTreeViewItem
|
||||
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, sValue)
|
||||
UserNotes = sValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sValue)
|
||||
TcPos = sValue
|
||||
SelectedTcPos = sValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.UUID, sValue)
|
||||
m_Uuid = sValue
|
||||
' Ora che tutti i parametri sono aggiornati, aggiorno il disegno
|
||||
@@ -974,7 +981,7 @@ Public Class ToolTreeViewItem
|
||||
EgtTdbSetCurrToolParam(MCH_TP.DRAW, Draw)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.HEAD, Head)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, UserNotes)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TCPOS, TcPos)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TCPOS, SelectedTcPos)
|
||||
End Sub
|
||||
|
||||
Public Sub WriteToolName()
|
||||
|
||||
@@ -804,13 +804,15 @@
|
||||
Visibility="{Binding Path=SelectedItem.Type, ElementName=ToolsTreeView,
|
||||
Converter={StaticResource ToolParamVisibilityConverter},
|
||||
ConverterParameter={StaticResource TcPos}}"/>
|
||||
<EgtWPFLib5:EgtTextBox Name="TcPosTxBx" Grid.Column="1" Style="{StaticResource ToolsTextBox}"
|
||||
Text="{Binding Path=SelectedItem.TcPos,
|
||||
ElementName=ToolsTreeView, UpdateSourceTrigger=PropertyChanged}"
|
||||
Visibility="{Binding Path=SelectedItem.Type,
|
||||
ElementName=ToolsTreeView,
|
||||
Converter={StaticResource ToolParamVisibilityConverter},
|
||||
ConverterParameter={StaticResource TcPos}}"/>
|
||||
<ComboBox Name="TcPosTxBx" Grid.Column="1" Style="{StaticResource ToolsComboBox}"
|
||||
ItemsSource="{Binding Path=SelectedItem.TcPosList, ElementName=ToolsTreeView,
|
||||
UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding Path=SelectedItem.SelectedTcPos, ElementName=ToolsTreeView,
|
||||
UpdateSourceTrigger=PropertyChanged}"
|
||||
Visibility="{Binding Path=SelectedItem.Type,
|
||||
ElementName=ToolsTreeView,
|
||||
Converter={StaticResource ToolParamVisibilityConverter},
|
||||
ConverterParameter={StaticResource TcPos}}"/>
|
||||
<!--<ContentPresenter Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Content="{Binding ElementName=TcPosTxBx,
|
||||
Path=(Validation.Errors).CurrentItem,
|
||||
|
||||
@@ -263,6 +263,25 @@ Namespace EgtCAM5
|
||||
Next
|
||||
Next
|
||||
End Sub)
|
||||
' carico Lua che contiene le funzioni di attrezzaggio
|
||||
EgtLuaExecFile(IniFile.m_sCurrMachScriptsDirPath & "\" & SETUP_LUA)
|
||||
' creo lista TcPos
|
||||
Dim nPosIndex As Integer = 1
|
||||
Dim sTcPos As String = String.Empty
|
||||
Dim nErr As Integer = 0
|
||||
While nErr = 0
|
||||
EgtLuaSetGlobIntVar("STU.INDEX", nPosIndex)
|
||||
EgtLuaCallFunction("STU.GetTcPosFromPos")
|
||||
' Leggo variabili
|
||||
EgtLuaGetGlobStringVar("STU.TCPOS", sTcPos)
|
||||
EgtLuaGetGlobIntVar("STU.ERR", nErr)
|
||||
If nErr = 0 Then
|
||||
ToolTreeViewItem.m_TcPosList.Add(sTcPos)
|
||||
End If
|
||||
nPosIndex += 1
|
||||
End While
|
||||
' Reset lua
|
||||
EgtLuaResetGlobVar("STU")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user