EgtCAM5 1.8b2 :

- corretto problema con sottotipo lavorazione in gestione DB lavorazioni.
This commit is contained in:
Dario Sassi
2017-03-07 11:22:32 +00:00
parent b6c96f8c25
commit 8008a9e48e
4 changed files with 50 additions and 64 deletions
+25 -39
View File
@@ -216,7 +216,7 @@ Public Class MachiningTreeViewItem
m_SelectedWorkSide = value
Dim DbWorkSide As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.WORKSIDE, DbWorkSide)
DbWorkSide = IdNameStruct.SearchToId(DbWorkSide, WorkSideList)
DbWorkSide = IdNameStruct.IndFromId(DbWorkSide, WorkSideList)
m_IsModifiedSelectedWorkSide = If(value <> DbWorkSide, True, False)
m_delIsEnabledBtns(IsValid And Not IsModified, IsValid And (IsModified Or NewMachining), True)
NotifyPropertyChanged("SelectedWorkSide")
@@ -247,7 +247,7 @@ Public Class MachiningTreeViewItem
m_SelectedHeadSide = value
Dim DbHeadSide As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.HEADSIDE, DbHeadSide)
DbHeadSide = IdNameStruct.SearchToId(DbHeadSide, HeadSideList)
DbHeadSide = IdNameStruct.IndFromId(DbHeadSide, HeadSideList)
m_IsModifiedSelectedHeadSide = If(value <> DbHeadSide, True, False)
m_delIsEnabledBtns(IsValid And Not IsModified, IsValid And (IsModified Or NewMachining), True)
NotifyPropertyChanged("SelectedHeadSide")
@@ -295,12 +295,12 @@ Public Class MachiningTreeViewItem
Public Property SelectedLeadInType As Integer
Get
If IsNothing(LeadInTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedLeadInType, LeadInTypeList)
Return IdNameStruct.IdFromInd(m_SelectedLeadInType, LeadInTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedLeadInType Then
If Not IsNothing(LeadInTypeList) Then
m_SelectedLeadInType = IdNameStruct.SearchToId(value, LeadInTypeList)
m_SelectedLeadInType = IdNameStruct.IndFromId(value, LeadInTypeList)
Dim DbLeadInType As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.LEADINTYPE, DbLeadInType)
m_IsModifiedSelectedLeadInType = If(value <> DbLeadInType, True, False)
@@ -325,12 +325,12 @@ Public Class MachiningTreeViewItem
Public Property SelectedExtLinkType As Integer
Get
If IsNothing(ExtLinkTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedExtLinkType, ExtLinkTypeList)
Return IdNameStruct.IdFromInd(m_SelectedExtLinkType, ExtLinkTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedExtLinkType Then
If Not IsNothing(ExtLinkTypeList) Then
m_SelectedExtLinkType = IdNameStruct.SearchToId(value, ExtLinkTypeList)
m_SelectedExtLinkType = IdNameStruct.IndFromId(value, ExtLinkTypeList)
Dim DbExtLinkType As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.EXTLINKTYPE, DbExtLinkType)
m_IsModifiedSelectedExtLinkType = If(value <> DbExtLinkType, True, False)
@@ -375,12 +375,12 @@ Public Class MachiningTreeViewItem
Public Property SelectedLeadOutType As Integer
Get
If IsNothing(LeadOutTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedLeadOutType, LeadOutTypeList)
Return IdNameStruct.IdFromInd(m_SelectedLeadOutType, LeadOutTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedLeadOutType Then
If Not IsNothing(LeadOutTypeList) Then
m_SelectedLeadOutType = IdNameStruct.SearchToId(value, LeadOutTypeList)
m_SelectedLeadOutType = IdNameStruct.IndFromId(value, LeadOutTypeList)
Dim DbLeadOutType As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.LEADOUTTYPE, DbLeadOutType)
m_IsModifiedSelectedLeadOutType = If(value <> DbLeadOutType, True, False)
@@ -417,12 +417,12 @@ Public Class MachiningTreeViewItem
Public Property SelectedCurveUse As Integer
Get
If IsNothing(CurveUseList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedCurveUse, CurveUseList)
Return IdNameStruct.IdFromInd(m_SelectedCurveUse, CurveUseList)
End Get
Set(value As Integer)
If value <> m_SelectedCurveUse Then
If Not IsNothing(CurveUseList) Then
m_SelectedCurveUse = IdNameStruct.SearchToId(value, CurveUseList)
m_SelectedCurveUse = IdNameStruct.IndFromId(value, CurveUseList)
Dim DbCurveUse As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.CURVEUSE, DbCurveUse)
m_IsModifiedSelectedCurveUse = If(value <> DbCurveUse, True, False)
@@ -465,12 +465,12 @@ Public Class MachiningTreeViewItem
Public Property SelectedStepType As Integer
Get
If IsNothing(StepTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedStepType, StepTypeList)
Return IdNameStruct.IdFromInd(m_SelectedStepType, StepTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedStepType Then
If Not IsNothing(StepTypeList) Then
m_SelectedStepType = IdNameStruct.SearchToId(value, StepTypeList)
m_SelectedStepType = IdNameStruct.IndFromId(value, StepTypeList)
Dim DbStepType As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.STEPTYPE, DbStepType)
m_IsModifiedSelectedStepType = If(value <> DbStepType, True, False)
@@ -495,7 +495,7 @@ Public Class MachiningTreeViewItem
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, Path.GetFileNameWithoutExtension(sGenScript)))
m_SubTypeList.Add(New IdNameStruct(Index, sGenScript))
Index += 1
End While
If m_SubTypeList.Count = 0 Then
@@ -520,14 +520,15 @@ Public Class MachiningTreeViewItem
Public Property SelectedSubType As Integer
Get
If IsNothing(SubTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(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.SearchToId(value, SubTypeList)
m_SelectedSubType = value
Dim DbSubType As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.SUBTYPE, DbSubType)
DbSubType = IdNameStruct.IndFromId(DbSubType, SubTypeList)
m_IsModifiedSelectedSubType = If(value <> DbSubType, True, False)
m_delIsEnabledBtns(IsValid And Not IsModified, IsValid And (IsModified Or NewMachining), True)
NotifyPropertyChanged("SelectedSubType")
@@ -558,12 +559,12 @@ Public Class MachiningTreeViewItem
Public Property SelectedLeadLinkType As Integer
Get
If IsNothing(LeadLinkTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedLeadLinkType, LeadLinkTypeList)
Return IdNameStruct.IdFromInd(m_SelectedLeadLinkType, LeadLinkTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedLeadLinkType Then
If Not IsNothing(LeadLinkTypeList) Then
m_SelectedLeadLinkType = IdNameStruct.SearchToId(value, LeadLinkTypeList)
m_SelectedLeadLinkType = IdNameStruct.IndFromId(value, LeadLinkTypeList)
Dim DbLeadLinkType As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.LEADLINKTYPE, DbLeadLinkType)
m_IsModifiedSelectedLeadLinkType = If(value <> DbLeadLinkType, True, False)
@@ -1578,17 +1579,9 @@ Public Class MachiningTreeViewItem
EgtMdbGetCurrMachiningParam(MCH_MP.INVERT, Invert)
EgtMdbGetCurrMachiningParam(MCH_MP.LEAVETAB, LeaveTab)
EgtMdbGetCurrMachiningParam(MCH_MP.WORKSIDE, nValue)
If Not IsNothing(WorkSideList) Then
SelectedWorkSide = IdNameStruct.SearchToId(nValue, WorkSideList)
Else
SelectedWorkSide = nValue
End If
SelectedWorkSide = If(IsNothing(WorkSideList), nValue, IdNameStruct.IndFromId(nValue, WorkSideList))
EgtMdbGetCurrMachiningParam(MCH_MP.HEADSIDE, nValue)
If Not IsNothing(HeadSideList) Then
SelectedHeadSide = IdNameStruct.SearchToId(nValue, HeadSideList)
Else
SelectedHeadSide = nValue
End If
SelectedHeadSide = If(IsNothing(HeadSideList), nValue, IdNameStruct.IndFromId(nValue, HeadSideList))
EgtMdbGetCurrMachiningParam(MCH_MP.LEADINTYPE, nValue)
SelectedLeadInType = nValue
EgtMdbGetCurrMachiningParam(MCH_MP.EXTLINKTYPE, nValue)
@@ -1600,7 +1593,7 @@ Public Class MachiningTreeViewItem
EgtMdbGetCurrMachiningParam(MCH_MP.STEPTYPE, nValue)
SelectedStepType = nValue
EgtMdbGetCurrMachiningParam(MCH_MP.SUBTYPE, nValue)
SelectedSubType = nValue
SelectedSubType = If(IsNothing(SubTypeList), nValue, IdNameStruct.IndFromId(nValue, SubTypeList))
EgtMdbGetCurrMachiningParam(MCH_MP.LEADLINKTYPE, nValue)
SelectedLeadLinkType = nValue
EgtMdbGetCurrMachiningParam(MCH_MP.SPEED, dValue)
@@ -1715,24 +1708,17 @@ Public Class MachiningTreeViewItem
EgtMdbSetCurrMachiningParam(MCH_MP.INVERT, Invert)
EgtMdbSetCurrMachiningParam(MCH_MP.LEAVETAB, LeaveTab)
EgtMdbSetCurrMachiningParam(MCH_MP.TYPE, Type)
If Not IsNothing(WorkSideList) Then
nValue = IdNameStruct.SearchFromId(m_SelectedWorkSide, WorkSideList)
Else
nValue = m_SelectedWorkSide
End If
nValue = If(IsNothing(WorkSideList), m_SelectedWorkSide, IdNameStruct.IdFromInd(m_SelectedWorkSide, WorkSideList))
EgtMdbSetCurrMachiningParam(MCH_MP.WORKSIDE, nValue)
If Not IsNothing(HeadSideList) Then
nValue = IdNameStruct.SearchFromId(m_SelectedHeadSide, HeadSideList)
Else
nValue = m_SelectedHeadSide
End If
nValue = If(IsNothing(HeadSideList), m_SelectedHeadSide, IdNameStruct.IdFromInd(m_SelectedHeadSide, HeadSideList))
EgtMdbSetCurrMachiningParam(MCH_MP.HEADSIDE, nValue)
EgtMdbSetCurrMachiningParam(MCH_MP.LEADINTYPE, SelectedLeadInType)
EgtMdbSetCurrMachiningParam(MCH_MP.EXTLINKTYPE, SelectedExtLinkType)
EgtMdbSetCurrMachiningParam(MCH_MP.LEADOUTTYPE, SelectedLeadOutType)
EgtMdbSetCurrMachiningParam(MCH_MP.CURVEUSE, SelectedCurveUse)
EgtMdbSetCurrMachiningParam(MCH_MP.STEPTYPE, SelectedStepType)
EgtMdbSetCurrMachiningParam(MCH_MP.SUBTYPE, SelectedSubType)
nValue = If(IsNothing(SubTypeList), m_SelectedSubType, IdNameStruct.IdFromInd(m_SelectedSubType, SubTypeList))
EgtMdbSetCurrMachiningParam(MCH_MP.SUBTYPE, nValue)
EgtMdbSetCurrMachiningParam(MCH_MP.LEADLINKTYPE, SelectedLeadLinkType)
StringToDouble(Speed, dValue)
EgtMdbSetCurrMachiningParam(MCH_MP.SPEED, dValue)
+2 -2
View File
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.8.3.1")>
<Assembly: AssemblyFileVersion("1.8.3.1")>
<Assembly: AssemblyVersion("1.8.3.2")>
<Assembly: AssemblyFileVersion("1.8.3.2")>
@@ -99,7 +99,7 @@ Namespace EgtCAM5
m_SelectedWorkSide = value
Dim OrigWorkSide As Integer = 0
EgtGetMachiningParam(MCH_MP.WORKSIDE, OrigWorkSide)
OrigWorkSide = IdNameStruct.SearchToId(OrigWorkSide, WorkSideList)
OrigWorkSide = IdNameStruct.IndFromId(OrigWorkSide, WorkSideList)
m_IsModifiedSelectedWorkSide = If(value <> OrigWorkSide, True, False)
NotifyPropertyChanged("UpdateMachiningBtnIsEnabled")
End If
@@ -129,7 +129,7 @@ Namespace EgtCAM5
m_SelectedHeadSide = value
Dim OrigHeadSide As Integer = 0
EgtGetMachiningParam(MCH_MP.HEADSIDE, OrigHeadSide)
OrigHeadSide = IdNameStruct.SearchToId(OrigHeadSide, HeadSideList)
OrigHeadSide = IdNameStruct.IndFromId(OrigHeadSide, HeadSideList)
m_IsModifiedSelectedHeadSide = If(value <> OrigHeadSide, True, False)
NotifyPropertyChanged("UpdateMachiningBtnIsEnabled")
End If
@@ -176,12 +176,12 @@ Namespace EgtCAM5
Public Property SelectedLeadInType As Integer
Get
If IsNothing(LeadInTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedLeadInType, LeadInTypeList)
Return IdNameStruct.IdFromInd(m_SelectedLeadInType, LeadInTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedLeadInType Then
If Not IsNothing(LeadInTypeList) Then
m_SelectedLeadInType = IdNameStruct.SearchToId(value, LeadInTypeList)
m_SelectedLeadInType = IdNameStruct.IndFromId(value, LeadInTypeList)
Dim OrigLeadInType As Integer = 0
EgtGetMachiningParam(MCH_MP.LEADINTYPE, OrigLeadInType)
m_IsModifiedSelectedLeadInType = If(value <> OrigLeadInType, True, False)
@@ -205,12 +205,12 @@ Namespace EgtCAM5
Public Property SelectedExtLinkType As Integer
Get
If IsNothing(ExtLinkTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedExtLinkType, ExtLinkTypeList)
Return IdNameStruct.IdFromInd(m_SelectedExtLinkType, ExtLinkTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedExtLinkType Then
If Not IsNothing(ExtLinkTypeList) Then
m_SelectedExtLinkType = IdNameStruct.SearchToId(value, ExtLinkTypeList)
m_SelectedExtLinkType = IdNameStruct.IndFromId(value, ExtLinkTypeList)
Dim OrigExtLinkType As Integer = 0
EgtGetMachiningParam(MCH_MP.EXTLINKTYPE, OrigExtLinkType)
m_IsModifiedSelectedExtLinkType = If(value <> OrigExtLinkType, True, False)
@@ -254,12 +254,12 @@ Namespace EgtCAM5
Public Property SelectedLeadOutType As Integer
Get
If IsNothing(LeadOutTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedLeadOutType, LeadOutTypeList)
Return IdNameStruct.IdFromInd(m_SelectedLeadOutType, LeadOutTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedLeadOutType Then
If Not IsNothing(LeadOutTypeList) Then
m_SelectedLeadOutType = IdNameStruct.SearchToId(value, LeadOutTypeList)
m_SelectedLeadOutType = IdNameStruct.IndFromId(value, LeadOutTypeList)
Dim OrigLeadOutType As Integer = 0
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, OrigLeadOutType)
m_IsModifiedSelectedLeadOutType = If(value <> OrigLeadOutType, True, False)
@@ -288,12 +288,12 @@ Namespace EgtCAM5
Public Property SelectedCurveUse As Integer
Get
If IsNothing(CurveUseList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedCurveUse, CurveUseList)
Return IdNameStruct.IdFromInd(m_SelectedCurveUse, CurveUseList)
End Get
Set(value As Integer)
If value <> m_SelectedCurveUse Then
If Not IsNothing(CurveUseList) Then
m_SelectedCurveUse = IdNameStruct.SearchToId(value, CurveUseList)
m_SelectedCurveUse = IdNameStruct.IndFromId(value, CurveUseList)
Dim OrigCurveUse As Integer = 0
EgtGetMachiningParam(MCH_MP.CURVEUSE, OrigCurveUse)
m_IsModifiedSelectedCurveUse = If(value <> OrigCurveUse, True, False)
@@ -327,12 +327,12 @@ Namespace EgtCAM5
Public Property SelectedStepType As Integer
Get
If IsNothing(StepTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedStepType, StepTypeList)
Return IdNameStruct.IdFromInd(m_SelectedStepType, StepTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedStepType Then
If Not IsNothing(StepTypeList) Then
m_SelectedStepType = IdNameStruct.SearchToId(value, StepTypeList)
m_SelectedStepType = IdNameStruct.IndFromId(value, StepTypeList)
Dim OrigStepType As Integer = 0
EgtGetMachiningParam(MCH_MP.STEPTYPE, OrigStepType)
m_IsModifiedSelectedStepType = If(value <> OrigStepType, True, False)
@@ -370,12 +370,12 @@ Namespace EgtCAM5
Public Property SelectedSubType As Integer
Get
If IsNothing(SubTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedSubType, SubTypeList)
Return IdNameStruct.IdFromInd(m_SelectedSubType, SubTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedSubType Then
If Not IsNothing(SubTypeList) Then
m_SelectedSubType = IdNameStruct.SearchToId(value, SubTypeList)
m_SelectedSubType = IdNameStruct.IndFromId(value, SubTypeList)
Dim OrigSubType As Integer = 0
EgtGetMachiningParam(MCH_MP.SUBTYPE, OrigSubType)
m_IsModifiedSelectedSubType = If(value <> OrigSubType, True, False)
@@ -407,12 +407,12 @@ Namespace EgtCAM5
Public Property SelectedLeadLinkType As Integer
Get
If IsNothing(LeadLinkTypeList) Then Return Nothing
Return IdNameStruct.SearchFromId(m_SelectedLeadLinkType, LeadLinkTypeList)
Return IdNameStruct.IdFromInd(m_SelectedLeadLinkType, LeadLinkTypeList)
End Get
Set(value As Integer)
If value <> m_SelectedLeadLinkType Then
If Not IsNothing(LeadLinkTypeList) Then
m_SelectedLeadLinkType = IdNameStruct.SearchToId(value, LeadLinkTypeList)
m_SelectedLeadLinkType = IdNameStruct.IndFromId(value, LeadLinkTypeList)
Dim OrigLeadLinkType As Integer = 0
EgtGetMachiningParam(MCH_MP.LEADLINKTYPE, OrigLeadLinkType)
m_IsModifiedSelectedLeadLinkType = If(value <> OrigLeadLinkType, True, False)
@@ -2226,7 +2226,7 @@ Namespace EgtCAM5
m_IsModifiedLeaveTab = False
EgtGetMachiningParam(MCH_MP.WORKSIDE, nValue)
If Not IsNothing(WorkSideList) Then
m_SelectedWorkSide = IdNameStruct.SearchToId(nValue, WorkSideList)
m_SelectedWorkSide = IdNameStruct.IndFromId(nValue, WorkSideList)
Else
m_SelectedWorkSide = nValue
End If
@@ -2234,7 +2234,7 @@ Namespace EgtCAM5
m_IsModifiedSelectedWorkSide = False
EgtGetMachiningParam(MCH_MP.HEADSIDE, nValue)
If Not IsNothing(HeadSideList) Then
m_SelectedHeadSide = IdNameStruct.SearchToId(nValue, HeadSideList)
m_SelectedHeadSide = IdNameStruct.IndFromId(nValue, HeadSideList)
Else
m_SelectedHeadSide = nValue
End If
@@ -2433,7 +2433,7 @@ Namespace EgtCAM5
End If
If m_IsModifiedSelectedWorkSide Then
If Not IsNothing(WorkSideList) Then
nValue = IdNameStruct.SearchFromId(m_SelectedWorkSide, WorkSideList)
nValue = IdNameStruct.IdFromInd(m_SelectedWorkSide, WorkSideList)
Else
nValue = m_SelectedWorkSide
End If
@@ -2443,7 +2443,7 @@ Namespace EgtCAM5
End If
If m_IsModifiedSelectedHeadSide Then
If Not IsNothing(HeadSideList) Then
nValue = IdNameStruct.SearchFromId(m_SelectedHeadSide, HeadSideList)
nValue = IdNameStruct.IdFromInd(m_SelectedHeadSide, HeadSideList)
Else
nValue = m_SelectedHeadSide
End If
+3 -3
View File
@@ -76,15 +76,15 @@ Public Module Utility
Return Name
End Function
Friend Shared Function SearchToId(Id As Integer, List As ObservableCollection(Of IdNameStruct)) As Integer
Friend Shared Function IndFromId(Id As Integer, List As ObservableCollection(Of IdNameStruct)) As Integer
For i = 0 To List.Count - 1
If List(i).Id = Id Then Return i
Next
Return 0
End Function
Friend Shared Function SearchFromId(Id As Integer, List As ObservableCollection(Of IdNameStruct)) As Integer
Return List(Id).Id
Friend Shared Function IdFromInd(Ind As Integer, List As ObservableCollection(Of IdNameStruct)) As Integer
Return List(Ind).Id
End Function
End Structure