diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb index b141807..2f8cf83 100644 --- a/Assembly/Assembly.vb +++ b/Assembly/Assembly.vb @@ -1267,6 +1267,7 @@ Public Class Assembly Local_Door.IsActive = True Local_PartDoor.Door = Local_Door Local_PartDoor.Door.SwingTypeList = OptionModule.m_SwingTypeList + Local_PartDoor.Door.MaterialsList = OptionModule.m_MaterialList Local_PartDoor.SetIsChecked(Local_Door.IsActive) ListPartDoor.Add(Local_PartDoor) Map.refPartPageVM.CurrPart = Local_Door diff --git a/DdfFile.vb b/DdfFile.vb index 08176b1..f04c5af 100644 --- a/DdfFile.vb +++ b/DdfFile.vb @@ -478,7 +478,12 @@ Friend Module DdfFile End If DdfFileContent.Add("") - '---------------------------------------------------------------------------------------------------------------------------------------------------- + + If Not IsNothing(Part.SelectedMaterial) andalso Part.SelectedMaterial.NameDDF <> GENERICMATERIAL then + DdfFileContent.Add("" & ConstCompo.S_MATERIAL & ": " & Part.SelectedMaterial.NameDDF) + DdfFileContent.Add("") + End If +'---------------------------------------------------------------------------------------------------------------------------------------------------- DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":") DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining)) diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index 6936bc2..abfe2fa 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -12,7 +12,9 @@ Module Modified For Each Compo In Map.refPartPageVM.CurrPart.CompoList Compo.BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush) Compo.BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#FFFFFF"), SolidColorBrush) + Compo.Foreground = DirectCast(New BrushConverter().ConvertFrom("#000000"), SolidColorBrush) Compo.BorderThickness = 1 + Compo.FontBold = FontWeights.Normal Next End If Else @@ -60,6 +62,17 @@ Public Class Compo End Set End Property + Private m_Foreground As SolidColorBrush = DirectCast(New BrushConverter().ConvertFrom("#000000"), SolidColorBrush) + Public Property Foreground As SolidColorBrush + Get + Return m_Foreground + End Get + Set(value As SolidColorBrush) + m_Foreground = value + NotifyPropertyChanged("Foreground") + End Set + End Property + Private m_BorderThickness As Integer = 1 Public Property BorderThickness As Integer Get @@ -71,6 +84,17 @@ Public Class Compo End Set End Property + Private m_FontBold As FontWeight = FontWeights.Bold + Public Property FontBold As FontWeight + Get + Return m_FontBold + End Get + Set(value As FontWeight) + m_FontBold = value + NotifyPropertyChanged("FontBold") + End Set + End Property + Private m_CompoType As CompoType Public ReadOnly Property CompoType As CompoType Get diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 84c6b9f..fc1fbed 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -180,12 +180,16 @@ Public Class Part #End Region ' Info generali del ddf -#Region "PROPERTIES" +#Region "PROPERTIES and MATERIAL" ' la lista dei materiali è caricta nell'init dell'OptionPage - Public ReadOnly Property MaterialsList As ObservableCollection(of MaterialType) + Friend Shared m_MaterilaList As ObservableCollection(Of MaterialType) + Public Property MaterialsList As ObservableCollection(of MaterialType) Get - Return OptionModule.m_MaterialList + Return m_MaterilaList End Get + Set (value As ObservableCollection(of MaterialType)) + m_MaterilaList = value + End Set End Property Private m_SelectedMaterial As MaterialType @@ -214,6 +218,17 @@ Public Class Part End Set End Property + Public Sub SetMaterial(ItemMaterial As MaterialType) + For Each Item In m_MaterilaList + If ItemMaterial.NameDDF = Item.NameDDF then + m_SelectedMaterial = Item + NotifyPropertyChanged("SelectedMaterial") + Exit for + End If + Next + + End Sub + Public ReadOnly Property MaterialIsVisible As Visibility Get Return OptionModule.m_MaterialIsVisible @@ -275,7 +290,7 @@ Public Class Part End Set End Property -#End Region ' Properties +#End Region ' Properties and Material #Region "SIZE" @@ -946,7 +961,9 @@ Public Class Part For Each Compo In Map.refPartPageVM.CurrPart.CompoList Compo.BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush) Compo.BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#FFFFFF"), SolidColorBrush) + Compo.Foreground = DirectCast(New BrushConverter().ConvertFrom("#000000"), SolidColorBrush) Compo.BorderThickness = 1 + Compo.FontBold = FontWeights.Normal Next ' creo la stringa che contiene la lista degli errori Dim ErrorList As String = String.Empty @@ -1023,10 +1040,15 @@ Public Class Part NewCompo.ReadDefaultParamLua(FileNameComplete, NewCompo) End If ' evidenzio il nome della componente appena aggiunto - NewCompo.BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush) - ' #B0D0D2 = Azzurro - NewCompo.BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#B0D0D2"), SolidColorBrush) - NewCompo.BorderThickness = 1 + '#FF4D84C4 EgaltechBlu1 + '#FF7096CE EgaltechBlu2 + '#FF90ABD9 EgaltechBlu3 + '#FFB2C3E4 EgaltechBlu4 + NewCompo.BorderColor = DirectCast(New BrushConverter().ConvertFrom("#FF4D84C4"), SolidColorBrush) + NewCompo.BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#FFFFFFFF"), SolidColorBrush) + NewCompo.Foreground = DirectCast(New BrushConverter().ConvertFrom("#FF4D84C4"), SolidColorBrush) + NewCompo.BorderThickness = 2 + NewCompo.FontBold = FontWeights.Bold m_SelCompo=NewCompo NotifyPropertyChanged("SelCompo") End If @@ -2468,6 +2490,7 @@ Public Class Part End If End If ' Inserisco il componente in lista + m_CurrCompo.FontBold = FontWeights.Normal m_CompoList.Add(m_CurrCompo) End While Return Index @@ -2834,6 +2857,7 @@ Public Class Part Me.m_Height = OptionModule.m_Height Me.m_Thickness = OptionModule.m_ThicknessJamb Me.SetSwing(OptionModule.m_Swing) + Me.SetMaterial(OptionModule.m_MaterialList(0)) Me.m_IsActive = True Me.m_Measure = ConvertMmUnitsToString(OptionModule.m_bIsMmUnit) Me.m_Weight = OptionModule.m_Weight @@ -2857,6 +2881,7 @@ Public Class Part Me.m_Height = OptionModule.m_Height Me.m_Thickness = OptionModule.m_Thickness Me.SetSwing(OptionModule.m_Swing) + Me.SetMaterial(OptionModule.m_MaterialList(0)) Me.m_IsActive = True Me.m_Measure = ConvertMmUnitsToString(OptionModule.m_bIsMmUnit) Me.m_Weight = OptionModule.m_Weight diff --git a/DoorParameters/PartPageV.xaml b/DoorParameters/PartPageV.xaml index 6d8b2a0..1a1355e 100644 --- a/DoorParameters/PartPageV.xaml +++ b/DoorParameters/PartPageV.xaml @@ -414,6 +414,10 @@ + + + + @@ -429,6 +433,10 @@ + + + + diff --git a/EgtDOORCreator.vbproj b/EgtDOORCreator.vbproj index 67d390d..26f42b0 100644 --- a/EgtDOORCreator.vbproj +++ b/EgtDOORCreator.vbproj @@ -169,6 +169,9 @@ HardwareHelpSceneHostV.xaml + + HardwarePartWindowV.xaml + LauncherV.xaml @@ -286,6 +289,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/HardwareManager/HardwarePageVM.vb b/HardwareManager/HardwarePageVM.vb index 4eaaa3f..ce1b519 100644 --- a/HardwareManager/HardwarePageVM.vb +++ b/HardwareManager/HardwarePageVM.vb @@ -6,7 +6,8 @@ Imports System.Text.RegularExpressions Imports EgtWPFLib5 Public Class HardwarePageVM - Inherits VMBase + Implements INotifyPropertyChanged + 'Inherits VMBase Private m_GenericPart As Part Public Property GenericPart As Part @@ -322,6 +323,12 @@ Public Class HardwarePageVM m_CompoPanelPart.DataContext = Map.refCompoPanelHardwareVM End Sub + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged + + Public Sub NotifyPropertyChanged(propName As String) + RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) + End Sub + End Class diff --git a/HardwarePart/HardwarePartV.xaml b/HardwarePart/HardwarePartV.xaml index 09429a9..3072cf2 100644 --- a/HardwarePart/HardwarePartV.xaml +++ b/HardwarePart/HardwarePartV.xaml @@ -1,15 +1,11 @@ - + BorderBrush="{StaticResource EgaltechBlue1}"> + @@ -22,101 +18,114 @@ - + - + + + - + Margin="5,0,30,5"/> - + Margin="5,0,30,5"/> - + Margin="5,0,30,5"/> - - + + + + + - - - - + + + - - diff --git a/ProjectManager/ProjectManagerHardwareVM.vb b/ProjectManager/ProjectManagerHardwareVM.vb index eca489a..a18d54e 100644 --- a/ProjectManager/ProjectManagerHardwareVM.vb +++ b/ProjectManager/ProjectManagerHardwareVM.vb @@ -121,7 +121,6 @@ Public Class ProjectManagerHardwareVM End Property Public ReadOnly Property DimensionToolTip As String Get - ' New Directory Return EgtMsg(50418) End Get End Property @@ -551,25 +550,25 @@ Public Class ProjectManagerHardwareVM #End Region ' LastProject -#Region "Dimension Part" +'#Region "Dimension Part" - Public ReadOnly Property DimensionCommand As ICommand - Get - If m_cmdDimensionPart Is Nothing Then - m_cmdDimensionPart = New Command(AddressOf Dimension) - End If - Return m_cmdDimensionPart - End Get - End Property +' Public ReadOnly Property DimensionCommand As ICommand +' Get +' If m_cmdDimensionPart Is Nothing Then +' m_cmdDimensionPart = New Command(AddressOf Dimension) +' End If +' Return m_cmdDimensionPart +' End Get +' End Property - Public Sub Dimension() - Dim ref_HardwarePartVM As New HardwarePartVM() - Dim HardwarePartWnd As New HardwarePartV(Application.Current.MainWindow, ref_HardwarePartVM) - HardwarePartWnd.ShowDialog() - ref_GeometryListConfigVM = Nothing - End Sub +' Public Sub Dimension() +' Dim ref_HardwarePartVM As New HardwarePartVM() +' Dim HardwarePartWnd As New HardwarePartV(Application.Current.MainWindow, ref_HardwarePartVM) +' HardwarePartWnd.ShowDialog() +' ref_GeometryListConfigVM = Nothing +' End Sub -#End Region ' Dimension Part +'#End Region ' Dimension Part #End Region ' Commands diff --git a/SceneManager/SceneManagerVM.vb b/SceneManager/SceneManagerVM.vb index 1531f1f..62cb132 100644 --- a/SceneManager/SceneManagerVM.vb +++ b/SceneManager/SceneManagerVM.vb @@ -289,7 +289,7 @@ Public Class SceneManagerVM ' eseguo If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage Then ' Verifico esista elemento selezionato - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return + If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) orelse IsNothing(Map.refPartPageVM.CurrPart) Then Return DdfFile.WriteDDFPart(Map.refPartPageVM.CurrPart, sTempFile, True, False) ExecDoors(m_ProjectScene, sTempFile, False) ' mantengo i layer accesi @@ -300,7 +300,7 @@ Public Class SceneManagerVM ShowGraphicError() ElseIf Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage Then ' Verifico esista elemento selezionato - If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return + If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) orelse IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then Return DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, sTempFile, True) ExecDoors(m_ProjectScene, sTempFile, False) ' mantengo i layer accesi