EgtCAM5 :

- modifiche e aggiornamenti per Scalpellatura e Svuotatura.
This commit is contained in:
Dario Sassi
2017-02-04 15:32:52 +00:00
parent d364ec1eae
commit 84e3d7bd84
8 changed files with 159 additions and 97 deletions
@@ -143,13 +143,28 @@
IsSynchronizedWithCurrentItem="True">
</ComboBox>
</UniformGrid>
<UniformGrid Columns="2" Visibility="{Binding Type,
Converter={StaticResource OperationParamVisibilityConverter},
ConverterParameter={StaticResource SubType}}">
<TextBlock Text="{Binding SubTypeMsg}"/>
<ComboBox ItemsSource="{Binding SubTypeList, Mode=OneWay}"
SelectedIndex="{Binding SelectedSubType}"
IsSynchronizedWithCurrentItem="True">
</ComboBox>
</UniformGrid>
<UniformGrid Columns="2" Visibility="{Binding Type,
Converter={StaticResource OperationParamVisibilityConverter},
ConverterParameter={StaticResource StepPar}}">
<TextBlock Text="{Binding StepParMsg}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding StepPar, UpdateSourceTrigger=PropertyChanged}"/>
</UniformGrid>
<UniformGrid Columns="2" Visibility="{Binding Type,
<UniformGrid Columns="2" Visibility="{Binding Type,
Converter={StaticResource OperationParamVisibilityConverter},
ConverterParameter={StaticResource SideStep}}">
<TextBlock Text="{Binding SideStepMsg}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SideStep, UpdateSourceTrigger=PropertyChanged}"/>
</UniformGrid>
<UniformGrid Columns="2" Visibility="{Binding Type,
Converter={StaticResource OperationParamVisibilityConverter},
ConverterParameter={StaticResource StartSlowLen}}">
<TextBlock Text="{Binding StartSlowLenMsg}"/>
@@ -362,23 +377,39 @@
<TextBlock Text="{Binding ToolExpanderHeader}"/>
</Expander.Header>
<StackPanel>
<UniformGrid Columns="2">
<UniformGrid Columns="2"
Visibility="{Binding Type,
Converter={StaticResource OperationParamVisibilityConverter},
ConverterParameter={StaticResource Speed}}">
<TextBlock Text="{Binding SpeedMsg}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding Speed, UpdateSourceTrigger=PropertyChanged}"/>
</UniformGrid>
<UniformGrid Columns="2">
<UniformGrid Columns="2"
Visibility="{Binding Type,
Converter={StaticResource OperationParamVisibilityConverter},
ConverterParameter={StaticResource Feed}}">
<TextBlock Text="{Binding FeedMsg}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding Feed, UpdateSourceTrigger=PropertyChanged}"/>
</UniformGrid>
<UniformGrid Columns="2">
<UniformGrid Columns="2"
Visibility="{Binding Type,
Converter={StaticResource OperationParamVisibilityConverter},
ConverterParameter={StaticResource TipFeed}}">
<TextBlock Text="{Binding TipFeedMsg}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding TipFeed, UpdateSourceTrigger=PropertyChanged}"/>
</UniformGrid>
<UniformGrid Columns="2">
<UniformGrid Columns="2"
Visibility="{Binding Type,
Converter={StaticResource OperationParamVisibilityConverter},
ConverterParameter={StaticResource StartFeed}}">
<TextBlock Text="{Binding StartFeedMsg}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding StartFeed, UpdateSourceTrigger=PropertyChanged}"/>
</UniformGrid>
<UniformGrid Columns="2">
<UniformGrid Columns="2"
Visibility="{Binding Type,
Converter={StaticResource OperationParamVisibilityConverter},
ConverterParameter={StaticResource EndFeed}}">
<TextBlock Text="{Binding EndFeedMsg}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding EndFeed, UpdateSourceTrigger=PropertyChanged}"/>
</UniformGrid>
@@ -67,9 +67,20 @@ Namespace EgtCAM5
End Property
'ObservableCollection che contiene le variabili per il combobox WorkSide
Private m_WorkSideList As New ObservableCollection(Of IdNameStruct)({New IdNameStruct(MCH_SAW_WS.CENTER, EgtMsg(MSG_MACHININGSDBPAGE + 120)), New IdNameStruct(MCH_SAW_WS.LEFT, EgtMsg(MSG_MACHININGSDBPAGE + 121)), New IdNameStruct(MCH_SAW_WS.RIGHT, EgtMsg(MSG_MACHININGSDBPAGE + 122))})
Private m_WorkSideList As ObservableCollection(Of IdNameStruct)
Public ReadOnly Property WorkSideList As ObservableCollection(Of IdNameStruct)
Get
Select Case m_Type
Case MCH_MY.CHISELING
m_WorkSideList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_CHISEL_WS.LEFT, EgtMsg(MSG_MACHININGSDBPAGE + 121)),
New IdNameStruct(MCH_CHISEL_WS.RIGHT, EgtMsg(MSG_MACHININGSDBPAGE + 122))})
Case Else
m_WorkSideList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_SAW_WS.CENTER, EgtMsg(MSG_MACHININGSDBPAGE + 120)),
New IdNameStruct(MCH_SAW_WS.LEFT, EgtMsg(MSG_MACHININGSDBPAGE + 121)),
New IdNameStruct(MCH_SAW_WS.RIGHT, EgtMsg(MSG_MACHININGSDBPAGE + 122))})
End Select
Return m_WorkSideList
End Get
End Property
@@ -80,14 +91,15 @@ Namespace EgtCAM5
Public Property SelectedWorkSide As Integer
Get
If IsNothing(WorkSideList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedWorkSide, WorkSideList)
Return m_SelectedWorkSide
End Get
Set(value As Integer)
If value <> m_SelectedWorkSide Then
If Not IsNothing(WorkSideList) Then
m_SelectedWorkSide = IdNameStruct.SearchToId(value, WorkSideList)
m_SelectedWorkSide = value
Dim OrigWorkSide As Integer = 0
EgtGetMachiningParam(MCH_MP.WORKSIDE, OrigWorkSide)
OrigWorkSide = IdNameStruct.SearchToId(OrigWorkSide, WorkSideList)
m_IsModifiedSelectedWorkSide = If(value <> OrigWorkSide, True, False)
NotifyPropertyChanged("UpdateMachiningBtnIsEnabled")
End If
@@ -109,14 +121,15 @@ Namespace EgtCAM5
Public Property SelectedHeadSide As Integer
Get
If IsNothing(HeadSideList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedHeadSide, HeadSideList)
Return m_SelectedHeadSide
End Get
Set(value As Integer)
If value <> m_SelectedHeadSide Then
If Not IsNothing(HeadSideList) Then
m_SelectedHeadSide = IdNameStruct.SearchToId(value, HeadSideList)
m_SelectedHeadSide = value
Dim OrigHeadSide As Integer = 0
EgtGetMachiningParam(MCH_MP.HEADSIDE, OrigHeadSide)
OrigHeadSide = IdNameStruct.SearchToId(OrigHeadSide, HeadSideList)
m_IsModifiedSelectedHeadSide = If(value <> OrigHeadSide, True, False)
NotifyPropertyChanged("UpdateMachiningBtnIsEnabled")
End If
@@ -130,9 +143,26 @@ Namespace EgtCAM5
Get
Select Case m_Type
Case MCH_MY.SAWING
m_LeadInTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(MCH_SAW_LI.CENT, EgtMsg(MSG_MACHININGSDBPAGE + 120)), New IdNameStruct(MCH_SAW_LI.STRICT, EgtMsg(MSG_MACHININGSDBPAGE + 125)), New IdNameStruct(MCH_SAW_LI.OUT, EgtMsg(MSG_MACHININGSDBPAGE + 126)), New IdNameStruct(MCH_SAW_LI.EXT_CENT, EgtMsg(MSG_MACHININGSDBPAGE + 127)), New IdNameStruct(MCH_SAW_LI.EXT_OUT, EgtMsg(MSG_MACHININGSDBPAGE + 128))})
m_LeadInTypeList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_SAW_LI.CENT, EgtMsg(MSG_MACHININGSDBPAGE + 120)),
New IdNameStruct(MCH_SAW_LI.STRICT, EgtMsg(MSG_MACHININGSDBPAGE + 125)),
New IdNameStruct(MCH_SAW_LI.OUT, EgtMsg(MSG_MACHININGSDBPAGE + 126)),
New IdNameStruct(MCH_SAW_LI.EXT_CENT, EgtMsg(MSG_MACHININGSDBPAGE + 127)),
New IdNameStruct(MCH_SAW_LI.EXT_OUT, EgtMsg(MSG_MACHININGSDBPAGE + 128))})
Case MCH_MY.MILLING
m_LeadInTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(MCH_MIL_LI.NONE, EgtMsg(MSG_MACHININGSDBPAGE + 129)), New IdNameStruct(MCH_MIL_LI.LINEAR, EgtMsg(MSG_MACHININGSDBPAGE + 130)), New IdNameStruct(MCH_MIL_LI.TANGENT, EgtMsg(MSG_MACHININGSDBPAGE + 131)), New IdNameStruct(MCH_MIL_LI.GLIDE, EgtMsg(MSG_MACHININGSDBPAGE + 132)), New IdNameStruct(MCH_MIL_LI.ZIGZAG, EgtMsg(MSG_MACHININGSDBPAGE + 142)), New IdNameStruct(MCH_MIL_LI.HELIX, EgtMsg(MSG_MACHININGSDBPAGE + 133))})
m_LeadInTypeList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_MIL_LI.NONE, EgtMsg(MSG_MACHININGSDBPAGE + 129)),
New IdNameStruct(MCH_MIL_LI.LINEAR, EgtMsg(MSG_MACHININGSDBPAGE + 130)),
New IdNameStruct(MCH_MIL_LI.TANGENT, EgtMsg(MSG_MACHININGSDBPAGE + 131)),
New IdNameStruct(MCH_MIL_LI.GLIDE, EgtMsg(MSG_MACHININGSDBPAGE + 132)),
New IdNameStruct(MCH_MIL_LI.ZIGZAG, EgtMsg(MSG_MACHININGSDBPAGE + 142)),
New IdNameStruct(MCH_MIL_LI.HELIX, EgtMsg(MSG_MACHININGSDBPAGE + 133))})
Case MCH_MY.POCKETING
m_LeadInTypeList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_POCK_LI.NONE, EgtMsg(MSG_MACHININGSDBPAGE + 129)),
New IdNameStruct(MCH_POCK_LI.GLIDE, EgtMsg(MSG_MACHININGSDBPAGE + 132)),
New IdNameStruct(MCH_POCK_LI.ZIGZAG, EgtMsg(MSG_MACHININGSDBPAGE + 142)),
New IdNameStruct(MCH_POCK_LI.HELIX, EgtMsg(MSG_MACHININGSDBPAGE + 133))})
Case Else
m_LeadInTypeList = Nothing
End Select
@@ -196,9 +226,21 @@ Namespace EgtCAM5
Get
Select Case m_Type
Case MCH_MY.SAWING
m_LeadOutTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(MCH_SAW_LO.CENT, EgtMsg(MSG_MACHININGSDBPAGE + 120)), New IdNameStruct(MCH_SAW_LO.STRICT, EgtMsg(MSG_MACHININGSDBPAGE + 125)), New IdNameStruct(MCH_SAW_LO.EXT, EgtMsg(MSG_MACHININGSDBPAGE + 123))})
m_LeadOutTypeList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_SAW_LO.CENT, EgtMsg(MSG_MACHININGSDBPAGE + 120)),
New IdNameStruct(MCH_SAW_LO.STRICT, EgtMsg(MSG_MACHININGSDBPAGE + 125)),
New IdNameStruct(MCH_SAW_LO.EXT, EgtMsg(MSG_MACHININGSDBPAGE + 123))})
Case MCH_MY.MILLING
m_LeadOutTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(MCH_MIL_LO.NONE, EgtMsg(MSG_MACHININGSDBPAGE + 129)), New IdNameStruct(MCH_MIL_LO.LINEAR, EgtMsg(MSG_MACHININGSDBPAGE + 130)), New IdNameStruct(MCH_MIL_LO.TANGENT, EgtMsg(MSG_MACHININGSDBPAGE + 131)), New IdNameStruct(MCH_MIL_LO.GLIDE, EgtMsg(MSG_MACHININGSDBPAGE + 132)), New IdNameStruct(MCH_MIL_LO.AS_LI, EgtMsg(MSG_MACHININGSDBPAGE + 137))})
m_LeadOutTypeList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_MIL_LO.NONE, EgtMsg(MSG_MACHININGSDBPAGE + 129)),
New IdNameStruct(MCH_MIL_LO.LINEAR, EgtMsg(MSG_MACHININGSDBPAGE + 130)),
New IdNameStruct(MCH_MIL_LO.TANGENT, EgtMsg(MSG_MACHININGSDBPAGE + 131)),
New IdNameStruct(MCH_MIL_LO.GLIDE, EgtMsg(MSG_MACHININGSDBPAGE + 132)),
New IdNameStruct(MCH_MIL_LO.AS_LI, EgtMsg(MSG_MACHININGSDBPAGE + 137))})
Case MCH_MY.POCKETING
m_LeadOutTypeList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_POCK_LO.NONE, EgtMsg(MSG_MACHININGSDBPAGE + 129)),
New IdNameStruct(MCH_POCK_LO.GLIDE, EgtMsg(MSG_MACHININGSDBPAGE + 132))})
Case Else
m_LeadOutTypeList = Nothing
End Select
@@ -306,9 +348,15 @@ Namespace EgtCAM5
Get
Select Case m_Type
Case MCH_MY.SAWFINISHING
m_SubTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(MCH_SAWFIN_SUB.ALONG, EgtMsg(MSG_MACHININGSDBPAGE + 146)), New IdNameStruct(MCH_SAWFIN_SUB.ACROSS, EgtMsg(MSG_MACHININGSDBPAGE + 147))})
Case MCH_MY.DRILLING
m_SubTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(0, "Prova 1"), New IdNameStruct(1, "Prova 2")})
m_SubTypeList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_SAWFIN_SUB.ALONG, EgtMsg(MSG_MACHININGSDBPAGE + 146)),
New IdNameStruct(MCH_SAWFIN_SUB.ACROSS, EgtMsg(MSG_MACHININGSDBPAGE + 147))})
Case MCH_MY.POCKETING
m_SubTypeList = New ObservableCollection(Of IdNameStruct)(
{New IdNameStruct(MCH_POCK_SUB.ZIGZAG, EgtMsg(MSG_MACHININGSDBPAGE + 142)),
New IdNameStruct(MCH_POCK_SUB.ONEWAY, EgtMsg(MSG_MACHININGSDBPAGE + 143)),
New IdNameStruct(MCH_POCK_SUB.SPIRALIN, EgtMsg(MSG_MACHININGSDBPAGE + 148)),
New IdNameStruct(MCH_POCK_SUB.SPIRALOUT, EgtMsg(MSG_MACHININGSDBPAGE + 149))})
Case Else
m_SubTypeList = Nothing
End Select
@@ -1927,12 +1975,24 @@ Namespace EgtCAM5
End Get
End Property
Public ReadOnly Property SubTypeMsg As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 103)
End Get
End Property
Public ReadOnly Property StepParMsg As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 77)
End Get
End Property
Public ReadOnly Property SideStepMsg As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 95)
End Get
End Property
Public ReadOnly Property StartSlowLenMsg As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 74)
@@ -2152,6 +2212,7 @@ Namespace EgtCAM5
#End Region ' Messages
Private Sub ReadMachiningParam()
Dim nValue As Integer = 0
Dim dValue As Double = 0
EgtGetMachiningParam(MCH_MP.TYPE, m_Type)
NotifyPropertyChanged("Type")
@@ -2161,10 +2222,20 @@ Namespace EgtCAM5
EgtGetMachiningParam(MCH_MP.LEAVETAB, m_LeaveTab)
NotifyPropertyChanged("LeaveTab")
m_IsModifiedLeaveTab = False
EgtGetMachiningParam(MCH_MP.WORKSIDE, m_SelectedWorkSide)
EgtGetMachiningParam(MCH_MP.WORKSIDE, nValue)
If Not IsNothing(WorkSideList) Then
m_SelectedWorkSide = IdNameStruct.SearchToId(nValue, WorkSideList)
Else
m_SelectedWorkSide = nValue
End If
NotifyPropertyChanged("SelectedWorkSide")
m_IsModifiedSelectedWorkSide = False
EgtGetMachiningParam(MCH_MP.HEADSIDE, m_SelectedHeadSide)
EgtGetMachiningParam(MCH_MP.HEADSIDE, nValue)
If Not IsNothing(HeadSideList) Then
m_SelectedHeadSide = IdNameStruct.SearchToId(nValue, HeadSideList)
Else
m_SelectedHeadSide = nValue
End If
NotifyPropertyChanged("SelectedHeadSide")
m_IsModifiedSelectedHeadSide = False
NotifyPropertyChanged("LeadInTypeList")
@@ -2346,6 +2417,7 @@ Namespace EgtCAM5
End Sub
Private Sub WriteMachiningParam()
Dim nValue As Integer = 0
Dim dValue As Double = 0
If m_IsModifiedInvert Then
If EgtSetMachiningParam(MCH_MP.INVERT, m_Invert) Then
@@ -2358,12 +2430,22 @@ Namespace EgtCAM5
End If
End If
If m_IsModifiedSelectedWorkSide Then
If EgtSetMachiningParam(MCH_MP.WORKSIDE, m_SelectedWorkSide) Then
If Not IsNothing(WorkSideList) Then
nValue = IdNameStruct.SearchFromId(m_SelectedWorkSide, WorkSideList)
Else
nValue = m_SelectedWorkSide
End If
If EgtSetMachiningParam(MCH_MP.WORKSIDE, nValue) Then
m_IsModifiedSelectedWorkSide = False
End If
End If
If m_IsModifiedSelectedHeadSide Then
If EgtSetMachiningParam(MCH_MP.HEADSIDE, m_SelectedHeadSide) Then
If Not IsNothing(HeadSideList) Then
nValue = IdNameStruct.SearchFromId(m_SelectedHeadSide, HeadSideList)
Else
nValue = m_SelectedHeadSide
End If
If EgtSetMachiningParam(MCH_MP.HEADSIDE, nValue) Then
m_IsModifiedSelectedHeadSide = False
End If
End If
@@ -2625,29 +2707,6 @@ Namespace EgtCAM5
m_UpdateParamValues = AddressOf ReadMachiningParam
End Sub
Private Function ConvertTypeToImage(Type As Integer) As String
Select Case Type
Case MCH_OY.DISP
Return ""
Case MCH_OY.DRILLING
Return ""
Case MCH_OY.SAWING
Return ""
Case MCH_OY.MILLING
Return ""
Case MCH_OY.POCKETING
Return ""
Case MCH_OY.MORTISING
Return ""
Case MCH_OY.SAWROUGHING
Return ""
Case MCH_OY.SAWFINISHING
Return ""
Case Else
Return String.Empty
End Select
End Function
#Region "UpdateMachiningCommand"
''' <summary>
@@ -2766,6 +2825,8 @@ Public Class OperationParamVisibilityConverter
Return SharedFieldsClass.Sawfinishing(CInt(parameter))
Case MCH_OY.GENMACHINING
Return SharedFieldsClass.GenMachining(CInt(parameter))
Case MCH_OY.CHISELING
Return SharedFieldsClass.Chiseling(CInt(parameter))
Case Else
Return Visibility.Hidden
End Select