EgtCAM5 :

- corretta gestione subtype nel dialogo lavorazione.
This commit is contained in:
Dario Sassi
2017-03-08 19:43:18 +00:00
parent 8008a9e48e
commit 4e2a005b5a
2 changed files with 34 additions and 36 deletions
@@ -347,19 +347,30 @@ Namespace EgtCAM5
Public ReadOnly Property SubTypeList As ObservableCollection(Of IdNameStruct)
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.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 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.GENMACHINING
Dim Index = 1
Dim sGenScript As String = String.Empty
m_SubTypeList = New ObservableCollection(Of IdNameStruct)
While EgtUILib.GetPrivateProfileString(S_GENMACHINING, K_GENSCRIPT & Index, "", sGenScript, IniFile.m_sCurrMachIniFilePath) > 0
m_SubTypeList.Add(New IdNameStruct(Index, sGenScript))
Index += 1
End While
If m_SubTypeList.Count = 0 Then
m_SubTypeList.Add(New IdNameStruct(0, ""))
End If
Case Else
m_SubTypeList = Nothing
End Select
m_SubTypeList = Nothing
End Select
Return m_SubTypeList
End Get
End Property
@@ -370,14 +381,15 @@ Namespace EgtCAM5
Public Property SelectedSubType As Integer
Get
If IsNothing(SubTypeList) Then Return Nothing
Return IdNameStruct.IdFromInd(m_SelectedSubType, SubTypeList)
Return m_SelectedSubType
End Get
Set(value As Integer)
If value <> m_SelectedSubType Then
If Not IsNothing(SubTypeList) Then
m_SelectedSubType = IdNameStruct.IndFromId(value, SubTypeList)
m_SelectedSubType = value
Dim OrigSubType As Integer = 0
EgtGetMachiningParam(MCH_MP.SUBTYPE, OrigSubType)
OrigSubType = IdNameStruct.IndFromId(OrigSubType, SubTypeList)
m_IsModifiedSelectedSubType = If(value <> OrigSubType, True, False)
NotifyPropertyChanged("UpdateMachiningBtnIsEnabled")
End If
@@ -2225,19 +2237,11 @@ Namespace EgtCAM5
NotifyPropertyChanged("LeaveTab")
m_IsModifiedLeaveTab = False
EgtGetMachiningParam(MCH_MP.WORKSIDE, nValue)
If Not IsNothing(WorkSideList) Then
m_SelectedWorkSide = IdNameStruct.IndFromId(nValue, WorkSideList)
Else
m_SelectedWorkSide = nValue
End If
m_SelectedWorkSide = If(IsNothing(WorkSideList), nValue, IdNameStruct.IndFromId(nValue, WorkSideList))
NotifyPropertyChanged("SelectedWorkSide")
m_IsModifiedSelectedWorkSide = False
EgtGetMachiningParam(MCH_MP.HEADSIDE, nValue)
If Not IsNothing(HeadSideList) Then
m_SelectedHeadSide = IdNameStruct.IndFromId(nValue, HeadSideList)
Else
m_SelectedHeadSide = nValue
End If
m_SelectedHeadSide = If(IsNothing(HeadSideList), nValue, IdNameStruct.IndFromId(nValue, HeadSideList))
NotifyPropertyChanged("SelectedHeadSide")
m_IsModifiedSelectedHeadSide = False
NotifyPropertyChanged("LeadInTypeList")
@@ -2260,7 +2264,8 @@ Namespace EgtCAM5
NotifyPropertyChanged("SelectedStepType")
m_IsModifiedSelectedStepType = False
NotifyPropertyChanged("SubTypeList")
EgtGetMachiningParam(MCH_MP.SUBTYPE, m_SelectedSubType)
EgtGetMachiningParam(MCH_MP.SUBTYPE, nValue)
m_SelectedSubType = If(IsNothing(SubTypeList), nValue, IdNameStruct.IndFromId(nValue, SubTypeList))
NotifyPropertyChanged("SelectedSubType")
m_IsModifiedSelectedSubType = False
NotifyPropertyChanged("LeadLinkTypeList")
@@ -2432,21 +2437,13 @@ Namespace EgtCAM5
End If
End If
If m_IsModifiedSelectedWorkSide Then
If Not IsNothing(WorkSideList) Then
nValue = IdNameStruct.IdFromInd(m_SelectedWorkSide, WorkSideList)
Else
nValue = m_SelectedWorkSide
End If
nValue = If(IsNothing(WorkSideList), m_SelectedWorkSide, IdNameStruct.IdFromInd(m_SelectedWorkSide, WorkSideList))
If EgtSetMachiningParam(MCH_MP.WORKSIDE, nValue) Then
m_IsModifiedSelectedWorkSide = False
End If
End If
If m_IsModifiedSelectedHeadSide Then
If Not IsNothing(HeadSideList) Then
nValue = IdNameStruct.IdFromInd(m_SelectedHeadSide, HeadSideList)
Else
nValue = m_SelectedHeadSide
End If
nValue = If(IsNothing(HeadSideList), m_SelectedHeadSide, IdNameStruct.IdFromInd(m_SelectedHeadSide, HeadSideList))
If EgtSetMachiningParam(MCH_MP.HEADSIDE, nValue) Then
m_IsModifiedSelectedHeadSide = False
End If
@@ -2477,7 +2474,8 @@ Namespace EgtCAM5
End If
End If
If m_IsModifiedSelectedSubType Then
If EgtSetMachiningParam(MCH_MP.SUBTYPE, m_SelectedSubType) Then
nValue = If(IsNothing(SubTypeList), m_SelectedSubType, IdNameStruct.IdFromInd(m_SelectedSubType, SubTypeList))
If EgtSetMachiningParam(MCH_MP.SUBTYPE, nValue) Then
m_IsModifiedSelectedSubType = False
End If
End If