diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb index ee648de..e1a7a09 100644 --- a/Assembly/Assembly.vb +++ b/Assembly/Assembly.vb @@ -7,16 +7,6 @@ Imports System.Text.RegularExpressions Public Class Assembly Implements INotifyPropertyChanged - Private m_NewAssembly As Boolean = True - Public Property NewAssembly As Boolean - Get - Return m_NewAssembly - End Get - Set(value As Boolean) - m_NewAssembly = value - End Set - End Property - Private m_OneDoorProperty As Boolean Public Property OneDoorProperty As Boolean Get @@ -28,6 +18,7 @@ Public Class Assembly End Property #Region "Light Up/Bottom" + Private m_LightUp As String Public Property LightUp As String Get @@ -37,7 +28,7 @@ Public Class Assembly m_LightUp = value HeightJamb(GetArrayPartDoor(0).Door.Height) UpDateAllCompo() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property Public Sub SetLightUp(sLightUp As String) @@ -55,7 +46,7 @@ Public Class Assembly ' modifico le dimensioni dei Jambs HeightJamb(GetArrayPartDoor(0).Door.Height) UpDateAllCompo() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property Public Sub SetLightBottom(sLightBottom As String) @@ -65,6 +56,7 @@ Public Class Assembly #End Region ' Light Up/Bottom #Region "Light Hinge/Lock" + Private m_LightHinge As String Public Property LightHinge As String Get @@ -75,7 +67,7 @@ Public Class Assembly 'SetWidthJamb() TopBottomWidth() UpDateAllCompo() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property Public Sub SetLightHinge(sSetLightHinge As String) @@ -93,7 +85,7 @@ Public Class Assembly TopBottomWidth() 'SetWidthJamb() UpDateAllCompo() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property Public Sub SetLightLock(sLightLock As String) @@ -114,7 +106,7 @@ Public Class Assembly HeightJamb(GetArrayPartDoor(0).Door.Height) TopRabbetJamb() UpDateAllCompo() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property Public Sub SetThicknessHead(sThicknessHead As String) @@ -133,7 +125,7 @@ Public Class Assembly ' modifico le dimensioni dei Jambs 'DoorVisibilityNew() TopBottomWidth() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True 'SetWidthJamb() TopRabbetJamb() HingeRabbetJamb() @@ -156,7 +148,7 @@ Public Class Assembly ' modifico le dimensioni dei Jambs 'DoorVisibilityNew() TopBottomWidth() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True 'SetWidthJamb() TopRabbetJamb() HingeRabbetJamb() @@ -176,7 +168,7 @@ Public Class Assembly End Get Set(value As String) m_OverlapTop = value - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True HeightJamb(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Height) SetWidthJamb() HingeRabbetJamb() @@ -196,7 +188,7 @@ Public Class Assembly End Get Set(value As String) m_DeltaThickness = value - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True HingeRabbetJamb() UpDateAllCompo() End Set @@ -236,7 +228,7 @@ Public Class Assembly TopRabbetJamb() ReplaceHardware() End If - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True HingeRabbetJamb() BottomRabbetJamb() End Set @@ -256,7 +248,7 @@ Public Class Assembly m_Thickness = value SetThicKnessJamb() UpDateAllCompo() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property Public Sub SetThickness(sThickness As String) @@ -274,7 +266,7 @@ Public Class Assembly HeightJamb(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Height) SetWidthJamb() UpDateAllCompo() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property Public Sub SetWidth(sWidth As String) @@ -297,14 +289,14 @@ Public Class Assembly Get If m_LockEdgeType.IsActive = Visibility.Collapsed Then m_LockEdgeType = EdgeTypeList(0) - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End If Return m_LockEdgeType End Get Set(value As EdgeType) m_LockEdgeType = value NotifyPropertyChanged("LockEdgeType") - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.LockEdgeType = value m_RightJamb.LockEdgeType = value m_TopJamb.LockEdgeType = value @@ -321,14 +313,14 @@ Public Class Assembly Get If m_HingeEdgeType.IsActive = Visibility.Collapsed Then m_HingeEdgeType = EdgeTypeList(0) - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End If Return m_HingeEdgeType End Get Set(value As EdgeType) m_HingeEdgeType = value NotifyPropertyChanged("HingeEdgeType") - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.HingeEdgeType = value m_RightJamb.HingeEdgeType = value m_TopJamb.HingeEdgeType = value @@ -345,14 +337,14 @@ Public Class Assembly Get If m_TopType.IsActive = Visibility.Collapsed Then m_TopType = EdgeTypeList(0) - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End If Return m_TopType End Get Set(value As EdgeType) m_TopType = value NotifyPropertyChanged("TopType") - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.TopType = value m_RightJamb.TopType = value m_TopJamb.TopType = value @@ -369,14 +361,14 @@ Public Class Assembly Get If m_BottomType.IsActive = Visibility.Collapsed Then m_BottomType = EdgeTypeList(0) - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End If Return m_BottomType End Get Set(value As EdgeType) m_BottomType = value NotifyPropertyChanged("BottomType") - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.BottomType = value m_RightJamb.BottomType = value m_TopJamb.BottomType = value @@ -395,7 +387,7 @@ Public Class Assembly End Get Set(value As Boolean) m_TopMachining = value - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.TopMachining = m_TopMachining m_RightJamb.TopMachining = m_TopMachining m_TopJamb.TopMachining = m_TopMachining @@ -414,8 +406,8 @@ Public Class Assembly End Get Set(value As Boolean) m_LockEdgeMachining = value - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.LockEdgeMachining = m_LockEdgeMachining m_RightJamb.LockEdgeMachining = m_LockEdgeMachining m_TopJamb.LockEdgeMachining = m_LockEdgeMachining @@ -434,7 +426,7 @@ Public Class Assembly End Get Set(value As Boolean) m_HingeEdgeMachining = value - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.HingeEdgeMachining = value m_RightJamb.HingeEdgeMachining = value m_TopJamb.HingeEdgeMachining = value @@ -453,7 +445,7 @@ Public Class Assembly End Get Set(value As Boolean) m_BottomMachining = value - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.BottomMachining = value m_RightJamb.BottomMachining = value m_TopJamb.BottomMachining = value @@ -482,7 +474,7 @@ Public Class Assembly Else MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk) End If - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.LockEdgeOverMaterial = value m_RightJamb.LockEdgeOverMaterial = value m_TopJamb.LockEdgeOverMaterial = value @@ -507,7 +499,7 @@ Public Class Assembly Else MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk) End If - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.HingeEdgeOverMaterial = value m_RightJamb.HingeEdgeOverMaterial = value m_TopJamb.HingeEdgeOverMaterial = value @@ -532,7 +524,7 @@ Public Class Assembly Else MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk) End If - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.TopOverMaterial = value m_RightJamb.TopOverMaterial = value m_TopJamb.TopOverMaterial = value @@ -557,7 +549,7 @@ Public Class Assembly Else MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk) End If - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True m_LeftJamb.BottomOverMaterial = value m_RightJamb.BottomOverMaterial = value m_TopJamb.BottomOverMaterial = value @@ -569,7 +561,7 @@ Public Class Assembly NotifyPropertyChanged("BottomOverMaterial") End Sub -#End Region ' OverMterial +#End Region ' OverMaterial #Region "Lista Porte" @@ -619,7 +611,7 @@ Public Class Assembly HeightJamb(GetArrayPartDoor(1).Door.Height) End If ReplaceHardware() - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property Public Sub SetDoorNumber(sDoorNumber As String) @@ -952,8 +944,7 @@ Public Class Assembly If String.IsNullOrEmpty(Local_Door.TypePart) Then Local_Door.TypePart = "DO_1" Dim sDoorPiece As String = Local_Door.TypePart ' per eliminare lo swing associato al jamb FL_L --> FL_ - If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then Local_Door.IsNotAssembly = True - If Not Local_Door.IsNotAssembly Then + If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then If sDoorPiece.Count > 3 AndAlso sDoorPiece.Contains("F") Then sDoorPiece = sDoorPiece.Remove(3) End If @@ -961,14 +952,11 @@ Public Class Assembly Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage Else ' significa che stiamo per leggere una porta singola - Local_Door.IsNotAssembly = True Local_Door.IsActive = True Local_PartDoor.Door = Local_Door Local_PartDoor.Door.SwingTypeList = OptionModule.m_SwingTypeList Local_PartDoor.SetIsChecked(Local_Door.IsActive) SetArrayPartDoor(Local_PartDoor, 0) - DdfFile.WriteDDFPart(GetArrayPartDoor(0).Door, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False) - ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE) Map.refPartPageVM.CurrPart = Local_Door Map.refCompoPanelVM.GoBackVisibility = Visibility.Collapsed Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage @@ -1146,7 +1134,7 @@ Public Class Assembly End If Next If Not IsNothing(GetArrayPartDoor(0).Door) Then - If GetArrayPartDoor(0).Door.IsNotAssembly = True Then m_DoorNumber = "1" + If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then m_DoorNumber = "1" End If If m_DoorNumber = "1" Then OneDoorProperty = True @@ -1563,6 +1551,7 @@ Public Class Assembly m_LeftJamb.SetThickness(m_Thickness) m_RightJamb.SetThickness(m_Thickness) End Sub + ' questa funzione può essere richiamata solo dopo che sono state create tutte le porte! Private Sub TopBottomWidth() Dim dLightHinge As Double @@ -1603,6 +1592,7 @@ Public Class Assembly End If End Select End Sub + ' dimensione gli spessori dei Jamb (l'unico diverso dagli altri è quello top) Public Sub SetWidthJamb() m_BottomJamb.SetHeight(m_Width) @@ -1610,13 +1600,14 @@ Public Class Assembly m_LeftJamb.SetWidth(m_Width) m_RightJamb.SetWidth(m_Width) End Sub + ' ricalcola il valore degli swing dalla modifica dello swing della porta Public Sub UpdateSwing(sSwing As String) Dim bInvertDoor As Boolean = False Select Case DoorNumber Case "1" ' aggiorno l'elenco dello swing della porta - If Not GetArrayPartDoor(0).Door.IsNotAssembly Then + If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then GetArrayPartDoor(0).Door.SwingTypeList = OptionModule.m_SwingTypeListSinlgeDoor GetArrayPartDoor(0).Door.SetSwing(GetArrayPartDoor(0).Door.SwingTypeList(GetArrayPartDoor(0).Door.SwingTypeList.IndexOf(sSwing))) ' aggiorno gli swing sui Jamb (tutti hanno lo stesso swing) diff --git a/Assembly/AssemblyPageVM.vb b/Assembly/AssemblyPageVM.vb index e442c46..52bd777 100644 --- a/Assembly/AssemblyPageVM.vb +++ b/Assembly/AssemblyPageVM.vb @@ -6,15 +6,14 @@ Imports EgtUILib Public Class AssemblyPageVM Implements INotifyPropertyChanged - Private m_CurrAssembly As Assembly - Public Property CurrAssembly As Assembly + Public ReadOnly Property CurrAssembly As Assembly Get - Return m_CurrAssembly + If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then + Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly + Else + Return Nothing + End If End Get - Set(value As Assembly) - m_CurrAssembly = value - NotifyPropertyChanged("CurrAssembly") - End Set End Property ' Definizione comando @@ -24,9 +23,6 @@ Public Class AssemblyPageVM Sub New() Map.SetRefJambPageVM(Me) - If IsNothing(m_CurrAssembly) Then - m_CurrAssembly = New Assembly - End If End Sub #Region "Messages" @@ -253,9 +249,10 @@ Public Class AssemblyPageVM End Property Public Sub ShowOrder() - Map.refAssemblyManagerVM.NewAssembly = True - Map.refAssemblyManagerVM.OpenSelectedAssembly(Map.refAssemblyManagerVM.SelectedAssembly) + Dim OrderWnd As New OrderV(Application.Current.MainWindow, New OrderVM()) + OrderWnd.ShowDialog() End Sub + #End Region ' Comand #Region "METHODS" diff --git a/Assembly/PartDoor.vb b/Assembly/PartDoor.vb index ef9db94..d789793 100644 --- a/Assembly/PartDoor.vb +++ b/Assembly/PartDoor.vb @@ -27,7 +27,7 @@ Public Class PartDoor IsChecked = bIsChecked m_Door.IsActive = IsChecked NotifyPropertyChanged("IsChecked") - Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Sub Private m_IsVisible As Visibility diff --git a/AssemblyManager/AssemblyManagerV.xaml b/AssemblyManager/AssemblyManagerV.xaml index 9076c4e..8f33219 100644 --- a/AssemblyManager/AssemblyManagerV.xaml +++ b/AssemblyManager/AssemblyManagerV.xaml @@ -22,7 +22,7 @@ @@ -58,14 +58,14 @@ - +