-piccole correzioni
This commit is contained in:
@@ -177,138 +177,6 @@ Public Class BTLPartManagerVM
|
||||
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
|
||||
End Sub
|
||||
|
||||
Private Sub GetGeneralParameters(bValuePart As Boolean)
|
||||
Map.refProjectVM.StrategySetupList.Clear()
|
||||
' leggo cartella dei setup delle strategie
|
||||
Dim AISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(ProjectManagerVM.CurrProd.nType, True)
|
||||
Dim AISetupPaths As String() = Directory.GetFiles(AISetupDirPath).Where(Function(f) Path.GetExtension(f).ToLower() <> ".ini").ToArray()
|
||||
For Each AiSetup In AISetupPaths
|
||||
Map.refProjectVM.StrategySetupList.Add(Path.GetFileNameWithoutExtension(AiSetup))
|
||||
Next
|
||||
|
||||
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(Map.refStrategyManagerVM.SelStrategyType.Id)
|
||||
Dim sGeneralParametersFilePath As String = sStrategiesDirPath & "\" & GENERALPARAMETERS_FILE & ".json"
|
||||
If File.Exists(sGeneralParametersFilePath) Then
|
||||
Dim sReadedFiles As String = File.ReadAllText(sGeneralParametersFilePath)
|
||||
Dim JsonGeneralParametersList As List(Of JsonGeneralParameters) = JsonConvert.DeserializeObject(Of List(Of JsonGeneralParameters))(sReadedFiles)
|
||||
Map.refProjectVM.GeneralParametersList = New ObservableCollection(Of ProjectParameters)((From JsonGeneralParameter In JsonGeneralParametersList
|
||||
Select JsonGeneralParameter.Deserialize(Map.refStrategyManagerVM.SelStrategyType.Id)).ToList())
|
||||
For Each GenericItem As ProjectParameters In Map.refProjectVM.GeneralParametersList
|
||||
Select Case GenericItem.sMinUserLevel
|
||||
Case UserLevel.ADVANCED
|
||||
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UserAdmin_IsChecked, Visibility.Visible, Visibility.Collapsed))
|
||||
Case UserLevel.ADMINISTRATOR
|
||||
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, Visibility.Visible, Visibility.Collapsed))
|
||||
Case Else
|
||||
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
|
||||
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, Visibility.Visible, Visibility.Collapsed))
|
||||
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(Map.refProjectVM.GeneralParametersList))
|
||||
End If
|
||||
|
||||
' Leggo info se presenti
|
||||
Dim sInfo As String = String.Empty
|
||||
Dim sStrategyBTLSetup As String = String.Empty
|
||||
Dim sTmpStrategySetup As String = String.Empty
|
||||
Dim nBTLInfoLayerId As Integer = 0
|
||||
If bValuePart Then
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, Map.refProjectVM.SelStrategySetup)
|
||||
Else
|
||||
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
EgtGetInfo(nBTLInfoLayerId, AI_SETUP, sStrategyBTLSetup)
|
||||
If IsNothing(sStrategyBTLSetup) Then
|
||||
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, Map.refProjectVM.SelStrategySetup)
|
||||
Else
|
||||
' restituisce la lista dei file presenti nella cartella con le relative informazioni
|
||||
Dim StrategySetupListFile As List(Of FileInfo) = Map.refProjectVM.StrategySetupList.Where(Function(f) File.Exists(AISetupDirPath & "\" & f & ".json")).
|
||||
Select(Function(f) New FileInfo(AISetupDirPath & "\" & f & ".json")).
|
||||
OrderByDescending(Function(fi) fi.LastWriteTime).ToList()
|
||||
' restituisce l'ultimo file modificato
|
||||
If StrategySetupListFile.Any() Then
|
||||
sStrategyBTLSetup = Path.GetFileNameWithoutExtension(StrategySetupListFile.First().Name)
|
||||
End If
|
||||
sTmpStrategySetup = Map.refProjectVM.StrategySetupList.FirstOrDefault(Function(x) x = sStrategyBTLSetup)
|
||||
Map.refProjectVM.SelStrategySetup = sTmpStrategySetup
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, Map.refProjectVM.SelStrategySetup)
|
||||
End If
|
||||
Else
|
||||
Map.refProjectVM.SelStrategySetup = sStrategyBTLSetup
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, Map.refProjectVM.SelStrategySetup)
|
||||
End If
|
||||
End If
|
||||
For Each GeneralParameter In Map.refProjectVM.GeneralParametersList
|
||||
Select Case GeneralParameter.GetType()
|
||||
Case GetType(BooleanGenericParameter)
|
||||
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)
|
||||
End If
|
||||
Case GetType(DoubleGenericParameter)
|
||||
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)
|
||||
End If
|
||||
Case GetType(ComboGenericParameter)
|
||||
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)
|
||||
End If
|
||||
Case GetType(StringGenericParameter)
|
||||
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)
|
||||
End If
|
||||
Case GetType(ListGenericParameter)
|
||||
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)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -492,7 +360,7 @@ Public Class BTLPartManagerVM
|
||||
Next
|
||||
|
||||
If bValuePart Then
|
||||
GetGeneralParameters(bValuePart)
|
||||
Map.refProjectVM.GetGeneralParameters(bValuePart)
|
||||
Else
|
||||
Map.refProjectVM.Read(ProjectManagerVM.CurrProd.nType)
|
||||
End If
|
||||
|
||||
@@ -378,6 +378,12 @@ Public Class ProjectVM
|
||||
NotifyPropertyChanged(NameOf(SelStrategySetup))
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetSelStrategy(value As String)
|
||||
m_SelStrategySetup = value
|
||||
Map.refStrategyManagerVM.SelStrategySetup.Read()
|
||||
Map.refSceneHostVM.SaveProject()
|
||||
NotifyPropertyChanged(NameOf(SelStrategySetup))
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
@@ -583,7 +589,7 @@ Public Class ProjectVM
|
||||
|
||||
Friend Sub ResetGeneralParameters()
|
||||
Dim sInfo As String = String.Empty
|
||||
For Each PartItem As BTLPartVM In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
For Each PartItem As BTLPartVM In m_BTLStructureVM.BTLPartVMList
|
||||
PartItem.SetStrategyModify_Visibility(Visibility.Collapsed)
|
||||
For Each FeatureItem As BTLFeatureVM In PartItem.BTLFeatureVMList
|
||||
FeatureItem.SetbStrategy_Visibility(Visibility.Collapsed)
|
||||
@@ -591,31 +597,31 @@ Public Class ProjectVM
|
||||
For Each GeneralParameter In m_GeneralParametersList
|
||||
Select Case GeneralParameter.GetType()
|
||||
Case GetType(BooleanGenericParameter)
|
||||
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
||||
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(DoubleGenericParameter)
|
||||
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
||||
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(ComboGenericParameter)
|
||||
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
||||
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(StringGenericParameter)
|
||||
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
||||
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(ListGenericParameter)
|
||||
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
|
||||
If Item.bIsActive Then
|
||||
sInfo &= Item.sUUID & "," & Item.sName & ";"
|
||||
Map.refProjectVM.SetbSaveGeneralParameters(False)
|
||||
Map.refProjectVM.SetGeneralParametersIsEnable(False)
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
EgtRemoveInfo(PartItem.nPartId, GeneralParameter.sNameNge)
|
||||
End If
|
||||
Next
|
||||
@@ -637,35 +643,37 @@ Public Class ProjectVM
|
||||
|
||||
' Leggo info se presenti
|
||||
Dim sStrategyBTLSetup As String = String.Empty
|
||||
Dim sStrategyPartSetup As String = String.Empty
|
||||
Dim sTmpStrategySetup As String = String.Empty
|
||||
Dim nBTLInfoLayerId As Integer = 0
|
||||
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
EgtGetInfo(nBTLInfoLayerId, AI_SETUP, sStrategyBTLSetup)
|
||||
|
||||
If String.IsNullOrWhiteSpace(sStrategyBTLSetup) Then
|
||||
If Map.refProjectVM.bSaveGeneralParameters Then
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, sStrategyPartSetup)
|
||||
|
||||
If String.IsNullOrWhiteSpace(sStrategyPartSetup) Then
|
||||
If bSaveGeneralParameters Then
|
||||
EgtGetInfo(m_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)
|
||||
SetSelStrategy(sStrategyBTLSetup)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
Else
|
||||
' restituisce la lista dei file presenti nella cartella con le relative informazioni
|
||||
Dim StrategySetupListFile As List(Of FileInfo) = Map.refProjectVM.StrategySetupList.Where(Function(f) File.Exists(AISetupDirPath & "\" & f & ".json")).
|
||||
Select(Function(f) New FileInfo(AISetupDirPath & "\" & f & ".json")).
|
||||
OrderByDescending(Function(fi) fi.LastWriteTime).ToList()
|
||||
Dim StrategySetupListFile As List(Of FileInfo) = m_StrategySetupList.Where(Function(f) File.Exists(AISetupDirPath & "\" & f & ".json")).
|
||||
Select(Function(f) New FileInfo(AISetupDirPath & "\" & f & ".json")).
|
||||
OrderByDescending(Function(fi) fi.LastWriteTime).ToList()
|
||||
' restituisce l'ultimo file modificato
|
||||
If StrategySetupListFile.Any() Then
|
||||
sStrategyBTLSetup = Path.GetFileNameWithoutExtension(StrategySetupListFile.First().Name)
|
||||
End If
|
||||
sTmpStrategySetup = Map.refProjectVM.StrategySetupList.FirstOrDefault(Function(x) x = sStrategyBTLSetup)
|
||||
Map.refProjectVM.SelStrategySetup = sTmpStrategySetup
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
sTmpStrategySetup = m_StrategySetupList.FirstOrDefault(Function(x) x = sStrategyBTLSetup)
|
||||
SetSelStrategy(sTmpStrategySetup)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
Map.refProjectVM.SelStrategySetup = sStrategyBTLSetup
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
SetSelStrategy(sStrategyPartSetup)
|
||||
End If
|
||||
|
||||
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(nType)
|
||||
@@ -698,10 +706,10 @@ Public Class ProjectVM
|
||||
Case GetType(BooleanGenericParameter)
|
||||
Dim sTmpBoolValue As Boolean = False
|
||||
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpBoolValue)
|
||||
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
|
||||
Else
|
||||
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
|
||||
SetGeneralParametersIsEnable(False)
|
||||
@@ -710,10 +718,10 @@ Public Class ProjectVM
|
||||
Case GetType(DoubleGenericParameter)
|
||||
Dim sTmpDoubleValue As String = String.Empty
|
||||
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpDoubleValue)
|
||||
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
|
||||
Else
|
||||
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
|
||||
SetGeneralParametersIsEnable(False)
|
||||
@@ -723,10 +731,10 @@ Public Class ProjectVM
|
||||
Dim sTmpComboValue As String = String.Empty
|
||||
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpComboValue)
|
||||
Dim sTmpValueInfo As String = String.Empty
|
||||
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sTmpValueInfo)
|
||||
EgtGetInfo(m_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
|
||||
@@ -736,10 +744,10 @@ Public Class ProjectVM
|
||||
Case GetType(StringGenericParameter)
|
||||
Dim sTmpStringValue As String = String.Empty
|
||||
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpStringValue)
|
||||
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
|
||||
Else
|
||||
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
|
||||
SetGeneralParametersIsEnable(False)
|
||||
@@ -750,10 +758,10 @@ Public Class ProjectVM
|
||||
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
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
|
||||
Else
|
||||
sInfo = sTmpInfo
|
||||
SetGeneralParametersIsEnable(False)
|
||||
@@ -812,16 +820,16 @@ Public Class ProjectVM
|
||||
' Leggo info se presenti
|
||||
Dim sInfo As String = String.Empty
|
||||
Dim sDefaultConfig As String = String.Empty
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, sDefaultConfig)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, sDefaultConfig)
|
||||
If SelStrategySetupCombo.Equals(sDefaultConfig) Then
|
||||
For Each GeneralParameter In m_GeneralParametersList
|
||||
Select Case GeneralParameter.GetType()
|
||||
Case GetType(BooleanGenericParameter)
|
||||
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
|
||||
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
|
||||
Else
|
||||
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
|
||||
SetGeneralParametersIsEnable(False)
|
||||
@@ -829,10 +837,10 @@ Public Class ProjectVM
|
||||
End If
|
||||
Case GetType(DoubleGenericParameter)
|
||||
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
|
||||
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
|
||||
Else
|
||||
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
|
||||
SetGeneralParametersIsEnable(False)
|
||||
@@ -841,10 +849,10 @@ Public Class ProjectVM
|
||||
Case GetType(ComboGenericParameter)
|
||||
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
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sTmpValueInfo)
|
||||
EgtGetInfo(m_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
|
||||
@@ -853,10 +861,10 @@ Public Class ProjectVM
|
||||
End If
|
||||
Case GetType(StringGenericParameter)
|
||||
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
|
||||
If EgtExistsInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
|
||||
Else
|
||||
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
|
||||
SetGeneralParametersIsEnable(False)
|
||||
@@ -867,10 +875,10 @@ Public Class ProjectVM
|
||||
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
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetGeneralParametersIsEnable(True)
|
||||
SetbSaveGeneralParameters(True)
|
||||
EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
|
||||
Else
|
||||
sInfo = sTmpInfo
|
||||
SetGeneralParametersIsEnable(False)
|
||||
@@ -884,6 +892,139 @@ Public Class ProjectVM
|
||||
NotifyPropertyChanged(NameOf(GeneralParametersList))
|
||||
End Sub
|
||||
|
||||
Friend Sub GetGeneralParameters(bValuePart As Boolean)
|
||||
m_StrategySetupList.Clear()
|
||||
' leggo cartella dei setup delle strategie
|
||||
Dim AISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(ProjectManagerVM.CurrProd.nType, True)
|
||||
Dim AISetupPaths As String() = Directory.GetFiles(AISetupDirPath).Where(Function(f) Path.GetExtension(f).ToLower() <> ".ini").ToArray()
|
||||
For Each AiSetup In AISetupPaths
|
||||
Map.refProjectVM.StrategySetupList.Add(Path.GetFileNameWithoutExtension(AiSetup))
|
||||
Next
|
||||
|
||||
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(Map.refStrategyManagerVM.SelStrategyType.Id)
|
||||
Dim sGeneralParametersFilePath As String = sStrategiesDirPath & "\" & GENERALPARAMETERS_FILE & ".json"
|
||||
If File.Exists(sGeneralParametersFilePath) Then
|
||||
Dim sReadedFiles As String = File.ReadAllText(sGeneralParametersFilePath)
|
||||
Dim JsonGeneralParametersList As List(Of JsonGeneralParameters) = JsonConvert.DeserializeObject(Of List(Of JsonGeneralParameters))(sReadedFiles)
|
||||
m_GeneralParametersList = New ObservableCollection(Of ProjectParameters)((From JsonGeneralParameter In JsonGeneralParametersList
|
||||
Select JsonGeneralParameter.Deserialize(Map.refStrategyManagerVM.SelStrategyType.Id)).ToList())
|
||||
|
||||
For Each GenericItem As ProjectParameters In m_GeneralParametersList
|
||||
Select Case GenericItem.sMinUserLevel
|
||||
Case UserLevel.ADVANCED
|
||||
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UserAdmin_IsChecked, Visibility.Visible, Visibility.Collapsed))
|
||||
Case UserLevel.ADMINISTRATOR
|
||||
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, Visibility.Visible, Visibility.Collapsed))
|
||||
Case Else
|
||||
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
|
||||
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, Visibility.Visible, Visibility.Collapsed))
|
||||
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(GeneralParametersList))
|
||||
End If
|
||||
|
||||
' Leggo info se presenti
|
||||
Dim sInfo As String = String.Empty
|
||||
Dim sStrategyBTLSetup As String = String.Empty
|
||||
Dim sTmpStrategySetup As String = String.Empty
|
||||
Dim nBTLInfoLayerId As Integer = 0
|
||||
If bValuePart Then
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, Map.refProjectVM.SelStrategySetup)
|
||||
Else
|
||||
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
EgtGetInfo(nBTLInfoLayerId, AI_SETUP, sStrategyBTLSetup)
|
||||
If IsNothing(sStrategyBTLSetup) Then
|
||||
If EgtUILib.GetPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sStrategyBTLSetup, Map.refMainWindowVM.MainWindowM.sDefaultConfig) <> 0 Then
|
||||
SetSelStrategy(sStrategyBTLSetup)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
Else
|
||||
' restituisce la lista dei file presenti nella cartella con le relative informazioni
|
||||
Dim StrategySetupListFile As List(Of FileInfo) = m_StrategySetupList.Where(Function(f) File.Exists(AISetupDirPath & "\" & f & ".json")).
|
||||
Select(Function(f) New FileInfo(AISetupDirPath & "\" & f & ".json")).
|
||||
OrderByDescending(Function(fi) fi.LastWriteTime).ToList()
|
||||
' restituisce l'ultimo file modificato
|
||||
If StrategySetupListFile.Any() Then
|
||||
sStrategyBTLSetup = Path.GetFileNameWithoutExtension(StrategySetupListFile.First().Name)
|
||||
End If
|
||||
sTmpStrategySetup = m_StrategySetupList.FirstOrDefault(Function(x) x = sStrategyBTLSetup)
|
||||
SetSelStrategy(sTmpStrategySetup)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
End If
|
||||
Else
|
||||
SetSelStrategy(sStrategyBTLSetup)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
End If
|
||||
End If
|
||||
For Each GeneralParameter In m_GeneralParametersList
|
||||
Select Case GeneralParameter.GetType()
|
||||
Case GetType(BooleanGenericParameter)
|
||||
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetbSaveGeneralParameters(True)
|
||||
SetGeneralParametersIsEnable(True)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
|
||||
Else
|
||||
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
End If
|
||||
Case GetType(DoubleGenericParameter)
|
||||
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetbSaveGeneralParameters(True)
|
||||
SetGeneralParametersIsEnable(True)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
|
||||
Else
|
||||
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
End If
|
||||
Case GetType(ComboGenericParameter)
|
||||
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
|
||||
Dim sTmpValueInfo As String = String.Empty
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetbSaveGeneralParameters(True)
|
||||
SetGeneralParametersIsEnable(True)
|
||||
EgtGetInfo(m_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
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
End If
|
||||
Case GetType(StringGenericParameter)
|
||||
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
|
||||
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetbSaveGeneralParameters(True)
|
||||
SetGeneralParametersIsEnable(True)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
|
||||
Else
|
||||
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
End If
|
||||
Case GetType(ListGenericParameter)
|
||||
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(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
|
||||
SetbSaveGeneralParameters(True)
|
||||
SetGeneralParametersIsEnable(True)
|
||||
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
|
||||
Else
|
||||
sInfo = sTmpInfo
|
||||
SetbSaveGeneralParameters(False)
|
||||
SetGeneralParametersIsEnable(False)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMAND"
|
||||
@@ -936,14 +1077,14 @@ Public Class ProjectVM
|
||||
End Property
|
||||
|
||||
Public Sub Back()
|
||||
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Visible)
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.SetFeatureListVisibility(Visibility.Visible)
|
||||
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Collapsed)
|
||||
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
|
||||
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
|
||||
SetRawPartManagerVisibility(Visibility.Visible)
|
||||
If Not IsNothing(m_MachGroupPanelVM) Then Map.refProjectVM.SetFeatureListVisibility(Visibility.Visible)
|
||||
SetStrategyManagerVisibility(Visibility.Collapsed)
|
||||
SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
|
||||
SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
|
||||
' Abilito LeftPanel
|
||||
Map.refProjectVM.SetLeftPanel_IsEnabled(True)
|
||||
Map.refProjectVM.SetLeftPanel_Opacity(1)
|
||||
SetLeftPanel_IsEnabled(True)
|
||||
SetLeftPanel_Opacity(1)
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel_Command
|
||||
@@ -961,70 +1102,70 @@ Public Class ProjectVM
|
||||
|
||||
Public Sub Ok()
|
||||
NotifyPropertyChanged(NameOf(GeneralParametersList))
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
|
||||
Dim sInfo As String = String.Empty
|
||||
If m_bSaveGeneralParameters Then
|
||||
For Each GeneralParameter In m_GeneralParametersList
|
||||
Select Case GeneralParameter.GetType()
|
||||
Case GetType(BooleanGenericParameter)
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, BooleanGenericParameter).bIsBooleanModify)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, BooleanGenericParameter).bIsBooleanModify)
|
||||
Case GetType(DoubleGenericParameter)
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, DoubleGenericParameter).bIsDoubleModify)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, DoubleGenericParameter).bIsDoubleModify)
|
||||
Case GetType(ComboGenericParameter)
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue)
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, ComboGenericParameter).bIsComboBoxModify)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, ComboGenericParameter).bIsComboBoxModify)
|
||||
Case GetType(StringGenericParameter)
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, StringGenericParameter).bIsStringModify)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, StringGenericParameter).bIsStringModify)
|
||||
Case GetType(ListGenericParameter)
|
||||
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
|
||||
If Item.bIsActive Then
|
||||
sInfo &= Item.sUUID & "," & Item.sName & ";"
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo)
|
||||
End If
|
||||
Next
|
||||
EgtSetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, ListGenericParameter).bIsListModify)
|
||||
EgtSetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED", DirectCast(GeneralParameter, ListGenericParameter).bIsListModify)
|
||||
End Select
|
||||
Next
|
||||
Else
|
||||
For Each GeneralParameter In m_GeneralParametersList
|
||||
Select Case GeneralParameter.GetType()
|
||||
Case GetType(BooleanGenericParameter)
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(DoubleGenericParameter)
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(ComboGenericParameter)
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(StringGenericParameter)
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
Case GetType(ListGenericParameter)
|
||||
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
|
||||
If Item.bIsActive Then
|
||||
sInfo &= Item.sUUID & "," & Item.sName & ";"
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge)
|
||||
End If
|
||||
Next
|
||||
EgtRemoveInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
EgtRemoveInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge & "_FORCED")
|
||||
End Select
|
||||
Next
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.SetStrategyModify_Visibility(Visibility.Collapsed)
|
||||
m_BTLStructureVM.SelBTLPart.SetStrategyModify_Visibility(Visibility.Collapsed)
|
||||
End If
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.ResetCalcFeature()
|
||||
If Not IsNothing(m_BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then m_BTLStructureVM.SelBTLPart.SelBTLFeatureVM.ResetCalcFeature()
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart()
|
||||
If Map.refProdManagerVM.ListProjAsseBase.Count > 0 Then UpdatePart(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
|
||||
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Visible)
|
||||
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Collapsed)
|
||||
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
|
||||
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
|
||||
If Map.refProdManagerVM.ListProjAsseBase.Count > 0 Then UpdatePart(m_BTLStructureVM.SelBTLPart.nPartId)
|
||||
SetRawPartManagerVisibility(Visibility.Visible)
|
||||
SetStrategyManagerVisibility(Visibility.Collapsed)
|
||||
SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
|
||||
SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
|
||||
' Abilito LeftPanel
|
||||
Map.refProjectVM.SetLeftPanel_IsEnabled(True)
|
||||
Map.refProjectVM.SetLeftPanel_Opacity(1)
|
||||
SetLeftPanel_IsEnabled(True)
|
||||
SetLeftPanel_Opacity(1)
|
||||
Map.refSceneHostVM.SaveProject()
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user