From 7a6dc310d9961c130db074189ef6192f7a7ac3d4 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Wed, 25 Jul 2018 10:27:09 +0000 Subject: [PATCH] =?UTF-8?q?EgtDOORCreator=201.9g2=20:=20-=20la=20lista=20d?= =?UTF-8?q?egli=20swing=20=C3=A8=20configurabile=20-=20=C3=A8=20possibile?= =?UTF-8?q?=20usare=20le=20costanti=20anche=20nell'assemblato=20-=20=C3=A8?= =?UTF-8?q?=20possibile=20salvare=20un=20assemblato=20in=20forma=20di=20te?= =?UTF-8?q?mplate.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assembly/Assembly.vb | 138 +++++++----------- Assembly/AssemblyPageVM.vb | 6 +- AssemblyManager/AssemblyManagerVM.vb | 14 +- CompoMatch.vb | 3 +- Constants/ConstIni.vb | 1 + DdfFile.vb | 28 ++-- DoorParameters/Compo.vb | 4 +- DoorParameters/Part.vb | 70 ++++++--- My Project/AssemblyInfo.vb | 4 +- OptionsWindow/OptionModule.vb | 113 +++++++++++++- OptionsWindow/OptionsViewModel.vb | 49 ++++++- .../DimensioningPanel/DimensioningPanelV.xaml | 1 - .../DimensioningPanel/DimensioningPanelVM.vb | 1 + 13 files changed, 295 insertions(+), 137 deletions(-) diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb index 6026b29..150c3b2 100644 --- a/Assembly/Assembly.vb +++ b/Assembly/Assembly.vb @@ -1216,10 +1216,7 @@ Public Class Assembly Dim Local_PartDoor As New PartDoor Dim Local_Door As New Part(Local_PartDoor) ' carcio la liste delle propiretà - If OptionModule.m_DisableProperties = Visibility.Visible Then - ' copio i valori letti dall'optionpage - CreateNewPropertiesList(Local_Door.PropertiesList) - End If + CreateNewPropertiesList(Local_Door.PropertiesList) If Line > 0 Then ' per saltare la riga che è stata appena restituita che contiene "---" Line += 1 @@ -1390,7 +1387,7 @@ Public Class Assembly End Sub Private Sub ResearchMatchDoor(DoorActive As Part, DoorInactive As Part) - If Not DoorActive.Swing.Contains(ConstGen.INACTIVE) Then + If Not DoorActive.SwingAlias.Name.Contains(ConstGen.INACTIVE) Then For IndexCompo As Integer = 0 To DoorActive.CompoList.Count - 1 If Not String.IsNullOrEmpty(DoorActive.CompoList(IndexCompo).IdCode) Then For IndexCompoInactiveDoor As Integer = 0 To DoorInactive.CompoList.Count - 1 @@ -1432,32 +1429,6 @@ Public Class Assembly End Sub #End Region ' Associazione delle compo lette da ddf - '' Aggiorna IsVisible delle porte contenute nell'ArrayPartDoor - 'Public Sub DoorVisibility() - ' Dim nDoorNumber As Integer = 1 - ' Integer.TryParse(m_DoorNumber, nDoorNumber) - ' ' aggiorno la visibilità delle porte senza però modificare la dimensione dei Jamb caricati - ' For Index As Integer = 0 To nDoorNumber - 1 - ' If Not IsNothing(m_ArrayPartDoor(Index)) Then - ' m_ArrayPartDoor(Index).IsVisible = Visibility.Visible - ' m_ArrayPartDoor(Index).NotifyPropertyChanged("IsVisible") - ' End If - ' Next - ' For Index As Integer = nDoorNumber To MAX_DOORNUMBER - ' If Not IsNothing(m_ArrayPartDoor(Index)) Then - ' m_ArrayPartDoor(Index).IsVisible = Visibility.Collapsed - ' m_ArrayPartDoor(Index).NotifyPropertyChanged("IsVisible") - ' End If - ' Next - ' If Not IsNothing(GetArrayPartDoor(0).Door) Then - ' If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then - ' m_DoorNumber = "1" - ' nDoorNumber = 1 - ' End If - ' End If - ' OneDoorProperty = (nDoorNumber = 1) - ' NotifyPropertyChanged("CurrAssembly") - 'End Sub #End Region ' Lettura Assemblato #Region "RULES ASSEMBLY" @@ -1500,13 +1471,13 @@ Public Class Assembly Select Case Side Case "Lock" ' se è LeftHand - If Map.refPartPageVM.CurrPart.Swing.Contains("L") Then + If Map.refPartPageVM.CurrPart.SwingAlias.Name.Contains("L") Then nSide = 100 Else nSide = 300 End If Case "Hinge" - If Map.refPartPageVM.CurrPart.Swing.Contains("L") Then + If Map.refPartPageVM.CurrPart.SwingAlias.Name.Contains("L") Then nSide = 300 Else nSide = 100 @@ -1584,7 +1555,7 @@ Public Class Assembly ' assegno i parametri letti dallo script per il corretto posizionamento del pezzo ( solo se il pezzo corrente è un DO_) If LoadCompoParam(CurrCompo, Map.refPartPageVM.CurrPart.TypePart) Then - UpDateCurrCompoJamb(CurrCompo) + UpDateCurrCompoJamb(CurrCompo, Map.refPartPageVM.CurrPart.TypePart) ResetSTU() ResetCompoParam() Else @@ -1662,12 +1633,14 @@ Public Class Assembly TopRabbetJamb() BottomRabbetJamb() HingeRabbetJamb() + SetVarAssembly() Case "Width" TopBottomWidth() TopRabbetJamb() BottomRabbetJamb() HingeRabbetJamb() + SetVarAssembly() Case "Thickness" TopRabbetJamb() @@ -1675,11 +1648,13 @@ Public Class Assembly Case "Swing" UpDateCompolistOnJamb() SwingJamb() + UpDateAllCompo() Case "DoorNumber" Map.refAssemblyManagerVM.CreateDoor(Me) Map.refAssemblyManagerVM.CreateAssociation(Me) SetPartDoorCurrAssembly() + SetVarAssembly() TopBottomWidth() SwingJamb() HeightDoor() @@ -1702,7 +1677,7 @@ Public Class Assembly If Not IsNothing(CurrCompo.refJambCompo) Then ' ricerco il file lua che gestisce le associazioni delle componenti If LoadCompoParam(CurrCompo, ListPartDoorOfDoor(IndexDoor).Door.TypePart) Then - UpDateCurrCompoJamb(CurrCompo) + UpDateCurrCompoJamb(CurrCompo, ListPartDoorOfDoor(IndexDoor).Door.TypePart) ResetCompoParam() Else Dim Msg As String = String.Format(EgtMsg(50157), CurrCompo.CompoType.Path, MATCHING_FILE_NAME) @@ -1714,7 +1689,7 @@ Public Class Assembly End Sub ' Ricevuta la componente Compo aggiorna la refCompo - Public Sub UpDateCurrCompoJamb(ByRef CurrCompo As Compo) + Public Sub UpDateCurrCompoJamb(ByRef CurrCompo As Compo, ByRef sCurrTypeDoor As String) CurrCompo.refJambCompo.IsReadOnly = False ' devo distinguere il caso della componente sulla porta o sul jamb ' se il numero di elementi presenti nella lista riferita al jamb sono diversi da quelli riferiti all'anta @@ -1728,7 +1703,7 @@ Public Class Assembly Dim TBoxPar As TextBoxParam = DirectCast(CurrCompo.CompoParamList(IndexParam), TextBoxParam) Dim TBoxRefPar As TextBoxParam = DirectCast(CurrCompo.refJambCompo.CompoParamList(IndexParam), TextBoxParam) ' assegno i valori della componente dell'anta, e ricevo i valori da asseganre alla compente sul jamb - CalcCompoParamValue(TBoxPar.DDFName, TBoxPar.m_Value, TBoxRefPar.m_Value, TBoxRefPar.IsReadOnly) + CalcCompoParamValue(TBoxPar.DDFName, TBoxPar.m_Value, TBoxRefPar.m_Value, TBoxRefPar.IsReadOnly, sCurrTypeDoor) ElseIf TypeOf CurrCompo.refJambCompo.CompoParamList(IndexParam) Is ComboBoxParam AndAlso CurrCompo.CompoParamList(IndexParam).DDFName = CurrCompo.refJambCompo.CompoParamList(IndexParam).DDFName Then ' ho controllato che i nome ddf del parametro sul jamb è lo stesso che sta sull'anta @@ -1740,7 +1715,7 @@ Public Class Assembly Dim TBoxPar As TextBoxOnOffParam = DirectCast(CurrCompo.CompoParamList(IndexParam), TextBoxOnOffParam) Dim TBoxRefPar As TextBoxOnOffParam = DirectCast(CurrCompo.refJambCompo.CompoParamList(IndexParam), TextBoxOnOffParam) ' assegno i valori della componente dell'anta, e ricevo i valori da asseganre alla compente sul jamb - CalcCompoParamValue(TBoxPar.DDFName, TBoxPar.m_Value, TBoxRefPar.m_Value, TBoxRefPar.IsReadOnly) + CalcCompoParamValue(TBoxPar.DDFName, TBoxPar.m_Value, TBoxRefPar.m_Value, TBoxRefPar.IsReadOnly, sCurrTypeDoor) End If Next End Sub @@ -2051,21 +2026,21 @@ Public Class Assembly ' se sulla porta singola avviene cambio swing (da LeftHand a RightHand) allora devo invertire i Jamb laterali ' se eistono entrambi i Jamb laterali inverto allora li inverto Public Sub UpDateCompolistOnJamb() - Dim sSwing1 As String = String.Empty + Dim sSwing1 As SwingItemTypeList = Nothing ' in AssemblyManager ho assegnato ai Jamb la lista completa degli swing For Each Item In OptionModule.m_SwingTypeList - If Trim(m_Door1.Swing) = Trim(Item) Then - sSwing1 = Item + If Trim(m_Door1.SwingAlias.AliasName) = Trim(Item) Then + OptionModule.SetCurrSwing(sSwing1, Item) Exit For End If Next - If String.IsNullOrEmpty(sSwing1) Then Return + If IsNothing(sSwing1) Then Return Select Case DoorNumber Case "1" ' passo da un'anta LeftHand ad una RightHand If Not IsNothing(m_JambL) Then - If (m_JambL.Swing.Contains("LH") And sSwing1.Contains("RH")) OrElse - (m_JambL.Swing.Contains("RH") And sSwing1.Contains("LH")) Then + If (m_JambL.SwingAlias.Name.Contains("LH") And sSwing1.Name.Contains("RH")) OrElse + (m_JambL.SwingAlias.Name.Contains("RH") And sSwing1.Name.Contains("LH")) Then If Not IsNothing(m_JambR) Then Dim TempJambL As Part = Map.refAssemblyManagerVM.ReserchPartDoor("FL_").Door.ShallowCopy() Dim TempJambR As Part = Map.refAssemblyManagerVM.ReserchPartDoor("FR_").Door.ShallowCopy() @@ -2091,14 +2066,14 @@ Public Class Assembly End If ' in AssemblyManager ho assegnato ai Jamb la lista completa degli swing For Each Item In OptionModule.m_SwingTypeList - If Trim(m_Door1.Swing) = Trim(Item) Then - sSwing1 = Item + If Trim(m_Door1.SwingAlias.AliasName) = Trim(Item) Then + OptionModule.SetCurrSwing(sSwing1, Item) Exit For End If Next If Not IsNothing(m_JambL) Then - If (m_JambL.Swing.Contains("I") And Not sSwing1.Contains("I")) OrElse - (Not m_JambL.Swing.Contains("I") And sSwing1.Contains("I")) Then + If (m_JambL.SwingAlias.Name.Contains("I") And Not sSwing1.Name.Contains("I")) OrElse + (Not m_JambL.SwingAlias.Name.Contains("I") And sSwing1.Name.Contains("I")) Then Dim TempDoor1 As Part = Map.refAssemblyManagerVM.ReserchPartDoor("DO_1").Door.ShallowCopy() Dim TempDoor2 As Part = Map.refAssemblyManagerVM.ReserchPartDoor("DO_2").Door.ShallowCopy() TempDoor2.IsActive = TempDoor1.IsActive @@ -2121,7 +2096,7 @@ Public Class Assembly TempJambR.TypePart = ConstGen.PART_FRAME_LEFT Map.refAssemblyManagerVM.ReserchPartDoor("FL_").Door = TempJambR TempJambL.TypePart = ConstGen.PART_FRAME_RIGHT - Map.refAssemblyManagerVM.ReserchPartDoor("FR_").Door = TempJambL + Map.refAssemblyManagerVM.ReserchPartDoor("FR_").Door = TempJambL End If ' aggiorno le copie presenti nell'assemblato SetPartDoorCurrAssembly() @@ -2142,7 +2117,7 @@ Public Class Assembly Dim sSwing1 As String = String.Empty ' in AssemblyManager assegno ai Jamb la lista completa degli swing For Each Item In OptionModule.m_SwingTypeList - If Trim(m_Door1.Swing) = Trim(Item) Then + If Trim(m_Door1.SwingAlias.AliasName) = Trim(Item) Then sSwing1 = Item Exit For End If @@ -2157,7 +2132,7 @@ Public Class Assembly If Exterior Then ' se di tipo LeftHand - If m_JambL.Swing.Contains("LH") Then + If m_JambL.SwingAlias.Name.Contains("LH") Then If Not IsNothing(m_JambL) Then m_JambL.TypePart = ConstGen.PART_FRAME_LEFT & ConstGen.HINGE & ConstGen.EXTERIOR If Not IsNothing(m_JambR) Then m_JambR.TypePart = ConstGen.PART_FRAME_RIGHT & ConstGen.LOCK & ConstGen.EXTERIOR Else @@ -2167,7 +2142,7 @@ Public Class Assembly If Not IsNothing(m_JambB) Then m_JambB.TypePart = ConstGen.PART_FRAME_BOTTOM & ConstGen.BOTTOM & ConstGen.EXTERIOR If Not IsNothing(m_JambT) Then m_JambT.TypePart = ConstGen.PART_FRAME_TOP & ConstGen.TOP & ConstGen.EXTERIOR Else - If m_JambL.Swing.Contains("LH") Then + If m_JambL.SwingAlias.Name.Contains("LH") Then If Not IsNothing(m_JambL) Then m_JambL.TypePart = ConstGen.PART_FRAME_LEFT & ConstGen.HINGE If Not IsNothing(m_JambR) Then m_JambR.TypePart = ConstGen.PART_FRAME_RIGHT & ConstGen.LOCK Else @@ -2199,7 +2174,7 @@ Public Class Assembly Dim sSwing2 As String = String.Empty ' in AssemblyManager assegno ai Jamb la lista completa degli swing For Each Item In OptionModule.m_SwingTypeList - If Trim(m_Door2.Swing) = Trim(Item) Then + If Trim(m_Door2.SwingAlias.Name) = Trim(Item) Then sSwing2 = Item Exit For End If @@ -2244,34 +2219,29 @@ Public Class Assembly Dim dHeight As Double Dim dWidth As Double Dim dThickness As Double - If Not IsNothing(Map.refPartPageVM.CurrPart) Then - If IsNothing(Map.refPartPageVM.CurrPart.TypePart) OrElse Map.refPartPageVM.CurrPart.TypePart.Contains(ConstGen.PART_DO_ & "1") Then - If Not IsNothing(Map.refPartPageVM.CurrPart.Height) And Not IsNothing(Map.refPartPageVM.CurrPart.Width) And Not IsNothing(Map.refPartPageVM.CurrPart.Thickness) Then - If StringToDouble(Map.refPartPageVM.CurrPart.Height, dHeight) Then - EgtLuaSetGlobNumVar("H", dHeight) - EgtLuaSetGlobNumVar("H1", dHeight) - End If - If StringToDouble(Map.refPartPageVM.CurrPart.Width, dWidth) Then - EgtLuaSetGlobNumVar("W", dWidth) - EgtLuaSetGlobNumVar("W1", dWidth) - End If - If StringToDouble(Map.refPartPageVM.CurrPart.Thickness, dThickness) Then - EgtLuaSetGlobNumVar("T", dThickness) - EgtLuaSetGlobNumVar("T1", dThickness) - End If - End If - ElseIf Map.refPartPageVM.CurrPart.TypePart.Contains(ConstGen.PART_DO_ & "2") Then - If Not IsNothing(Map.refPartPageVM.CurrPart.Height) And Not IsNothing(Map.refPartPageVM.CurrPart.Width) And Not IsNothing(Map.refPartPageVM.CurrPart.Thickness) Then - If StringToDouble(Map.refPartPageVM.CurrPart.Height, dHeight) Then - EgtLuaSetGlobNumVar("H2", dHeight) - End If - If StringToDouble(Map.refPartPageVM.CurrPart.Width, dWidth) Then - EgtLuaSetGlobNumVar("W2", dWidth) - End If - If StringToDouble(Map.refPartPageVM.CurrPart.Thickness, dThickness) Then - EgtLuaSetGlobNumVar("T2", dThickness) - End If - End If + If Not IsNothing(m_Door1) Then + If Not IsNothing(m_Door1.Height) AndAlso StringToDouble(m_Door1.Height, dHeight) Then + EgtLuaSetGlobNumVar("H", dHeight) + EgtLuaSetGlobNumVar("H1", dHeight) + End If + If Not IsNothing(m_Door1.Width) AndAlso StringToDouble(m_Door1.Width, dWidth) Then + EgtLuaSetGlobNumVar("W", dWidth) + EgtLuaSetGlobNumVar("W1", dWidth) + End If + If Not IsNothing(m_Door1.Thickness) AndAlso StringToDouble(m_Door1.Thickness, dThickness) Then + EgtLuaSetGlobNumVar("T", dThickness) + EgtLuaSetGlobNumVar("T1", dThickness) + End If + End If + If Not IsNothing(m_Door2) Then + If Not IsNothing(m_Door2.Height) AndAlso StringToDouble(m_Door2.Height, dHeight) Then + EgtLuaSetGlobNumVar("H2", dHeight) + End If + If Not IsNothing(m_Door2.Width) AndAlso StringToDouble(m_Door2.Width, dWidth) Then + EgtLuaSetGlobNumVar("W2", dWidth) + End If + If Not IsNothing(m_Door2.Thickness) AndAlso StringToDouble(m_Door2.Thickness, dThickness) Then + EgtLuaSetGlobNumVar("T2", dThickness) End If End If @@ -2287,7 +2257,7 @@ Public Class Assembly Dim sLightUp As String = Map.refAssemblyPageVM.CurrAssembly.LightUp Select Case DoorNumber Case "1" - If Not m_JambL.Swing.Contains("L") Then + If Not m_JambL.SwingAlias.Name.Contains("L") Then If Not IsNothing(m_JambL) Then SetTopRabbetJamb(m_JambL, sThicknessHead, sOverLapLock, sLightUp) If Not IsNothing(m_JambR) Then SetTopRabbetJamb(m_JambR, sThicknessHead, sOverlapHinge, sLightUp) Else @@ -2390,7 +2360,7 @@ Public Class Assembly Dim IndexBottom As Integer = 1 Select Case DoorNumber Case "1" - If Not m_JambL.Swing.Contains(ConstGen.LOCK) Then + If Not m_JambL.SwingAlias.Name.Contains(ConstGen.LOCK) Then RabbetExterior(m_JambL, sThicknessDoor, sWidthJamb, sOverLapLock, IndexBottom) RabbetExterior(m_JambR, sThicknessDoor, sWidthJamb, sOverLapHinge, IndexBottom) Else @@ -2418,7 +2388,7 @@ Public Class Assembly Dim IndexHinge As Integer = 2 Select Case DoorNumber Case "1" - If Not m_JambL.Swing.Contains(ConstGen.LOCK) Then + If Not m_JambL.SwingAlias.Name.Contains(ConstGen.LOCK) Then RabbetExterior(m_JambL, sThicknessDoor, sDeltaT, sOverLapLock, IndexHinge) RabbetExterior(m_JambR, sThicknessDoor, sDeltaT, sOverLapHinge, IndexHinge) RabbetExterior(m_JambT, sThicknessDoor, sDeltaT, sOverLapTop, IndexHinge) diff --git a/Assembly/AssemblyPageVM.vb b/Assembly/AssemblyPageVM.vb index 8aad703..a0661cd 100644 --- a/Assembly/AssemblyPageVM.vb +++ b/Assembly/AssemblyPageVM.vb @@ -213,11 +213,11 @@ Public Class AssemblyPageVM Case ConstGen.PART_FRAME_LEFT LoadSelectedPartDoor(ConstGen.PART_FRAME_LEFT, Visibility.Hidden, True) Case ConstGen.PART_FRAME_RIGHT - LoadSelectedPartDoor(ConstGen.PART_FRAME_RIGHT, Visibility.Hidden, False) + LoadSelectedPartDoor(ConstGen.PART_FRAME_RIGHT, Visibility.Hidden, True) Case ConstGen.PART_FRAME_TOP - LoadSelectedPartDoor(ConstGen.PART_FRAME_TOP, Visibility.Hidden, False) + LoadSelectedPartDoor(ConstGen.PART_FRAME_TOP, Visibility.Hidden, True) Case ConstGen.PART_FRAME_BOTTOM - LoadSelectedPartDoor(ConstGen.PART_FRAME_TOP, Visibility.Hidden, False) + LoadSelectedPartDoor(ConstGen.PART_FRAME_TOP, Visibility.Hidden, True) Case Else LoadSelectedPartDoor(SelectPart, Visibility.Visible, False) End Select diff --git a/AssemblyManager/AssemblyManagerVM.vb b/AssemblyManager/AssemblyManagerVM.vb index 17c4b02..265f568 100644 --- a/AssemblyManager/AssemblyManagerVM.vb +++ b/AssemblyManager/AssemblyManagerVM.vb @@ -71,6 +71,8 @@ Public Class AssemblyManagerVM Else DdfFile.WriteDDFAssembly(NewAssName.SelAssembly, sTempFile, False) ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False) + ' aggiorno elenco quotature + Map.refDimensioningPanelVM.LoadHardwareDimList() EgtZoom(ZM.ALL) Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage End If @@ -124,6 +126,8 @@ Public Class AssemblyManagerVM EgtZoom(ZM.ALL) Else DdfFile.WriteDDFAssembly(OpenedAssName.SelAssembly, sTempFile, True) + ' aggiorno elenco quotature + Map.refDimensioningPanelVM.LoadHardwareDimList() ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False) Map.refSceneManagerVM.ShowGraphicError() EgtZoom(ZM.ALL) @@ -270,7 +274,7 @@ Public Class AssemblyManagerVM ' definisce la disposizione (da selezionare in una sola anta) LeftJamb.Door.SetDispositionItem(OptionModule.m_Disposition) LeftJamb.IsChecked = OptionModule.m_LeftJambChk - CreateNewPropertiesList(LeftJamb.Door.PropertiesList) + CreateNewPropertiesListJamb(LeftJamb.Door.PropertiesList) ' aggiungo alla lista dei PartDoor CurrAssembly.ListPartDoor.Add(LeftJamb) End If @@ -288,7 +292,7 @@ Public Class AssemblyManagerVM ' definisce la disposizione (da selezionare in una sola anta) RightJamb.Door.SetDispositionItem(OptionModule.m_Disposition) RightJamb.IsChecked = OptionModule.m_RightJambChk - CreateNewPropertiesList(RightJamb.Door.PropertiesList) + CreateNewPropertiesListJamb(RightJamb.Door.PropertiesList) ' aggiungo alla lista dei PartDoor CurrAssembly.ListPartDoor.Add(RightJamb) End If @@ -306,7 +310,7 @@ Public Class AssemblyManagerVM ' definisce la disposizione (da selezionare in una sola anta) TopJamb.Door.SetDispositionItem(OptionModule.m_Disposition) TopJamb.IsChecked = OptionModule.m_TopJambChk - CreateNewPropertiesList(TopJamb.Door.PropertiesList) + CreateNewPropertiesListJamb(TopJamb.Door.PropertiesList) CurrAssembly.ListPartDoor.Add(TopJamb) End If @@ -323,7 +327,7 @@ Public Class AssemblyManagerVM ' definisce la disposizione (da selezionare in una sola anta) BottomJamb.Door.SetDispositionItem(OptionModule.m_Disposition) BottomJamb.IsChecked = OptionModule.m_TopJambChk - CreateNewPropertiesList(BottomJamb.Door.PropertiesList) + CreateNewPropertiesListJamb(BottomJamb.Door.PropertiesList) BottomJamb.IsChecked = True ' aggiungo alla lista dei PartDoor CurrAssembly.ListPartDoor.Add(BottomJamb) @@ -735,7 +739,7 @@ Public Class AssemblyManagerVM Next EgtZoom(ZM.ALL) Else - DdfFile.WriteDDFAssembly(m_CurrProject.SelAssemblyName.SelAssembly, m_CurrProject.SelAssemblyName.Name, True) + DdfFile.WriteDDFAssembly(m_CurrProject.SelAssemblyName.SelAssembly, m_CurrProject.SelAssemblyName.Name, False) ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False) Map.refSceneManagerVM.ShowGraphicError() EgtZoom(ZM.ALL) diff --git a/CompoMatch.vb b/CompoMatch.vb index a30c39a..fed009a 100644 --- a/CompoMatch.vb +++ b/CompoMatch.vb @@ -105,9 +105,10 @@ Module CompoMatch End Function ' asseganto un parametro restituisce il valore da associare allo stesso parametro sul jamb - Friend Function CalcCompoParamValue(sInParamName As String, sInParamValue As String, ByRef sOutParamValue As String, ByRef IsEnable As Boolean) As Boolean + Friend Function CalcCompoParamValue(sInParamName As String, sInParamValue As String, ByRef sOutParamValue As String, ByRef IsEnable As Boolean, ByRef sSelDoor As String) As Boolean ' Assegno dati parametro EgtLuaSetGlobStringVar("STU.InParamName", sInParamName) + EgtLuaSetGlobStringVar("STU.SelDoor", sSelDoor) Dim dInParamValue As Double StringToDouble(sInParamValue, dInParamValue) EgtLuaSetGlobNumVar("STU.InParamValue", dInParamValue) diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 7b1365e..924fb3a 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -89,6 +89,7 @@ Module ConstIni Public Const S_PROPERTIES_INI As String = "Properties" Public Const K_PROPRTIESLIST_INI As String = "PropertiesList" + Public Const K_PROPRTIESLISTJAMB_INI As String = "PropertiesListJamb" Public Const S_EDGE As String = "Edge" Public Const S_EDGEASSEMBLY = "EdgeAssembly" diff --git a/DdfFile.vb b/DdfFile.vb index e8c138c..9af8b74 100644 --- a/DdfFile.vb +++ b/DdfFile.vb @@ -201,7 +201,7 @@ Friend Module DdfFile '---------------------------------------------------------------------------------------------------------------------------------------------------- ' aggiungo il secure nullo al DDF If Part.TypePart.Contains(ConstGen.PART_DO_) Then - DdfFileContent.Add("" & ConstCompo.S_SECURE & ": " & SetSecure(Part.Swing, Part.DispositionItem.Name, Part.Secure)) + DdfFileContent.Add("" & ConstCompo.S_SECURE & ": " & SetSecure(Part.SwingAlias.Name, Part.DispositionItem.Name, Part.Secure)) ' aggiungo una riga vuota per separare la lista successiva Else DdfFileContent.Add("" & ConstCompo.S_SECURE & ": " & ConstGen.SWING_DOWN) @@ -225,7 +225,7 @@ Friend Module DdfFile DdfFileContent.Add("") '---------------------------------------------------------------------------------------------------------------------------------------------------- DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.Swing)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining)) If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_LOCKEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -237,7 +237,7 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.LockEdgeOverMaterial) End If End If - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.Swing)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.HingeEdgeMachining)) If Not StringToDouble(Part.HingeEdgeOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_HINGEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -249,7 +249,7 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.HingeEdgeOverMaterial) End If End If - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.Swing)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.TopMachining)) If Not StringToDouble(Part.TopOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_TOPOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -286,7 +286,7 @@ Friend Module DdfFile End If End If - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.Swing)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining)) If Not StringToDouble(Part.BottomOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_BOTTOMOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -444,7 +444,7 @@ Friend Module DdfFile '---------------------------------------------------------------------------------------------------------------------------------------------------- ' aggiungo il secure nullo al DDF If Part.TypePart.Contains(ConstGen.PART_DO_) Then - DdfFileContent.Add("" & ConstCompo.S_SECURE & ": " & SetSecure(Part.Swing, Part.DispositionItem.Name, Part.Secure)) + DdfFileContent.Add("" & ConstCompo.S_SECURE & ": " & SetSecure(Part.SwingAlias.Name, Part.DispositionItem.Name, Part.Secure)) ' aggiungo una riga vuota per separare la lista successiva Else DdfFileContent.Add("" & ConstCompo.S_SECURE & ": " & ConstGen.SWING_DOWN) @@ -453,7 +453,7 @@ Friend Module DdfFile DdfFileContent.Add("") '---------------------------------------------------------------------------------------------------------------------------------------------------- DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.Swing)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining)) If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_LOCKEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -469,7 +469,7 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) End If End If - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.Swing)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.HingeEdgeMachining)) If Not StringToDouble(Part.HingeEdgeOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_HINGEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -485,7 +485,7 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) End If End If - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.Swing)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.TopMachining)) If Not StringToDouble(Part.TopOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_TOPOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -501,7 +501,7 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) End If End If - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.Swing)) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining)) If Not StringToDouble(Part.BottomOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_BOTTOMOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -617,7 +617,7 @@ Friend Module DdfFile End If ' posiziono il jamb sopra If CurrPart.TypePart.Contains(ConstGen.PART_FRAME_TOP) Then - If CurrPart.Swing.Contains(ConstGen.LOCK) Then + If CurrPart.SwingAlias.Name.Contains(ConstGen.LOCK) Then x = DoubleToString(-dLightHinge, 4) Else x = DoubleToString(-dLightLock, 4) @@ -625,7 +625,7 @@ Friend Module DdfFile End If ' posiziono il jamb sotto If CurrPart.TypePart.Contains(ConstGen.PART_FRAME_BOTTOM) Then - If CurrPart.Swing.Contains(ConstGen.LOCK) Then + If CurrPart.SwingAlias.Name.Contains(ConstGen.LOCK) Then x = DoubleToString(-dLightHinge, 4) Else x = DoubleToString(-dLightLock, 4) @@ -652,7 +652,7 @@ Friend Module DdfFile End If ' posiziono il jamb sopra If CurrPart.TypePart.Contains(ConstGen.PART_FRAME_TOP) Then - If CurrPart.Swing.Contains(ConstGen.LOCK) Then + If CurrPart.SwingAlias.Name.Contains(ConstGen.LOCK) Then x = DoubleToString(-dOverlapHinge - dLightHinge, 4) Else x = DoubleToString(-dOverlapLock - dLightLock, 4) @@ -666,7 +666,7 @@ Friend Module DdfFile Dim z As String Dim dDeltaThickness As Double StringToDouble(Map.refAssemblyPageVM.CurrAssembly.DeltaThickness, dDeltaThickness) - If CurrPart.Swing.Contains(ConstGen.HAND_REVERSE) Then + If CurrPart.SwingAlias.Name.Contains(ConstGen.HAND_REVERSE) Then Dim dThicknessDoor As Double Dim dThicknessJamb As Double ' StringToDouble(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Thickness, dThicknessDoor) diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index 05df2db..f1a224b 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -1564,7 +1564,7 @@ Public Class TextBoxParam If TypeOf CmpRefPar Is TextBoxParam AndAlso CmpPar.DDFName = CmpRefPar.DDFName Then Dim TBoxPar As TextBoxParam = DirectCast(CmpPar, TextBoxParam) Dim TBoxRefPar As TextBoxParam = DirectCast(CmpRefPar, TextBoxParam) - CalcCompoParamValue(TBoxPar.DDFName, TBoxPar.m_Value, TBoxRefPar.m_Value, TBoxRefPar.IsReadOnly) + CalcCompoParamValue(TBoxPar.DDFName, TBoxPar.m_Value, TBoxRefPar.m_Value, TBoxRefPar.IsReadOnly, Map.refPartPageVM.CurrPart.TypePart) Return True ElseIf TypeOf CmpRefPar Is ComboBoxParam AndAlso CmpPar.DDFName = CmpRefPar.DDFName Then DirectCast(CmpRefPar, ComboBoxParam).IsReadOnly = False @@ -1572,7 +1572,7 @@ Public Class TextBoxParam ElseIf TypeOf CmpRefPar Is TextBoxOnOffParam AndAlso CmpPar.DDFName = CmpRefPar.DDFName Then Dim TBoxPar As TextBoxOnOffParam = DirectCast(CmpPar, TextBoxOnOffParam) Dim TBoxRefPar As TextBoxOnOffParam = DirectCast(CmpRefPar, TextBoxOnOffParam) - CalcCompoParamValue(TBoxPar.DDFName, TBoxPar.m_Value, TBoxRefPar.m_Value, TBoxRefPar.IsReadOnly) + CalcCompoParamValue(TBoxPar.DDFName, TBoxPar.m_Value, TBoxRefPar.m_Value, TBoxRefPar.IsReadOnly, Map.refPartPageVM.CurrPart.TypePart) Return True End If Next diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 15f202d..bce0e33 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -362,7 +362,7 @@ Public Class Part #Region "SWING" ' lista degli Swing - Private m_SwingTypeList As List(Of String) = New List(Of String) + Private m_SwingTypeList As New List(Of String) Public Property SwingTypeList As List(Of String) Get Return m_SwingTypeList @@ -373,6 +373,16 @@ Public Class Part End Set End Property + Private m_SwingAlias As SwingItemTypeList = Nothing + Public Property SwingAlias As SwingItemTypeList + Get + Return m_SwingAlias + End Get + Set(value As SwingItemTypeList) + m_SwingAlias = value + End Set + End Property + Private m_Swing As String = Nothing Public Property Swing As String Get @@ -380,6 +390,8 @@ Public Class Part End Get Set(value As String) m_Swing = value + OptionModule.SetCurrSwing(m_SwingAlias, value) + m_Swing = m_SwingAlias.AliasName NotifyPropertyChanged("Swing") Map.refAssemblyPageVM.CurrAssembly.SetDimension("Swing") Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True @@ -387,13 +399,10 @@ Public Class Part Map.refSceneManagerVM.RefreshBtn() End Set End Property + Public Sub SetSwing(sSwing As String) - For Each ItemsSwing In m_SwingTypeList - If Trim(ItemsSwing) = Trim(sSwing) Then - m_Swing = ItemsSwing - Exit For - End If - Next + OptionModule.SetCurrSwing(m_SwingAlias, sSwing) + m_Swing = m_SwingAlias.AliasName NotifyPropertyChanged("Swing") End Sub @@ -818,7 +827,7 @@ Public Class Part If NewCompo.CompoType.DDFName = m_CompoList(CompoIndex).CompoType.DDFName Then ' cerco l'ultima componente con lo stesso nome Dim Lastindex As Integer = 0 - Dim PrecCompo As Compo + Dim PrecCompo As Compo = Nothing While CompoIndex + Lastindex < m_CompoList.Count AndAlso NewCompo.CompoType.DDFName = m_CompoList(CompoIndex + Lastindex).CompoType.DDFName PrecCompo = m_CompoList(CompoIndex + Lastindex) Lastindex += 1 @@ -859,9 +868,6 @@ Public Class Part ' carico l'elenco dei direttori If IsFrame Then CurrFolderList = CurrCompoType.FrameFolderList - '' devo dividere il nome che arriva dal matching lua - 'NewCompo.SetTemplateSelItemRefCompo(FrameFile, NewCompo) - 'Return True Else CurrFolderList = CurrCompoType.FolderList End If @@ -1344,7 +1350,7 @@ Public Class Part ' controllo che i parametri della porta siano stati caricati correttamente If Not ReadDoorCompleted Then - sErrorInfo = EgtMsg(50156) + If String.IsNullOrEmpty(sErrorInfo) Then sErrorInfo = EgtMsg(50156) ReadDoor = Nothing End If @@ -1363,7 +1369,7 @@ Public Class Part MessageBox.Show(EgtMsg(50194), EgtMsg(50118), MessageBoxButton.OK, MessageBoxImage.Information) FirstReadingEdge = True End If - + ' Sarebbe buona norma inserire qui la stringa con i messaggi di errore e avvertimento (dopo aver caricato i bevel corretti) If ReadDoor.bModifyBevel Then ' 50169 =Door dispositiopn has been modify. @@ -1498,6 +1504,11 @@ Public Class Part Dim sType As String = GetValueWithKey(RemoveComment(FileContent(Index)), S_PIECE) If Not String.IsNullOrWhiteSpace(sType) Then m_TypePart = sType + If sType.Contains("DO_") Then + OptionModule.CreateNewPropertiesList(m_PropertiesList) + Else + OptionModule.CreateNewPropertiesListJamb(m_PropertiesList) + End If End If ' passo alla riga successiva Return NextIndex(Index) @@ -1642,6 +1653,31 @@ Public Class Part Else ' carico il valore nella porta corrente m_Swing = Swing + OptionModule.SetCurrSwing(m_SwingAlias, m_Swing) + 'For Each Item In OptionModule.m_SwingList + ' If Trim(Swing) = Trim(Item.Name) Then + ' m_SwingAlias = Item + ' If Item.AliasList.Count > 0 Then + ' m_SwingAlias.AliasName = Item.AliasList(0) + ' m_Swing = Item.AliasList(0) + ' End If + ' Exit For + ' End If + 'Next + '' se arrivo fni qui significa che sicuramente deve esistere un alias + 'If IsNothing(m_SwingAlias) Then + ' For Each ItemSwingList In OptionModule.m_SwingList + ' For Each ItemAlias In ItemSwingList.AliasList + ' If Trim(Swing) = Trim(ItemAlias) Then + ' m_SwingAlias = ItemSwingList + ' m_SwingAlias.AliasName = ItemAlias + ' Exit For + ' End If + ' Next + ' Next + 'End If + ' se ancora non esiste un alias allora restituisco un errore + If IsNothing(m_SwingAlias) Then Return -1 End If ' passo alla riga successiva Return NextIndex(Index) @@ -1753,7 +1789,7 @@ Public Class Part Part.FirstReadingEdge = True End Try Else ' Bevel SQ - If m_Swing.Contains(ConstGen.HAND_REVERSE) Then + If m_SwingAlias.Name.Contains(ConstGen.HAND_REVERSE) Then If m_Secure = ConstGen.SWING_UP Then SetDispositionItem(m_DispositionList(0)) OptionModule.m_bBevelUp = Visibility.Visible @@ -2464,12 +2500,12 @@ Public Class Part Part.FirstReadingEdge = True End If ' Modifico il secure (diverso da zero) - If String.IsNullOrEmpty(Bevel) AndAlso m_Secure <> "0" AndAlso m_Secure <> DdfFile.SetSecure(m_Swing, m_DispositionItem.Name, m_Secure) Then + If String.IsNullOrEmpty(Bevel) AndAlso m_Secure <> "0" AndAlso m_Secure <> DdfFile.SetSecure(m_SwingAlias.Name, m_DispositionItem.Name, m_Secure) Then bModifyBevel = True Part.FirstReadingEdge = True ' per mantere attivo l'asterisco di modifica End If ' caso speciale - If String.IsNullOrEmpty(Bevel) AndAlso m_Secure = "0" AndAlso DdfFile.SetSecure(m_Swing, m_DispositionItem.Name, m_Secure) = ConstGen.SWING_UP Then + If String.IsNullOrEmpty(Bevel) AndAlso m_Secure = "0" AndAlso DdfFile.SetSecure(m_SwingAlias.Name, m_DispositionItem.Name, m_Secure) = ConstGen.SWING_UP Then bModifyBevel = True Part.FirstReadingEdge = True ' per mantere attivo l'asterisco di modifica End If @@ -2489,7 +2525,7 @@ Public Class Part Me.m_Width = OptionModule.m_Width Me.m_Height = OptionModule.m_Height Me.m_Thickness = OptionModule.m_Thickness - Me.m_Swing = OptionModule.m_Swing + Me.SetSwing(OptionModule.m_Swing) Me.m_IsActive = True Me.m_Measure = ConvertMmUnitsToString(OptionModule.m_bIsMmUnit) Me.m_Weight = OptionModule.m_Weight diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 073fd62..9d86d89 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -72,5 +72,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 335a1a3..9bca7a0 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -24,6 +24,7 @@ Friend Module OptionModule Friend m_DisableProperties As Visibility Friend m_PropertList As New ObservableCollection(Of PropertyItem) + Friend m_PropertListJamb As New ObservableCollection(Of PropertyItem) Friend Enum LauncherWindow As Integer Open_window = 0 @@ -44,7 +45,10 @@ Friend Module OptionModule Friend m_Height As String Friend m_Thickness As String Friend m_Weight As String + Friend m_SwingTypeList As New List(Of String) + Friend m_SwingList As New List(Of SwingItemTypeList) + Friend m_Swing As String Friend m_StaticEdgeTypeList As New ObservableCollection(Of String) Friend m_LockEdgeType As New EdgeType("", Visibility.Visible) @@ -155,7 +159,7 @@ Friend Module OptionModule ' Package JAMBS is not available m_ConfigurationSoftware = ConfigType.Door End If - + Dim DisableOrder As Integer = GetMainPrivateProfileInt(S_GENERAL, "DisableOrder", 0) m_DisableWindowOrder = If(DisableOrder = 0, False, True) @@ -282,6 +286,9 @@ Friend Module OptionModule Dim PropertyList As New ObservableCollection(Of String) DefaultGetPrivateProfileObservableCollection(ConstIni.S_PROPERTIES_INI, ConstIni.K_PROPRTIESLIST_INI, PropertyList) LoadPropertiesList(PropertyList, m_PropertList) + PropertyList.Clear() + DefaultGetPrivateProfileObservableCollection(ConstIni.S_PROPERTIES_INI, ConstIni.K_PROPRTIESLISTJAMB_INI, PropertyList) + LoadPropertiesList(PropertyList, m_PropertListJamb) ' Leggo le dimensioni della porta dal file Default.ini Dim Width As String = String.Empty @@ -299,14 +306,18 @@ Friend Module OptionModule m_Thickness = Thickness Dim dThickness As Double If StringToDouble(m_Thickness, dThickness) Then EgtLuaSetGlobNumVar("T", dThickness) + ' carico i valori associati allo swing della porta Dim SwingTypeList As New List(Of String) DefaultGetPrivateProfileList(S_SIZE_INI, K_SWING_LIST_INI, SwingTypeList) - m_SwingTypeList = SwingTypeList + LoadSwingTypeList(SwingTypeList) + 'm_SwingTypeList = SwingTypeList + Dim Swing As String = String.Empty DefaultGetPrivateProfileString(S_SIZE_INI, K_SWING_INI, ConstGen.RIGHTHAND, Swing) m_Swing = Swing LoadSwingList() + Dim Weight As String = String.Empty DefaultGetPrivateProfileString(S_SIZE_INI, K_WEIGHT_INI, "25", Weight) m_Weight = Weight @@ -548,11 +559,27 @@ Friend Module OptionModule End Sub Friend Sub CreateNewPropertiesList(ByRef List As ObservableCollection(Of PropertyItem)) + If OptionModule.m_DisableProperties <> Visibility.Visible Then Return + If List.Count > 0 Then List.Clear() For Each Item In OptionModule.m_PropertList List.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked)) Next End Sub + Friend Sub CreateNewPropertiesListJamb(ByRef List As ObservableCollection(Of PropertyItem)) + If OptionModule.m_DisableProperties <> Visibility.Visible Then Return + Dim LocalList As ObservableCollection(Of PropertyItem) + If Not String.IsNullOrEmpty(OptionModule.m_PropertListJamb(0).Name) Then + LocalList = OptionModule.m_PropertListJamb + Else + LocalList = OptionModule.m_PropertList + End If + If List.Count > 0 Then List.Clear() + For Each Item In LocalList + List.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked)) + Next + End Sub + Friend Sub SetEdgeTypeList(EdgeTypeList As ObservableCollection(Of String), bBevelUp As Boolean, bBevelDown As Boolean) If Not bBevelUp Then EdgeTypeList.Remove(ConstGen.BEVEL_UP) @@ -562,18 +589,94 @@ Friend Module OptionModule End If End Sub + Private Sub LoadSwingTypeList(ByRef List As List(Of String)) + If List.Count = 0 Then Return + For Each ItemSwing In List + If ItemSwing.Contains("/"c) Then + Dim ItemAlias() As String = ItemSwing.Split("/"c) + Dim Swing As New SwingItemTypeList(ItemAlias(0)) + For IndexItem As Integer = 1 To ItemAlias.Count - 1 + Swing.AliasList.Add(ItemAlias(IndexItem)) + Next + m_SwingList.Add(Swing) + Else + Dim Swing As New SwingItemTypeList(ItemSwing) + m_SwingList.Add(Swing) + End If + Next + End Sub + + ' carico le liste che devono essere rappresentate a video Private Sub LoadSwingList() For Index As Integer = 0 To 3 - m_SwingTypeListSinlgeDoor.Add(m_SwingTypeList(Index)) + ' carico gli swing della porta singola da mostrare a video + If m_SwingList(Index).AliasList.Count = 0 Then + m_SwingTypeListSinlgeDoor.Add(m_SwingList(Index).Name) + m_SwingTypeList.Add(m_SwingList(Index).Name) + Else + For Each Item In m_SwingList(Index).AliasList + m_SwingTypeListSinlgeDoor.Add(Item) + m_SwingTypeList.Add(Item) + Next + End If Next For Index As Integer = 4 To 7 - m_SwingTypeListLeftDoor.Add(m_SwingTypeList(Index)) + ' carico gli swing della prima anta + If m_SwingList(Index).AliasList.Count = 0 Then + m_SwingTypeListLeftDoor.Add(m_SwingList(Index).Name) + m_SwingTypeList.Add(m_SwingList(Index).Name) + Else + For Each Item In m_SwingList(Index).AliasList + m_SwingTypeListLeftDoor.Add(Item) + m_SwingTypeList.Add(Item) + Next + End If Next For Index As Integer = 8 To 11 - m_SwingTypeListRightDoor.Add(m_SwingTypeList(Index)) + ' carico gli swing della seconda anta + If m_SwingList(Index).AliasList.Count = 0 Then + m_SwingTypeListRightDoor.Add(m_SwingList(Index).Name) + m_SwingTypeList.Add(m_SwingList(Index).Name) + Else + For Each Item In m_SwingList(Index).AliasList + m_SwingTypeListRightDoor.Add(Item) + m_SwingTypeList.Add(Item) + Next + End If Next End Sub + Public Sub SetCurrSwing(ByRef SwingAlias As SwingItemTypeList, ByRef SwingDDF As String) + SwingAlias = Nothing + For Each Item In OptionModule.m_SwingList + If Trim(SwingDDF) = Trim(Item.Name) Then + SwingAlias = Item + If Item.AliasList.Count > 0 Then + SwingAlias = Item + If Item.AliasList.Count > 0 Then + SwingAlias.AliasName = Item.AliasList(0) + Swing = Item.AliasList(0) + End If + Else + SwingAlias.AliasName = Item.Name + End If + Exit For + End If + Next + ' se arrivo fni qui significa che sicuramente deve esistere un alias + If IsNothing(SwingAlias) Then + For Each ItemSwingList In OptionModule.m_SwingList + For Each ItemAlias In ItemSwingList.AliasList + If Trim(SwingDDF) = Trim(ItemAlias) Then + SwingAlias = ItemSwingList + SwingAlias.AliasName = ItemAlias + Exit For + End If + Next + Next + End If + End Sub + Public Function DispositionVisibility() As Visibility ' se non è selezionata nessuna disposizione allora deve essere selezionabile da interfaccia If IsNothing(m_Disposition) Then diff --git a/OptionsWindow/OptionsViewModel.vb b/OptionsWindow/OptionsViewModel.vb index ad4b4d7..4d7a26c 100644 --- a/OptionsWindow/OptionsViewModel.vb +++ b/OptionsWindow/OptionsViewModel.vb @@ -222,11 +222,17 @@ Public Class OptionsVM Public Property SwingValue As String Get + Dim SwingAlias As SwingItemTypeList = Nothing + SetCurrSwing(SwingAlias, OptionModule.m_Swing) + OptionModule.m_Swing = SwingAlias.AliasName Return OptionModule.m_Swing End Get Set(value As String) OptionModule.m_Swing = value - DefaultWritePrivateProfileString(S_SIZE, K_SWING_INI, OptionModule.m_Swing) + Dim SwingAlias As SwingItemTypeList = Nothing + SetCurrSwing(SwingAlias, value) + OptionModule.m_Swing = SwingAlias.AliasName + DefaultWritePrivateProfileString(S_SIZE, K_SWING_INI, SwingAlias.Name) End Set End Property @@ -477,7 +483,7 @@ Public Class OptionsVM DefaultWritePrivateProfileString(S_LIGHT, K_LIGHTBOTTOM, OptionModule.m_LightBottom) End Set End Property - + Public Property LightHinge As String Get Return OptionModule.m_LightHinge @@ -528,7 +534,7 @@ Public Class OptionsVM DefaultWritePrivateProfileString(S_OVERLAP, K_OVERLAPLOCK, OptionModule.m_OverlapLock) End Set End Property - + Public Property OverlapTop As String Get Return OptionModule.m_OverlapTop @@ -1460,4 +1466,41 @@ Public Class EdgeType Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub +End Class + +Public Class SwingItemTypeList + + Private m_Name As String + Public Property Name As String + Get + Return m_Name + End Get + Set(value As String) + m_Name = value + End Set + End Property + + Private m_AliasList As New List(Of String) + Public Property AliasList As List(Of String) + Get + Return m_AliasList + End Get + Set(value As List(Of String)) + m_AliasList = value + End Set + End Property + + Private m_AliasName As String + Public Property AliasName As String + Get + Return m_AliasName + End Get + Set(value As String) + m_AliasName = value + End Set + End Property + + Sub New(sNameSwing As String) + m_Name = sNameSwing + End Sub End Class \ No newline at end of file diff --git a/SceneManager/DimensioningPanel/DimensioningPanelV.xaml b/SceneManager/DimensioningPanel/DimensioningPanelV.xaml index b0fe196..3a95d4b 100644 --- a/SceneManager/DimensioningPanel/DimensioningPanelV.xaml +++ b/SceneManager/DimensioningPanel/DimensioningPanelV.xaml @@ -11,7 +11,6 @@ ToolTip="{Binding DimensionToolTip}"> -