-piccola modifica a parametri generali

This commit is contained in:
Demetrio Cassarino
2026-03-27 14:13:17 +01:00
parent e603793dc0
commit e66e974688
5 changed files with 121 additions and 115 deletions
@@ -659,38 +659,40 @@ Public Class BTLDataWndVM
Case GetType(BooleanGenericParameter)
SetGeneralParametersIsEnable(True)
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue) Then
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Else
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(DoubleGenericParameter)
SetGeneralParametersIsEnable(True)
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue) Then
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Else
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ComboGenericParameter)
SetGeneralParametersIsEnable(True)
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
Dim sTmpValueInfo As String = String.Empty
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpValueInfo)
If sTmpValueInfo = String.Empty Then
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpValueInfo)
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
Else
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
SetGeneralParametersIsEnable(False)
Return
Else
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
End If
Case GetType(StringGenericParameter)
SetGeneralParametersIsEnable(True)
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue) Then
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
Else
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ListGenericParameter)
SetGeneralParametersIsEnable(True)
@@ -698,10 +700,11 @@ Public Class BTLDataWndVM
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
Dim sTmpInfo As String = sInfo
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo) Then
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo)
Else
sInfo = sTmpInfo
SetGeneralParametersIsEnable(False)
Return
End If
End If
Next
@@ -743,38 +746,40 @@ Public Class BTLDataWndVM
Case GetType(BooleanGenericParameter)
SetGeneralParametersIsEnable(True)
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue) Then
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Else
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(DoubleGenericParameter)
SetGeneralParametersIsEnable(True)
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue) Then
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Else
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ComboGenericParameter)
SetGeneralParametersIsEnable(True)
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
Dim sTmpValueInfo As String = String.Empty
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpValueInfo)
If sTmpValueInfo = String.Empty Then
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
SetGeneralParametersIsEnable(False)
Return
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpValueInfo)
Else
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
SetGeneralParametersIsEnable(False)
End If
Case GetType(StringGenericParameter)
SetGeneralParametersIsEnable(True)
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue) Then
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
Else
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ListGenericParameter)
SetGeneralParametersIsEnable(True)
@@ -782,10 +787,11 @@ Public Class BTLDataWndVM
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
Dim sTmpInfo As String = sInfo
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo) Then
If EgtExistsInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo)
Else
sInfo = sTmpInfo
SetGeneralParametersIsEnable(False)
Return
End If
End If
Next
@@ -244,69 +244,64 @@ Public Class BTLPartManagerVM
For Each GeneralParameter In Map.refProjectVM.GeneralParametersList
Select Case GeneralParameter.GetType()
Case GetType(BooleanGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Else
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(DoubleGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Else
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ComboGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
Dim sTmpValueInfo As String = String.Empty
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sTmpValueInfo)
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
Else
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(StringGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
Else
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ListGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
Dim sTmpInfo As String = sInfo
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
Else
sInfo = sTmpInfo
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
End If
Next
@@ -509,7 +509,7 @@ Public Class BooleanGenericParameter
End Property
Friend Sub SetbIsBooleanModify(value As Boolean)
m_bIsBooleanModify = value
If m_bIsBooleanModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
If m_bIsBooleanModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.bSaveGeneralParameters Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SetStrategyModify_Visibility(Visibility.Visible)
End If
NotifyPropertyChanged(NameOf(bIsBooleanModify))
@@ -602,7 +602,7 @@ Public Class DoubleGenericParameter
End Property
Friend Sub SetbIsDoubleModify(value As Boolean)
m_bIsDoubleModify = value
If m_bIsDoubleModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
If m_bIsDoubleModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.bSaveGeneralParameters Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SetStrategyModify_Visibility(Visibility.Visible)
End If
NotifyPropertyChanged(NameOf(bIsDoubleModify))
@@ -678,7 +678,7 @@ Public Class StringGenericParameter
End Property
Friend Sub SetbIsStringModify(value As Boolean)
m_bIsStringModify = value
If m_bIsStringModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
If m_bIsStringModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.bSaveGeneralParameters Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SetStrategyModify_Visibility(Visibility.Visible)
End If
NotifyPropertyChanged(NameOf(bIsStringModify))
@@ -767,7 +767,7 @@ Public Class ComboGenericParameter
End Property
Friend Sub SetbIsComboBoxModify(value As Boolean)
m_bIsComboBoxModify = value
If m_bIsComboBoxModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
If m_bIsComboBoxModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.bSaveGeneralParameters Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SetStrategyModify_Visibility(Visibility.Visible)
End If
NotifyPropertyChanged(NameOf(bIsComboBoxModify))
@@ -923,7 +923,7 @@ Public Class ListGenericParameter
End Property
Friend Sub SetbIsListModify(value As Boolean)
m_bIsListModify = value
If m_bIsListModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
If m_bIsListModify AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.bSaveGeneralParameters Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SetStrategyModify_Visibility(Visibility.Visible)
End If
NotifyPropertyChanged(NameOf(bIsListModify))
@@ -150,41 +150,45 @@ Public Class GeneralParametersWndVM
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
If Not EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue) Then
If EgtExistsInfo(nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Else
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
Return
End If
Case GetType(DoubleGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
If Not EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue) Then
If EgtExistsInfo(nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Else
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
Return
End If
Case GetType(ComboGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
If Not EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue) Then
If EgtExistsInfo(nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue)
Else
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(StringGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
If Not EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue) Then
If EgtExistsInfo(nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
Else
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
Return
End If
Case GetType(ListGenericParameter)
SetbSaveGeneralParameters(True)
@@ -193,11 +197,12 @@ Public Class GeneralParametersWndVM
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
Dim sTmpInfo As String = sInfo
If Not EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo) Then
If EgtExistsInfo(nBTLInfoLayerId, GeneralParameter.sNameNge) Then
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo)
Else
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
sInfo = sTmpInfo
Return
End If
End If
Next
+59 -59
View File
@@ -642,12 +642,10 @@ Public Class ProjectVM
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
EgtGetInfo(nBTLInfoLayerId, AI_SETUP, sStrategyBTLSetup)
If Map.refProjectVM.bSaveGeneralParameters Then
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
Else
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
EgtGetInfo(nBTLInfoLayerId, AI_SETUP, sStrategyBTLSetup)
If IsNothing(sStrategyBTLSetup) Then
If String.IsNullOrWhiteSpace(sStrategyBTLSetup) Then
If Map.refProjectVM.bSaveGeneralParameters Then
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
Else
If EgtUILib.GetPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sStrategyBTLSetup, Map.refMainWindowVM.MainWindowM.sDefaultConfig) <> 0 Then
Map.refProjectVM.SelStrategySetup = sStrategyBTLSetup
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
@@ -664,10 +662,10 @@ Public Class ProjectVM
Map.refProjectVM.SelStrategySetup = sTmpStrategySetup
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
End If
Else
Map.refProjectVM.SelStrategySetup = sStrategyBTLSetup
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
End If
Else
Map.refProjectVM.SelStrategySetup = sStrategyBTLSetup
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
End If
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(nType)
@@ -698,69 +696,68 @@ Public Class ProjectVM
For Each GeneralParameter In m_GeneralParametersList
Select Case GeneralParameter.GetType()
Case GetType(BooleanGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
'Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
Dim sTmpBoolValue As Boolean = False
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpBoolValue)
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue) Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Else
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
'Return
End If
Case GetType(DoubleGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
'Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
Dim sTmpDoubleValue As String = String.Empty
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpDoubleValue)
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue) Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Else
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
'Return
End If
Case GetType(ComboGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
'Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
Dim sTmpComboValue As String = String.Empty
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpComboValue)
Dim sTmpValueInfo As String = String.Empty
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sTmpValueInfo)
If sTmpValueInfo = String.Empty Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sTmpValueInfo)
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
Else
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
'Return
Else
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
End If
Case GetType(StringGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
'Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
Dim sTmpStringValue As String = String.Empty
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpStringValue)
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue) Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
Else
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
'Return
End If
Case GetType(ListGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
Dim sTmpInfo As String = sInfo
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo) Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
Else
sInfo = sTmpInfo
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
'Return
End If
End If
Next
@@ -820,61 +817,64 @@ Public Class ProjectVM
For Each GeneralParameter In m_GeneralParametersList
Select Case GeneralParameter.GetType()
Case GetType(BooleanGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue) Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Else
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
Return
End If
Case GetType(DoubleGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue) Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Else
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
Return
End If
Case GetType(ComboGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
Dim sTmpValueInfo As String = String.Empty
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sTmpValueInfo)
If sTmpValueInfo = String.Empty Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sTmpValueInfo)
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
Else
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
Return
Else
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList.FirstOrDefault(Function(x) x.sValue = sTmpValueInfo)
End If
Case GetType(StringGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue) Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
Else
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
Return
End If
Case GetType(ListGenericParameter)
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
Dim sTmpInfo As String = sInfo
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo) Then
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
Else
sInfo = sTmpInfo
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
Return
End If
End If
Next