From 13b49e14cb3837fbabab1ade939835c62ea661f0 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 9 Mar 2020 11:37:24 +0000 Subject: [PATCH] EgtDOORCreator 2.2c1: -> gestione della stampa quote porta. --- App.config | 2 +- Application.xaml | 2 +- Constants/ConstIni.vb | 5 + DdfFile.vb | 426 ++++++++++++++++++++++--------- DoorParameters/Part.vb | 150 ++++++++++- DoorParameters/PartPageV.xaml | 187 ++++++++++++-- DoorParameters/PartPageVM.vb | 33 +++ DoorParameters/PropertyItem.vb | 39 +++ EgtDOORCreator.vbproj | 18 +- IniFile.vb | 4 + My Project/AssemblyInfo.vb | 4 +- My Project/Resources.Designer.vb | 26 +- My Project/Settings.Designer.vb | 14 +- OptionsWindow/OptionModule.vb | 20 ++ Print/PrintWndV.xaml | 41 +-- Print/PrintWndV.xaml.vb | 41 ++- Print/PrintWndVM.vb | 133 +++++++--- ReportInfo/ReportCompo.vb | 293 +++++++++++++++++++++ SceneManager/SceneManagerVM.vb | 9 + 19 files changed, 1227 insertions(+), 220 deletions(-) create mode 100644 ReportInfo/ReportCompo.vb diff --git a/App.config b/App.config index 3fa3cae..2c307fa 100644 --- a/App.config +++ b/App.config @@ -1,6 +1,6 @@ - + diff --git a/Application.xaml b/Application.xaml index 59d2741..12dcf9b 100644 --- a/Application.xaml +++ b/Application.xaml @@ -1,7 +1,7 @@  + ShutdownMode="OnMainWindowClose"> diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 56e62a4..38dbce1 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -35,6 +35,7 @@ Module ConstIni Public Const K_DISABLEARCH As String = "DisableArch" Public Const K_SINGLEDOOR As String = "SingleDoor" Public Const K_DELETEPROJECT As String = "DeleteProject" + Public Const K_ENABLEBTNDESING As String = "EnableDesign" Public Const S_LANGUAGES As String = "Languages" Public Const K_LANGUAGE As String = "Language" @@ -85,6 +86,10 @@ Module ConstIni Public Const K_TEMPLATEDIR As String = "TemplateDirectory" Public Const K_MACHINDIR As String = "MachinDirectory" + Public Const S_LISTLABEL As String = "ListLabel" + Public Const K_LISTLABELDIR As String = "ListLabelDirectory" + Public Const K_LISTLABELFILE As String = "ListLabelCurrent" + Public Const S_LAUNCHERWINDOW As String = "LauncherWindow" Public Const K_LAUNCHER As String = "Launcher" Public Const K_LASTPROJECT As String = "LastProject" diff --git a/DdfFile.vb b/DdfFile.vb index 21be596..54ab63d 100644 --- a/DdfFile.vb +++ b/DdfFile.vb @@ -15,6 +15,14 @@ Friend Module DdfFile Friend SaveErrorCompo As Boolean = False ' raccoglie gli errori in fase di scrittura del ddf Friend ErrorInWriting As String = String.Empty + + ' lista delle componenti della porta da stampare nel report + Friend OrderInReport As New ReportOrder + Friend ReportList As New List(Of ReportCompo) + + ' nuova gestione liste + Friend ReportDoor As New TableDoor + Private ParamInCompoIsCorrect As Boolean = True #Region "SCRITTURA DDF" @@ -23,6 +31,19 @@ Friend Module DdfFile Private IdIndex As Integer = 0 Friend Sub WriteDDFPart(Part As Part, sPath As String, bIsDDF As Boolean, bIsForAssembly As Boolean) + ReportList.Clear() + + ReportDoor.Order.Clear() + ReportDoor.Dimension.Clear() + ReportDoor.Proflie.Clear() + ReportDoor.OtherInfo.Clear() + ReportDoor.HardwareList.Clear() + ReportDoor.MachList.Clear() + + ' definsco la componente porta (devo decidere come asseganre il Brand e il Template) + Dim CompoDoorReport As New ReportCompo("DOOR", "", Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) + ReportList.Add(CompoDoorReport) + ErrorInWriting = String.Empty DDFIsCorrect = False DoorExists = False @@ -42,6 +63,9 @@ Friend Module DdfFile DdfFileContent.Add("") If IsNothing(Part.Measure) Then Part.Measure = ConvertMmUnitsToString(OptionModule.m_bIsMmUnit) DdfFileContent.Add(ConstCompo.S_MEASURES & ": " & Part.Measure) + ' 50200=Unit measure + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50200), Part.Measure)) + ' aggiungo una riga vuota per separare la lista successiva DdfFileContent.Add("") If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then @@ -63,34 +87,61 @@ Friend Module DdfFile End If DdfFileContent.Add(ConstCompo.S_ORDER & ":") + Dim TOrder As New TableOrder ' Probabilmente da cambiare If Not IsNothing(Part.Customer) Then DdfFileContent.Add(ConstCompo.DDF_SPACE3 & 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 & ": ") + 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) + ' 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 & ": ") + 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) + ' 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 & ": ") + 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) + ' 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 & ": ") + 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) + ' 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 & ": ") + OrderInReport.OrderParameterList.Add(New ReportParameter(EgtMsg(50409), "")) + TOrder.Order_ParametersList.Add(New ReportParameter(EgtMsg(50409), "")) End If ' aggiungo una riga vuota per separare la lista successiva DdfFileContent.Add("") + DdfFileContent.Add(ConstCompo.S_DATE & ":" & " " & System.DateTime.Now.ToString("dd/MM/yyyy")) ' aggiungo una riga vuota per separare la lista successiva DdfFileContent.Add("") @@ -151,7 +202,7 @@ Friend Module DdfFile Dim dVal As Double = 0 DdfFileContent.Add(ConstCompo.S_SIZE & ":") - + Dim TDimension As New TableDimension If Not StringToDouble(Part.Width, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_WIDTH), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) Return @@ -162,6 +213,9 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_WIDTH & ": " & Part.Width) End If End If + ' 50001=Width + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50001), DoubleToString(dVal, 5))) + TDimension.Dimension_ParametersList.Add(New ReportParameter(EgtMsg(50001), DoubleToString(dVal, 5))) If Not StringToDouble(Part.Height, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_HEIGHT), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -172,8 +226,10 @@ Friend Module DdfFile Else DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HEIGHT & ": " & Part.Height) End If - End If + ' 50002=Height + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50002), DoubleToString(dVal, 5))) + TDimension.Dimension_ParametersList.Add(New ReportParameter(EgtMsg(50002), DoubleToString(dVal, 5))) If Not StringToDouble(Part.Thickness, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_THICKNESS), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -185,6 +241,9 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_THICKNESS & ": " & Part.Thickness) End If End If + ' 50003=Thickness + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50003), DoubleToString(dVal, 5))) + TDimension.Dimension_ParametersList.Add(New ReportParameter(EgtMsg(50003), DoubleToString(dVal, 5))) ' aggiungo il peso della porta If Part.IsCheckedWeight = Visibility.Visible Then @@ -200,9 +259,17 @@ Friend Module DdfFile End If End If End If + ' 50047=Weight + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50047), DoubleToString(dVal, 5))) + TDimension.Dimension_ParametersList.Add(New ReportParameter(EgtMsg(50047), DoubleToString(dVal, 5))) + ' aggiungo una riga vuota per separare la lista successiva DdfFileContent.Add("") DdfFileContent.Add("" & ConstCompo.S_SWING & ": " & Part.Swing) + Dim TOtherInfo As New TableOtherInfo + ' 50004=Swing + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50004), Part.Swing)) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter(EgtMsg(50004), Part.Swing)) ' aggiungo una riga vuota per separare la lista successiva DdfFileContent.Add("") '---------------------------------------------------------------------------------------------------------------------------------------------------- @@ -217,34 +284,45 @@ Friend Module DdfFile '---------------------------------------------------------------------------------------------------------------------------------------------------- ' aggiungo le Properties ' il tipo di materiale, se è selezionato deve sempre essere stampato - If Not IsNothing(Part.SelectedMaterial) andalso Part.SelectedMaterial.NameDDF <> GENERICMATERIAL then + If Not IsNothing(Part.SelectedMaterial) AndAlso Part.SelectedMaterial.NameDDF <> GENERICMATERIAL Then DdfFileContent.Add("" & ConstCompo.S_MATERIAL & ": " & Part.SelectedMaterial.NameDDF) + ' 50710=Material + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50710), Part.SelectedMaterial.NameDDF)) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter(EgtMsg(50710), Part.SelectedMaterial.NameDDF)) DdfFileContent.Add("") End If - '' scrittura utilizzata per la multi selezione - 'Dim sProperties As String = String.Empty - 'Dim ItemIndex As Integer - 'For ItemIndex = 0 To Part.PropertiesList.Count - 1 - ' 'If Part.PropertiesList(ItemIndex).IsChecked Then - ' ' sProperties &= Part.PropertiesList(ItemIndex).Name & ", " - ' 'End If - 'Next - 'If Not String.IsNullOrEmpty(sProperties) Then - ' sProperties = sProperties.Remove(sProperties.LastIndexOf(","c)) - ' DdfFileContent.Add("" & ConstCompo.S_PROPERTIES & ": " & sProperties) - ' DdfFileContent.Add("") - 'End If - ' scrittura delle proprietà in caso di selezione da ComboBox - If Part.PropertiesIsVisible = Visibility.Visible then + '' scrittura utilizzata per la multi selezione + 'Dim sProperties As String = String.Empty + 'Dim ItemIndex As Integer + 'For ItemIndex = 0 To Part.PropertiesList.Count - 1 + ' 'If Part.PropertiesList(ItemIndex).IsChecked Then + ' ' sProperties &= Part.PropertiesList(ItemIndex).Name & ", " + ' 'End If + 'Next + 'If Not String.IsNullOrEmpty(sProperties) Then + ' sProperties = sProperties.Remove(sProperties.LastIndexOf(","c)) + ' DdfFileContent.Add("" & ConstCompo.S_PROPERTIES & ": " & sProperties) + ' DdfFileContent.Add("") + 'End If + ' scrittura delle proprietà in caso di selezione da ComboBox + If Part.PropertiesIsVisible = Visibility.Visible Then Dim sProperties As String = String.Empty - If Not IsNothing(Part.SelectedProperty) andalso Part.SelectedProperty.Name <> "none" Then + If Not IsNothing(Part.SelectedProperty) AndAlso Part.SelectedProperty.Name <> "none" Then DdfFileContent.Add("" & ConstCompo.S_PROPERTIES & ": " & Part.SelectedProperty.Name) + ' 50709=Properties + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50709), Part.SelectedProperty.Name)) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter(EgtMsg(50709), Part.SelectedProperty.Name)) DdfFileContent.Add("") End If 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)) + 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) + ' 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)) If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_LOCKEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -256,7 +334,12 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.LockEdgeOverMaterial) End If End If - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) + + BevelDDF = SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & BevelDDF) + ' 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)) If Not StringToDouble(Part.HingeEdgeOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_HINGEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -268,7 +351,12 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & Part.HingeEdgeOverMaterial) End If End If - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) + + BevelDDF = SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_TOP & ": " & BevelDDF) + ' 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)) If Not StringToDouble(Part.TopOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_TOPOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -281,7 +369,7 @@ Friend Module DdfFile End If End If - If Part.TopArcIsChecked And (Not IsNothing(Part.Radius) AndAlso Not IsNothing(Part.Posx)) Then + If Part.TopShapeIsChecked And Part.TopArcIsChecked And (Not IsNothing(Part.Radius) AndAlso Not IsNothing(Part.Posx)) Then If Not StringToDouble(Part.Radius, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_RADIUS), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) Return @@ -303,9 +391,18 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_POSX & ": " & Part.Posx) End If End If + ' 50707=Top Arc + CompoDoorReport.CompoParameterList.Add(New ReportParameter("Top shape", EgtMsg(50707))) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter("Top shape", EgtMsg(50707))) + ' 50706=Pos_x + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50706), Part.Posx)) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter(EgtMsg(50706), Part.Posx)) + ' 50704=Radius + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50704), Part.Radius)) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter(EgtMsg(50704), Part.Radius)) End If - If Part.TopAngleIsChecked And (Not IsNothing(Part.Angle) AndAlso Not IsNothing(Part.Posx)) Then + If Part.TopShapeIsChecked And Part.TopAngleIsChecked And (Not IsNothing(Part.Angle) AndAlso Not IsNothing(Part.Posx)) Then If Not StringToDouble(Part.PosxAngle, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_POSX), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) Return @@ -327,10 +424,22 @@ Friend Module DdfFile DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_ANGLE & ": " & Part.Angle) End If End If - + ' 50708=Top Angle + CompoDoorReport.CompoParameterList.Add(New ReportParameter("Top shape", EgtMsg(50708))) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter("Top shape", EgtMsg(50708))) + ' 50706=Pos_x + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50706), Part.Posx)) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter(EgtMsg(50706), Part.Posx)) + ' 50705=Angle + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50705), Part.Angle)) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter(EgtMsg(50705), Part.Angle)) End If - DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name)) + BevelDDF = SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name) + DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_BOTTOM & ": " & BevelDDF) + ' 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)) If Not StringToDouble(Part.BottomOverMaterial, dVal) Then MessageBox.Show(String.Format(EgtMsg(50141), K_BOTTOMOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) @@ -343,6 +452,7 @@ Friend Module DdfFile End If End If DoorExists = True + ' Riordino e stampo le compo SearchCompo(DdfFileContent, Part, bIsDDF) If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then @@ -351,6 +461,12 @@ Friend Module DdfFile DdfFileContent.Add(" ") DdfFileContent.Add("# End Part") ' se sono arrivato fin qui significa che tutto è andato a buon fine (posso quindisalvare il file corrente) + OrderInReport.ReportCompoList = ReportList + ReportDoor.Order.Add(TOrder) + ReportDoor.Dimension.Add(TDimension) + ReportDoor.Proflie.Add(TProfile) + ReportDoor.OtherInfo.Add(TOtherInfo) + DDFIsCorrect = ParamInCompoIsCorrect '----------------------------------------------------------------------------------------------------------------------------------- 'Stampa su file @@ -503,12 +619,12 @@ Friend Module DdfFile End If DdfFileContent.Add("") - - If Not IsNothing(Part.SelectedMaterial) andalso Part.SelectedMaterial.NameDDF <> GENERICMATERIAL then + + If Not IsNothing(Part.SelectedMaterial) AndAlso Part.SelectedMaterial.NameDDF <> GENERICMATERIAL Then DdfFileContent.Add("" & ConstCompo.S_MATERIAL & ": " & Part.SelectedMaterial.NameDDF) DdfFileContent.Add("") End If -'---------------------------------------------------------------------------------------------------------------------------------------------------- + '---------------------------------------------------------------------------------------------------------------------------------------------------- DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":") DdfFileContent.Add(ConstCompo.DDF_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel)) DdfFileContent.Add(ConstCompo.DDF_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining)) @@ -790,7 +906,7 @@ Friend Module DdfFile Next Next TidyCompo(DdfFileContent, TempList, bIsDDF) - ' finto di leggere tutte le componenti stampo il messaggio degli errori + ' finito di leggere tutte le componenti stampo il messaggio degli errori If Not String.IsNullOrWhiteSpace(WritingError) Then MessageBox.Show(WritingError, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) End If @@ -810,6 +926,7 @@ Friend Module DdfFile End If Next AscendingOrder(TempList, DdfFileContent, bIsDDF) + GenerateCompoListReport(TempList) Index1 += TempList.Count - 1 Next TempList = New ObservableCollection(Of Compo) @@ -817,7 +934,9 @@ Friend Module DdfFile If Door(Door.Count - 1).CompoType.DDFName <> Door(Door.Count - 2).CompoType.DDFName Then TempList.Add(Door(Door.Count - 1)) AscendingOrder(TempList, DdfFileContent, bIsDDF) + GenerateCompoListReport(TempList) End If + Return True End Function @@ -935,67 +1054,29 @@ Friend Module DdfFile End If End If - ' ComboBox - ElseIf TypeOf CurrCompoParam Is ComboBoxParam Then - Dim cbParam As ComboBoxParam = DirectCast(CurrCompoParam, ComboBoxParam) - If Not cbParam.ErrorInReading And Not cbParam.MissingParameterInReading Then - ' recupero l'indice dell'elemento selezionato - Dim IndexDDF As Integer = -1 - If Not String.IsNullOrWhiteSpace(cbParam.SelItem) Then - ' raccolgo il valore IndexDDF come indice del valore selezionato dalla lista - IndexDDF = cbParam.ItemList.IndexOf(cbParam.SelItem) - End If - ' controllo che sia selezionato un elemento - If IndexDDF >= 0 AndAlso IndexDDF < cbParam.ItemListDDF.Count() Then - ' 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) - Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) - End If + ' ComboBox + ElseIf TypeOf CurrCompoParam Is ComboBoxParam Then + Dim cbParam As ComboBoxParam = DirectCast(CurrCompoParam, ComboBoxParam) + If Not cbParam.ErrorInReading And Not cbParam.MissingParameterInReading Then + ' recupero l'indice dell'elemento selezionato + Dim IndexDDF As Integer = -1 + If Not String.IsNullOrWhiteSpace(cbParam.SelItem) Then + ' raccolgo il valore IndexDDF come indice del valore selezionato dalla lista + IndexDDF = cbParam.ItemList.IndexOf(cbParam.SelItem) + End If + ' controllo che sia selezionato un elemento + If IndexDDF >= 0 AndAlso IndexDDF < cbParam.ItemListDDF.Count() Then + ' 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) Else - ' se non è selezionato nessun elemento (cosa impossibile...) - If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine - ' 50125: Error reading {0} param in {1} compo: do not exist value. - 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) - Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) - End If - End If - ElseIf Not cbParam.ErrorInReading And cbParam.MissingParameterInReading Then - ' recupero l'indice dell'elemento selezionato - Dim IndexDDF As Integer = -1 - If Not String.IsNullOrWhiteSpace(cbParam.SelItem) Then - ' raccolgo il valore IndexDDF come indice del valore selezionato dalla lista - IndexDDF = cbParam.ItemList.IndexOf(cbParam.SelItem) - End If - ' controllo che sia selezionato un elemento - If IndexDDF >= 0 AndAlso IndexDDF < cbParam.ItemListDDF.Count() Then - ' 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) - Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) - End If - Else - ' se non è selezionato nessun elemento (cosa impossibile...) - If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine - ' 50125: Error reading {0} param in {1} compo: do not exist value. - 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) - Else - CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) - End If + CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) End If Else - ' 50125 =Error in reading {0} in compo {1}. + ' se non è selezionato nessun elemento (cosa impossibile...) + If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine + ' 50125: Error reading {0} param in {1} compo: do not exist value. sErrorList &= String.Format(EgtMsg(50125), cbParam.Name, Compo.CompoType.DDFName) ParamInCompoIsCorrect = False If Compo.LoadByDefault And Not SaveErrorCompo Then @@ -1004,43 +1085,81 @@ Friend Module DdfFile CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) End If End If - ' TextBox Opzionale - ElseIf TypeOf CurrCompoParam Is TextBoxOnOffParam Then + ElseIf Not cbParam.ErrorInReading And cbParam.MissingParameterInReading Then + ' recupero l'indice dell'elemento selezionato + Dim IndexDDF As Integer = -1 + If Not String.IsNullOrWhiteSpace(cbParam.SelItem) Then + ' raccolgo il valore IndexDDF come indice del valore selezionato dalla lista + IndexDDF = cbParam.ItemList.IndexOf(cbParam.SelItem) + End If + ' controllo che sia selezionato un elemento + If IndexDDF >= 0 AndAlso IndexDDF < cbParam.ItemListDDF.Count() Then + ' 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) + Else + CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & SelItemDDF) + End If + Else + ' se non è selezionato nessun elemento (cosa impossibile...) + If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine + ' 50125: Error reading {0} param in {1} compo: do not exist value. + 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) + Else + CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) + End If + End If + Else + ' 50125 =Error in reading {0} in compo {1}. + 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) + Else + CompoListDDF.Add(DDF_SPACE5 & cbParam.DDFName & ": " & cbParam.SelItem) + End If + End If + ' TextBox Opzionale + ElseIf TypeOf CurrCompoParam Is TextBoxOnOffParam Then Dim tboParam As TextBoxOnOffParam = DirectCast(CurrCompoParam, TextBoxOnOffParam) If Not String.IsNullOrWhiteSpace(tboParam.ToolTipValue) AndAlso tboParam.IsActive Then - ' se è stata inserita un'espressione non valida restituisco un errore (50143: Invalid expression.) - If tboParam.ToolTipValue = EgtMsg(50143) Then - If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine - ' 50122: Error reading {0} param in {1} compo. - sErrorList &= String.Format(EgtMsg(50122), tboParam.Name, Compo.CompoType.DDFName) + ' se è stata inserita un'espressione non valida restituisco un errore (50143: Invalid expression.) + If tboParam.ToolTipValue = EgtMsg(50143) Then + If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine + ' 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 & ": ") + ParamInCompoIsCorrect = False + Else + CompoListDDF.Add(DDF_SPACE5 & 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 & ": ") - ParamInCompoIsCorrect = False + CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.ToolTipValue) Else - CompoListDDF.Add(DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.Value) - ParamInCompoIsCorrect = False + CompoListDDF.Add(DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.ToolTipValue) End If Else - If bIsDDF Then - If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.ToolTipValue) - Else - CompoListDDF.Add(DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.ToolTipValue) - End If + If Compo.LoadByDefault And Not SaveErrorCompo Then + CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.Value) Else - If Compo.LoadByDefault And Not SaveErrorCompo Then - CompoListDDF.Add(DDF_METADATA & DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.Value) - Else - CompoListDDF.Add(DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.Value) - End If + CompoListDDF.Add(DDF_SPACE5 & tboParam.DDFName & ": " & tboParam.Value) End If End If - ElseIf Not String.IsNullOrWhiteSpace(tboParam.ToolTipValue) AndAlso Not tboParam.IsActive Then - ' non restituire nessun tipo di errore End If - ' TextBox - ElseIf TypeOf CurrCompoParam Is TextBoxParam Then - Dim tbParam As TextBoxParam = DirectCast(CurrCompoParam, TextBoxParam) + ElseIf Not String.IsNullOrWhiteSpace(tboParam.ToolTipValue) AndAlso Not tboParam.IsActive Then + ' non restituire nessun tipo di errore + End If + ' TextBox + ElseIf TypeOf CurrCompoParam Is TextBoxParam Then + Dim tbParam As TextBoxParam = DirectCast(CurrCompoParam, TextBoxParam) ' se c'è scritto qualcosa If Not String.IsNullOrWhiteSpace(tbParam.ToolTipValue) And Not Compo.MissingParameter Then ' se è stata inserita un'espressine non valida restituisco un errore @@ -1106,7 +1225,7 @@ Friend Module DdfFile sErrorList &= String.Format(EgtMsg(50122), tbParam.Name, Compo.CompoType.DDFName) CompoListDDF.Add(DDF_SPACE5 & tbParam.DDFName & ": " & tbParam.Value) End If - End If + End If Next ' inserisco qui il riferimento da stampare (il codice è scelto dalla porta) If Not IsNothing(Compo.refJambCompo) Then @@ -1126,6 +1245,80 @@ Friend Module DdfFile Return CompoListDDF End Function + 'Genero la lista delle componenti da passare al report + Private Sub GenerateCompoListReport(TempList As ObservableCollection(Of Compo)) + + For Each ItemCompo In TempList + If ItemCompo.CompoType.DDFName.Trim = "vision_cut_outs" OrElse + ItemCompo.CompoType.DDFName.Trim = "louver_cut_outs" OrElse + ItemCompo.CompoType.DDFName.Trim = "mail_slots" OrElse + ItemCompo.CompoType.DDFName.Trim = "groove" OrElse + ItemCompo.CompoType.DDFName.Trim = "rabbet" OrElse + ItemCompo.CompoType.DDFName.Trim = "face_decoration" Then + ReportDoor.MachList.Add(New TableMach(ItemCompo.CompoType.Name, ItemCompo.SelFile)) + For Each ItemParameter In ItemCompo.CompoParamList + Dim sValue As String = String.Empty + Dim bIsActive As Boolean = True + If TypeOf ItemParameter Is TextBoxOnOffParam Then + bIsActive = DirectCast(ItemParameter, TextBoxOnOffParam).IsActive + sValue = DirectCast(ItemParameter, TextBoxOnOffParam).m_Value + ElseIf TypeOf ItemParameter Is ComboBoxOnOffParam Then + bIsActive = DirectCast(ItemParameter, ComboBoxOnOffParam).IsActive + sValue = DirectCast(ItemParameter, ComboBoxOnOffParam).m_SelItem + ElseIf TypeOf ItemParameter Is TextBoxParam Then + sValue = DirectCast(ItemParameter, TextBoxParam).m_Value + ElseIf TypeOf ItemParameter Is ComboBoxParam Then + sValue = DirectCast(ItemParameter, ComboBoxParam).m_SelItem + End If + If bIsActive Then + ReportDoor.MachList(ReportDoor.MachList.Count - 1).Mach_ParametersList.Add(New ReportParameter(ItemParameter.Name, sValue)) + End If + Next + Else + ReportDoor.HardwareList.Add(New TableHardaware(ItemCompo.CompoType.Name, ItemCompo.SelBrandPart, ItemCompo.SelFile)) + For Each ItemParameter In ItemCompo.CompoParamList + Dim sValue As String = String.Empty + Dim bIsActive As Boolean = True + If TypeOf ItemParameter Is TextBoxOnOffParam Then + bIsActive = DirectCast(ItemParameter, TextBoxOnOffParam).IsActive + sValue = DirectCast(ItemParameter, TextBoxOnOffParam).m_Value + ElseIf TypeOf ItemParameter Is ComboBoxOnOffParam Then + bIsActive = DirectCast(ItemParameter, ComboBoxOnOffParam).IsActive + sValue = DirectCast(ItemParameter, ComboBoxOnOffParam).m_SelItem + ElseIf TypeOf ItemParameter Is TextBoxParam Then + sValue = DirectCast(ItemParameter, TextBoxParam).m_Value + ElseIf TypeOf ItemParameter Is ComboBoxParam Then + sValue = DirectCast(ItemParameter, ComboBoxParam).m_SelItem + End If + If bIsActive Then + ReportDoor.HardwareList(ReportDoor.HardwareList.Count - 1).Hardware_ParametersList.Add(New ReportParameter(ItemParameter.Name, sValue)) + End If + Next + End If + + Dim ReportompoItem As New ReportCompo(ItemCompo.CompoType.Name, ItemCompo.SelBrandPart, ItemCompo.SelFile) + For Each ItemParameter In ItemCompo.CompoParamList + Dim sValue As String = String.Empty + Dim bIsActive As Boolean = True + If TypeOf ItemParameter Is TextBoxOnOffParam Then + bIsActive = DirectCast(ItemParameter, TextBoxOnOffParam).IsActive + sValue = DirectCast(ItemParameter, TextBoxOnOffParam).m_Value + ElseIf TypeOf ItemParameter Is ComboBoxOnOffParam Then + bIsActive = DirectCast(ItemParameter, ComboBoxOnOffParam).IsActive + sValue = DirectCast(ItemParameter, ComboBoxOnOffParam).m_SelItem + ElseIf TypeOf ItemParameter Is TextBoxParam Then + sValue = DirectCast(ItemParameter, TextBoxParam).m_Value + ElseIf TypeOf ItemParameter Is ComboBoxParam Then + sValue = DirectCast(ItemParameter, ComboBoxParam).m_SelItem + End If + If bIsActive Then + ReportompoItem.CompoParameterList.Add(New ReportParameter(ItemParameter.Name, sValue)) + End If + Next + ReportList.Add(ReportompoItem) + Next + End Sub + #End Region ' Funzioni per la scrittura delle componenti ' calcola il secure da salvare e il tipo di bevel @@ -1200,7 +1393,6 @@ Friend Module DdfFile End If End Function - #End Region ' Scrittura DDF #Region "SCRITTURA ASSEMBLATO" diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 4be854e..28377ff 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -671,6 +671,32 @@ Public Class Part #End Region ' Edge +#Region "RESIZE" + + Private m_ResizeLockHinge As Boolean + Public Property ResizeLockHinge As Boolean + Get + Return m_ResizeLockHinge + End Get + Set(value As Boolean) + m_ResizeLockHinge = value + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True + End Set + End Property + + Private m_ResizeTopBottom As Boolean + Public Property ResizeTopBottom As Boolean + Get + Return m_ResizeTopBottom + End Get + Set(value As Boolean) + m_ResizeTopBottom = value + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True + End Set + End Property + +#End Region ' Resize + #Region "MACHINING" Private m_TopMachining As Boolean @@ -815,6 +841,98 @@ Public Class Part #End Region ' OverMaterial +#Region "CUT" + + Private m_CutIsChecked As Boolean = False + Public Property CutIsChecked As Boolean + Get + Return m_CutIsChecked + End Get + Set(value As Boolean) + m_CutIsChecked = value + ' Gestione dell'aggiunta della componente + Map.refSceneManagerVM.RefreshBtn() + End Set + End Property + + Private m_PosCut As String = "0" + Public Property PosCut As String + Get + Return m_PosCut + End Get + Set(value As String) + m_PosCut = value + NotifyPropertyChanged("PosCut") + NotifyPropertyChanged("ToolTipEvaluatedPosCut") + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True + End Set + End Property + Public ReadOnly Property ToolTipEvaluatedPosCut As String + Get + Dim dVal As Double + If StringToDouble(m_PosCut, dVal) Then + Return DoubleToString(dVal, 4) + Else + Return EgtMsg(50143) + End If + End Get + End Property + + Private m_CutDirectionList As New List(Of String) From {"Horizontal", "Vertical"} + Public ReadOnly Property CutDirectionList As List (of String) + Get + Return m_CutDirectionList + End Get + End Property + Private m_SelectedDirection As String = m_CutDirectionList(0) + Public Property SelectedDirection As String + Get + Return m_SelectedDirection + End Get + Set(value As String) + m_SelectedDirection = value + End Set + End Property + +#End Region ' Cut + + Private m_TopShapeIsChecked As Boolean = False + Public Property TopShapeIsChecked As Boolean + Get + Return m_TopShapeIsChecked + End Get + Set(value As Boolean) + m_TopShapeIsChecked = value + Map.refSceneManagerVM.RefreshBtn() + End Set + End Property + + Private Property m_TopShapeList As New List(Of TopShape) From {New TopShape(EgtMsg(50707)), New TopShape(EgtMsg(50708))} + Public ReadOnly Property TopShapeList As List(Of TopShape) + Get + Return m_TopShapeList + End Get + End Property + + Private m_SelectedShape As TopShape = m_TopShapeList(0) + Public Property SelectedShape As TopShape + Get + Return m_SelectedShape + End Get + Set(value As TopShape) + m_SelectedShape = value + If value.Name.Trim() = m_TopShapeList(0).Name.Trim then + TopArcIsChecked = True + TopAngleIsChecked = False + ElseIf value.Name.Trim() = m_TopShapeList(1).Name.Trim then + TopAngleIsChecked = True + TopArcIsChecked = False + End If + NotifyPropertyChanged("VisibilityTopArch") + NotifyPropertyChanged("VisibilityTopAngle") + End Set + End Property + #Region "TOP ARC" Private m_Radius As String = "W" @@ -863,7 +981,7 @@ Public Class Part End Get End Property - Private m_TopArcIsChecked As Boolean + Private m_TopArcIsChecked As Boolean = True Public Property TopArcIsChecked As Boolean Get Return m_TopArcIsChecked @@ -880,6 +998,18 @@ Public Class Part End Set End Property + Private m_VisibilityTopArch As Visibility = Visibility.Visible + Public ReadOnly Property VisibilityTopArch As Visibility + Get + If m_TopArcIsChecked then + m_VisibilityTopArch = Visibility.Visible + Else + m_VisibilityTopArch = Visibility.Hidden + End If + Return m_VisibilityTopArch + End Get + End Property + #End Region ' Top Arc #Region "TOP ANGLE" @@ -947,6 +1077,18 @@ Public Class Part End Set End Property + Private m_VisibilityTopAngle As Visibility = Visibility.Hidden + Public ReadOnly Property VisibilityTopAngle As Visibility + Get + If m_TopAngleIsChecked then + m_VisibilityTopAngle = Visibility.Visible + Else + m_VisibilityTopAngle = Visibility.Hidden + End If + Return m_VisibilityTopAngle + End Get + End Property + #End Region ' Top Angle #End Region ' General @@ -2237,11 +2379,13 @@ Public Class Part m_Radius = Radius m_Posx = Posx TopArcIsChecked = True + TopShapeIsChecked = True End If End If End If - If Not m_TopArcIsChecked then + ' If Not m_TopArcIsChecked then + If Not m_TopShapeIsChecked then Dim PosxAngle As String = GetValueWithKey(sLine, ConstCompo.K_POSX) If Not String.IsNullOrEmpty(PosxAngle) Then Index = NextIndex(Index) @@ -2258,6 +2402,8 @@ Public Class Part m_Angle = Angle m_PosxAngle = PosxAngle TopAngleIsChecked = True + SelectedShape = m_TopShapeList(1) + TopShapeIsChecked = True End If End If End If diff --git a/DoorParameters/PartPageV.xaml b/DoorParameters/PartPageV.xaml index 1a4e71e..f5ed263 100644 --- a/DoorParameters/PartPageV.xaml +++ b/DoorParameters/PartPageV.xaml @@ -55,6 +55,7 @@ + @@ -68,13 +69,16 @@ - - + + - @@ -137,7 +141,7 @@ ItemsSource="{Binding CurrPart.LockEdgeTypeList}" SelectedItem="{Binding CurrPart.LockEdgeType}" Style="{StaticResource DoorEdgeParamsCmBx}" - Margin="0.4,2,40,4" + Margin="0.4,2,30,4" IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/> @@ -160,7 +164,7 @@ ItemsSource="{Binding CurrPart.TopEdgeTypeList}" SelectedItem="{Binding CurrPart.TopType}" Style="{StaticResource DoorEdgeParamsCmBx}" - Margin="0.4,2,40,4" + Margin="0.4,2,30,4" IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/> + + + - - - - - - - - - - - + @@ -274,13 +291,92 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DoorParameters/PartPageVM.vb b/DoorParameters/PartPageVM.vb index 7d643f7..7fa6f32 100644 --- a/DoorParameters/PartPageVM.vb +++ b/DoorParameters/PartPageVM.vb @@ -72,6 +72,12 @@ Public Class PartPageVM Return EgtMsg(50711) End Get End Property + Public ReadOnly Property ResizeMsg As String + Get + '50311=Resize + Return EgtMsg(50311) + End Get + End Property Public ReadOnly Property EdgeMsg As String Get Return EgtMsg(50044) @@ -199,6 +205,22 @@ Public Class PartPageVM Return EgtMsg(50710) End Get End Property + + Public ReadOnly Property CutMsg As String + Get + Return "Cut" + End Get + End Property + Public ReadOnly Property PosCutMsg As String + Get + Return "Pos." + End Get + End Property + Public ReadOnly Property OrientationMsg As String + Get + Return "Dir." + End Get + End Property Public ReadOnly Property DeleteCompoToolTip As String Get @@ -208,6 +230,17 @@ Public Class PartPageVM #End Region + Private m_IsResize As Boolean + Public Property IsResize As Boolean + Get + Return m_IsResize + End Get + Set(value As Boolean) + m_IsResize = value + NotifyPropertyChanged("IsResize") + End Set + End Property + Private m_IsReadOnly As Boolean Public Property IsRaedOnly As Boolean Get diff --git a/DoorParameters/PropertyItem.vb b/DoorParameters/PropertyItem.vb index 25a0efc..64dfdd7 100644 --- a/DoorParameters/PropertyItem.vb +++ b/DoorParameters/PropertyItem.vb @@ -102,4 +102,43 @@ Public Class MaterialType RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub +End Class + +Public Class TopShape + 'Inherits VMBase + Implements INotifyPropertyChanged + + ' nome caricato dalla lista dei messaggi + Private m_Name As String + Public Property Name As String + Get + Return m_Name + End Get + Set(value As String) + m_Name = value + End Set + End Property + + ' nome caricato dalla configurazione + Private m_NameDDF As String + Public Property NameDDF As String + Get + Return m_NameDDF + End Get + Set(value As String) + m_NameDDF = value + End Set + End Property + + Sub New(sGraphicName As String) + m_Name = sGraphicName + m_NameDDF = sGraphicName + End Sub + + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged + + Public Sub NotifyPropertyChanged(propName As String) + RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) + End Sub + End Class \ No newline at end of file diff --git a/EgtDOORCreator.vbproj b/EgtDOORCreator.vbproj index e6024c0..6fc255d 100644 --- a/EgtDOORCreator.vbproj +++ b/EgtDOORCreator.vbproj @@ -11,7 +11,8 @@ EgtDOORCreator v4.0 Custom - Client + + false publish\ true @@ -76,18 +77,27 @@ My Project\app.manifest + + False + ..\..\EgtProg\EgtDOORCreator\combit.ListLabel25.dll + + + ..\..\EgtProg\EgtDOORCreator\combit.ListLabel25.Wpf.dll + ..\..\EgtProg\DllD32\EgtUILib.dll - + False - ..\..\EgtProg\DllD32\EgtWPFLib5.dll + ..\..\EgtProg\EgtDOORCreator\EgtWPFLib5.dll ..\..\EgtProg\EgtDOORCreator\Ionic.Zip.dll + + @@ -213,6 +223,7 @@ + DimensioningPanelV.xaml @@ -601,6 +612,7 @@ + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtDOORCreator\EgtDOORCreatorR32.exe diff --git a/IniFile.vb b/IniFile.vb index bb034b6..d600c56 100644 --- a/IniFile.vb +++ b/IniFile.vb @@ -48,6 +48,10 @@ Friend Module IniFile Friend m_DDFFilePath As String = String.Empty ' Path Doors directory Friend m_sDoorsDirPath As String = String.Empty + ' Path del direttorio List&Label corrente + Friend m_sListLabelDir As String = String.Empty + ' Path del modello ListLabel + Friend m_sListLabelCurrent As String = String.Empty ' EgtDoorCreator.ini Public Function GetPrivateProfileLanguage(ByVal lpAppName As String, ByVal lpKeyName As String) As Language diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index bf9ee39..9bf57a0 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/My Project/Resources.Designer.vb b/My Project/Resources.Designer.vb index ca76024..55a1a0e 100644 --- a/My Project/Resources.Designer.vb +++ b/My Project/Resources.Designer.vb @@ -1,10 +1,10 @@ '------------------------------------------------------------------------------ ' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 +' Il codice è stato generato da uno strumento. +' Versione runtime:4.0.30319.42000 ' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. +' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se +' il codice viene rigenerato. ' '------------------------------------------------------------------------------ @@ -15,14 +15,14 @@ Imports System Namespace My.Resources - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. + 'Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder. + 'tramite uno strumento quale ResGen o Visual Studio. + 'Per aggiungere o rimuovere un membro, modificare il file con estensione ResX ed eseguire nuovamente ResGen + 'con l'opzione /str oppure ricompilare il progetto VS. ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via. ''' - _ @@ -33,7 +33,7 @@ Namespace My.Resources Private resourceCulture As Global.System.Globalization.CultureInfo ''' - ''' Returns the cached ResourceManager instance used by this class. + ''' Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe. ''' _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager @@ -47,8 +47,8 @@ Namespace My.Resources End Property ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. + ''' Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte le + ''' ricerche di risorse eseguite utilizzando questa classe di risorse fortemente tipizzata. ''' _ Friend Property Culture() As Global.System.Globalization.CultureInfo diff --git a/My Project/Settings.Designer.vb b/My Project/Settings.Designer.vb index 5ff2570..f5d385b 100644 --- a/My Project/Settings.Designer.vb +++ b/My Project/Settings.Designer.vb @@ -1,10 +1,10 @@ '------------------------------------------------------------------------------ ' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 +' Il codice è stato generato da uno strumento. +' Versione runtime:4.0.30319.42000 ' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. +' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se +' il codice viene rigenerato. ' '------------------------------------------------------------------------------ @@ -14,21 +14,21 @@ Option Explicit On _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) -#Region "My.Settings Auto-Save Functionality" +#Region "Funzionalità di salvataggio automatico My.Settings" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 3c5aea3..7c04582 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -37,6 +37,8 @@ Friend Module OptionModule Friend m_MaterialList As New ObservableCollection(Of MaterialType) Friend m_CurrMaterial As MaterialType + Friend m_VisibilityBtnDesign As Visibility = Visibility.Collapsed + Friend Enum LauncherOpt As Integer Open_window = 0 Open_last_project = 1 @@ -234,6 +236,22 @@ Friend Module OptionModule EgtOutLog(String.Format(EgtMsg(50180), sMachinDir)) End If + Dim sListLabelDir As String = String.Empty + If GetMainPrivateProfileString(S_LISTLABEL, K_LISTLABELDIR, "", sListLabelDir) > 0 AndAlso Directory.Exists(sListLabelDir) Then + IniFile.m_sListLabelDir = sListLabelDir + Else + ' mantengo l'accesso a quello di default + EgtOutLog(String.Format(EgtMsg(50180), sListLabelDir)) + End If + + Dim sListLabelFile As String = String.Empty + If GetMainPrivateProfileString(S_LISTLABEL, K_LISTLABELFILE, "", sListLabelFile) > 0 AndAlso File.Exists(sListLabelFile) Then + IniFile.m_sListLabelCurrent = sListLabelFile + Else + ' mantengo l'accesso a quello di default + EgtOutLog(String.Format(EgtMsg(50180), sListLabelFile)) + End If + Dim nHelpSelct As Integer = 0 Select Case GetMainPrivateProfileInt(S_GENERAL, K_SMARTHELP, 1) Case 0 @@ -261,6 +279,8 @@ Friend Module OptionModule m_DeleteProject = If(GetMainPrivateProfileInt(S_GENERAL, K_DELETEPROJECT, 0) = 1, True, False) + m_VisibilityBtnDesign = If(GetMainPrivateProfileInt(S_GENERAL, K_ENABLEBTNDESING, 0) = 1, Visibility.Visible, Visibility.Hidden) + ' leggo il tipo di Bevel selezionato DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELU_INI, m_bBevelUp) DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELD_INI, m_bBevelDown) diff --git a/Print/PrintWndV.xaml b/Print/PrintWndV.xaml index aa65265..13c1fee 100644 --- a/Print/PrintWndV.xaml +++ b/Print/PrintWndV.xaml @@ -1,38 +1,45 @@  - + + - + + -