From b4b344773099b2d3a91ab888e075af5934b0d8e6 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Wed, 26 Apr 2023 12:33:02 +0200 Subject: [PATCH] Gestione lettura/stampa nuova versione DDF --- Constants/ConstCompo.vb | 11 +- Constants/ConstIni.vb | 1 + DdfFile.vb | 350 +++++++++++++++++++--------------- DoorParameters/Part.vb | 133 +++++++++---- MainWindow/MainWindowModel.vb | 4 +- My Project/AssemblyInfo.vb | 4 +- OptionsWindow/OptionModule.vb | 22 +++ RegexFunction.vb | 10 +- 8 files changed, 340 insertions(+), 195 deletions(-) diff --git a/Constants/ConstCompo.vb b/Constants/ConstCompo.vb index e652034..6b5ccf2 100644 --- a/Constants/ConstCompo.vb +++ b/Constants/ConstCompo.vb @@ -16,6 +16,7 @@ Module ConstCompo ' Sezioni e chiavi standard del file DDF Public Const S_GENERALINI As String = "General" Public Const K_MMUNITSINI As String = "MmUnits" + Public Const S_VERSION As String = "version" Public Const S_PRODUCE As String = "produce" Public Const S_MEASURES As String = "measures" Public Const S_CODE As String = "code" @@ -47,8 +48,9 @@ Module ConstCompo Public Const K_LOCKEDGE As String = "lockedge" Public Const K_HINGEEDGE As String = "hingeedge" Public Const K_TOP As String = "top" - Public Const K_BOTTOM As String = "bottom" - Public Const K_MACHINING As String = "machining" + Public Const K_BOTTOM As String = "bottom" + Public Const K_TYPEEDGE As String = "type" + Public Const K_MACHINING As String = "machining" Public Const K_OVERMATERIAL As String = "overmaterial" Public Const K_IDCODECOMPONENT As String = "IdCodeComponent" Public Const K_OTHERDOOR As String = "other_door" @@ -59,6 +61,7 @@ Module ConstCompo Public Const K_THICKNESS_BOTTOM As String = "thickness bottom" Public Const K_DEPTH_BOTTOM As String = "depth bottom" Public Const K_DELTA_BOTTOM As String = "delta bottom" + Public Const K_HARDWARE As String = "hardware" ' Nome, sezioni e chiavi del file Config.ini Public Const CONFIGINI_FILE_NAME As String = "Config.ini" @@ -106,8 +109,12 @@ Module ConstCompo ' Alcune stringhe notevoli dei file DDF Public Const DDF_HYPHEN As String = " - " + Public Const DDF_HYPHEN_2 As String = " - " + Public Const DDF_SPACE2 As String = " " Public Const DDF_SPACE3 As String = " " + Public Const DDF_SPACE4 As String = " " Public Const DDF_SPACE5 As String = " " + Public Const DDF_SPACE6 As String = " " Public Const DDF_METADATA As String = "##" Public Const DDF_ON As String = "ON" Public Const DDF_OFF As String = "OFF" diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 2207590..4b307a2 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -41,6 +41,7 @@ Module ConstIni Public Const K_ASKMEAGAINCONFIRM As String = "AskMeAgainConfirm" Public Const K_EGTCAMEXE As String = "EgtCam5Exe" Public Const K_REFRESHTIME As String = "RefreshTime" + Public Const K_DDFVERSION As String = "DDFVersion" Public Const S_LANGUAGES As String = "Languages" Public Const K_LANGUAGE As String = "Language" diff --git a/DdfFile.vb b/DdfFile.vb index b9d45c3..a3d6f4b 100644 --- a/DdfFile.vb +++ b/DdfFile.vb @@ -68,6 +68,12 @@ Friend Module DdfFile DdfFileContent.Add("#" & PrintTitleDDFPart(Part.TypePart)) End If DdfFileContent.Add("") + ' dal 20/04/2023 inserita gestione della versione (da configurare nel programma) + If OptionModule.m_sVersionDDF <> "1" Then + DdfFileContent.Add("version: " & OptionModule.m_sVersionDDF) + End If + DdfFileContent.Add("") + ' definisco se il pezzo deve essere prodotto DdfFileContent.Add("produce: " & If(Part.IsActive, "true", "false")) 'Genero una lista di stringhe DdfFileContent.Add("") @@ -103,52 +109,52 @@ Friend Module DdfFile TOrder.Order_ParametersList.Add(New ReportParameter("Door", Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName)) ' Probabilmente da cambiare If Not IsNothing(Part.Customer) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_CUSTOMER & ": " & Part.Customer) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_CUSTOMER & ": " & Part.Customer) ' 50070=Customer OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50070), Part.Customer)) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50070), Part.Customer)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_CUSTOMER & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_CUSTOMER & ": ") OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50070), "")) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50070), "")) End If If Not IsNothing(Part.Elevation) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_ELEVATION & ": " & Part.Elevation) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_ELEVATION & ": " & Part.Elevation) ' 50406=Elevation OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50406), Part.Elevation)) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50406), Part.Elevation)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_ELEVATION & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_ELEVATION & ": ") OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50406), "")) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50406), "")) End If If Not IsNothing(Part.Project) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_PROJECT & ": " & Part.Project) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_PROJECT & ": " & Part.Project) ' 50407=Project OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50407), Part.Project)) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50407), Part.Project)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_PROJECT & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_PROJECT & ": ") OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50407), "")) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50407), "")) End If If Not IsNothing(Part.PO) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_PO & ": " & Part.PO) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_PO & ": " & Part.PO) ' 50408=PO OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50408), Part.PO)) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50408), Part.PO)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_PO & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_PO & ": ") OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50408), "")) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50408), "")) End If If Not IsNothing(Part.Line) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LINE & ": " & Part.Line) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LINE & ": " & Part.Line) ' 50409=Line OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50409), Part.Line)) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50409), Part.Line)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LINE & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LINE & ": ") OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50409), "")) TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50409), "")) End If @@ -167,9 +173,9 @@ Friend Module DdfFile ' il posizionamento della prima porta sta nell'origine If Part.TypePart = ConstGen.PART_DO_ & "1" Then DdfFileContent.Add("position: ") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & "0") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & "0") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & "0") + DdfFileContent.Add(m_sSpace1Tab & "x: " & "0") + DdfFileContent.Add(m_sSpace1Tab & "y: " & "0") + DdfFileContent.Add(m_sSpace1Tab & "z: " & "0") ElseIf Part.TypePart = ConstGen.PART_DO_ & "2" Then ' si trova traslata verso destra dello spessore DO_1 sommato a LightLock" Dim x_DO_1 As Double = 0.0 @@ -181,30 +187,30 @@ Friend Module DdfFile StringToDouble(Map.refAssemblyPageVM.CurrAssembly.LightLock, dLightLock) Dim x As String = DoubleToString(x_DO_1 + dLightLock, 4) DdfFileContent.Add("position: ") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & x) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & "0") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & "0") + DdfFileContent.Add(m_sSpace1Tab & "x: " & x) + DdfFileContent.Add(m_sSpace1Tab & "y: " & "0") + DdfFileContent.Add(m_sSpace1Tab & "z: " & "0") ' Jamb Sinistro serratura ElseIf Part.TypePart.Contains(ConstGen.PART_FRAME_LEFT) Then DdfFileContent.Add("position: ") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & PositionJamb_X(Part)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & PositionJamb_Y(Part)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & PositionJamb_Z(Part)) + DdfFileContent.Add(m_sSpace1Tab & "x: " & PositionJamb_X(Part)) + DdfFileContent.Add(m_sSpace1Tab & "y: " & PositionJamb_Y(Part)) + DdfFileContent.Add(m_sSpace1Tab & "z: " & PositionJamb_Z(Part)) ElseIf Part.TypePart.Contains(ConstGen.PART_FRAME_RIGHT) Then DdfFileContent.Add("position: ") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & PositionJamb_X(Part)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & PositionJamb_Y(Part)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & PositionJamb_Z(Part)) + DdfFileContent.Add(m_sSpace1Tab & "x: " & PositionJamb_X(Part)) + DdfFileContent.Add(m_sSpace1Tab & "y: " & PositionJamb_Y(Part)) + DdfFileContent.Add(m_sSpace1Tab & "z: " & PositionJamb_Z(Part)) ElseIf Part.TypePart.Contains(ConstGen.PART_FRAME_TOP) Then DdfFileContent.Add("position: ") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & PositionJamb_X(Part)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & PositionJamb_Y(Part)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & PositionJamb_Z(Part)) + DdfFileContent.Add(m_sSpace1Tab & "x: " & PositionJamb_X(Part)) + DdfFileContent.Add(m_sSpace1Tab & "y: " & PositionJamb_Y(Part)) + DdfFileContent.Add(m_sSpace1Tab & "z: " & PositionJamb_Z(Part)) ElseIf Part.TypePart.Contains(ConstGen.PART_FRAME_BOTTOM) Then DdfFileContent.Add("position: ") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "x: " & PositionJamb_X(Part)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "y: " & PositionJamb_Y(Part)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & "z: " & PositionJamb_Z(Part)) + DdfFileContent.Add(m_sSpace1Tab & "x: " & PositionJamb_X(Part)) + DdfFileContent.Add(m_sSpace1Tab & "y: " & PositionJamb_Y(Part)) + DdfFileContent.Add(m_sSpace1Tab & "z: " & PositionJamb_Z(Part)) End If DdfFileContent.Add("") End If @@ -218,9 +224,9 @@ Friend Module DdfFile Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_WIDTH & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_WIDTH & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_WIDTH & ": " & Part.Width) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_WIDTH & ": " & Part.Width) End If End If ' 50001=Width @@ -232,9 +238,9 @@ Friend Module DdfFile Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HEIGHT & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HEIGHT & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HEIGHT & ": " & Part.Height) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HEIGHT & ": " & Part.Height) End If End If ' 50002=Height @@ -246,9 +252,9 @@ Friend Module DdfFile Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_THICKNESS & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_THICKNESS & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_THICKNESS & ": " & Part.Thickness) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_THICKNESS & ": " & Part.Thickness) End If End If ' 50003=Thickness @@ -357,53 +363,68 @@ Friend Module DdfFile DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":") Dim TProfile As New TableProfile Dim BevelDDF As String = SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & BevelDDF) + If OptionModule.m_sVersionDDF = "2" Then ' K_TYPE + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LOCKEDGE & ": ") + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & BevelDDF) + Else + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LOCKEDGE & ": " & BevelDDF) + End If ' 50005=Lock edge CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50005), BevelDDF)) TProfile.Profile_ParametersList.Add(New ReportParameter(EgtMsg(50005), BevelDDF)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining)) + DdfFileContent.Add(m_sSpace2Tab & 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) Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.LockEdgeOverMaterial) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & Part.LockEdgeOverMaterial) End If End If BevelDDF = SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & BevelDDF) + If OptionModule.m_sVersionDDF = "2" Then + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HINGEEDGE & ": ") + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & BevelDDF) + Else + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HINGEEDGE & ": " & BevelDDF) + End If ' 50006=Hinge edge CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50006), BevelDDF)) TProfile.Profile_ParametersList.Add(New ReportParameter(EgtMsg(50006), BevelDDF)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.HingeEdgeMachining)) + DdfFileContent.Add(m_sSpace2Tab & 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) Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.HingeEdgeOverMaterial) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & Part.HingeEdgeOverMaterial) End If End If BevelDDF = SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_TOP & ": " & BevelDDF) + If OptionModule.m_sVersionDDF = "2" Then + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_TOP & ": ") + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & BevelDDF) + Else + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_TOP & ": " & BevelDDF) + End If ' 50007=Top CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50007), BevelDDF)) TProfile.Profile_ParametersList.Add(New ReportParameter(EgtMsg(50007), BevelDDF)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.TopMachining)) + DdfFileContent.Add(m_sSpace2Tab & 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) Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.TopOverMaterial) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & Part.TopOverMaterial) End If End If @@ -413,9 +434,9 @@ Friend Module DdfFile Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_RADIUS & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_RADIUS & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_RADIUS & ": " & Part.Radius) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_RADIUS & ": " & Part.Radius) End If End If @@ -424,9 +445,9 @@ Friend Module DdfFile Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_POSX & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_POSX & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_POSX & ": " & Part.Posx) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_POSX & ": " & Part.Posx) End If End If ' 50707=Top Arc @@ -446,9 +467,9 @@ Friend Module DdfFile Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_POSX & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_POSX & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_POSX & ": " & Part.PosxAngle) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_POSX & ": " & Part.PosxAngle) End If End If @@ -457,9 +478,9 @@ Friend Module DdfFile Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_ANGLE & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_ANGLE & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_ANGLE & ": " & Part.Angle) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_ANGLE & ": " & Part.Angle) End If End If ' 50708=Top Angle @@ -474,23 +495,32 @@ Friend Module DdfFile End If BevelDDF = SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_BOTTOM & ": " & BevelDDF) + If OptionModule.m_sVersionDDF = "2" Then + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_BOTTOM & ": ") + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & BevelDDF) + Else + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_BOTTOM & ": " & BevelDDF) + End If ' 50008=Bottom CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50008), BevelDDF)) TProfile.Profile_ParametersList.Add(New ReportParameter(EgtMsg(50008), BevelDDF)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining)) + DdfFileContent.Add(m_sSpace2Tab & 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) Return Else If bIsDDF Then - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.BottomOverMaterial) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & Part.BottomOverMaterial) End If End If DoorExists = True + DdfFileContent.Add(" ") + If OptionModule.m_sVersionDDF = "2" Then + DdfFileContent.Add(ConstCompo.K_HARDWARE & ": ") + End If ' Riordino e stampo le compo SearchCompo(DdfFileContent, Part, bIsDDF) If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then @@ -532,6 +562,10 @@ Friend Module DdfFile If Not String.IsNullOrEmpty(CurrHardwareReference) Then DdfFileContent.Add("#" & CurrHardwareReference) End If + ' dal 20/04/2023 inserita gestione della versione (da configurare nel programma) + If OptionModule.m_sVersionDDF <> "1" Then + DdfFileContent.Add("version: " & OptionModule.m_sVersionDDF) + End If DdfFileContent.Add("") DdfFileContent.Add("produce: " & If(Part.IsActive, "true", "false")) 'Genero una lista di stringhe @@ -558,29 +592,29 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.S_ORDER & ":") ' Probabilmente da cambiare If Not IsNothing(Part.Customer) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_CUSTOMER & ": " & Part.Customer) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_CUSTOMER & ": " & Part.Customer) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_CUSTOMER & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_CUSTOMER & ": ") End If If Not IsNothing(Part.Elevation) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_ELEVATION & ": " & Part.Elevation) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_ELEVATION & ": " & Part.Elevation) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_ELEVATION & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_ELEVATION & ": ") End If If Not IsNothing(Part.Project) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_PROJECT & ": " & Part.Project) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_PROJECT & ": " & Part.Project) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_PROJECT & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_PROJECT & ": ") End If If Not IsNothing(Part.PO) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_PO & ": " & Part.PO) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_PO & ": " & Part.PO) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_PO & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_PO & ": ") End If If Not IsNothing(Part.Line) Then - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LINE & ": " & Part.Line) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LINE & ": " & Part.Line) Else - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LINE & ": ") + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LINE & ": ") End If ' aggiungo una riga vuota per separare la lista successiva DdfFileContent.Add("") @@ -602,11 +636,11 @@ Friend Module DdfFile ' ConvertCurrentUnitMeasure(sVal) 'Part.SetWidth(sVal) If bIsDDF Then - 'DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_WIDTH & ": " & DoubleToString(dVal, 5)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_WIDTH & ": " & sVal) + 'DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_WIDTH & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_WIDTH & ": " & sVal) Else - 'DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_WIDTH & ": " & Part.Width) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_WIDTH & ": " & sVal) + 'DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_WIDTH & ": " & Part.Width) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_WIDTH & ": " & sVal) End If End If @@ -618,11 +652,11 @@ Friend Module DdfFile ' ConvertCurrentUnitMeasure(sVal) 'Part.SetHeight(sVal) If bIsDDF Then - 'DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HEIGHT & ": " & DoubleToString(dVal, 5)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HEIGHT & ": " & sVal) + 'DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HEIGHT & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HEIGHT & ": " & sVal) Else - 'DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HEIGHT & ": " & Part.Height) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HEIGHT & ": " & sVal) + 'DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HEIGHT & ": " & Part.Height) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HEIGHT & ": " & sVal) End If End If @@ -635,11 +669,11 @@ Friend Module DdfFile ' ConvertCurrentUnitMeasure(sVal) 'Part.SetThickness(sVal) If bIsDDF Then - 'DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_THICKNESS & ": " & DoubleToString(dVal, 5)) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_THICKNESS & ": " & sVal) + 'DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_THICKNESS & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_THICKNESS & ": " & sVal) Else - 'DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_THICKNESS & ": " & Part.Thickness) - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_THICKNESS & ": " & sVal) + 'DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_THICKNESS & ": " & Part.Thickness) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_THICKNESS & ": " & sVal) End If End If ' aggiungo una riga vuota per separare la lista successiva @@ -664,8 +698,8 @@ Friend Module DdfFile End If '---------------------------------------------------------------------------------------------------------------------------------------------------- DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":") - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel)) + DdfFileContent.Add(m_sSpace2Tab & 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) Return @@ -673,15 +707,15 @@ Friend Module DdfFile sVal = Part.LockEdgeOverMaterial ' ConvertCurrentUnitMeasure(sVal) If bIsDDF Then - 'DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) + 'DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal) Else - 'DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.LockEdgeOverMaterial) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) + 'DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & Part.LockEdgeOverMaterial) + DdfFileContent.Add(m_sSpace2Tab & 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.SwingAlias.Name)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.HingeEdgeMachining)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) + DdfFileContent.Add(m_sSpace2Tab & 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) Return @@ -689,15 +723,15 @@ Friend Module DdfFile sVal = Part.HingeEdgeOverMaterial ConvertCurrentUnitMeasure(sVal) If bIsDDF Then - 'DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) + 'DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal) Else - 'DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.HingeEdgeOverMaterial) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) + 'DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & Part.HingeEdgeOverMaterial) + DdfFileContent.Add(m_sSpace2Tab & 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.SwingAlias.Name)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.TopMachining)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) + DdfFileContent.Add(m_sSpace2Tab & 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) Return @@ -705,15 +739,15 @@ Friend Module DdfFile sVal = Part.TopOverMaterial ' ConvertCurrentUnitMeasure(sVal) If bIsDDF Then - 'DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) + 'DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal) Else - 'DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.TopOverMaterial) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) + 'DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & Part.TopOverMaterial) + DdfFileContent.Add(m_sSpace2Tab & 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.SwingAlias.Name)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining)) + DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) + DdfFileContent.Add(m_sSpace2Tab & 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) Return @@ -721,13 +755,17 @@ Friend Module DdfFile sVal = Part.BottomOverMaterial ' ConvertCurrentUnitMeasure(sVal) If bIsDDF Then - 'DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) + 'DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5)) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal) Else - 'DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.BottomOverMaterial) - DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & sVal) + 'DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & Part.BottomOverMaterial) + DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal) End If End If + + If OptionModule.m_sVersionDDF = "2" Then + DdfFileContent.Add(ConstCompo.K_HARDWARE & "hardware: ") + End If ' Riordino e stampo le compo SearchCompo(DdfFileContent, Part, bIsDDF) If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then @@ -958,7 +996,9 @@ Friend Module DdfFile Dim NewCompoNameDDF = False Dim WritingError As String = String.Empty Dim TempList As New ObservableCollection(Of Compo) - DdfFileContent.Add("") + If OptionModule.m_sVersionDDF = "1" Then + DdfFileContent.Add("") + End If '------------------------------------------------------------------------------------------------------------------------------------------ ' cerco la prima componente da aggiungere alla lista delle componenti For Index1 = 0 To DdfFile.CompoListOrder.Count() - 1 @@ -1065,15 +1105,15 @@ Friend Module DdfFile ' se il nome non esiste ancora nella lista lo aggiungo If bNewCompoNameDDF Then ' aggiungo il nome DDF della componente - CompoListDDF.Add(Compo.CompoType.DDFName & ":") + CompoListDDF.Add(m_sSpaceTabCompo & Compo.CompoType.DDFName & ":") End If ' se esiste il template If Not String.IsNullOrWhiteSpace(Compo.TemplateDDFName) Then ' aggiungo " - nomeTemplate: TemplateSelezionato" If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_HYPHEN & Compo.TemplateDDFName & ": " & Compo.TemplateSelItem) + CompoListDDF.Add(DDF_METADATA & OptionModule.m_sSpaceHype & Compo.TemplateDDFName & ": " & Compo.TemplateSelItem) ElseIf Compo.LoadByDefault And SaveErrorCompo Then - CompoListDDF.Add(DDF_HYPHEN & Compo.TemplateDDFName & ": " & Compo.TemplateSelItem) + CompoListDDF.Add(OptionModule.m_sSpaceHype & Compo.TemplateDDFName & ": " & Compo.TemplateSelItem) If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine ' 50563=Compo {0} does not exist. sErrorList &= String.Format(EgtMsg(50563), Compo.SelBrandPart & "\" & Compo.SelFile) @@ -1085,7 +1125,7 @@ Friend Module DdfFile End If ParamInCompoIsCorrect = False Else - CompoListDDF.Add(DDF_HYPHEN & Compo.TemplateDDFName & ": " & Compo.TemplateSelItem) + CompoListDDF.Add(OptionModule.m_sSpaceHype & Compo.TemplateDDFName & ": " & Compo.TemplateSelItem) End If End If @@ -1110,9 +1150,9 @@ Friend Module DdfFile ' restituisco il valore DDF della lista associato all'indice passato Dim SelItemDDF As String = Trim(cbParam.ItemListDDF(IndexDDF)) If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & cbParam.DDFName & ": " & SelItemDDF) Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) + CompoListDDF.Add(m_sSpace3Tab & cbParam.DDFName & ": " & SelItemDDF) End If Else ' se non è selezionato nessun elemento (cosa impossibile...) @@ -1138,9 +1178,9 @@ Friend Module DdfFile ' restituisco il valore DDF della lista associato all'indice passato Dim SelItemDDF As String = Trim(cbParam.ItemListDDF(IndexDDF)) If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & cbParam.DDFName & ": " & SelItemDDF) Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) + CompoListDDF.Add(m_sSpace3Tab & cbParam.DDFName & ": " & SelItemDDF) End If Else ' se non è selezionato nessun elemento (cosa impossibile...) @@ -1149,9 +1189,9 @@ Friend Module DdfFile sErrorList &= String.Format(EgtMsg(50125), cbParam.Name, Compo.CompoType.DDFName) ParamInCompoIsCorrect = False If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & cbParam.DDFName & ": " & cbParam.SelItem) Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) + CompoListDDF.Add(m_sSpace3Tab & cbParam.DDFName & ": " & cbParam.SelItem) End If End If ElseIf Not cbParam.ErrorInReading And cbParam.MissingParameterInReading Then @@ -1166,9 +1206,9 @@ Friend Module DdfFile ' restituisco il valore DDF della lista associato all'indice passato Dim SelItemDDF As String = Trim(cbParam.ItemListDDF(IndexDDF)) If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & cbParam.DDFName & ": " & SelItemDDF) Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) + CompoListDDF.Add(m_sSpace3Tab & cbParam.DDFName & ": " & SelItemDDF) End If Else ' se non è selezionato nessun elemento (cosa impossibile...) @@ -1177,9 +1217,9 @@ Friend Module DdfFile sErrorList &= String.Format(EgtMsg(50125), cbParam.Name, Compo.CompoType.DDFName) ParamInCompoIsCorrect = False If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & cbParam.DDFName & ": " & cbParam.SelItem) Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) + CompoListDDF.Add(m_sSpace3Tab & cbParam.DDFName & ": " & cbParam.SelItem) End If End If Else @@ -1187,9 +1227,9 @@ Friend Module DdfFile sErrorList &= String.Format(EgtMsg(50125), cbParam.Name, Compo.CompoType.DDFName) ParamInCompoIsCorrect = False If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & cbParam.DDFName & ": " & cbParam.SelItem) Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) + CompoListDDF.Add(m_sSpace3Tab & cbParam.DDFName & ": " & cbParam.SelItem) End If End If ' TextBox Opzionale @@ -1202,24 +1242,24 @@ Friend Module DdfFile ' 50122: Error reading {0} param in {1} compo. sErrorList &= String.Format(EgtMsg(50122), tboParam.Name, Compo.CompoType.DDFName) If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tboParam.DDFName & ": ") + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & tboParam.DDFName & ": ") ParamInCompoIsCorrect = False Else - CompoListDDF.Add(DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.Value) + CompoListDDF.Add(m_sSpace3Tab & tboParam.DDFName & ": " & tboParam.Value) ParamInCompoIsCorrect = False End If Else If bIsDDF Then If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.ToolTipValue) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & tboParam.DDFName & ": " & tboParam.ToolTipValue) Else - CompoListDDF.Add(DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.ToolTipValue) + CompoListDDF.Add(m_sSpace3Tab & tboParam.DDFName & ": " & tboParam.ToolTipValue) End If Else If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.Value) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & tboParam.DDFName & ": " & tboParam.Value) Else - CompoListDDF.Add(DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.Value) + CompoListDDF.Add(m_sSpace3Tab & tboParam.DDFName & ": " & tboParam.Value) End If End If End If @@ -1237,24 +1277,24 @@ Friend Module DdfFile ' 50122: Error reading {0} param in {1} compo. sErrorList &= String.Format(EgtMsg(50122), tbParam.Name, Compo.CompoType.DDFName) If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.Value) ParamInCompoIsCorrect = False Else - CompoListDDF.Add(DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) + CompoListDDF.Add(m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.Value) ParamInCompoIsCorrect = False End If Else If bIsDDF Then If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.ToolTipValue) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.ToolTipValue) Else - CompoListDDF.Add(DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.ToolTipValue) + CompoListDDF.Add(m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.ToolTipValue) End If Else If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.Value) Else - CompoListDDF.Add(DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) + CompoListDDF.Add(m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.Value) End If End If End If @@ -1267,24 +1307,24 @@ Friend Module DdfFile ' 50122: Error reading {0} param in {1} compo. sErrorList &= String.Format(EgtMsg(50122), tbParam.Name, Compo.CompoType.DDFName) If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.Value) ParamInCompoIsCorrect = False Else - CompoListDDF.Add(DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) + CompoListDDF.Add(m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.Value) ParamInCompoIsCorrect = False End If Else If bIsDDF Then If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.ToolTipValue) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.ToolTipValue) Else - CompoListDDF.Add(DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.ToolTipValue) + CompoListDDF.Add(m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.ToolTipValue) End If Else If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) + CompoListDDF.Add(DDF_METADATA & m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.Value) Else - CompoListDDF.Add(DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) + CompoListDDF.Add(m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.Value) End If End If End If @@ -1292,7 +1332,7 @@ Friend Module DdfFile If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine ' 50122: Error reading {0} param in {1} compo. sErrorList &= String.Format(EgtMsg(50122), tbParam.Name, Compo.CompoType.DDFName) - CompoListDDF.Add(DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) + CompoListDDF.Add(m_sSpace3Tab & tbParam.DDFName & ": " & tbParam.Value) End If End If Next @@ -1300,33 +1340,33 @@ Friend Module DdfFile If Not IsNothing(Compo.refJambCompo) Then ' stampo una componente dell'anta If Not String.IsNullOrEmpty(Compo.IdCode) AndAlso Trim(Compo.refJambCompo.IdCode) = Trim(Compo.IdCode) Then - CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode) + CompoListDDF.Add(m_sSpace3Tab & "##IdCodeComponent : " & Compo.IdCode) Else Compo.IdCode = CStr(IdIndex) Compo.refJambCompo.IdCode = Trim(Compo.IdCode) - CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode) + CompoListDDF.Add(m_sSpace3Tab & "##IdCodeComponent : " & Compo.IdCode) End If IdIndex += 1 ElseIf Not IsNothing(Compo.refCompoDoor) Then ' stampo una componente sul telaio If Not String.IsNullOrEmpty(Compo.refCompoDoor.IdCode) Then If Compo.OtherDoor Then - CompoListDDF.Add(DDF_SPACE5 & "other_door: 1") + CompoListDDF.Add(m_sSpace3Tab & "other_door: 1") End If Compo.IdCode = Compo.refCompoDoor.IdCode If Compo.MatchedDoor Then ' solo per il caso di sue ante - CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode & " , Matched") + CompoListDDF.Add(m_sSpace3Tab & "##IdCodeComponent : " & Compo.IdCode & " , Matched") Else - CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode) + CompoListDDF.Add(m_sSpace3Tab & "##IdCodeComponent : " & Compo.IdCode) End If End If ElseIf Not String.IsNullOrEmpty(Compo.IdCode) Then If Compo.OtherDoor Then - CompoListDDF.Add(DDF_SPACE5 & "other_door: 1") + CompoListDDF.Add(m_sSpace3Tab & "other_door: 1") End If - CompoListDDF.Add(DDF_SPACE5 & "##IdCodeComponent : " & Compo.IdCode) + CompoListDDF.Add(m_sSpace3Tab & "##IdCodeComponent : " & Compo.IdCode) IdIndex += 1 End If Return CompoListDDF @@ -1442,18 +1482,18 @@ Friend Module DdfFile If InvertBevel Then ' If sCurrBevel = ConstGen.BEVEL_GRAPHIC And DispositionItem = ConstGen.BEVEL_DOWN Then If sCurrBevel.Contains(ConstGen.BEVEL_GRAPHIC) And DispositionItem = ConstGen.BEVEL_DOWN Then - Return sCurrBevel.Replace(ConstGen.BEVEL_GRAPHIC, ConstGen.BEVEL_UP) & ConstCompo.DDF_SPACE3 & " ## Inverted" - ' Return ConstGen.BEVEL_UP & ConstCompo.DDF_SPACE3 & " ## Inverted" + Return sCurrBevel.Replace(ConstGen.BEVEL_GRAPHIC, ConstGen.BEVEL_UP) & m_sSpace1Tab & " ## Inverted" + ' Return ConstGen.BEVEL_UP & m_sSpace1Tab & " ## Inverted" ElseIf sCurrBevel.Contains(ConstGen.BEVEL_GRAPHIC) And DispositionItem = ConstGen.BEVEL_UP Then - Return sCurrBevel.Replace(ConstGen.BEVEL_GRAPHIC, ConstGen.BEVEL_DOWN) & ConstCompo.DDF_SPACE3 & " ## Inverted" - 'Return ConstGen.BEVEL_DOWN & ConstCompo.DDF_SPACE3 & " ## Inverted" + Return sCurrBevel.Replace(ConstGen.BEVEL_GRAPHIC, ConstGen.BEVEL_DOWN) & m_sSpace1Tab & " ## Inverted" + 'Return ConstGen.BEVEL_DOWN & m_sSpace1Tab & " ## Inverted" ElseIf sCurrBevel.Contains(ConstGen.BEVEL_GRAPHIC) And DispositionItem <> ConstGen.BEVEL_UP And DispositionItem <> ConstGen.BEVEL_DOWN Then If sSwing.Contains(ConstGen.HAND_REVERSE) Then - Return sCurrBevel.Replace(ConstGen.BEVEL_GRAPHIC, ConstGen.BEVEL_UP) & ConstCompo.DDF_SPACE3 & " ## Inverted" - 'Return ConstGen.BEVEL_UP & ConstCompo.DDF_SPACE3 & " ## Inverted" + Return sCurrBevel.Replace(ConstGen.BEVEL_GRAPHIC, ConstGen.BEVEL_UP) & m_sSpace1Tab & " ## Inverted" + 'Return ConstGen.BEVEL_UP & m_sSpace1Tab & " ## Inverted" Else - Return sCurrBevel.Replace(ConstGen.BEVEL_GRAPHIC, ConstGen.BEVEL_DOWN) & ConstCompo.DDF_SPACE3 & " ## Inverted" - 'Return ConstGen.BEVEL_DOWN & ConstCompo.DDF_SPACE3 & " ## Inverted" + Return sCurrBevel.Replace(ConstGen.BEVEL_GRAPHIC, ConstGen.BEVEL_DOWN) & m_sSpace1Tab & " ## Inverted" + 'Return ConstGen.BEVEL_DOWN & m_sSpace1Tab & " ## Inverted" End If Else Return sCurrBevel diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 9e08a77..8a0a704 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -46,6 +46,18 @@ Public Class Part End Set End Property + ' per sapere quale tipo versione è il file + Private m_Version As String = "1" + Public Property Version As String + Get + Return m_Version + End Get + Set(value As String) + m_Version = value + RegexFunction.sCurrVersionDoor = m_Version + End Set + End Property + ' per sapere se il check è attivo (nella modalità assembalto) Private m_IsActive As Boolean Public Property IsActive As Boolean @@ -1543,7 +1555,8 @@ Public Class Part 'Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected ReadDoor.FileContent = ArrayFile ReadDoor.m_TypePart = ConstGen.PART_DO_ & "1" - + ' Imposto di default la porta in lettura è versione 1 + ReadDoor.Version = "1" ' Se il file DDF è vuoto If ReadDoor.FileContent.Count = 0 Then ' 50107 = Empty file. @@ -1565,6 +1578,8 @@ Public Class Part ' Processo la sezione Dim sSection As String = GetName(sLine) Select Case sSection + Case S_VERSION + LineIndex = ReadDoor.GetVersion(LineIndex) Case S_PRODUCE LineIndex = ReadDoor.GetProduce(LineIndex) Case S_MEASURES @@ -1685,6 +1700,8 @@ Public Class Part sErrorInfo &= LocalMsg End If ReadDoorCompleted = True + Case ConstCompo.K_HARDWARE + LineIndex = LineIndex + 1 Case Else 'COMPONENTS ' Se sezione senza nome o altro errore If String.IsNullOrWhiteSpace(sSection) Then @@ -1800,6 +1817,24 @@ Public Class Part Return SkipWhiteSpace(FileContent, Index + 1) End Function + ' Leggo versione + Private Function GetVersion(Index As Integer) As Integer + Dim sVersion As String = GetValueWithKey(RemoveComment(FileContent(Index)), S_VERSION) + If String.IsNullOrWhiteSpace(sVersion) Then + m_Version = "1" + Else + ' verifico che sia valido (dove leggo l'elenco delle versioni disponibili?) + If sVersion.Trim <> "2" Then + m_Version = "1" + Else + m_Version = sVersion.Trim + End If + End If + RegexFunction.sCurrVersionDoor = m_Version + ' passo alla riga successiva + Return NextIndex(Index) + End Function + ' Leggo il frame Private Function GetProduce(Index As Integer) As Integer Dim sProduce As String = GetValueWithKey(RemoveComment(FileContent(Index)), S_PRODUCE) @@ -2293,19 +2328,18 @@ Public Class Part refOptionsVM.RefreshEdgeTypeList() End If Dim bError As Boolean = False + '------------------------------------------------------------------------------- ' Lock If Index > FileContent.Count() - 1 Then Return -1 Dim sLine As String = RemoveComment(FileContent(Index)) m_LockEdgeType = m_LockEdgeTypeList(0) - Dim LockEdgeType As String = GetValueWithKey(sLine, K_LOCKEDGE) + ' se vrsione 2 (20/04/2023) il tipo di bevel è inserito nella riga successiva con chaive K_TYPEEDGE + Dim nError As Integer = Index + Dim LockEdgeType As String = ManageProfileType(sLine, Index, nError, K_LOCKEDGE) + If nError = -1 Then Return -1 If String.IsNullOrWhiteSpace(LockEdgeType) Then ' se non c'è la parola chiave allora esco con errore - If Not SearchKey(sLine, K_LOCKEDGE) Then - Return -1 - Else - FirstReadingEdge = True - sErrorMsg = String.Format(EgtMsg(50523), SIDE_LOCK) - End If + If ManageProfileError(sLine, K_LOCKEDGE, SIDE_LOCK) = -1 Then Return -1 Else Try Dim sMetaData As String = Trim(RegexFunction.Metadata(sLine)) @@ -2335,7 +2369,6 @@ Public Class Part End Try End If End Try - If Not ControlProfileInList(LockEdgeTypeList, LockEdgeType) Then ' 50522=The profile {0} is not a member of the {1} list. sErrorMsg = String.Format(EgtMsg(50522), LockEdgeType, SIDE_LOCK) @@ -2367,15 +2400,13 @@ Public Class Part If Index > FileContent.Count() - 1 Then Return -1 sLine = RemoveComment(FileContent(Index)) m_HingeEdgeType = m_HingeEdgeTypeList(0) - Dim HingeEdgeType As String = GetValueWithKey(sLine, K_HINGEEDGE) + ' se vrsione 2 (20/04/2023) il tipo di bevel è inserito nella riga successiva con chaive K_TYPEEDGE + nError = Index + Dim HingeEdgeType As String = ManageProfileType(sLine, Index, nError, K_HINGEEDGE) + If nError = -1 Then Return -1 If String.IsNullOrWhiteSpace(HingeEdgeType) Then ' se non c'è la parola chiave allora esco con errore - If Not SearchKey(sLine, K_HINGEEDGE) Then - Return -1 - Else - FirstReadingEdge = True - sErrorMsg = String.Format(EgtMsg(50523), SIDE_HINGE) - End If + If ManageProfileError(sLine, K_HINGEEDGE, SIDE_HINGE) = -1 Then Return -1 Else Try m_HingeEdgeType = HingeEdgeTypeList.First(Function(x) x.Name = HingeEdgeType) @@ -2430,14 +2461,12 @@ Public Class Part If Index > FileContent.Count() - 1 Then Return -1 sLine = RemoveComment(FileContent(Index)) m_TopType = m_TopEdgeTypeList(0) - Dim TopType As String = GetValueWithKey(sLine, K_TOP) + ' se vrsione 2 (20/04/2023) il tipo di bevel è inserito nella riga successiva con chaive K_TYPEEDGE + nError = Index + Dim TopType As String = ManageProfileType(sLine, Index, nError, K_TOP) + If nError = -1 Then Return -1 If String.IsNullOrWhiteSpace(TopType) Then - If Not SearchKey(sLine, K_TOP) Then - Return -1 - Else - FirstReadingEdge = True - sErrorMsg = String.Format(EgtMsg(50523), SIDE_TOP) - End If + If ManageProfileError(sLine, K_TOP, SIDE_TOP) = -1 Then Return -1 Else Try m_TopType = TopEdgeTypeList.First(Function(x) x.Name = TopType) @@ -2543,14 +2572,12 @@ Public Class Part If Index > FileContent.Count() - 1 Then Return -1 sLine = RemoveComment(FileContent(Index)) m_BottomType = m_BottomEdgeTypeList(0) - Dim BottomType As String = GetValueWithKey(sLine, K_BOTTOM) + ' se vrsione 2 (20/04/2023) il tipo di bevel è inserito nella riga successiva con chaive K_TYPEEDGE + nError = Index + Dim BottomType As String = ManageProfileType(sLine, Index, nError, K_BOTTOM) + If nError = -1 Then Return -1 If String.IsNullOrWhiteSpace(BottomType) Then - If Not SearchKey(sLine, K_BOTTOM) Then - Return -1 - Else - FirstReadingEdge = True - sErrorMsg = String.Format(EgtMsg(50523), SIDE_BOTTOM) - End If + If ManageProfileError(sLine, K_BOTTOM, SIDE_BOTTOM) = -1 Then Return -1 Else Try m_BottomType = BottomEdgeTypeList.First(Function(x) x.Name = BottomType) @@ -2602,6 +2629,45 @@ Public Class Part Return NextIndex(Index) End Function + Private Function ManageProfileType(ByRef sLine As String, ByRef Index As Integer, ByRef nError As Integer, sEdgeName As String) As String + Dim sVal As String = String.Empty + If m_Version = "2" Then + If SearchKey(sLine, sEdgeName) Then + ' passo alla riga successiva + Index = NextIndex(Index) + If Index > FileContent.Count() - 1 Then Return -1 + sLine = RemoveComment(FileContent(Index)) + sVal = GetValueWithKey(sLine, K_TYPEEDGE) + Else + nError = -1 + Return sVal + End If + Else + sVal = GetValueWithKey(sLine, sEdgeName) + End If + Return sVal + End Function + + Private Function ManageProfileError(sLine As String, sEdgeName As String, sMsgName As String) As Integer + Dim nError As Integer = 0 + If m_Version = "2" Then + If Not SearchKey(sLine, K_TYPEEDGE) Then + Return -1 + Else + FirstReadingEdge = True + sErrorMsg = String.Format(EgtMsg(50523), sMsgName) + End If + Else + If Not SearchKey(sLine, sEdgeName) Then + Return -1 + Else + FirstReadingEdge = True + sErrorMsg = String.Format(EgtMsg(50523), sMsgName) + End If + End If + Return nError + End Function + ' Leggo i dati del componente ( da senllire riutilizzando funzioni che già esistono) Private Function GetCompo(Index As Integer, CompoNameDDF As String, ByRef sErrorInfo As String) As Integer ' Controllo esistenza del componente @@ -2861,7 +2927,7 @@ Public Class Part While IndexLine < FileContent.Count - 1 AndAlso Not (Search3Hyphens(RemoveComment(FileContent(IndexLine))) OrElse Search3Dots(RemoveComment(FileContent(IndexLine)))) AndAlso Not Trim(RemoveComment(FileContent(IndexLine))).StartsWith("- ") AndAlso - RemoveComment(FileContent(IndexLine)).StartsWith(ConstCompo.DDF_SPACE3) + (RemoveComment(FileContent(IndexLine)).StartsWith(ConstCompo.DDF_SPACE3) Or RemoveComment(FileContent(IndexLine)).StartsWith(ConstCompo.DDF_SPACE2)) ' salvo i commenti If String.IsNullOrWhiteSpace(FileContent(IndexLine)) Then IndexLine += 1 @@ -3083,6 +3149,7 @@ Public Class Part ' assegno al parametro della compnente il valore "filtrato" DirectCast(CurrCompoParam, ComboBoxOnOffParam).SetSelItem(SelItem) 'DirectCast(CurrCompoParam, ComboBoxOnOffParam).SelItem = SelItem + DirectCast(CurrCompoParam, ComboBoxOnOffParam).SetIsActive(True) ' se il nome esiste ma è sbagliato ElseIf Not String.IsNullOrWhiteSpace(GetKey(sLine)) Then ' significa che la TextBoxOnOff è stata disattivata @@ -3142,8 +3209,8 @@ Public Class Part Return False End If ' per riconoscere una componente: no spazi ad inizio riga, dopo i ":" riga vuota - If FileContent(IndexLine) = FileContent(IndexLine).Trim AndAlso - GetValueWithoutKey(FileContent(IndexLine)) = String.Empty Then + If FileContent(IndexLine).StartsWith(OptionModule.m_sSpaceTabCompo) AndAlso + GetValueWithoutKey(FileContent(IndexLine)) = String.Empty Then m_StopNextIndexLine = True Return True End If diff --git a/MainWindow/MainWindowModel.vb b/MainWindow/MainWindowModel.vb index 7926977..7969f2d 100644 --- a/MainWindow/MainWindowModel.vb +++ b/MainWindow/MainWindowModel.vb @@ -57,8 +57,8 @@ Friend Class MainWindowModel EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile) EgtSetKey(sKey) ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(3279, 2531, 1, IniFile.m_nKeyLevel) And - EgtGetKeyOptions(3279, 2531, 1, IniFile.m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(3279, 2541, 1, IniFile.m_nKeyLevel) And + EgtGetKeyOptions(3279, 2541, 1, IniFile.m_nKeyOptions) 'Inizializzazione generale di EgtInterface m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index b9e3990..fe79270 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 ef1fa48..401713a 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -30,6 +30,14 @@ Friend Module OptionModule Friend m_bBevelUp As Visibility Friend m_bBevelDown As Visibility + ' Parametri per la scelta della versione di stampa ddf + Friend m_sVersionDDF As String = "2" + Friend m_sSpaceTabCompo As String = "" + Friend m_sSpace1Tab As String = ConstCompo.DDF_SPACE3 + Friend m_sSpace2Tab As String = ConstCompo.DDF_SPACE5 + Friend m_sSpace3Tab As String = ConstCompo.DDF_SPACE5 + Friend m_sSpaceHype As String = ConstCompo.DDF_HYPHEN + Friend m_DisableInvertBevel As Visibility = Visibility.Collapsed Friend m_DisableAddGeometry As Visibility = Visibility.Collapsed @@ -232,6 +240,20 @@ Friend Module OptionModule OptionModule.ReadOnlyDDF = False End If + ' valore indentazione programma + Dim sVer As String = String.Empty + If GetMainPrivateProfileString(S_GENERAL, K_DDFVERSION, "1", sVer) > 0 Then + Dim sItem() As String = sVer.Split(";"c) + m_sVersionDDF = sItem(0).Trim + End If + If m_sVersionDDF = "2" Then + m_sSpaceTabCompo = ConstCompo.DDF_SPACE2 + m_sSpace1Tab = ConstCompo.DDF_SPACE2 + m_sSpace2Tab = ConstCompo.DDF_SPACE4 + m_sSpace3Tab = ConstCompo.DDF_SPACE6 + m_sSpaceHype = ConstCompo.DDF_HYPHEN_2 + End If + ' imposto unità di misura per interfaccia utente m_bIsMmUnit = (GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0) EgtSetUiUnits(m_bIsMmUnit) diff --git a/RegexFunction.vb b/RegexFunction.vb index 682f526..5080156 100644 --- a/RegexFunction.vb +++ b/RegexFunction.vb @@ -4,6 +4,8 @@ Imports EgtUILib Imports EgtWPFLib5 Module RegexFunction + Friend sCurrVersionDoor As String = "1" + ' restituisce vero se trova il capitoletto [Graphic parameters] Friend Function IsGraphicParametersTitle(sLine As String) As Boolean Return Regex.Match(sLine, "\s*--\s*(\[Graphic parameters\])\s*$").Groups(1).Value = "[Graphic parameters]" @@ -216,8 +218,14 @@ Module RegexFunction ' Restituisce il nome che precede i due punti (tutti i caratteri dall'inizio della stringa) Friend Function GetName(sLine As String) As String + ' La versione deve essere impostata in fase di lettura della porta Dim sTmp As String = RemoveComment(sLine) - If String.IsNullOrWhiteSpace(sTmp) OrElse Char.IsWhiteSpace(sTmp, 0) Then Return "" + If sCurrVersionDoor = "2" Then + If String.IsNullOrWhiteSpace(sTmp) OrElse sTmp.StartsWith(OptionModule.m_sSpaceHype) OrElse sTmp.StartsWith(OptionModule.m_sSpace3Tab) Then Return "" + Else + If String.IsNullOrWhiteSpace(sTmp) OrElse Char.IsWhiteSpace(sTmp, 0) Then Return "" + End If + Dim sString As String = Regex.Match(RemoveComment(sLine), "\s*(.*?\b)\s*:.*").Groups(1).Value Return Regex.Match(RemoveComment(sLine), "\s*(.*?\b)\s*:.*").Groups(1).Value End Function