EgtCAM5 :

- Migliorie lavorazioni.
- Sistemata nuova lavorazione in Db.
This commit is contained in:
Emmanuele Sassi
2016-07-18 10:19:37 +00:00
parent 25f7d05697
commit edd43d516d
8 changed files with 102 additions and 250 deletions
@@ -39,7 +39,11 @@
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<UniformGrid Rows="1">
<Button Content="Move Up" Command="{Binding MoveUpCommand}" Height="40"/>
<Button Content="Move Down" Command="{Binding MoveDownCommand}" Height="40"/>
</UniformGrid>
</StackPanel>
</Expander>
@@ -151,7 +155,7 @@
</UniformGrid>
</StackPanel>
</Expander>
<Expander HorizontalAlignment="Left">
<Expander>
<Expander.Header>
<UniformGrid Columns="2">
<TextBlock Text="{Binding LeadOutTypeTxBl}"/>
@@ -91,6 +91,7 @@ Namespace EgtCAM5
EgtResetMark(m_LastMarkedOperationId)
' Ne deseleziono la geometria
EgtDeselectAll()
EgtDraw()
End If
' Verifico se l'operazione è una disposizione
If EgtGetOperationType(value.Id) = MCH_OY.DISP Then
@@ -310,6 +311,8 @@ Namespace EgtCAM5
Private m_cmdNewMachining As ICommand
Private m_cmdNewPositioning As ICommand
Private m_cmdCancelOperation As ICommand
Private m_cmdMoveUp As ICommand
Private m_cmdMoveDown As ICommand
Private m_cmdReloadMachining As ICommand
Sub New()
@@ -430,6 +433,95 @@ Namespace EgtCAM5
#End Region ' CancelOperationCommand
#Region "MoveUpCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
Public ReadOnly Property MoveUpCommand As ICommand
Get
If m_cmdMoveUp Is Nothing Then
m_cmdMoveUp = New RelayCommand(AddressOf MoveUp, AddressOf CanMoveUp)
End If
Return m_cmdMoveUp
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub MoveUp(ByVal param As Object)
If Not IsNothing(SelectedOperation) Then
' Verifico se l'entità selezionata è una lavorazione o una disposizione,
' se è una disposizione esco perchè non si possono spostare
If SelectedOperation.Type = MCH_OY.DISP Then Return
' Trovo indice dell'entità selezionata
Dim SelectedIndex As Integer = OperationList.IndexOf(SelectedOperation)
' Verifico che l'indice sia >= 2 perchè il primo è e deve essere una disposizione
If SelectedIndex < 2 Then
Return
End If
' Recupero Id entità precedente a quella selezionata
Dim PreviousId As Integer = OperationList(SelectedIndex - 1).Id
' Sposto l'entità selezionata
EgtRelocate(SelectedOperation.Id, PreviousId, GDB_POS.BEFORE)
' Ricarico la lista delle operazioni
Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
End If
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanMoveUp(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' MoveUpCommand
#Region "MoveDownCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
Public ReadOnly Property MoveDownCommand As ICommand
Get
If m_cmdMoveDown Is Nothing Then
m_cmdMoveDown = New RelayCommand(AddressOf MoveDown, AddressOf CanMoveDown)
End If
Return m_cmdMoveDown
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub MoveDown(ByVal param As Object)
If m_NewMachining Then
NewMachining = False
Else
If Not IsNothing(SelectedOperation) Then
' Smarco e deseleziono la geometria selezionata
EgtResetMark(m_LastMarkedOperationId)
EgtDeselectAll()
EgtDraw()
' Rimuovo l'operazione selezionata
EgtRemoveOperation(SelectedOperation.Id)
' Ricarico la lista delle operazioni
Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
End If
End If
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanMoveDown(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' MoveDownCommand
#Region "ReloadMachiningCommand"
''' <summary>
@@ -1,194 +0,0 @@
<UserControl x:Class="OperationPropertyExpanderView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5" DataContext="{Binding RelativeSource={RelativeSource
AncestorType={x:Type ListBox}}, Path=SelectedItem}">
<Expander Header="Operation Parameters">
<StackPanel >
<UniformGrid Columns="2">
<TextBlock Text="Name"/>
<TextBox Text="{Binding Path=Depth,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="Depth"/>
<TextBox Text="{Binding Depth}"/>
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="Invert"/>
<CheckBox HorizontalAlignment="Center" IsChecked="{Binding Invert}" />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="WorkSide"/>
<ComboBox ItemsSource="{Binding WorkSideList}"
SelectedIndex="{Binding SelectedWorkSide}">
<ComboBoxItem Content="Center" IsSelected="True"/>
<ComboBoxItem Content="Left"/>
<ComboBoxItem Content="Right"/>
</ComboBox>
</UniformGrid>
<Expander Header="Generic">
<StackPanel>
<UniformGrid Columns="2">
<TextBlock Text="Step"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="StepType"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="SideAngle"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="StartPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="StartSlowLen"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="EndSlowLen"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="OffsetSr"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="OffsetSl"/>
<TextBox />
</UniformGrid>
</StackPanel>
</Expander>
<Expander>
<Expander.Header>
<UniformGrid Columns="2">
<TextBlock Text="LeadInType"/>
<ComboBox>
<ComboBoxItem Content="None"/>
<ComboBoxItem Content="Linear"/>
<ComboBoxItem Content="Tangent" IsSelected="True"/>
<ComboBoxItem Content="Helix"/>
</ComboBox>
</UniformGrid>
</Expander.Header>
<StackPanel>
<UniformGrid Columns="2">
<TextBlock Text="StartAddLen"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<TextBox />
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
</StackPanel>
</Expander>
<Expander HorizontalAlignment="Left">
<Expander.Header>
<UniformGrid Columns="2">
<TextBlock Text="LeadOutType"/>
<ComboBox>
<ComboBoxItem Content="None"/>
<ComboBoxItem Content="Linear"/>
<ComboBoxItem Content="Tangent" IsSelected="True"/>
<ComboBoxItem Content="Helix"/>
</ComboBox>
</UniformGrid>
</Expander.Header>
<StackPanel>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
</StackPanel>
</Expander>
<Expander>
<Expander.Header>
<UniformGrid Columns="2">
<TextBlock Text="LeaveTab"/>
<CheckBox HorizontalAlignment="Center"/>
</UniformGrid>
</Expander.Header>
<StackPanel>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="ReturnPos"/>
<TextBox />
</UniformGrid>
</StackPanel>
</Expander>
<Expander Header="Tool">
<StackPanel>
<UniformGrid Columns="2">
<TextBlock Text="Speed"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="Feed"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="StartFeed"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="EndFeed"/>
<TextBox />
</UniformGrid>
<UniformGrid Columns="2">
<TextBlock Text="TipFeed"/>
<TextBox />
</UniformGrid>
</StackPanel>
</Expander>
</StackPanel>
</Expander>
</UserControl>
@@ -1,3 +0,0 @@
Public Class OperationPropertyExpanderView
End Class
@@ -1,47 +0,0 @@
Imports EgtUILib
Namespace EgtCAM5
Public Class OperationPropertyExpanderViewModel
Inherits ViewModelBase
'Private m_SelectedOperation As OperationListBoxItem
'Public Property SelectedOperation As OperationListBoxItem
' Get
' Return m_SelectedOperation
' End Get
' Set(value As OperationListBoxItem)
' If value IsNot m_SelectedOperation Then
' Dim x = EgtSetCurrMachining(value.Id)
' m_SelectedOperation = value
' 'm_SelectedOperation.NotifyPropertyChanged("Invert")
' End If
' End Set
'End Property
'Private m_Depth As String
'Public Property Depth As String
' Get
' EgtGetMachiningParam(MCH_MP.DEPTH, m_Depth)
' Return m_Depth
' End Get
' Set(value As String)
' If value <> m_Depth Then
' If EgtSetMachiningParam(MCH_MP.NAME, value) Then
' m_Depth = value
' End If
' End If
' 'OnPropertyChanged("Depth")
' End Set
'End Property
Sub New()
Application.Msn.Register(Application.SELECTEDOPERATION, Sub(SelectedOperation As OperationListBoxItem)
'Me.SelectedOperation = SelectedOperation
End Sub)
End Sub
End Class
End Namespace
@@ -444,9 +444,7 @@ Namespace EgtCAM5
Private Sub CloseSimulation()
' Mi assicuro di terminare la simulazione
ResetSimulation()
' Nascondo tutte le lavorazioni
'HideAllMachinings()
EgtDraw()
End Sub
Private Sub ResetSimulation()