diff --git a/CompoPanel/CompoPanelVM.vb b/CompoPanel/CompoPanelVM.vb index e6f4906..166c22d 100644 --- a/CompoPanel/CompoPanelVM.vb +++ b/CompoPanel/CompoPanelVM.vb @@ -133,6 +133,7 @@ Public Class CompoPanelVM m_CurrCompoType.LoadListTemplate() If Not IsNothing(Map.refPartPageVM.CurrPart) Then Dim NewCompo As Compo = Map.refPartPageVM.CurrPart.AddNewCompo(m_CurrCompoType) + If IsNothing(NewCompo) Then Return ' aggiorno lista hardware di quotatura Map.refDimensioningPanelVM.LoadHardwareDimList() ' aggiungo le componenti sui Jamb diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index 3227c5b..7b3e8e2 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -372,6 +372,23 @@ Public Class Compo End Set End Property + ' è usato solo per i capitoli del HardwareManager + Private m_EnableChapter As Boolean = True + Public Property EnableChapter As Boolean + Get + Return m_EnableChapter + End Get + Set(value As Boolean) + m_EnableChapter = value + End Set + End Property + Public Sub SetEnableChapter(bEnableChapter As Boolean) + m_EnableChapter = bEnableChapter + m_ErrorColor = DirectCast(New BrushConverter().ConvertFrom(OptionModule.ColorDisableChapter), SolidColorBrush) + NotifyPropertyChanged("EnableChapter") + NotifyPropertyChanged("ErrorColor") + End Sub + #Region "Template ComboBox" #Region "Brand" @@ -2000,8 +2017,30 @@ End Class Public Class CompoParam Implements INotifyPropertyChanged + ' è utilizzato solo nell'HardwareManager + Public ReadOnly Property FontStyleParam As String + Get + If CurrCompo.EnableChapter Then + Return "Normal" + Else + Return "Italic" + End If + End Get + End Property + Public ReadOnly Property ColorParam As String Get + If Not IsNothing(Map.refHardwarePageVM) AndAlso + Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage Then + If CurrCompo.EnableChapter Then + NotifyPropertyChanged("FontStyleParam") + Return "Black" + Else + NotifyPropertyChanged("FontStyleParam") + Return OptionModule.ColorDisableChapter + End If + + End If If m_IsModifingRefCompoParam Then Return OptionModule.ColorModifyingParamRef Else @@ -2014,10 +2053,10 @@ Public Class CompoParam Get If m_ErrorInReading Or m_MissingParameterInReading Or m_IsModifingRefCompoParam Then Return True - NotifyPropertyChanged("ColorParam") + 'NotifyPropertyChanged("ColorParam") Else Return False - NotifyPropertyChanged("ColorParam") + 'NotifyPropertyChanged("ColorParam") End If End Get End Property diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 0ee4cfe..aa68bd1 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -2916,6 +2916,7 @@ Public Class Part Dim dVal As Double If String.IsNullOrEmpty(sVal) OrElse Not StringToDouble(sVal, dVal) Then ' Part.FirstReadingEdge = True + CompoTemplateItem.MissingParameter = true CompoTemplateItem.ErrorValue = True CurrCompoParam.ErrorInReading = True End If diff --git a/DoorParameters/PartPageV.xaml b/DoorParameters/PartPageV.xaml index 0866ad6..8c0eef6 100644 --- a/DoorParameters/PartPageV.xaml +++ b/DoorParameters/PartPageV.xaml @@ -585,7 +585,7 @@ - + @@ -615,7 +615,7 @@ - + @@ -635,7 +635,7 @@ - + diff --git a/HardwareManager/Hardware.vb b/HardwareManager/Hardware.vb index 08d2f5f..1145f96 100644 --- a/HardwareManager/Hardware.vb +++ b/HardwareManager/Hardware.vb @@ -723,8 +723,27 @@ Public Class Hardware ' legge se è attivo Dim nIsActive As Integer = 0 nIsActive = StdTemplateGetPrivateProfileInt(S_CHAPTER & ChapterIndex, K_ISACTIVE, nIsActive) + + ' leggo se il capitolo appartiene al tipo di materiale, + ' il tipo di visualizzazione da adoperare in caso il materiale non sia quello corrente + Dim sMaterialList As New List(Of String) + Dim nIsActiveMaterial As Integer = 3 + Dim bIsCurrentMaterial As Boolean = True + StdTemplateGetPrivateProfileListMaterial(S_CHAPTER & ChapterIndex, K_MATERIAL, sMaterialList, nIsActiveMaterial) + For Each ItemMaterial In sMaterialList + bIsCurrentMaterial = False + Dim ArrayItemMaterial As String() = ItemMaterial.Split("/"c) + If Trim(ArrayItemMaterial(0)) = Trim(Map.refHardwarePageVM.GenericPart.SelectedMaterial.NameDDF) Then + bIsCurrentMaterial = True + Exit For + End If + Next + If Not bIsCurrentMaterial Then + nIsActive = nIsActiveMaterial + End If + ' verifico che non stia leggendo un nuovo hardware - If Not bNewHardware And nIsActive > 3 Then + If Not bNewHardware And nIsActive > 4 Then nIsActive = 0 End If Select Case nIsActive @@ -741,17 +760,23 @@ Public Class Hardware Chapter.SetIsFixed(False) Chapter.SetIsActiveChapter(False) Chapter.GroupVisibilityChapter = Visibility.Collapsed + Case 4 + Chapter.SetIsFixed(False) + Chapter.SetIsActiveChapter(False) + Chapter.SetEnableChapter(False) End Select - ' leggo se il capitolo appartiene al tipo di materiale - Dim sMaterialList As New List(Of String) - StdTemplateGetPrivateProfileList(S_CHAPTER & ChapterIndex, K_MATERIAL, sMaterialList) - For Each ItemMaterial In sMaterialList - Chapter.GroupVisibilityChapter = Visibility.Collapsed - If ItemMaterial = Map.refHardwarePageVM.GenericPart.SelectedMaterial.NameDDF Then - Chapter.GroupVisibilityChapter = Visibility.Visible - Exit For - End If - Next + + '' leggo se il capitolo appartiene al tipo di materiale ed eventualmente il tipo di visualizzazione da adoperare + 'Dim sMaterialList As New List(Of String) + 'StdTemplateGetPrivateProfileListMaterial(S_CHAPTER & ChapterIndex, K_MATERIAL, sMaterialList, nIsActive) + 'For Each ItemMaterial In sMaterialList + ' Chapter.GroupVisibilityChapter = Visibility.Collapsed + ' Dim ArrayItemMaterial As String() = ItemMaterial.Split("/"c) + ' If Trim(ArrayItemMaterial(0)) = Trim(Map.refHardwarePageVM.GenericPart.SelectedMaterial.NameDDF) Then + ' Chapter.GroupVisibilityChapter = Visibility.Visible + ' Exit For + ' End If + 'Next While EgtUILib.GetPrivateProfileString(S_CHAPTER & ChapterIndex, K_PARAM & ParamIndex, "", sParam, m_StdTemplate) > 0 ' Verifico che esista il parametro nuovo "Param-ParamIndex" If Not String.IsNullOrWhiteSpace(sParam) Then diff --git a/HardwareManager/HardwarePageV.xaml b/HardwareManager/HardwarePageV.xaml index 697266d..cfb497b 100644 --- a/HardwareManager/HardwarePageV.xaml +++ b/HardwareManager/HardwarePageV.xaml @@ -108,10 +108,23 @@ Converter={StaticResource SplitConverter},ConverterParameter=2}" IsExpanded="{Binding IsActiveChapter}" Visibility="{Binding GroupVisibilityChapter}" + IsEnabled="{Binding EnableChapter}" Style="{StaticResource HardwareExpander}"> - + + + + + @@ -123,9 +136,16 @@ - + + + + + + + - - + + + + + + + @@ -173,9 +199,15 @@ - + + + + + + - - + + + + + + + - + + + + + + - + + + + + + - - + + + + + + + @@ -307,11 +388,23 @@ - - - + + + + + + + + @@ -333,10 +426,22 @@ - - + + + + + + - + + + + + + - - --> + + + + + + @@ -421,11 +544,17 @@ - - - + + + + + + + + @@ -459,9 +588,14 @@ - + + + + + - - + + + + + + - + + + + + + - + + + + + + - + + + + + + @@ -592,9 +774,21 @@ - + + + + + + - + + + + + + 1 Then + For Index = 0 To sItems.Count() - 2 + List.Add(Trim(sItems(Index))) + Next + End If + ' se la lista ha un solo elemento, oppure ha un solo elemento + Dim LastItems As String() = sItems.Last.Split(";"c) + List.Add(Trim(LastItems(0))) + If LastItems.Count > 1 AndAlso IsNumeric(LastItems(1)) Then + nIsActiveMaterial = CInt(LastItems(1)) + End If + Return True + End Function + Public Function StdTemplateGetPrivateProfileChapterName(ByVal lpAppName As String, ByVal lpKeyName As String, ByRef sValueLua As String, ByRef sValue As String) As Boolean Dim sVal As String = String.Empty StdTemplateGetPrivateProfileString(lpAppName, lpKeyName, "", sVal) diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 41f241a..b3634e1 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -150,6 +150,7 @@ Friend Module OptionModule Friend ColorLoadByDefault As String = "Red" Friend ColorErrorAndMissing As String = "Red" Friend ColorModifyingParamRef As String = "Yellow" + Friend ColorDisableChapter As String = "Gray" Friend m_CompoPaneOrder As List(Of String) = New List(Of String) @@ -488,7 +489,7 @@ Friend Module OptionModule Catch ex As Exception End Try End If - DefaultGetPrivateProfileString("Error", "MissingParameter", "Orange", sColor) + DefaultGetPrivateProfileString("Error", "MissingParameter", "Purple", sColor) If Not String.IsNullOrEmpty(sColor) Then Try ColorConvert = DirectCast(New BrushConverter().ConvertFrom(sColor), SolidColorBrush) @@ -520,6 +521,14 @@ Friend Module OptionModule Catch ex As Exception End Try End If + DefaultGetPrivateProfileString("Error", "DisableChapter", "Gray", sColor) + If Not String.IsNullOrEmpty(sColor) Then + Try + ColorConvert = DirectCast(New BrushConverter().ConvertFrom(sColor), SolidColorBrush) + ColorDisableChapter = sColor + Catch ex As Exception + End Try + End If '----------------------------------------------------------------------------------------------------------------- ' SIZE JAMB Dim ThicknessHead As String = String.Empty