Merge remote-tracking branch 'origin/feature/NewGraphicsProgram' into feature/RipristinoSiemens

This commit is contained in:
Emmanuele Sassi
2026-04-30 14:59:43 +02:00
11 changed files with 171 additions and 342 deletions
@@ -75,7 +75,7 @@ Public Class BTLDataWndVM
Return m_sErrText
End Get
End Property
Friend Sub SetIErrText(value As String)
Friend Sub SetErrText(value As String)
m_sErrText = value
NotifyPropertyChanged(NameOf(ErrText))
End Sub
@@ -626,60 +626,21 @@ Public Class BTLDataWndVM
If EgtGetInfo(m_nBTLInfoLayerId, AI_SETUP, sDefaultConfigFile) Then
If m_StrategySetupList.Contains(sDefaultConfigFile) Then
m_SelStrategySetup = sDefaultConfigFile
SetIErrText(String.Empty)
SetErrText(String.Empty)
Else
SetIErrText(EgtMsg(62113) & sDefaultConfigFile & EgtMsg(62114))
SetErrText(EgtMsg(62113) & sDefaultConfigFile & EgtMsg(62114))
End If
ElseIf EgtUILib.GetPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sDefaultConfigFile, Map.refMainWindowVM.MainWindowM.sDefaultConfig) <> 0 Then
m_SelStrategySetup = sDefaultConfigFile
End If
If Not EgtExistsInfo(m_nBTLInfoLayerId, AI_SETUP) AndAlso Not IsNothing(m_SelStrategySetup) Then EgtSetInfo(m_nBTLInfoLayerId, AI_SETUP, m_SelStrategySetup)
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(nType)
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, True, False))
Case UserLevel.ADMINISTRATOR
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, True, False))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, True, False))
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
End If
End Select
Next
End If
GetGeneralParamtersList(nType)
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(nType, True)
Dim sStrategyConfigurationFilePath As String = sAISetupDirPath & "\" & SelStrategySetup & ".json"
If File.Exists(sStrategyConfigurationFilePath) Then
Dim sReadedFile As String = File.ReadAllText(sStrategyConfigurationFilePath)
Dim JsonRoot As CustomJsonRoot = Nothing
Try
JsonRoot = JsonConvert.DeserializeObject(Of CustomJsonRoot)(sReadedFile)
Catch ex As Exception
JsonRoot = Nothing
Return
End Try
For Each ProjectItem In JsonRoot.GENERAL
Dim DefaultProject As ProjectParameters = m_GeneralParametersList.FirstOrDefault(Function(x) x.sName = ProjectItem.sName)
If Not IsNothing(DefaultProject) Then
DefaultProject.ReadConfiguration(ProjectItem, m_GeneralParametersList)
Else
EgtOutLog("Parametro Generale: " & ProjectItem.sName & " non presente")
End If
Next
End If
ReadGeneralConfiguration(sStrategyConfigurationFilePath)
' Leggo info se presenti
Dim sInfo As String = String.Empty
@@ -700,12 +661,20 @@ Public Class BTLDataWndVM
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
End If
Case GetType(ComboGenericParameter)
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
Dim sTmpComboValue As String = String.Empty
If Not IsNothing(DirectCast(GeneralParameter, ComboGenericParameter).SelValue) Then
sTmpComboValue = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
Else
sTmpComboValue = DirectCast(GeneralParameter, ComboGenericParameter).ComboList(0).sValue
End If
Dim sTmpValueInfo As String = String.Empty
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
If IsNothing(DirectCast(GeneralParameter, ComboGenericParameter).SelValue) Then
DirectCast(GeneralParameter, ComboGenericParameter).SelValue = New ComboParameter
End If
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
End If
Case GetType(StringGenericParameter)
@@ -732,54 +701,15 @@ Public Class BTLDataWndVM
End Sub
Friend Sub ReadCustomGeneralParameters(SelStrategySetup As String)
SetIErrText(String.Empty)
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())
SetErrText(String.Empty)
GetGeneralParamtersList(Map.refStrategyManagerVM.SelStrategyType.Id)
For Each GenericItem As ProjectParameters In m_GeneralParametersList
Select Case GenericItem.sMinUserLevel
Case UserLevel.ADVANCED
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UserAdmin_IsChecked, True, False))
Case UserLevel.ADMINISTRATOR
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, True, False))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, True, False))
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
End If
End Select
Next
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(Map.refStrategyManagerVM.SelStrategyType.Id, False)
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(Map.refStrategyManagerVM.SelStrategyType.Id, False)
Dim sStrategyConfigurationFilePath As String = sAISetupDirPath & "\" & SelStrategySetup & ".json"
ReadGeneralConfiguration(sStrategyConfigurationFilePath)
Dim sStrategyConfigurationFilePath As String = sAISetupDirPath & "\" & SelStrategySetup & ".json"
If File.Exists(sStrategyConfigurationFilePath) Then
Dim sReadedFile As String = File.ReadAllText(sStrategyConfigurationFilePath)
Dim JsonRoot As CustomJsonRoot = Nothing
Try
JsonRoot = JsonConvert.DeserializeObject(Of CustomJsonRoot)(sReadedFile)
Catch ex As Exception
JsonRoot = Nothing
Return
End Try
For Each ProjectItem In JsonRoot.GENERAL
Dim DefaultProject As ProjectParameters = m_GeneralParametersList.FirstOrDefault(Function(x) x.sName = ProjectItem.sName)
If Not IsNothing(DefaultProject) Then
DefaultProject.ReadConfiguration(ProjectItem, m_GeneralParametersList)
Else
EgtOutLog("Parametro Generale: " & ProjectItem.sName & " non presente")
End If
Next
End If
NotifyPropertyChanged(NameOf(GeneralParametersList))
End If
NotifyPropertyChanged(NameOf(GeneralParametersList))
End Sub
Friend Sub SaveInfoBTL(nType As BWType)
@@ -861,6 +791,58 @@ Public Class BTLDataWndVM
Next
End Sub
Private Sub ReadGeneralConfiguration(sStrategyConfigurationFilePath As String)
If File.Exists(sStrategyConfigurationFilePath) Then
Dim sReadedFile As String = File.ReadAllText(sStrategyConfigurationFilePath)
Dim JsonRoot As CustomJsonRoot = Nothing
Try
JsonRoot = JsonConvert.DeserializeObject(Of CustomJsonRoot)(sReadedFile)
Catch ex As Exception
JsonRoot = Nothing
Return
End Try
For Each ProjectItem In JsonRoot.GENERAL
Dim DefaultProject As ProjectParameters = m_GeneralParametersList.FirstOrDefault(Function(x) x.sName = ProjectItem.sName)
If Not IsNothing(DefaultProject) Then
DefaultProject.ReadConfiguration(ProjectItem, m_GeneralParametersList)
Else
EgtOutLog("Parametro Generale: " & ProjectItem.sName & " non presente")
End If
Next
End If
End Sub
Private Sub GetGeneralParamtersList(nTypeId As BWType)
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(nTypeId)
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())
UserLevelControl(m_GeneralParametersList)
End If
End Sub
Private Sub UserLevelControl(GeneralParametersList As ObservableCollection(Of ProjectParameters))
For Each GenericItem As ProjectParameters In GeneralParametersList
Select Case GenericItem.sMinUserLevel
Case UserLevel.ADVANCED
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UserAdmin_IsChecked, True, False))
Case UserLevel.ADMINISTRATOR
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, True, False))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, True, False))
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
End If
End Select
Next
End Sub
#End Region ' METHODS
#Region "COMMANDS"
@@ -894,7 +876,7 @@ Public Class BTLDataWndVM
#End Region ' Ok
#Region "Ok"
#Region "Cancel"
Public ReadOnly Property Cancel_Command As ICommand
Get
@@ -909,7 +891,7 @@ Public Class BTLDataWndVM
RaiseEvent m_CloseWindow(False)
End Sub
#End Region ' Ok
#End Region ' Cancel
#End Region ' COMMANDS
@@ -275,6 +275,7 @@ Public Class BTLPartManagerVM
Private Sub RemoveScenePart(BTLPartToDelete As BTLPartVM)
' Rimuovo pezzo dalla scena
Dim IdAsseBase As Integer = Map.refProdManagerVM.ListProjAsseBase(BTLPartToDelete.nPROJ)
If IdAsseBase < 0 Then Return
' Setto il nuovo contesto
EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx())
If EgtBeamGetBuildingIsOn(IdAsseBase) Then EgtBeamShowBuilding(IdAsseBase, False)
@@ -361,6 +362,7 @@ Public Class BTLPartManagerVM
Else
Map.refProjectVM.Read(ProjectManagerVM.CurrProd.nType)
End If
Map.refProjectVM.SetRawPartManagerVisibility(False)
Map.refProjectVM.SetFeatureListVisibility(False)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.FEATUREMANAGER)
@@ -125,7 +125,6 @@ Public Class BTLStructureVM
EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight)
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
Dim MachGroupList As New List(Of MyMachGroupVM)
For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
Dim bFound As Boolean = False
For Each Part As PartVM In Machgroup.PartVMList
@@ -1382,15 +1381,6 @@ Public Class BTLStructureVM
GetMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, "", sDir)
If bWithDlg Then
' apro finestra scelta file
'Dim BTLDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
' .Title = EgtMsg(61834),
' .Filter = "BTL (*.btl)|*.btl" &
' "|BTLX (*.btlx)|*.btlx",
' .FilterIndex = 1,
' .InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
' .CheckFileExists = True,
' .ValidateNames = True,
' .Mode = 1}
Dim BTLDlg As New Microsoft.Win32.OpenFileDialog() With {
.Title = EgtMsg(61834),
.DefaultExt = ".btl",
@@ -718,16 +718,6 @@ Public Class ConfigurationPageVM
End Property
Public Sub ChooseExternalBackupFolderPath()
'Dim FileDialog As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
' .Title = EgtMsg(63039),
' .Filter = "BTL (*.btl)|*.btl" &
' "|BTLX (*.btlx)|*.btlx",
' .InitialDirectory = m_ExternalBackupFolderPath,
' .FileName = "Select this ",
' .FilterIndex = 1,
' .CheckFileExists = False,
' .OverwritePrompt = False,
' .Mode = 1}
Dim FileDialog As New Microsoft.Win32.SaveFileDialog() With {.InitialDirectory = m_ExternalBackupFolderPath,
.CheckFileExists = False,
.CheckPathExists = False,
@@ -505,15 +505,6 @@ Public Class ProdManagerVM
GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
' apro finestra scelta file
Dim sImportFilePath As String = ""
'Dim BTLDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
' .Title = EgtMsg(61840),
' .Filter = "BTL (*.btl)|*.btl" &
' "|BTLX (*.btlx)|*.btlx",
' .FilterIndex = 1,
' .InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
' .CheckFileExists = True,
' .ValidateNames = True,
' .Mode = 1}
Dim BTLDlg As New Microsoft.Win32.OpenFileDialog() With {
.Title = EgtMsg(61840),
.DefaultExt = ".btl",
@@ -706,7 +697,7 @@ Public Class ProdManagerVM
Dim sDefaultConfigFile As String = String.Empty
If EgtUILib.GetPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sDefaultConfigFile, Map.refMainWindowVM.MainWindowM.sDefaultConfig) = 0 Then
SetFirstStrategy(GeneralParametersWndVM, sDefaultConfigFile, nType)
SetFirstStrategy(GeneralParametersWndVM, sDefaultConfigFile)
End If
GeneralParametersWndVM.SetbSaveGeneralParameters(True)
@@ -716,12 +707,6 @@ Public Class ProdManagerVM
m_BTLDataWnd.Read(nType)
m_BTLDataWnd.SaveInfoBTL(nType)
' Controllo se effettuare import + verifica
If Map.refConfigurationPageVM.bVerifyImportBTL_IsChecked Then
' Eseguo procedura
End If
SectionXMaterial.SetType(nType)
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTBTL, 2, EgtMsg(63005), 50, 70) ' Loading parts
' leggo struttura BTL per liste
@@ -867,12 +852,6 @@ Public Class ProdManagerVM
m_BTLDataWnd.Read(nType)
m_BTLDataWnd.SaveInfoBTL(nType)
' Controllo se effettuare import + verifica
If Map.refConfigurationPageVM.bVerifyImportBTL_IsChecked Then
' Eseguo procedura
End If
' leggo struttura BTL per liste
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
CopyBuilding()
@@ -1023,7 +1002,7 @@ Public Class ProdManagerVM
CopyBuilding()
' aggiorno Db
Dim ExportDate As DateTime
Dim sBTLFileName As String = " New - EgtBEAMWALL"
Dim sBTLFileName As String = " New - AEdifica"
DateTime.TryParse(Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPDATE & " " &
Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPTIME, ExportDate)
DbControllers.m_ProjController.UpdateInfo(nProjId, sBTLFileName, sBTLFileName, Map.refProjectVM.BTLStructureVM.sLISTNAME, ExportDate, nType, Machine.Name)
@@ -1434,14 +1413,6 @@ Public Class ProdManagerVM
End Sub
Private Sub ModifyStrategyInfo(BTLPartVMList As ObservableCollection(Of BTLPartVM))
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
@@ -1449,20 +1420,6 @@ Public Class ProdManagerVM
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, True, False))
Case UserLevel.ADMINISTRATOR
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, True, False))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, True, False))
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
End If
End Select
Next
NotifyPropertyChanged(NameOf(Map.refProjectVM.GeneralParametersList))
End If
Dim bValuePart As Boolean = False
@@ -1473,14 +1430,14 @@ Public Class ProdManagerVM
If bValuePart Then PartItem.SetStrategyModify_Visibility(True)
Next
Next
NotifyPropertyChanged(NameOf(Map.refProjectVM.GeneralParametersList))
End Sub
''' <summary>
''' Funzione che scrive il file json di default se non è presente un file di configurazione
''' </summary>
''' <param name="GeneralParametersWndVM"></param>
''' <param name="nType"></param>
Private Sub SetFirstStrategy(GeneralParametersWndVM As GeneralParametersWndVM, sDefaultConfigFile As String, nType As BWType)
Private Sub SetFirstStrategy(GeneralParametersWndVM As GeneralParametersWndVM, sDefaultConfigFile As String)
sDefaultConfigFile = "DefaultConfig"
Dim Strategy As New StrategySetup(sDefaultConfigFile)
Map.refStrategyManagerVM.SelStrategySetup = Strategy
@@ -1617,12 +1574,6 @@ Public Class ProdManagerVM
If IsNothing(CurrProd) Then Return Nothing
' apro finestra di salvataggio progetto
'Dim ExportDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
' .Title = EgtMsg(61838),
' .Filter = "ProjectExport (*.ngexp)|*.ngexp",
' .FilterIndex = 1,
' .FileName = CurrProd.nProdId.ToString("0000") & " - " & CurrProd.sName & " - ProjectExport.ngexp",
' .Mode = 1}
Dim ExportDlg As New Microsoft.Win32.SaveFileDialog() With {
.Title = EgtMsg(61838),
.DefaultExt = ".ngexp",
@@ -1730,14 +1681,6 @@ Public Class ProdManagerVM
Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, "", sDir)
' apro finestra scelta file
'Dim ImportDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
' .Title = EgtMsg(61839),
' .Filter = "ProjectExport (*.ngexp)|*.ngexp",
' .FilterIndex = 1,
' .InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
' .CheckFileExists = True,
' .ValidateNames = True,
' .Mode = 1}
Dim ImportDlg As New Microsoft.Win32.OpenFileDialog() With {
.Title = EgtMsg(61839),
.DefaultExt = ".ngexp",
@@ -2023,15 +1966,6 @@ Public Class ProdManagerVM
Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
Dim sFile As String = ""
'Dim BTLDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
' .Title = EgtMsg(63038),
' .Filter = "BTL (*.btl)|*.btl" &
' "|BTLX (*.btlx)|*.btlx",
' .FilterIndex = 1,
' .InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
' .CheckFileExists = True,
' .ValidateNames = True,
' .Mode = 1}
Dim BTLDlg As New Microsoft.Win32.OpenFileDialog() With {
.Title = EgtMsg(63038),
.DefaultExt = ".btl",
+71 -114
View File
@@ -555,6 +555,7 @@ Public Class ProjectVM
''' </summary>
Friend Sub UpdatePart(nPartId As Integer)
Dim IdAsseBase As Integer = Map.refProdManagerVM.ListProjAsseBase(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ)
If IdAsseBase < 0 Then Return
Dim IdPart As Integer = 0
Dim NewId As Integer = 0
' Setto il nuovo contesto
@@ -636,9 +637,7 @@ Public Class ProjectVM
' leggo cartella dei setup delle strategie
Dim AISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(nType, True)
Dim AISetupPaths As String() = Directory.GetFiles(AISetupDirPath).Where(Function(f) Path.GetExtension(f).ToLower() <> ".ini").ToArray()
For Each AiSetup In AISetupPaths
m_StrategySetupList.Add(Path.GetFileNameWithoutExtension(AiSetup))
Next
GetStrategySetupDir(AISetupPaths, ProjectManagerVM.CurrProd.nType)
' Leggo info se presenti
Dim sStrategyBTLSetup As String = String.Empty
@@ -677,28 +676,7 @@ Public Class ProjectVM
SetSelStrategy(sStrategyBTLPartSetup)
End If
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(nType)
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, True, False))
Case UserLevel.ADMINISTRATOR
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, True, False))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, True, False))
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
End If
End Select
Next
NotifyPropertyChanged(NameOf(GeneralParametersList))
End If
GetGeneralParamtersList(nType)
' Leggo info se presenti
Dim sInfo As String = String.Empty
@@ -708,94 +686,64 @@ Public Class ProjectVM
Dim sTmpBoolValue As Boolean = False
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpBoolValue)
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
SetGeneralParameters(True)
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Else
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
SetGeneralParameters(False)
End If
Case GetType(DoubleGenericParameter)
Dim sTmpDoubleValue As String = String.Empty
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpDoubleValue)
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
SetGeneralParameters(True)
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Else
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
SetGeneralParameters(False)
End If
Case GetType(ComboGenericParameter)
Dim sTmpComboValue As String = String.Empty
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpComboValue)
Dim sTmpValueInfo As String = String.Empty
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
SetGeneralParameters(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
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
SetGeneralParameters(False)
End If
Case GetType(StringGenericParameter)
Dim sTmpStringValue As String = String.Empty
EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, sTmpStringValue)
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
SetGeneralParameters(True)
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
Else
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
SetGeneralParameters(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 & ";"
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetGeneralParametersIsEnable(True)
SetbSaveGeneralParameters(True)
SetGeneralParameters(True)
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ListGenericParameter).sValue)
Else
DirectCast(GeneralParameter, ListGenericParameter).sValue = sInfo
SetGeneralParametersIsEnable(False)
SetbSaveGeneralParameters(False)
SetGeneralParameters(False)
End If
End If
Next
End Select
Next
NotifyPropertyChanged(NameOf(GeneralParametersList))
End Sub
Friend Sub CustomGeneralParameters(SelStrategySetupCombo As String)
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, True, False))
Case UserLevel.ADMINISTRATOR
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, True, False))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, True, False))
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
End If
End Select
Next
End If
GetGeneralParamtersList(Map.refStrategyManagerVM.SelStrategyType.Id)
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(Map.refStrategyManagerVM.SelStrategyType.Id, False)
@@ -880,33 +828,9 @@ Public Class ProjectVM
' 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
GetStrategySetupDir(AISetupPaths, ProjectManagerVM.CurrProd.nType)
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, True, False))
Case UserLevel.ADMINISTRATOR
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, True, False))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, True, False))
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
End If
End Select
Next
NotifyPropertyChanged(NameOf(GeneralParametersList))
End If
GetGeneralParamtersList(Map.refStrategyManagerVM.SelStrategyType.Id)
' Leggo info se presenti
Dim sInfo As String = String.Empty
@@ -914,7 +838,7 @@ Public Class ProjectVM
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)
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, AI_SETUP, m_SelStrategySetup)
Else
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
EgtGetInfo(nBTLInfoLayerId, AI_SETUP, sStrategyBTLSetup)
@@ -940,71 +864,104 @@ Public Class ProjectVM
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)
SetGeneralParameters(True)
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Else
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
SetGeneralParameters(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)
SetGeneralParameters(True)
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Else
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
SetGeneralParameters(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)
SetGeneralParameters(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)
SetGeneralParameters(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)
SetGeneralParameters(True)
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
Else
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
SetGeneralParameters(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 & ";"
If EgtExistsInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge) Then
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
SetGeneralParameters(True)
EgtGetInfo(m_BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ListGenericParameter).sValue)
Else
DirectCast(GeneralParameter, ListGenericParameter).sValue = sInfo
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
SetGeneralParameters(False)
End If
End If
Next
End Select
Next
NotifyPropertyChanged(NameOf(SelStrategySetup))
NotifyPropertyChanged(NameOf(GeneralParametersList))
End Sub
Private Sub GetStrategySetupDir(AISetupPaths As String(), nType As BWType)
For Each AiSetup In AISetupPaths
m_StrategySetupList.Add(Path.GetFileNameWithoutExtension(AiSetup))
Next
End Sub
Private Sub GetGeneralParamtersList(nTypeId As BWType)
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(nTypeId)
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())
UserLevelControl(m_GeneralParametersList)
End If
End Sub
Private Sub UserLevelControl(GeneralParametersList As ObservableCollection(Of ProjectParameters))
For Each GenericItem As ProjectParameters In GeneralParametersList
Select Case GenericItem.sMinUserLevel
Case UserLevel.ADVANCED
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UserAdmin_IsChecked, True, False))
Case UserLevel.ADMINISTRATOR
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UnlockAllIsChecked, True, False))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, True, False))
Map.refMainMenuVM.SetUnloackImage(PADLOCK_IMAGE)
End If
End Select
Next
End Sub
Private Sub SetGeneralParameters(bValue As Boolean)
SetbSaveGeneralParameters(bValue)
SetGeneralParametersIsEnable(bValue)
End Sub
#End Region ' Methods
@@ -87,14 +87,6 @@ Public Class MySceneHostVM
Dim sTitle As String = EgtMsg(10101)
If EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
' Apro dialogo per richiesta file licenza
'Dim LicDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
' .Title = EgtMsg(110026),
' .Filter = "Licences (.lic)|*.lic",
' .FilterIndex = 1,
' .InitialDirectory = Map.refMainWindowVM.MainWindowM.sConfigDir,
' .CheckFileExists = True,
' .ValidateNames = True,
' .Mode = 1}
Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
.Title = EgtMsg(110026),
.DefaultExt = ".lic",
@@ -117,8 +117,7 @@ Public Class ButtonBuildingItem
EgtSetStatus(ItemAsseBaseId, GDB_ST.OFF)
End If
Next
EgtZoom(ZM.ALL)
EgtDraw()
EgtRedraw()
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
End Sub
@@ -148,28 +148,25 @@ Public Class SceneShowBuldingVM
Dim nSel As Integer = 0
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
Dim nId As Integer = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
Dim nOrigPartId As Integer = nPartId
nOldPartId = nOrigPartId
Dim nCopId As Integer = 0
If EgtGetInfo(nPartId, "!COP", nCopId) Then
nPartId = nCopId
End If
Dim nOrIdKey As KeyValuePair(Of Integer, Integer) = Map.refSceneShowBuldingVM.MapInfo.FirstOrDefault(Function(x) x.Value = nPartId)
Dim nOrdId As Integer = nOrIdKey.Key
Dim BTLPartVM As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(y) y.nPartId = nOrdId)
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(BTLPartVM, True)
Map.refProjectVM.BTLStructureVM.SelectBTLPartScene(BTLPartVM, True)
' Setto il nuovo contesto
EgtSetCurrentContext(SceneShowBulding.GetCtx())
EgtSetStatus(nOrigPartId, GDB_ST.SEL)
EgtDraw()
nId = EgtGetNextObjInSelWin()
End While
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
Dim nOrigPartId As Integer = nPartId
nOldPartId = nOrigPartId
Dim nCopId As Integer = 0
If EgtGetInfo(nPartId, "!COP", nCopId) Then
nPartId = nCopId
End If
Dim nOrIdKey As KeyValuePair(Of Integer, Integer) = Map.refSceneShowBuldingVM.MapInfo.FirstOrDefault(Function(x) x.Value = nPartId)
Dim nOrdId As Integer = nOrIdKey.Key
Dim BTLPartVM As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(y) y.nPartId = nOrdId)
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(BTLPartVM, True)
Map.refProjectVM.BTLStructureVM.SelectBTLPartScene(BTLPartVM, True)
' Setto il nuovo contesto
EgtSetCurrentContext(SceneShowBulding.GetCtx())
EgtSetStatus(nOrigPartId, GDB_ST.SEL)
EgtDraw()
End Sub
#End Region ' Events
@@ -72,12 +72,6 @@ Public Class MainMenuVM
End Get
End Property
Public ReadOnly Property ViewerOptimizer_Visibility As Visibility
Get
Return Visibility.Collapsed
End Get
End Property
Private m_SelPage As Integer = -1
Public Property SelPage As Integer
Get
@@ -87,14 +87,6 @@ Public Class MySceneHostVM
Dim sTitle As String = EgtMsg(10101)
If EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
' Apro dialogo per richiesta file licenza
'Dim LicDlg As New EgtBEAMWALL.Core.EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
' .Title = EgtMsg(110026),
' .Filter = "Licences (.lic)|*.lic",
' .FilterIndex = 1,
' .InitialDirectory = Map.refMainWindowVM.MainWindowM.sConfigDir,
' .CheckFileExists = True,
' .ValidateNames = True,
' .Mode = 1}
Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
.Title = EgtMsg(110026),
.DefaultExt = ".lic",