From 45e20498bc2358f01fefb1fdc19ac4e29134740f Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 26 Oct 2020 14:56:26 +0000 Subject: [PATCH] EgtDOORCreator 2.2j1: -> inserito bottone per andare direttamente nell'HardareMangaer della componente selezionata nella porta/telaio, -> disabiliti i controlli nelle TextBoxParam nell'HardwareManager (non richiesto). --- Constants/ConstCompo.vb | 2 +- DdfFile.vb | 32 ++++++---- DoorParameters/Compo.vb | 113 +++++++++++++++++++++++++++++---- DoorParameters/Part.vb | 2 + DoorParameters/PartPageV.xaml | 23 ++++--- HardwareManager/Hardware.vb | 3 + SceneManager/SceneManagerVM.vb | 2 +- 7 files changed, 142 insertions(+), 35 deletions(-) diff --git a/Constants/ConstCompo.vb b/Constants/ConstCompo.vb index df821c2..70921e8 100644 --- a/Constants/ConstCompo.vb +++ b/Constants/ConstCompo.vb @@ -37,7 +37,7 @@ Module ConstCompo Public Const K_HEIGHT As String = "height" Public Const K_THICKNESS As String = "thickness" Public Const S_ORIGHEIGHTDOOR As String = "origdoorheight" - Public Const K_OVERLAP As String = "overlap" + Public Const S_OVERLAP_DDF As String = "overlap" Public Const S_WEIGHT As String = "pressure" Public Const S_SWING As String = "swing" Public Const S_SECURE As String = "secure" diff --git a/DdfFile.vb b/DdfFile.vb index d500cca..b5d6132 100644 --- a/DdfFile.vb +++ b/DdfFile.vb @@ -253,17 +253,7 @@ Friend Module DdfFile CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50003), DoubleToString(dVal, 5))) TDimension.Dimension_ParametersList.Add(New ReportParameter(EgtMsg(50003), DoubleToString(dVal, 5))) - '' origheightdoor: solo per i Jamb anche la dimensione della porta - 'If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly AndAlso - ' Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) AndAlso - ' Part.TypePart.Contains("F") Then - ' DdfFileContent.Add("") - ' If Part.TypePart.Contains("_H") Then - ' DdfFileContent.Add(ConstCompo.K_OVERLAP & ": " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.OverlapHinge) - ' End If - 'End If - - ' overlap: solo per i Jamb inserisco la dimensioe dell'verlap + ' origheightdoor: solo per i Jamb inserisco la dimensioe dell'verlap If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) AndAlso Part.TypePart.Contains("F") Then @@ -271,6 +261,26 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.S_ORIGHEIGHTDOOR & ": " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.OrigHeightDoor) End If + '' overlap: solo per i Jamb inserisco l'verlap + 'If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly AndAlso + ' Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) AndAlso + ' Part.TypePart.Contains("F") Then + ' DdfFileContent.Add("") + ' If Part.TypePart.Contains("_H") Then + ' DdfFileContent.Add(ConstCompo.S_OVERLAP_DDF & ": " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.OverlapHinge) + ' ElseIf Part.TypePart.Contains("_L") Then + ' If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.DoorNumber = "1" Then + ' DdfFileContent.Add(ConstCompo.S_OVERLAP_DDF & ": " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.OverlapLock) + ' Else + ' DdfFileContent.Add(ConstCompo.S_OVERLAP_DDF & ": " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.OverlapHinge) + ' End If + ' ElseIf Part.TypePart.Contains("FT_") Then + ' DdfFileContent.Add(ConstCompo.S_OVERLAP_DDF & ": " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.OverlapTop) + ' ElseIf Part.TypePart.Contains("FB_") Then + ' DdfFileContent.Add(ConstCompo.S_OVERLAP_DDF & ": " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.OverlapBottom) + ' End If + 'End If + ' aggiungo il peso della porta If Part.IsCheckedWeight = Visibility.Visible Then If Not StringToDouble(Part.Weight, dVal) Then diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index 39187b7..f0034e5 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -27,6 +27,8 @@ End Module Public Class Compo Implements INotifyPropertyChanged Friend TempFileDDF As String = IniFile.m_sTempDir & "\" & TEMP_FILE + ' permette di bloccare il refresh della componente singola (solo se nell'Hardwaremanagaer) + Friend Shared DoRefreshCompo As Boolean = False Friend LoadDefaultFromLua As Boolean = True @@ -327,6 +329,13 @@ Public Class Compo End Get End Property + Private m_ImageHardware As String = "/Resources/InstrumentPanel/Hardware.png" + Public ReadOnly Property ImageHardware As String + Get + Return m_ImageHardware + End Get + End Property + ' Ha il compito di assegnare il colore in funzione della cmbinaione di errori ' e comunicare che è stato trivato un errore Public ReadOnly Property IsError As Boolean @@ -1959,6 +1968,7 @@ Public Class Compo ' Definizione comando Private m_CmdDelete As ICommand Private m_CmdReload As ICommand + Private m_CmdGoToHardware As ICommand ' creo una copia dell'oggetto Sub New(CompoType As CompoType) @@ -2065,6 +2075,60 @@ Public Class Compo #End Region ' ReloadCompoRef +#Region "GoToHardware" + + Public ReadOnly Property GoToHardwareCmd As ICommand + Get + If m_CmdGoToHardware Is Nothing Then + m_CmdGoToHardware = New Command(AddressOf GoToHardware) + End If + Return m_CmdGoToHardware + End Get + End Property + + Public Sub GoToHardware() + ' blocco la posssiblità di aggiornare la parte grafica + DoRefreshCompo = False + If Not IsNothing(Map.refProjectManagerVM) Then + Map.refProjectManagerVM.GoToHardwarePage() + End If + If Not IsNothing(Map.refCompoPanelVM) Then + Map.refCompoPanelVM.CompoBtn(Me.CompoType) + Dim bBrandExists As Boolean = False + If Not IsNothing(Map.refHardwarePageVM.CurrHardware) Then + For Each ItemBrand In m_CompoType.HardwareFolderList + If Trim(ItemBrand.ModelDirGraphic) = Trim(m_SelBrandPart) Then + Map.refHardwarePageVM.CurrHardware.SelBrand = ItemBrand + bBrandExists = True + Exit For + End If + Next + Dim bFileExists As Boolean = False + If bBrandExists Then + For Each ItemFile In Map.refHardwarePageVM.CurrHardware.SelBrand.ModelFileList + If Trim(ItemFile) = Trim(m_SelFile) Then + Map.refHardwarePageVM.CurrHardware.SelTemplate = ItemFile + bFileExists = True + Exit For + End If + Next + Else + MessageBox.Show(String.Format(EgtMsg(50565), m_SelBrandPart), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) + End If + If Not bFileExists Then + MessageBox.Show(String.Format(EgtMsg(50566), m_SelFile), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) + End If + End If + End If + DoRefreshCompo = True + If Not IsNothing(Map.refSceneManagerVM) Then + Map.refSceneManagerVM.RefreshBtn() + End If + + End Sub + +#End Region ' GoToHardware + #End Region 'Commands Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged @@ -2320,12 +2384,23 @@ Public Class TextBoxParam ' per evitare di evideziare tutta la componente come errore IsModifingRefCompoParam = False '----------------------------------------------------- - If Not IsNumeric(ToolTipValue) Then - ErrorInReading = True - CurrCompo.ErrorValue = True + ' gestione diversificata errori per DoorCreator e HardwareManager + If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage AndAlso + Not IsNothing(Map.refHardwarePageVM) AndAlso Not IsNothing(Map.refHardwarePageVM.CurrHardware) Then + 'If Not IsNumeric(ToolTipValue) Then + ' ErrorInReading = False + 'Else + ' ErrorInReading = True + 'End If + 'NotifyPropertyChanged("ColorParam") Else - ErrorInReading = False - CurrCompo.ErrorValue = False + If Not IsNumeric(ToolTipValue) Then + ErrorInReading = True + CurrCompo.ErrorValue = True + Else + ErrorInReading = False + CurrCompo.ErrorValue = False + End If End If MissingParameterInReading = False SetModified() @@ -2367,15 +2442,25 @@ Public Class TextBoxParam NotifyPropertyChanged("Value") NotifyPropertyChanged("ToolTipValue") ' verifica i valori della configurazione - If TypeVar <> ConstGen.VAL_STRING And Not IsNumeric(ToolTipValue) Then - ErrorInReading = True - CurrCompo.ErrorValue = True - End If - NotifyPropertyChanged("ErrorParameter") - If Not String.IsNullOrEmpty( sValue) AndAlso sValue.Trim = "$" then - EnableCopy = False - m_Value = "" - NotifyPropertyChanged("Value") + If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage AndAlso + Not IsNothing(Map.refHardwarePageVM) AndAlso Not IsNothing(Map.refHardwarePageVM.CurrHardware) Then + 'If Not IsNumeric(ToolTipValue) Then + ' ErrorInReading = False + 'Else + ' ErrorInReading = True + 'End If + 'NotifyPropertyChanged("ColorParam") + Else + If TypeVar <> ConstGen.VAL_STRING And Not IsNumeric(ToolTipValue) Then + ErrorInReading = True + CurrCompo.ErrorValue = True + End If + NotifyPropertyChanged("ErrorParameter") + If Not String.IsNullOrEmpty(sValue) AndAlso sValue.Trim = "$" Then + EnableCopy = False + m_Value = "" + NotifyPropertyChanged("Value") + End If End If End Sub diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index bf8bc1b..4acc989 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -1609,6 +1609,8 @@ Public Class Part End If Case S_ORIGHEIGHTDOOR LineIndex = LineIndex + 1 + 'Case S_OVERLAP_DDF + ' LineIndex = LineIndex + 1 Case S_WEIGHT LineIndex = ReadDoor.GetWeight(LineIndex) bPressure = True diff --git a/DoorParameters/PartPageV.xaml b/DoorParameters/PartPageV.xaml index bc81e8d..0722c83 100644 --- a/DoorParameters/PartPageV.xaml +++ b/DoorParameters/PartPageV.xaml @@ -598,14 +598,21 @@ - - + + + + diff --git a/HardwareManager/Hardware.vb b/HardwareManager/Hardware.vb index 6373b00..58f6624 100644 --- a/HardwareManager/Hardware.vb +++ b/HardwareManager/Hardware.vb @@ -1035,6 +1035,9 @@ Public Class Hardware Dim sLen As String = Trim(Utility.GetMeasure(sValue)) Text.SetValue(sLen) End If + ' comunico che non c'è nessun tipo di errore nel valore caricato + m_GroupChapters(IndexGroupChapters).ErrorValue = False + m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter).NotifyPropertyChanged("ErrorParameter") ElseIf TypeOf m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter) Is TextBoxNgeParam Then Dim Text As TextBoxNgeParam = DirectCast(m_GroupChapters(IndexGroupChapters).CompoParamList(IndexChapter), TextBoxNgeParam) diff --git a/SceneManager/SceneManagerVM.vb b/SceneManager/SceneManagerVM.vb index e1c66f7..730ba29 100644 --- a/SceneManager/SceneManagerVM.vb +++ b/SceneManager/SceneManagerVM.vb @@ -341,7 +341,7 @@ Public Class SceneManagerVM EgtDraw() ShowGraphicError() ElseIf Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage Then - If Not Hardware.DoRefresh Then Return + If Not Hardware.DoRefresh OrElse Not Compo.DoRefreshCompo Then Return If Not IsNothing(Map.refHardwarePageVM.CurrHardware) Then Map.refHardwarePageVM.CurrHardware.RefreshTempHardware() End If