From a46d38bc3583ff6ef7e4d6444d47c5491f4d50a0 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 15 Mar 2021 15:24:32 +0000 Subject: [PATCH] EgtDOORCreator 2.3c1: -> passando da HardwareManager a DoorCreator ripristino l'ultimo Part visualizzato. --- Assembly/Assembly.vb | 2 ++ Assembly/AssemblyPageVM.vb | 27 ++++++++++++++-------- AssemblyManager/AssemblyManagerVM.vb | 2 +- CompoPanel/CompoPanelVM.vb | 1 + DoorParameters/PartPageV.xaml | 2 +- MainWindow/MainWindowModel.vb | 4 ++-- My Project/AssemblyInfo.vb | 6 ++--- ProjectManager/ProjectManagerHardwareVM.vb | 16 ++++++++++--- 8 files changed, 41 insertions(+), 19 deletions(-) diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb index e727984..69e964d 100644 --- a/Assembly/Assembly.vb +++ b/Assembly/Assembly.vb @@ -12,6 +12,8 @@ Public Class Assembly Public bIsNewAssembly As Boolean = False Public Shared FirstReadingWeight As Boolean = False + Public Shared Refreshing As Boolean = True + Public bOldVersion As Boolean = False ' è usata per abilitare la TextBox associata all'OverlapLock diff --git a/Assembly/AssemblyPageVM.vb b/Assembly/AssemblyPageVM.vb index 5c98f99..75deaaf 100644 --- a/Assembly/AssemblyPageVM.vb +++ b/Assembly/AssemblyPageVM.vb @@ -22,6 +22,9 @@ Public Class AssemblyPageVM Private m_EnterRefreshCmd As ICommand Private m_CmdOrderBtn As ICommand + ' all'avvio del programma definisco come pagina impostata quella dell'Assemblato (altrimenti dovrei definire "FR_", "FL_"..) + Public Property SlectedPart As String = "AssemblyPage" + ' Costruttore Sub New() Map.SetRefJambPageVM(Me) @@ -247,20 +250,22 @@ Public Class AssemblyPageVM Public Sub JambBtn(param As Object) ' il parametro param arriva direttamente dal Jamb del bottone, quindi è gia scritto nella forma FL_ (le porte no! sono passate da binding) Dim SelectPart As String = (CStr(param)) + SlectedPart = SelectPart + Dim bOkSelection As Boolean = False ' In questa fase manca la gestione degli swing dei Jamb Select Case SelectPart Case ConstGen.PART_FRAME_LEFT - LoadSelectedPartDoor(ConstGen.PART_FRAME_LEFT, OptionModule.m_CompoPanelFrameVisibility, True) + bOkSelection = LoadSelectedPartDoor(ConstGen.PART_FRAME_LEFT, OptionModule.m_CompoPanelFrameVisibility, True) Case ConstGen.PART_FRAME_RIGHT - LoadSelectedPartDoor(ConstGen.PART_FRAME_RIGHT, OptionModule.m_CompoPanelFrameVisibility, True) + bOkSelection = LoadSelectedPartDoor(ConstGen.PART_FRAME_RIGHT, OptionModule.m_CompoPanelFrameVisibility, True) Case ConstGen.PART_FRAME_TOP - LoadSelectedPartDoor(ConstGen.PART_FRAME_TOP, OptionModule.m_CompoPanelFrameVisibility, True) + bOkSelection = LoadSelectedPartDoor(ConstGen.PART_FRAME_TOP, OptionModule.m_CompoPanelFrameVisibility, True) Case ConstGen.PART_FRAME_BOTTOM - LoadSelectedPartDoor(ConstGen.PART_FRAME_BOTTOM, OptionModule.m_CompoPanelFrameVisibility, True) + bOkSelection = LoadSelectedPartDoor(ConstGen.PART_FRAME_BOTTOM, OptionModule.m_CompoPanelFrameVisibility, True) Case Else - LoadSelectedPartDoor(SelectPart, Visibility.Visible, False) + bOkSelection = LoadSelectedPartDoor(SelectPart, Visibility.Visible, False) End Select - Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage + If bOkSelection Then Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage ' aggiorno elenco quotature Map.refDimensioningPanelVM.LoadHardwareDimList() Map.refSceneManagerVM.RefreshBtn() @@ -311,6 +316,9 @@ Public Class AssemblyPageVM ' ricevuto il nome dell'oggetto di tipo Part restituisce il PartDoor che lo contiene Public Function ReserchPartDoor(TypePart As String) As PartDoor Dim PD As PartDoor = Nothing + If IsNothing(CurrAssembly) OrElse IsNothing(CurrAssembly.ListPartDoor) Then + Return PD + End If For IndexPartDoor As Integer = 0 To CurrAssembly.ListPartDoor.Count - 1 If CurrAssembly.ListPartDoor(IndexPartDoor).Door.TypePart.Contains(TypePart) Then PD = CurrAssembly.ListPartDoor(IndexPartDoor) @@ -321,16 +329,17 @@ Public Class AssemblyPageVM End Function ' carica a video l'ogetto di cui è passato il nome (TypePart) - Private Sub LoadSelectedPartDoor(TypePart As String, CompoPanelVisibility As Visibility, PartPageIsReadOnly As Boolean) + Private Function LoadSelectedPartDoor(TypePart As String, CompoPanelVisibility As Visibility, PartPageIsReadOnly As Boolean) As Boolean Dim Local_PD As PartDoor = ReserchPartDoor(TypePart) - If IsNothing(Local_PD) Then Return + If IsNothing(Local_PD) Then Return False DdfFile.WriteDDFPart(Local_PD.Door, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False) ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE, False) Map.refPartPageVM.CurrPart = Local_PD.Door Map.refCompoPanelVM.IsVisible = CompoPanelVisibility Map.refPartPageVM.NotifyPropertyChanged("VisibilityTopShape") Map.refPartPageVM.IsRaedOnly = PartPageIsReadOnly - End Sub + Return True + End Function Sub SetStatusPage() NotifyPropertyChanged("EnablePageAssembly") diff --git a/AssemblyManager/AssemblyManagerVM.vb b/AssemblyManager/AssemblyManagerVM.vb index ad7d740..19f27c6 100644 --- a/AssemblyManager/AssemblyManagerVM.vb +++ b/AssemblyManager/AssemblyManagerVM.vb @@ -987,7 +987,7 @@ Public Class AssemblyManagerVM PrintWndVM.TurnDimensioningLayer(HardwareDimension.NameLayer, HardwareDimension.SelectedLayer) Next 'ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False) - EgtZoom(ZM.ALL) + If Assembly.Refreshing Then EgtZoom(ZM.ALL) m_CurrProject.SelAssemblyName.SelAssembly.MatchCompo() m_CurrProject.SelAssemblyName.SelAssembly.UpDateAllOrigValue() Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage diff --git a/CompoPanel/CompoPanelVM.vb b/CompoPanel/CompoPanelVM.vb index 1117801..1771298 100644 --- a/CompoPanel/CompoPanelVM.vb +++ b/CompoPanel/CompoPanelVM.vb @@ -170,6 +170,7 @@ Public Class CompoPanelVM ' aggiorno lista hardware di quotatura Map.refDimensioningPanelVM.LoadHardwareDimList() Map.refSceneManagerVM.RefreshBtn() + Map.refAssemblyPageVM.SlectedPart = "AssemblyPage" Else Map.refCompoPanelVM.GoBackVisibility = Visibility.Collapsed Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage diff --git a/DoorParameters/PartPageV.xaml b/DoorParameters/PartPageV.xaml index 01013b4..3c441ed 100644 --- a/DoorParameters/PartPageV.xaml +++ b/DoorParameters/PartPageV.xaml @@ -751,7 +751,7 @@ - - + @@ -72,5 +72,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/ProjectManager/ProjectManagerHardwareVM.vb b/ProjectManager/ProjectManagerHardwareVM.vb index fb60b87..effab69 100644 --- a/ProjectManager/ProjectManagerHardwareVM.vb +++ b/ProjectManager/ProjectManagerHardwareVM.vb @@ -10,6 +10,8 @@ Public Class ProjectManagerHardwareVM #Region "FIELDS & PROPERTIES" + Friend Shared StopRefresh As Boolean = True + Private m_IsModified As Boolean = False Public Property IsModified As Boolean Get @@ -550,7 +552,7 @@ Public Class ProjectManagerHardwareVM Map.refCompoPanelVM.GoBackVisibility = Visibility.Collapsed Map.refMainWindowVM.ProjectNameMsg = "" End If - Map.refRefreshPanelVM.DimensionVisibility = Visibility.Collapsed + 'Map.refRefreshPanelVM.DimensionVisibility = Visibility.Collapsed ' elimino i riferimenti all'hardware corrente Map.refHardwarePageVM.CurrHardware = Nothing ' spengo il focus su tutti i bottoni @@ -561,12 +563,20 @@ Public Class ProjectManagerHardwareVM 'ShowDimensionCommand = Visibility.Collapsed ' apro l'ultimo progetto LauncherModule.InitLauncherModule() - Map.refProjectManagerVM.DoorIsChecked = true + Map.refProjectManagerVM.DoorIsChecked = True + Assembly.Refreshing = False Map.refProjectManagerVM.OpenLastProject() - Map.refSceneManagerVM.RefreshBtn() + Assembly.Refreshing = True + ' controllo quale pagina deve essere avviata + If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nNothingSelected Then + Map.refAssemblyPageVM.JambBtn(Map.refAssemblyPageVM.SlectedPart) + Else + Map.refSceneManagerVM.RefreshBtn() + End If Map.refInstrumentPanelVM.DimensionVisibility = OptionModule.m_DimensionDoor Map.refInstrumentPanelVM.SaveImgHardware = OptionModule.m_DimensionDoor Map.refProjectManagerVM.NotifyPropertyChanged("VisibilityCreateAssembly") + Map.refRefreshPanelVM.DimensionVisibility = Visibility.Collapsed CompoMatch.ResetSTU() End Sub