diff --git a/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndVM.vb index c54d59fa..01b392a6 100644 --- a/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/AddSectionXMaterialWnd/AddSectionXMaterialWndVM.vb @@ -85,7 +85,7 @@ Public Class AddSectionXMaterialWndVM NewSectXMatItem.Alias_IsChecked = False For Each SectionListItem In Map.refProjectVM.BTLStructureVM.SectionList - If CurrentMachine.nType = MachineType.BEAM Then + If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then If NewSectXMatItem.dW = SectionListItem.dW AndAlso NewSectXMatItem.dH = SectionListItem.dH Then ' Se le sezioni sono uguali allora indago sui materiali For Index As Integer = 0 To SectionListItem.sMaterial.Count - 1 @@ -97,7 +97,7 @@ Public Class AddSectionXMaterialWndVM End If Next End If - ElseIf CurrentMachine.nType = MachineType.WALL Then + ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then If NewSectXMatItem.dH = SectionListItem.dH Then ' Se le sezioni sono uguali allora indago sui materiali For Index As Integer = 0 To SectionListItem.sMaterial.Count - 1 @@ -133,11 +133,11 @@ Public Class AddSectionXMaterialWndVM Public Sub Ok() ' Se i valori non sono corretti segnalo l'errore e impedisco il salvataggio For Index As Integer = 0 To NewSectionXMaterialList.Count - 1 - If CurrentMachine.nType = MachineType.BEAM AndAlso NewSectionXMaterialList(Index).dNewL < 0 Then + If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM AndAlso NewSectionXMaterialList(Index).dNewL < 0 Then MessageBox.Show(IncorrectValues_Msg, Error_Msg) Return End If - If CurrentMachine.nType = MachineType.WALL AndAlso (NewSectionXMaterialList(Index).dNewW < 0 Or NewSectionXMaterialList(Index).dNewL < 0) Then + If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL AndAlso (NewSectionXMaterialList(Index).dNewW < 0 Or NewSectionXMaterialList(Index).dNewL < 0) Then MessageBox.Show(IncorrectValues_Msg, Error_Msg) Return End If @@ -164,7 +164,7 @@ Public Class AddSectionXMaterialWndVM Dim sWarehousePath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_MEDIUM_INI_FILE_NAME - If CurrentMachine.nType = MachineType.BEAM Then + If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then ' Ciclo sui parametri L esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere Dim sValue As String = String.Empty @@ -190,7 +190,7 @@ Public Class AddSectionXMaterialWndVM Index += 1 ParamIndex += 1 Next - ElseIf CurrentMachine.nType = MachineType.WALL Then + ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then ' Ciclo sui parametri S esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere Dim sValue As String = String.Empty diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb index f5c5ce77..6a4dc198 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelVM.vb @@ -148,7 +148,7 @@ Public Class LeftPanelVM Dim dStartOffset As Double = 0 Dim dKerf As Double = 0 Dim sWarehouseIniPath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_BASIC_INI_FILE_NAME - If CurrentMachine.nType = MachineType.BEAM Then + If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then dStartOffset = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_BEAM, WRH_STARTOFFSET, 0, sWarehouseIniPath) dRawL += dStartOffset Else diff --git a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb index 23b7443c..c657f778 100644 --- a/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/SceneHost/MySceneHostVM.vb @@ -495,7 +495,9 @@ Public Class MySceneHostVM Map.refShowBeamPanelVM.ShowAll() End If WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile) + ' in base al tipo progetto aggiungo il file in apertura alla lista degli MRU If ProjectType = ProjectType.PROJ Then + ' nel caso PROJ ricavo il percorso del file tramite il ProjId Dim PjFileVM As ProjFileVM If Not IsNothing(ProjId) AndAlso ProjId <> 0 Then PjFileVM = New ProjFileVM(DbControllers.m_ProjController.FindByProjIdConv(ProjId)) @@ -504,7 +506,9 @@ Public Class MySceneHostVM End If If ProjectType = ProjectType.PROD Then Map.refProdManagerVM.m_MruFiles.Add(sFile) Else + ' in base al tipo progetto rimuovo il file in apertura dalla lista degli MRU If ProjectType = ProjectType.PROJ Then + ' nel caso PROJ ricavo il percorso del file tramite il ProjId Dim PjFileVM As ProjFileVM If Not IsNothing(ProjId) AndAlso ProjId <> 0 Then PjFileVM = New ProjFileVM(DbControllers.m_ProjController.FindByProjIdConv(ProjId)) @@ -530,7 +534,9 @@ Public Class MySceneHostVM Dim ProjId As Integer = If(ProjectType = ProjectType.PROJ, Map.refProjManagerVM.nLoadingProjId, 0) ' Se salvataggio non riuscito, esco subito If Not bOk Then + ' in base al tipo progetto rimuovo il file in salvataggio dalla lista degli MRU If ProjectType = ProjectType.PROJ Then + ' nel caso PROJ ricavo il percorso del file tramite il ProjId Dim PjFileVM As ProjFileVM If Not IsNothing(ProjId) AndAlso ProjId <> 0 Then PjFileVM = New ProjFileVM(DbControllers.m_ProjController.FindByProjIdConv(ProjId)) @@ -542,8 +548,9 @@ Public Class MySceneHostVM MessageBox.Show(sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error Return End If - ' Inserisco nome in MRU + ' in base al tipo progetto aggiungo il file in salvataggio alla lista degli MRU If ProjectType = ProjectType.PROJ Then + ' nel caso PROJ ricavo il percorso del file tramite il ProjId Dim PjFileVM As ProjFileVM If Not IsNothing(ProjId) AndAlso ProjId <> 0 Then PjFileVM = New ProjFileVM(DbControllers.m_ProjController.FindByProjIdConv(ProjId))