From 8062819a2db3d00264a0657d7c43bd091e2cc947 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 11 May 2020 17:14:11 +0000 Subject: [PATCH] EgtDOORcreator 2.2e1:; -> aggiunto nuovo parametro ("other_door:1") in ddf per le componenti dei frame Top/BOttom, -> aggiunti i nuovi parametri della soglia nella pagina delle impostazioni. --- Assembly/Assembly.vb | 115 +++++--- Assembly/PartDoor.vb | 7 +- AssemblyManager/AssemblyManagerVM.vb | 12 +- CompoMatch.vb | 10 +- Constants/ConstCompo.vb | 5 +- Constants/ConstIni.vb | 6 + DdfFile.vb | 5 +- DoorParameters/Compo.vb | 17 +- DoorParameters/Part.vb | 39 ++- OptionsWindow/OptionModule.vb | 43 ++- OptionsWindow/OptionsV.xaml | 375 +++++++++++++++------------ OptionsWindow/OptionsViewModel.vb | 188 +++++++++----- 12 files changed, 523 insertions(+), 299 deletions(-) diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb index b1ce33f..cd78099 100644 --- a/Assembly/Assembly.vb +++ b/Assembly/Assembly.vb @@ -9,7 +9,7 @@ Public Class Assembly ' questa variabile se settata a vero da la possibilità di costruire un riferimento sui Jamb Friend Shared BuiltReffCompo As Boolean = False - + Public bIsNewAssembly As Boolean = False Public Shared FirstReadingWeight As Boolean = False Public bOldVersion As Boolean = False @@ -664,16 +664,17 @@ Public Class Assembly Dim nBH As Double = 0 Dim nOLB As Double = 0 Dim nDO_1H As Double = 0 + Dim nOLT As Double = 0 StringToDouble(LightUp, nLU) StringToDouble(LightBottom, nLB) StringToDouble(ThicknessHead, nTH) StringToDouble(ThicknessBottom, nBH) StringToDouble(OverlapBottom, nOLB) StringToDouble(m_Door1.Height, nDO_1H) - m_AssemblyHeight = DoubleToString(nLU + nLB + nTH + nDO_1H, 4) + StringToDouble(OverlapTop, nOLT) + m_AssemblyHeight = DoubleToString(nLU + nLB + nTH + nDO_1H - nOLT, 4) If Exterior Then - Dim nOLT As Double - StringToDouble(OverlapTop, nOLT) + m_AssemblyHeight = DoubleToString(nLU + nLB + nTH + nBH + nDO_1H - nOLT - nOLB, 4) End If End If @@ -1952,15 +1953,13 @@ Public Class Assembly If String.IsNullOrEmpty(Side) Then GetPrivateProfileJambSide(S_POSITIONSIDE, K_SIDE, Side, CurrCompo.CompoType.Path & "\" & CONFIGINI_FILE_NAME) End If - ' controllo nell'elenco dei parametri se esiste un parametro di tipo Side - If String.IsNullOrEmpty(Side) Then - For IndexParam As Integer = 0 To CurrCompo.CompoParamList.Count - 1 - If CurrCompo.CompoParamList(IndexParam).DDFName.ToLower = K_SIDE.ToLower Then - Side = DirectCast(CurrCompo.CompoParamList(IndexParam), ComboBoxParam).SelItem - Exit For - End If - Next - End If + ' controllo sempre nell'elenco dei parametri se esiste un parametro di tipo Side + For IndexParam As Integer = 0 To CurrCompo.CompoParamList.Count - 1 + If CurrCompo.CompoParamList(IndexParam).DDFName.ToLower = K_SIDE.ToLower Then + Side = DirectCast(CurrCompo.CompoParamList(IndexParam), ComboBoxParam).SelItem + Exit For + End If + Next ' a questo punto ricerco nella lista delle associazioni se esite il frame sul quale costruire il riferimento ' converto la posizione letta in valore numerico @@ -2076,9 +2075,15 @@ Public Class Assembly ' aggiungo la componete sul riferiento passato (caricando la lista dei file di tipo Frame) CurrCompo.refJambCompo = refPartDoor.Door.AddNewCompo(refCompoType, True) CurrCompo.refJambCompo.refCompoDoor = CurrCompo + ' definsco se la componente deve essre ribalata (Top-Door2; Bottom-Door1) + If Side = "Top" And Map.refPartPageVM.CurrPart.TypePart.Contains("DO_2") Then + CurrCompo.refJambCompo.OtherDoor = True + ElseIf Side = "Bottom" And Map.refPartPageVM.CurrPart.TypePart.Contains("DO_1") Then + CurrCompo.refJambCompo.OtherDoor = True + End If End If - ' setto il nome della componente da caricare - If Not IsNothing(CurrCompo.refJambCompo) Then + ' setto il nome della componente da caricare + If Not IsNothing(CurrCompo.refJambCompo) Then CurrCompo.refJambCompo.SplitBrandFile(FrameFile) Else MessageBox.Show("File '" & FrameFile & "' exist, but it is not in the correct Directory!", EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning) @@ -2142,7 +2147,7 @@ Public Class Assembly ' Durante la costruzione di un nuovo assemblato, oppure quando viene aggiunta/rimossa un'anta ' una volta creata la prima porta questa funzione calcola le dimensioni del telaio - Public Sub SetNewDimensionAssembly() + Public Sub SetNewDimensionAssembly(ByVal Optional IsNewAssembly As Boolean = False) ' permette di creare una copia degli oggetti di tipo PartDoor presenti nell'assemblato SetPartDoorCurrAssembly() ' se non esiste la prima porta allora non calcolo le dimensioni del telaio @@ -2151,7 +2156,7 @@ Public Class Assembly ' Size, Swing, Rabbet If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then Return SwingJamb() - HeightJamb() + HeightJamb(IsNewAssembly) TopBottomWidth() HeightDoor() TopRabbetJamb() @@ -2430,7 +2435,7 @@ Public Class Assembly #Region "HEIGHT" ' calcola l'altezza dei JambLeft e JambRight - Public Sub HeightJamb() + Public Sub HeightJamb(ByVal Optional IsNewAssembly As Boolean = False) ' se ho impostanto l'area di lavoro non modifico l'altezza dei jamb If Dimension Then If Not IsNothing(m_JambL) Then m_JambL.SetHeight(m_AssemblyHeight) @@ -2463,7 +2468,8 @@ Public Class Assembly 'End If If Not IsNothing(Map.refPartPageVM.CurrPart) AndAlso Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") AndAlso - Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage Then + Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage AndAlso + Not IsNewAssembly Then StringToDouble(Map.refPartPageVM.CurrPart.Height, dHeight) Else StringToDouble(m_Door1.Height, dHeight) @@ -2642,20 +2648,18 @@ Public Class Assembly Dim dWidth1 As Double Dim dWidth2 As Double Dim dActualWidth As Double + Dim dThicknessJamb As Double StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightHinge, dLightHinge) StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightLock, dLightLock) StringToDouble(Map.refAssemblyPageVM.CurrAssembly.OverlapLock, dOverlapLock) StringToDouble(Map.refAssemblyPageVM.CurrAssembly.OverlapHinge, dOverlapHinge) + StringToDouble(Map.refAssemblyPageVM.CurrAssembly.Thickness, dThicknessJamb) StringToDouble(m_Door1.Width, dWidth1) Select Case m_DoorNumber Case "1" - 'If Exterior Then dActualWidth = dLightHinge + dLightLock If Not IsNothing(m_JambB) Then m_JambB.SetWidth(DoubleToString(dWidth1 + dActualWidth, 4)) - 'Else - 'dActualWidth = dLightHinge + dLightLock + dOverlapLock + dOverlapHinge - 'End If If Not IsNothing(m_JambT) Then m_JambT.SetWidth(DoubleToString(dWidth1 + dActualWidth, 4)) Case "2" If Not IsNothing(m_Door2) Then @@ -2671,12 +2675,8 @@ Public Class Assembly Return End If ' se la seconda anta esiste allora procedo nel calcolo - 'If Exterior Then dActualWidth = dLightHinge + dLightHinge + dLightLock + dWidth1 If Not IsNothing(m_JambB) Then m_JambB.SetWidth(DoubleToString(dWidth2 + dActualWidth, 4)) - 'Else - 'dActualWidth = dLightHinge + dLightHinge + dLightLock + dOverlapHinge + dOverlapHinge + dWidth1 - 'End If If Not IsNothing(m_JambT) Then m_JambT.SetWidth(DoubleToString(dWidth2 + dActualWidth, 4)) End Select NotifyPropertyChanged("AssemblyWidth") @@ -2685,22 +2685,61 @@ Public Class Assembly ' calcola la larghezza dei Jamb laterali Public Sub SetWidthJamb() - If Not IsNothing(m_JambR) Then m_JambR.Width = m_Width - If Not IsNothing(m_JambL) Then m_JambL.Width = m_Width + If Not IsNothing(m_JambR) Then m_JambR.SetWidth(m_Width) + If Not IsNothing(m_JambL) Then m_JambL.SetWidth(m_Width) 'If Not IsNothing(m_JambB) Then m_JambB.Height = m_Width ' ricalcolo la dimensione dell'anta If Not Dimension Then Return - Dim DO_1 As PartDoor = Map.refAssemblyManagerVM.ReserchPartDoor("DO_1") - Dim DO_2 As PartDoor = Map.refAssemblyManagerVM.ReserchPartDoor("DO_2") + 'Dim DO_1 As PartDoor = Map.refAssemblyManagerVM.ReserchPartDoor("DO_1") + 'Dim DO_2 As PartDoor = Map.refAssemblyManagerVM.ReserchPartDoor("DO_2") Dim LL As String = LightLock Dim LH As String = LightHinge Dim JW As String = Width Dim TotW As String = m_AssemblyWidth - If Not IsNothing(DO_1) Then + 'If Not IsNothing(DO_1) Then + ' Dim nDO_1Width As Double = 0 + ' Dim nDO_2Width As Double = 0 + ' StringToDouble(DO_1.Door.Width, nDO_1Width) + ' Dim nJW As Double = 0 + ' StringToDouble(JW, nJW) + ' Dim nLL As Double = 0 + ' StringToDouble(LL, nLL) + ' Dim nLH As Double = 0 + ' StringToDouble(LH, nLH) + ' Dim nTotW As Double = 0 + ' StringToDouble(TotW, nTotW) + ' ' due ante + ' If Not IsNothing(DO_2) Then + ' ' la seconda anta viene ricalcolata mantenedo fissa la dimensione della prima + ' StringToDouble(DO_2.Door.Width, nDO_2Width) + ' nDO_2Width = nTotW - (nLL + nLH * 2 + 2 * nJW + nDO_1Width) + ' If Exterior Then + ' Dim nOLL As Double = 0 + ' StringToDouble(OverlapLock, nOLL) + ' Dim nOLH As Double = 0 + ' StringToDouble(OverlapHinge, nOLH) + ' nDO_2Width = nDO_2Width + 2 * nOLH + ' End If + ' DO_2.Door.SetWidth(DoubleToString(nDO_2Width, 4)) + ' Else + ' ' singol anta + ' nDO_1Width = nTotW - (nLL + nLH + 2 * nJW) + ' If Exterior Then + ' Dim nOLL As Double = 0 + ' StringToDouble(OverlapLock, nOLL) + ' Dim nOLH As Double = 0 + ' StringToDouble(OverlapHinge, nOLH) + ' nDO_1Width = nDO_1Width + nOLH + nOLL + ' End If + ' DO_1.Door.SetWidth(DoubleToString(nDO_1Width, 4)) + ' End If + 'End If + + If Not IsNothing(m_Door1) Then Dim nDO_1Width As Double = 0 Dim nDO_2Width As Double = 0 - StringToDouble(DO_1.Door.Width, nDO_1Width) + StringToDouble(m_Door1.Width, nDO_1Width) Dim nJW As Double = 0 StringToDouble(JW, nJW) Dim nLL As Double = 0 @@ -2710,9 +2749,9 @@ Public Class Assembly Dim nTotW As Double = 0 StringToDouble(TotW, nTotW) ' due ante - If Not IsNothing(DO_2) Then + If Not IsNothing(m_Door2) Then ' la seconda anta viene ricalcolata mantenedo fissa la dimensione della prima - StringToDouble(DO_2.Door.Width, nDO_2Width) + StringToDouble(m_Door2.Width, nDO_2Width) nDO_2Width = nTotW - (nLL + nLH * 2 + 2 * nJW + nDO_1Width) If Exterior Then Dim nOLL As Double = 0 @@ -2721,7 +2760,7 @@ Public Class Assembly StringToDouble(OverlapHinge, nOLH) nDO_2Width = nDO_2Width + 2 * nOLH End If - DO_2.Door.SetWidth(DoubleToString(nDO_2Width, 4)) + m_Door2.SetWidth(DoubleToString(nDO_2Width, 4)) Else ' singol anta nDO_1Width = nTotW - (nLL + nLH + 2 * nJW) @@ -2732,10 +2771,10 @@ Public Class Assembly StringToDouble(OverlapHinge, nOLH) nDO_1Width = nDO_1Width + nOLH + nOLL End If - DO_1.Door.SetWidth(DoubleToString(nDO_1Width, 4)) + m_Door1.SetWidth(DoubleToString(nDO_1Width, 4)) End If End If - + TopBottomWidth() 'm_BottomJamb.SetHeight(m_Width) 'm_TopJamb.SetHeight(m_ThicknessHead) 'm_LeftJamb.SetWidth(m_Width) diff --git a/Assembly/PartDoor.vb b/Assembly/PartDoor.vb index bde5a80..a6baec5 100644 --- a/Assembly/PartDoor.vb +++ b/Assembly/PartDoor.vb @@ -35,11 +35,14 @@ Public Class PartDoor Set(value As Boolean) m_IsChecked = value m_Door.IsActive = IsChecked + If m_Door.TypePart.Contains("DO_") Then + Map.refSceneManagerVM.RefreshBtn() + End If End Set End Property Public Sub SetIsChecked(bIsChecked As Boolean) - IsChecked = bIsChecked - m_Door.IsActive = IsChecked + m_IsChecked = bIsChecked + m_Door.IsActive = bIsChecked NotifyPropertyChanged("IsChecked") Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Sub diff --git a/AssemblyManager/AssemblyManagerVM.vb b/AssemblyManager/AssemblyManagerVM.vb index b2b5e17..544a891 100644 --- a/AssemblyManager/AssemblyManagerVM.vb +++ b/AssemblyManager/AssemblyManagerVM.vb @@ -1071,6 +1071,7 @@ Public Class AssemblyManagerVM ' creazione e di un nuovo assemblato Friend Function CreateNewAssembly(value As String) As Assembly + Dim bIsNewAssembly As Boolean = True ' costruisco un nuvo assemblato e lo carico con i valori Dim Local_SelAssembly As New Assembly ' carico i valori di default dell'assemblato @@ -1086,7 +1087,7 @@ Public Class AssemblyManagerVM ' costruisco le associazioni tra i pezzi CreateAssociation(Local_SelAssembly) ' carico le dimensioni dell'assemblato - Local_SelAssembly.SetNewDimensionAssembly() + Local_SelAssembly.SetNewDimensionAssembly(bIsNewAssembly) Return Local_SelAssembly End Function @@ -1123,11 +1124,10 @@ Public Class AssemblyManagerVM CurrAssembly.SetDimension(OptionModule.m_TotalDimension) CurrAssembly.SetAssemblyHeight(OptionModule.m_TotalHeight) CurrAssembly.SetAssemblyWidth(OptionModule.m_TotalWidth) - - CurrAssembly.SetThicknessBottom(OptionModule.m_WidthJamb) - CurrAssembly.SetOverlapBottom(OptionModule.m_OverlapTop) + CurrAssembly.SetThicknessBottom(OptionModule.m_ThicknessBottom) + CurrAssembly.SetOverlapBottom(OptionModule.m_OverlapBottom) CurrAssembly.SetDepthBottom(OptionModule.m_ThicknessJamb) - CurrAssembly.SetDeltaBottom("0") + CurrAssembly.SetDeltaBottom(OptionModule.m_DeltaBottom) End Sub ' creazione dei jamb @@ -1279,7 +1279,7 @@ Public Class AssemblyManagerVM Local_PartDoor.Door.TypePart = Type ' non viene caricato lo swing, che è carciato al termine del ciclo for LoadDefaultSingleDoor(Local_PartDoor.Door, CStr(nDoorNumber)) - Local_PartDoor.IsChecked = True + Local_PartDoor.SetIsChecked(True) 'CreateNewPropertiesList(Local_PartDoor.Door.PropertiesList, Local_PartDoor.Door.SelectedMaterial) CurrAssembly.ListPartDoor.Add(Local_PartDoor) Else diff --git a/CompoMatch.vb b/CompoMatch.vb index aea0690..24ae71b 100644 --- a/CompoMatch.vb +++ b/CompoMatch.vb @@ -52,8 +52,14 @@ Module CompoMatch ' eventualmente passo anche il valore del parametri "side" se è definito nella componente For Each ItemParam In CurrCompo.CompoParamList If ItemParam.DDFName = "side" AndAlso TypeOf ItemParam Is ComboBoxParam Then - Dim TextPar As String = DirectCast(ItemParam, ComboBoxParam).SelItem - EgtLuaSetGlobStringVar("STU.Side", TextPar) + Dim CombPar As ComboBoxParam = DirectCast(ItemParam, ComboBoxParam) + For IndexItemList = 0 To CombPar.ItemList.Count - 1 + ' dal parametro scritto nella grafica ricavo il valore del ddf + If CombPar.ItemList(IndexItemList) = CombPar.SelItem Then + EgtLuaSetGlobStringVar("STU.Side", CombPar.ItemListDDF(IndexItemList)) + Exit For + End If + Next End If Next Dim bExterior As Boolean = CurrAssembly.Exterior diff --git a/Constants/ConstCompo.vb b/Constants/ConstCompo.vb index 2f522d5..aba9ec6 100644 --- a/Constants/ConstCompo.vb +++ b/Constants/ConstCompo.vb @@ -49,8 +49,9 @@ Module ConstCompo Public Const K_BOTTOM As String = "bottom" Public Const K_MACHINING As String = "machining" Public Const K_OVERMATERIAL As String = "overmaterial" - Public Const K_IDCODECOMPONENT As String = "IdCodeComponent" - Public Const K_RADIUS As String = "radius" + Public Const K_IDCODECOMPONENT As String = "IdCodeComponent" + Public Const K_OTHERDOOR As String = "other_door" + Public Const K_RADIUS As String = "radius" Public Const K_ANGLE As String = "angle" Public Const K_POSX As String = "posx" Public Const K_OVERLAP_BOTTOM As String = "overlap bottom" diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 0b9d096..376ee80 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -150,12 +150,18 @@ Module ConstIni Public Const S_SIZEJAMB As String = "SizeJamb" Public Const S_OVERLAP As String = "Overlap" + Public Const S_THRESHOLD As String = "Threshold" Public Const K_OVERLAPTOP As String = "OverlapTop" + Public Const K_OVERLAPBOTTOM As String = "OverlapBottom" Public Const K_OVERLAPHINGE As String = "OverlapHinge" Public Const K_OVERLAPLOCK As String = "OverlapLock" Public Const K_EXTERIOR As String = "Exterior" Public Const K_DELTAT As String = "DeltaT" Public Const K_THICKNESSHEAD As String = "ThicknessHead" + Public Const K_DELTABOTTOM As String = "DeltaBottom" + Public Const K_THICKNESSBOTTOM As String = "ThicknessBottom" + Public Const K_DEPTHBOTTOM As String = "DepthBottom" + Public Const S_PART As String = "Part" Public Const K_TOPJAMB As String = "TopJamb" diff --git a/DdfFile.vb b/DdfFile.vb index 0c672aa..8983325 100644 --- a/DdfFile.vb +++ b/DdfFile.vb @@ -1257,7 +1257,7 @@ Friend Module DdfFile Next ' inserisco qui il riferimento da stampare (il codice è scelto dalla porta) If Not IsNothing(Compo.refJambCompo) Then - ' se il riferiento è stato stampato prima che si passi da questa pagina allora non posso modificare il valore del riferiento + ' assegno lo stesso indice alla componente sull'unta e sul telaio If Not String.IsNullOrEmpty(Compo.IdCode) AndAlso Compo.refJambCompo.IdCode = Compo.IdCode Then CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode) Else @@ -1267,6 +1267,9 @@ Friend Module DdfFile End If IdIndex += 1 ElseIf Not String.IsNullOrEmpty(Compo.IdCode) Then + If Compo.OtherDoor Then + CompoListDDF.Add(DDF_SPACE5 & "other_door: 1") + End If CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode) IdIndex += 1 End If diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index 73c5b8e..de16c23 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -142,6 +142,20 @@ Public Class Compo End Set End Property + ' deve essere settato a 1 (solo in presenza di due ante): + ' - inserisco un componente sul frame Top & sulla seconda anta (dx) + ' - inserisco un componente sul frema Bottom & sulla prima anta (sx) + Private m_OtherDoor As Boolean = False + Public Property OtherDoor As Boolean + Get + Return m_OtherDoor + End Get + Set(value As Boolean) + m_OtherDoor = value + NotifyPropertyChanged("OtherDoor") + End Set + End Property + #Region "Gestione Errori DOORCreator" Public m_ParameterDDfList As New List(Of String) @@ -497,6 +511,7 @@ Public Class Compo Map.refAssemblyPageVM.CurrAssembly.SetDimension("CreateRefCompo", Me) Assembly.BuiltReffCompo = False NotifyPropertyChanged("SelFile") + Map.refSceneManagerVM.RefreshBtn() End Set End Property Friend Sub SetSelFile(File As String) @@ -561,7 +576,7 @@ Public Class Compo SetTemplateSelItem(value) ' LoadByDefault = False SetModified() - Map.refSceneManagerVM.RefreshBtn() + 'Map.refSceneManagerVM.RefreshBtn() End Set End Property Private Sub SetSelTemplate(Template As String) diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 79cc6c8..a2588f5 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -1308,7 +1308,7 @@ Public Class Part NewCompo.Foreground = DirectCast(New BrushConverter().ConvertFrom("#FF4D84C4"), SolidColorBrush) NewCompo.BorderThickness = 2 NewCompo.FontBold = FontWeights.Bold - m_SelCompo=NewCompo + m_SelCompo = NewCompo NotifyPropertyChanged("SelCompo") End If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True @@ -2628,11 +2628,13 @@ Public Class Part bBrandExists = False sFile = Trim(sItems(0)) If m_CurrCompo.BrandListPart.Last = RAD_DIR Then - m_CurrCompo.SelBrandPart = m_CurrCompo.BrandListPart.Last + 'm_CurrCompo.SelBrandPart = m_CurrCompo.BrandListPart.Last + m_CurrCompo.SetSelBrand(m_CurrCompo.BrandListPart.Last) bBrandExists = True For IndexFile As Integer = 0 To m_CurrCompo.FileList.Count - 1 If sFile.ToLower = m_CurrCompo.FileList(IndexFile).ToLower Then - m_CurrCompo.SelFile = m_CurrCompo.FileList(IndexFile) + 'm_CurrCompo.SelFile = m_CurrCompo.FileList(IndexFile) + m_CurrCompo.SetSelFile(m_CurrCompo.FileList(IndexFile)) bFileExists = True Exit For End If @@ -2648,7 +2650,8 @@ Public Class Part Next For IndexBrand As Integer = 0 To m_CurrCompo.BrandListPart.Count - 1 If BrandDir.ToLower = m_CurrCompo.BrandListPart(IndexBrand).ToLower Then - m_CurrCompo.SelBrandPart = m_CurrCompo.BrandListPart(IndexBrand) + 'm_CurrCompo.SelBrandPart = m_CurrCompo.BrandListPart(IndexBrand) + m_CurrCompo.SetSelBrand(m_CurrCompo.BrandListPart(IndexBrand)) bBrandExists = True Exit For End If @@ -2656,7 +2659,8 @@ Public Class Part If bBrandExists Then For IndexFile As Integer = 0 To m_CurrCompo.FileList.Count - 1 If sFile.ToLower = m_CurrCompo.FileList(IndexFile).ToLower Then - m_CurrCompo.SelFile = m_CurrCompo.FileList(IndexFile) + 'm_CurrCompo.SelFile = m_CurrCompo.FileList(IndexFile) + m_CurrCompo.SetSelFile(m_CurrCompo.FileList(IndexFile)) bFileExists = True Exit For End If @@ -2669,13 +2673,15 @@ Public Class Part ' aggiungo il brand inesistente If String.IsNullOrEmpty(BrandDir) Then BrandDir = RAD_DIR m_CurrCompo.BrandListPart.Add(BrandDir) - m_CurrCompo.SelBrandPart = m_CurrCompo.BrandListPart(m_CurrCompo.BrandListPart.Count - 1) + 'm_CurrCompo.SelBrandPart = m_CurrCompo.BrandListPart(m_CurrCompo.BrandListPart.Count - 1) + m_CurrCompo.SetSelBrand(m_CurrCompo.BrandListPart(m_CurrCompo.BrandListPart.Count - 1)) m_CurrCompo.LoadByDefault = True m_CurrCompo.MissingDirectory = True End If If Not bFileExists Then m_CurrCompo.FileList.Add(sFile) - m_CurrCompo.SelFile = m_CurrCompo.FileList(m_CurrCompo.FileList.Count - 1) + 'm_CurrCompo.SelFile = m_CurrCompo.FileList(m_CurrCompo.FileList.Count - 1) + m_CurrCompo.SetSelFile(m_CurrCompo.FileList(m_CurrCompo.FileList.Count - 1)) ' File {0} in directory {1} has not been found. sErrorInfo &= String.Format(EgtMsg(50160), sFile, BrandDir) & vbCrLf m_CurrCompo.LoadByDefault = True @@ -2734,6 +2740,11 @@ Public Class Part If Index < FileContent.Count Then ' tolgo l'indicazione di metacomando "##" sLine = RemoveComment(FileContent(Index).Replace(DDF_METADATA, "")) + If GetKey(sLine) = K_OTHERDOOR Then + m_CurrCompo.OtherDoor = True + Index = NextIndex(Index) + End If + sLine = RemoveComment(FileContent(Index).Replace(DDF_METADATA, "")) If GetKey(sLine) = K_IDCODECOMPONENT Then Dim IdCode As String = String.Empty IdCode = GetValueWithKey(sLine, K_IDCODECOMPONENT) @@ -2784,6 +2795,10 @@ Public Class Part If String.IsNullOrWhiteSpace(FileContent(IndexLine)) Then IndexLine += 1 Continue While + ElseIf GetKey(FileContent(IndexLine)) = K_OTHERDOOR Then + CompoTemplateItem.OtherDoor = True + IndexLine += 1 + Continue While End If ErrParamList.Add(RemoveComment(FileContent(IndexLine))) IndexLine += 1 @@ -2792,6 +2807,12 @@ Public Class Part CompoTemplateItem.m_ParameterDDfList = ErrParamList Else While IndexParam < CompoTemplateItem.CompoParamList.Count + ' il parametro seguente non appartiene a nessuna componente + If GetKey(FileContent(IndexLine)) = K_OTHERDOOR Then + CompoTemplateItem.OtherDoor = True + IndexLine += 1 + Continue While + End If ' carico la lista dei parametri della componente parametro per parametro Dim CurrCompoParam As CompoParam = CompoTemplateItem.CompoParamList(IndexParam) ' Controllo che il file non sia terminato @@ -2868,8 +2889,8 @@ Public Class Part ' SelItem = List(0) End If ' assegno al parametro del componente il valore "filtrato" - ' DirectCast(CurrCompoParam, ComboBoxParam).SetSelItem(SelItem) - DirectCast(CurrCompoParam, ComboBoxParam).SelItem = SelItem + DirectCast(CurrCompoParam, ComboBoxParam).SetSelItem(SelItem) + 'DirectCast(CurrCompoParam, ComboBoxParam).SelItem = SelItem ' assegno il valore letto alla textbox ElseIf TypeOf CurrCompoParam Is TextBoxParam Then Dim sVal As String = GetValueWithoutKey(sLine) diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 4f0c0a3..3328bfd 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -117,6 +117,11 @@ Friend Module OptionModule Friend m_DoorsListNumber As New List(Of String) Friend m_DoorsNumber As String + Friend m_OverlapBottom As String + Friend m_ThicknessBottom As String + Friend m_DepthBottom As String + Friend m_DeltaBottom As String + Friend m_TopJambChk As Boolean Friend m_LeftJambChk As Boolean Friend m_BottomJambChk As Boolean @@ -507,7 +512,11 @@ Friend Module OptionModule End Try End If '----------------------------------------------------------------------------------------------------------------- - + ' SIZE JAMB + Dim ThicknessHead As String = String.Empty + DefaultGetPrivateProfileString(S_OVERLAP, S_SIZEJAMB, "0", ThicknessHead) + Utility.ConvertCompoConfig(ThicknessHead, 100) + m_ThicknessHead = ThicknessHead Dim ThicknessJamb As String = String.Empty DefaultGetPrivateProfileString(S_SIZEJAMB, K_THICKNESS, "25", ThicknessJamb) Utility.ConvertCompoConfig(ThicknessJamb, 100) @@ -516,7 +525,7 @@ Friend Module OptionModule DefaultGetPrivateProfileString(S_SIZEJAMB, K_WIDTH, "25", WidthJamb) Utility.ConvertCompoConfig(WidthJamb, 100) m_WidthJamb = WidthJamb - + ' LIGHT Dim LightUp As String = String.Empty DefaultGetPrivateProfileString(S_LIGHT, K_LIGHTUP, "25", LightUp) Utility.ConvertCompoConfig(LightUp, 100) @@ -537,10 +546,7 @@ Friend Module OptionModule Dim DoorsNumber As String = String.Empty DefaultGetPrivateProfileString(S_DOORSNUMBER, K_DOORSELECTEDTNUMBER, "0", DoorsNumber) m_DoorsNumber = DoorsNumber - Dim ThicknessHead As String = String.Empty - DefaultGetPrivateProfileString(S_OVERLAP, K_THICKNESSHEAD, "0", ThicknessHead) - Utility.ConvertCompoConfig(ThicknessHead, 100) - m_ThicknessHead = ThicknessHead + ' OVERLAP Dim OverlapHinge As String = String.Empty DefaultGetPrivateProfileString(S_OVERLAP, K_OVERLAPHINGE, "0", OverlapHinge) Utility.ConvertCompoConfig(OverlapHinge, 100) @@ -549,9 +555,6 @@ Friend Module OptionModule DefaultGetPrivateProfileString(S_OVERLAP, K_OVERLAPLOCK, "0", OverlapLock) Utility.ConvertCompoConfig(OverlapLock, 100) m_OverlapLock = OverlapLock - Dim Exterior As Boolean = False - DefaultGetPrivateProfilesMachining(S_OVERLAP, K_EXTERIOR, Exterior) - m_Exterior = Exterior Dim OverlapTop As String = String.Empty DefaultGetPrivateProfileString(S_OVERLAP, K_OVERLAPTOP, "0", OverlapTop) Utility.ConvertCompoConfig(OverlapTop, 100) @@ -560,7 +563,27 @@ Friend Module OptionModule DefaultGetPrivateProfileString(S_OVERLAP, K_DELTAT, "0", DeltaT) Utility.ConvertCompoConfig(DeltaT, 100) m_DeltaThickness = DeltaT - + ' THRESHOLD + Dim Exterior As Boolean = False + DefaultGetPrivateProfilesMachining(S_THRESHOLD, K_EXTERIOR, Exterior) + m_Exterior = Exterior + Dim OverlapBottom As String = String.Empty + DefaultGetPrivateProfileString(S_THRESHOLD, K_OVERLAPBOTTOM, "0", OverlapBottom) + Utility.ConvertCompoConfig(OverlapBottom, 100) + m_OverlapBottom = OverlapBottom + Dim ThicknessBottom As String = String.Empty + DefaultGetPrivateProfileString(S_THRESHOLD, K_THICKNESSBOTTOM, "0", ThicknessBottom) + Utility.ConvertCompoConfig(ThicknessBottom, 100) + m_ThicknessBottom = ThicknessBottom + Dim DepthBottom As String = String.Empty + DefaultGetPrivateProfileString(S_THRESHOLD, K_DEPTHBOTTOM, "0", DepthBottom) + Utility.ConvertCompoConfig(DepthBottom, 100) + m_DepthBottom = DepthBottom + Dim DeltaBottom As String = String.Empty + DefaultGetPrivateProfileString(S_THRESHOLD, K_DELTABOTTOM, "0", DeltaBottom) + Utility.ConvertCompoConfig(DeltaBottom, 100) + m_DeltaBottom = DeltaBottom + '-------------------------------------------------------------------------------- Dim TotalDim As Boolean = False DefaultGetPrivateProfilesMachining(S_TOTALDIMENSION, K_STATIC, TotalDim) m_TotalDimension = TotalDim diff --git a/OptionsWindow/OptionsV.xaml b/OptionsWindow/OptionsV.xaml index e17494f..2fb27ac 100644 --- a/OptionsWindow/OptionsV.xaml +++ b/OptionsWindow/OptionsV.xaml @@ -499,225 +499,264 @@ + Style="{StaticResource DoorParamsTxBl}" + Margin="2,2,0,2" + Grid.Column="0"/> + Text="{Binding LightUp, UpdateSourceTrigger=PropertyChanged}" + Padding="1" + Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" + Grid.Column="0"/> + Text="{Binding LightLock, UpdateSourceTrigger=PropertyChanged}" + Margin="5,0,10,2.5" VerticalAlignment="Stretch" + Padding="1"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" + Grid.Column="0"/> + Text="{Binding LightHinge, UpdateSourceTrigger=PropertyChanged}" + Padding="1" + Margin="5,0,10,2.5" VerticalAlignment="Stretch"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" + Grid.Column="0"/> + Text="{Binding LightBottom, UpdateSourceTrigger=PropertyChanged}" + Padding="1" + Margin="5,0,10,2.5" VerticalAlignment="Stretch"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,2,0,2" + Grid.Column="2"/> + Style="{StaticResource DoorParamsTxBx}" + Padding="1" + Text="{Binding ThicknessHead, UpdateSourceTrigger=PropertyChanged}" + Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" + Grid.Column="2"/> + Style="{StaticResource DoorParamsTxBx}" + Padding="1" + Text="{Binding OverlapHinge, UpdateSourceTrigger=PropertyChanged}" + Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" + Grid.Column="2"/> + Style="{StaticResource DoorParamsTxBx}" + Padding="1" + Text="{Binding OverlapLock, UpdateSourceTrigger=PropertyChanged}" + Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2"/> + ItemsSource="{Binding DoorListNumber}" + SelectedItem="{Binding DoorNumber}" + Style="{StaticResource DoorParamsCmBx}"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" + Grid.Column="2"/> + Style="{StaticResource DoorParamsTxBx}" + Padding="1" + Text="{Binding ThicknessJamb, UpdateSourceTrigger=PropertyChanged}" + Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" + Grid.Column="2"/> + Style="{StaticResource DoorParamsTxBx}" + Padding="1" + Text="{Binding WidthJamb, UpdateSourceTrigger=PropertyChanged}" + Margin="5,2.5,10,2.5" VerticalAlignment="Stretch"/> + Text="{Binding EdgeMsg}" + VerticalAlignment="Center" + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,5,0"/> + Grid.ColumnSpan="3" + Text="{Binding OverMaterialMsg}" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,5,0"/> + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" /> + ItemsSource="{Binding FrameEdgeTypeList}" + SelectedItem="{Binding LockEdgeTypeAssembly}" + Style="{StaticResource DoorEdgeParamsCmBx}" + Margin="5,2.5,10,2.5"/> + Text="{Binding HingeEdgeMsg}" + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" /> + ItemsSource="{Binding FrameEdgeTypeList}" + SelectedItem="{Binding HingeEdgeTypeAssembly}" + Style="{StaticResource DoorEdgeParamsCmBx}" + Margin="5,2.5,10,2.5"> + Text="{Binding TopMsg}" + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" /> + ItemsSource="{Binding FrameEdgeTypeList}" + SelectedItem="{Binding TopTypeAssembly}" + Style="{StaticResource DoorEdgeParamsCmBx}" + Margin="5,2.5,10,2.5"/> + Text="{Binding BottomMsg}" + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,2" /> + ItemsSource="{Binding FrameEdgeTypeList}" + SelectedItem="{Binding BottomTypeAssembly}" + Style="{StaticResource DoorEdgeParamsCmBx}" + Margin="5,2.5,10,2.5"/> + Name="LockEdgeAssembly" Style="{StaticResource DoorParamsChBx}" + IsChecked="{Binding LockEdgeMachiningAssembly}"/> + Name="HingeEdgeAssembly" Style="{StaticResource DoorParamsChBx}" + IsChecked="{Binding HingeEdgeMachiningAssembly}"/> + Name="TopAssembly" Style="{StaticResource DoorParamsChBx}" + IsChecked="{Binding TopMachiningAssembly}"/> + Name="BottomAssembly" Style="{StaticResource DoorParamsChBx}" + IsChecked="{Binding BottomMachiningAssembly}"/> + Text="{Binding LockEdgeOverMaterialAssembly, UpdateSourceTrigger=PropertyChanged}" + IsEnabled="{Binding IsChecked, ElementName=LockEdgeAssembly}" + Padding="1" + Margin="5,2.5,10,2.5"/> + Text="{Binding HingeEdgeOverMaterialAssembly, UpdateSourceTrigger=PropertyChanged}" + IsEnabled="{Binding IsChecked, ElementName=HingeEdgeAssembly}" + Padding="1" + Margin="5,2.5,10,2.5"/> + Text="{Binding TopOverMaterialAssembly, UpdateSourceTrigger=PropertyChanged}" + IsEnabled="{Binding IsChecked, ElementName=TopAssembly}" + Padding="1" + Margin="5,2.5,10,2.5"/> + Text="{Binding BottomOverMaterialAssembly, UpdateSourceTrigger=PropertyChanged}" + IsEnabled="{Binding IsChecked, ElementName=BottomAssembly}" + Padding="1" + Margin="5,2.5,10,2.5"/> + + - + + + Style="{StaticResource DoorParamsChBx}" + IsChecked="{Binding Exterior}" + Margin="0,0,2,0" VerticalAlignment="Stretch" Height="Auto"/> - - + + + + + + + + + + - + Style="{StaticResource DoorParamsTxBl}" + Margin="2,0,0,-5.5" + Grid.Row="6" + Grid.Column="0"/> + - + diff --git a/OptionsWindow/OptionsViewModel.vb b/OptionsWindow/OptionsViewModel.vb index 19a43a7..71ef823 100644 --- a/OptionsWindow/OptionsViewModel.vb +++ b/OptionsWindow/OptionsViewModel.vb @@ -709,7 +709,7 @@ Public Class OptionsVM Set(value As String) OptionModule.m_ThicknessHead = value ConvertToCompoConfig(value) - DefaultWritePrivateProfileString(S_OVERLAP, K_THICKNESSHEAD, value) + DefaultWritePrivateProfileString(S_SIZEJAMB, K_THICKNESSHEAD, value) End Set End Property @@ -764,9 +764,9 @@ Public Class OptionsVM Set(value As Boolean) OptionModule.m_Exterior = value If OptionModule.m_Exterior Then - DefaultWritePrivateProfileString(S_OVERLAP, K_EXTERIOR, "1") + DefaultWritePrivateProfileString(S_THRESHOLD, K_EXTERIOR, "1") Else - DefaultWritePrivateProfileString(S_OVERLAP, K_EXTERIOR, "0") + DefaultWritePrivateProfileString(S_THRESHOLD, K_EXTERIOR, "0") End If End Set End Property @@ -939,6 +939,50 @@ Public Class OptionsVM End Set End Property + Public Property OverlapBottom As String + Get + Return OptionModule.m_OverlapBottom + End Get + Set(value As String) + OptionModule.m_OverlapBottom = value + ConvertToCompoConfig(value) + DefaultWritePrivateProfileString(S_THRESHOLD, K_OVERLAPBOTTOM, value) + End Set + End Property + + Public Property ThickinessBottom As String + Get + Return OptionModule.m_ThicknessBottom + End Get + Set(value As String) + OptionModule.m_ThicknessBottom = value + ConvertToCompoConfig(value) + DefaultWritePrivateProfileString(S_THRESHOLD, K_THICKNESSBOTTOM, value) + End Set + End Property + + Public Property DepthBottom As String + Get + Return OptionModule.m_DepthBottom + End Get + Set(value As String) + OptionModule.m_DepthBottom = value + ConvertToCompoConfig(value) + DefaultWritePrivateProfileString(S_THRESHOLD, K_DEPTHBOTTOM, value) + End Set + End Property + + Public Property DeltaBottom As String + Get + Return OptionModule.m_DeltaBottom + End Get + Set(value As String) + OptionModule.m_DeltaBottom = value + ConvertToCompoConfig(value) + DefaultWritePrivateProfileString(S_THRESHOLD, K_DELTABOTTOM, value) + End Set + End Property + #Region "Machining Assembly" Public Property LockEdgeMachiningAssembly As Boolean Get @@ -1410,63 +1454,6 @@ Public Class OptionsVM End Get End Property - Private m_BevelConfiguration As Visibility - Public ReadOnly Property BevelConfiguration As Visibility - Get - Return m_BevelConfiguration - End Get - End Property - - Private m_EnableTemplate As Boolean = Not OptionModule.m_DisableTemplate - Public Property EnableTemplate As Boolean - Get - Return m_EnableTemplate - End Get - Set(value As Boolean) - m_EnableTemplate = value - If Not value Then - DefaultWritePrivateProfileString(S_EDGE, "DisableTemplate", "1") - Else - DefaultWritePrivateProfileString(S_EDGE, "DisableTemplate", "0") - End If - OptionModule.m_DisableTemplate = Not value - NotifyPropertyChanged("EnableTemplate") - End Set - End Property - - Private m_EnableOrder As Boolean = Not OptionModule.m_DisableWindowOrder - Public Property EnableOrder As Boolean - Get - Return m_EnableOrder - End Get - Set(value As Boolean) - m_EnableOrder = value - If Not value Then - DefaultWritePrivateProfileString(S_EDGE, "DisableOrder", "1") - Else - DefaultWritePrivateProfileString(S_EDGE, "DisableOrder", "0") - End If - OptionModule.m_DisableWindowOrder = Not value - NotifyPropertyChanged("EnableOrder") - End Set - End Property - - Private m_EnableSingleDoor As Boolean = OptionModule.m_SingleDoor - Public Property EnableSingleDoor As Boolean - Get - Return m_EnableSingleDoor - End Get - Set(value As Boolean) - m_EnableSingleDoor = value - If Not value Then - WriteMainPrivateProfileString(S_GENERAL, K_SINGLEDOOR, "0") - Else - WriteMainPrivateProfileString(S_GENERAL, K_SINGLEDOOR, "1") - End If - NotifyPropertyChanged("EnableSingleDoor") - End Set - End Property - Public ReadOnly Property ImpTempMsg As String Get ' Open template door @@ -1594,8 +1581,89 @@ Public Class OptionsVM End Get End Property + Public ReadOnly Property OverlapBottomMsg As String + Get + Return "Overlap Bottom" + End Get + End Property + + Public ReadOnly Property ThicknessBottomMsg As String + Get + Return "Thickness Bottom" + End Get + End Property + + Public ReadOnly Property DepthBottomMsg As String + Get + Return "Depth Bottom" + End Get + End Property + + Public ReadOnly Property DeltaBottomMsg As String + Get + Return "Delta Bottom" + End Get + End Property + #End Region + Private m_BevelConfiguration As Visibility + Public ReadOnly Property BevelConfiguration As Visibility + Get + Return m_BevelConfiguration + End Get + End Property + + Private m_EnableTemplate As Boolean = Not OptionModule.m_DisableTemplate + Public Property EnableTemplate As Boolean + Get + Return m_EnableTemplate + End Get + Set(value As Boolean) + m_EnableTemplate = value + If Not value Then + DefaultWritePrivateProfileString(S_EDGE, "DisableTemplate", "1") + Else + DefaultWritePrivateProfileString(S_EDGE, "DisableTemplate", "0") + End If + OptionModule.m_DisableTemplate = Not value + NotifyPropertyChanged("EnableTemplate") + End Set + End Property + + Private m_EnableOrder As Boolean = Not OptionModule.m_DisableWindowOrder + Public Property EnableOrder As Boolean + Get + Return m_EnableOrder + End Get + Set(value As Boolean) + m_EnableOrder = value + If Not value Then + DefaultWritePrivateProfileString(S_EDGE, "DisableOrder", "1") + Else + DefaultWritePrivateProfileString(S_EDGE, "DisableOrder", "0") + End If + OptionModule.m_DisableWindowOrder = Not value + NotifyPropertyChanged("EnableOrder") + End Set + End Property + + Private m_EnableSingleDoor As Boolean = OptionModule.m_SingleDoor + Public Property EnableSingleDoor As Boolean + Get + Return m_EnableSingleDoor + End Get + Set(value As Boolean) + m_EnableSingleDoor = value + If Not value Then + WriteMainPrivateProfileString(S_GENERAL, K_SINGLEDOOR, "0") + Else + WriteMainPrivateProfileString(S_GENERAL, K_SINGLEDOOR, "1") + End If + NotifyPropertyChanged("EnableSingleDoor") + End Set + End Property + ' Controllo di eliminare un bevel dalla lista: 1 se accendo un bevel, 2 se spengo un bevel, -1 tutti i casi che non sono questi Private Function CheckBevel(VisibilityBevel As Visibility, bValue As Boolean) As Integer Dim bAnser As Integer