From 0bc3faa4bf804acd8c1923cfdba107a6c25c6278 Mon Sep 17 00:00:00 2001 From: Renzo Lanza Date: Fri, 12 Jun 2020 15:43:23 +0000 Subject: [PATCH] EgtCAM5 2.2f4 : - Spostamento Parametri e metodi lettura/scrittura delle Operazioni in EgtWPFLib5 - Creazione diverse "paginette" per ciascun tipo di Operazione --- Constants/ConstMsg.vb | 1 + EgtCAM5.vbproj | 91 + My Project/AssemblyInfo.vb | 4 +- .../BeamMillingParameterExpanderV.xaml | 322 ++ .../BeamMillingParameterExpanderV.xaml.vb | 83 + .../ChiselingParameterExpanderV.xaml | 232 ++ .../ChiselingParameterExpanderV.xaml.vb | 83 + .../MachiningParameterExpanderV.xaml | 502 +-- .../MachiningParameterExpanderV.xaml.vb | 138 +- .../MachiningParameterExpanderVM.vb | 2681 +---------------- .../MortisingParameterExpanderV.xaml | 252 ++ .../MortisingParameterExpanderV.xaml.vb | 83 + .../PocketingParameterExpanderV.xaml | 272 ++ .../PocketingParameterExpanderV.xaml.vb | 83 + .../StoneDrillingParameterExpanderV.xaml | 181 ++ .../StoneDrillingParameterExpanderV.xaml.vb | 83 + .../StoneMillingParameterExpanderV.xaml | 185 ++ .../StoneMillingParameterExpanderV.xaml.vb | 83 + .../StoneSawFinishingParameterExpanderV.xaml | 226 ++ ...toneSawFinishingParameterExpanderV.xaml.vb | 83 + .../StoneSawRoughingParameterExpanderV.xaml | 216 ++ ...StoneSawRoughingParameterExpanderV.xaml.vb | 83 + .../StoneSawingParameterExpanderV.xaml | 250 ++ .../StoneSawingParameterExpanderV.xaml.vb | 83 + .../WaterjettingParameterExpanderV.xaml | 295 ++ .../WaterjettingParameterExpanderV.xaml.vb | 83 + .../WoodDrillingParameterExpanderV.xaml | 213 ++ .../WoodDrillingParameterExpanderV.xaml.vb | 83 + .../WoodMillingParameterExpanderV.xaml | 402 +++ .../WoodMillingParameterExpanderV.xaml.vb | 83 + .../WoodSawingParameterExpanderV.xaml | 290 ++ .../WoodSawingParameterExpanderV.xaml.vb | 83 + .../OperationExpander/OperationExpanderVM.vb | 40 +- Utility/Dictionary.xaml | 97 + Utility/Utility.vb | 16 + 35 files changed, 4884 insertions(+), 3101 deletions(-) create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MortisingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MortisingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/PocketingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/PocketingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneDrillingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneDrillingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneMillingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneMillingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneSawFinishingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneSawFinishingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneSawRoughingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneSawRoughingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneSawingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/StoneSawingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/WaterjettingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/WaterjettingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/WoodDrillingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/WoodDrillingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/WoodMillingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/WoodMillingParameterExpanderV.xaml.vb create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/WoodSawingParameterExpanderV.xaml create mode 100644 OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/WoodSawingParameterExpanderV.xaml.vb diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb index ccfdf11..c8c9761 100644 --- a/Constants/ConstMsg.vb +++ b/Constants/ConstMsg.vb @@ -14,6 +14,7 @@ Public Const MSG_TOOLSDBPAGE As Integer = MSG_EGTCAM5 + 1000 Public Const MSG_TOOLSERRORS As Integer = MSG_EGTCAM5 + 1100 Public Const MSG_MACHININGSDBPAGE As Integer = MSG_EGTCAM5 + 1200 + Public Const MSG_MACHININGDB As Integer = MSG_EGTWPFLIB5 + 1200 Public Const MSG_MACHININGSERRORS As Integer = MSG_EGTCAM5 + 1370 Public Const MSG_MACHININGOPTIONPAGE As Integer = MSG_EGTCAM5 + 1400 Public Const MSG_SETUP As Integer = MSG_EGTCAM5 + 1450 diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj index f4c49c0..10796fd 100644 --- a/EgtCAM5.vbproj +++ b/EgtCAM5.vbproj @@ -155,6 +155,45 @@ CurrSetUpV.xaml + + StoneMillingParameterExpanderV.xaml + + + ChiselingParameterExpanderV.xaml + + + StoneSawRoughingParameterExpanderV.xaml + + + StoneSawFinishingParameterExpanderV.xaml + + + StoneDrillingParameterExpanderV.xaml + + + WoodDrillingParameterExpanderV.xaml + + + PocketingParameterExpanderV.xaml + + + MortisingParameterExpanderV.xaml + + + BeamMillingParameterExpanderV.xaml + + + WaterjettingParameterExpanderV.xaml + + + WoodMillingParameterExpanderV.xaml + + + WoodSawingParameterExpanderV.xaml + + + StoneSawingParameterExpanderV.xaml + MachineBox.xaml @@ -374,6 +413,58 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 6120414..b55fcf3 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml new file mode 100644 index 0000000..b27474c --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml @@ -0,0 +1,322 @@ + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml.vb new file mode 100644 index 0000000..bab97ca --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml.vb @@ -0,0 +1,83 @@ +Imports EgtWPFLib5 +Imports EgtWPFLib5.EgtFloating + +Public Class BeamMillingParameterExpanderV + + Private EgtFloatingTray As EgtFloatingTray + Private EgtFloatingPanel As EgtFloatingPanel + + Private m_bFirst As Boolean = True + + Private Sub OperationExpanderView_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded + If m_bFirst Then + EgtFloatingTray = FindAncestor(Of EgtFloatingTray)(Me) + EgtFloatingPanel = FindAncestor(Of EgtFloatingPanel)(Me) + AddHandler EgtFloatingTray.SizeChanged, AddressOf EgtFloatingTray_SizeChanged + PanelHeight = EgtFloatingPanel.ActualHeight + Me.AutomaticCloseExpanderStackPanelHeight = AutomaticCloseExpanderStackPanel.ActualHeight + m_bFirst = False + End If + CalculateOperationParametersStackPanelMaxHeight() + End Sub + + Dim m_bSizeChanging As Boolean = False + + Private Sub EgtFloatingTray_SizeChanged(sender As Object, e As System.Windows.SizeChangedEventArgs) + If m_bSizeChanging Then Return + m_bSizeChanging = True + CalculateOperationParametersStackPanelMaxHeight() + m_bSizeChanging = False + End Sub + + Dim PanelHeight As Double = 0 + Dim AutomaticCloseExpanderStackPanelHeight As Double = 0 + + Private Sub CalculateOperationParametersStackPanelMaxHeight() + Dim AutomaticCloseExpanderStackPanelHeight As Double = 0 + Dim OpenedExpanderList As New List(Of Boolean) + For Index = 0 To AutomaticCloseExpanderStackPanel.Children.Count - 1 + If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then + Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander) + If IndexedExpander.IsExpanded Then + OpenedExpanderList.Add(True) + IndexedExpander.IsExpanded = False + Dim CurrExpanderContent As FrameworkElement = DirectCast(IndexedExpander.Content, FrameworkElement) + CurrExpanderContent.Measure(New Size(Double.PositiveInfinity, Double.PositiveInfinity)) + AutomaticCloseExpanderStackPanelHeight -= CurrExpanderContent.DesiredSize.Height + ' Sottraggo anche i padding + AutomaticCloseExpanderStackPanelHeight -= (IndexedExpander.Padding.Top + IndexedExpander.Padding.Bottom) + Else + OpenedExpanderList.Add(False) + End If + Else + OpenedExpanderList.Add(False) + End If + Next + Dim RemainingHeight As Double = EgtFloatingTray.ActualHeight - PanelHeight + AutomaticCloseExpanderStackPanel.MaxHeight = Me.AutomaticCloseExpanderStackPanelHeight + RemainingHeight + For Index = AutomaticCloseExpanderStackPanel.Children.Count - 1 To 0 Step -1 + If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then + Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander) + If OpenedExpanderList(Index) Then + IndexedExpander.IsExpanded = True + End If + End If + Next + End Sub + + ' Funzione che permette di trovare il primo contenitore di tipo T di un elemento grafico dependencyObject + Public Function FindAncestor(Of T As Class)(dependencyObject As DependencyObject) As T + Dim target As DependencyObject = dependencyObject + Do + target = LogicalTreeHelper.GetParent(target) + Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T) + If IsNothing(target) Then + target = dependencyObject + Do + target = VisualTreeHelper.GetParent(target) + Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T) + End If + Return TryCast(target, T) + End Function + +End Class diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml new file mode 100644 index 0000000..f627324 --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml @@ -0,0 +1,232 @@ + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml.vb new file mode 100644 index 0000000..a89818a --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml.vb @@ -0,0 +1,83 @@ +Imports EgtWPFLib5 +Imports EgtWPFLib5.EgtFloating + +Public Class ChiselingParameterExpanderV + + Private EgtFloatingTray As EgtFloatingTray + Private EgtFloatingPanel As EgtFloatingPanel + + Private m_bFirst As Boolean = True + + Private Sub OperationExpanderView_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded + If m_bFirst Then + EgtFloatingTray = FindAncestor(Of EgtFloatingTray)(Me) + EgtFloatingPanel = FindAncestor(Of EgtFloatingPanel)(Me) + AddHandler EgtFloatingTray.SizeChanged, AddressOf EgtFloatingTray_SizeChanged + PanelHeight = EgtFloatingPanel.ActualHeight + Me.AutomaticCloseExpanderStackPanelHeight = AutomaticCloseExpanderStackPanel.ActualHeight + m_bFirst = False + End If + CalculateOperationParametersStackPanelMaxHeight() + End Sub + + Dim m_bSizeChanging As Boolean = False + + Private Sub EgtFloatingTray_SizeChanged(sender As Object, e As System.Windows.SizeChangedEventArgs) + If m_bSizeChanging Then Return + m_bSizeChanging = True + CalculateOperationParametersStackPanelMaxHeight() + m_bSizeChanging = False + End Sub + + Dim PanelHeight As Double = 0 + Dim AutomaticCloseExpanderStackPanelHeight As Double = 0 + + Private Sub CalculateOperationParametersStackPanelMaxHeight() + Dim AutomaticCloseExpanderStackPanelHeight As Double = 0 + Dim OpenedExpanderList As New List(Of Boolean) + For Index = 0 To AutomaticCloseExpanderStackPanel.Children.Count - 1 + If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then + Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander) + If IndexedExpander.IsExpanded Then + OpenedExpanderList.Add(True) + IndexedExpander.IsExpanded = False + Dim CurrExpanderContent As FrameworkElement = DirectCast(IndexedExpander.Content, FrameworkElement) + CurrExpanderContent.Measure(New Size(Double.PositiveInfinity, Double.PositiveInfinity)) + AutomaticCloseExpanderStackPanelHeight -= CurrExpanderContent.DesiredSize.Height + ' Sottraggo anche i padding + AutomaticCloseExpanderStackPanelHeight -= (IndexedExpander.Padding.Top + IndexedExpander.Padding.Bottom) + Else + OpenedExpanderList.Add(False) + End If + Else + OpenedExpanderList.Add(False) + End If + Next + Dim RemainingHeight As Double = EgtFloatingTray.ActualHeight - PanelHeight + AutomaticCloseExpanderStackPanel.MaxHeight = Me.AutomaticCloseExpanderStackPanelHeight + RemainingHeight + For Index = AutomaticCloseExpanderStackPanel.Children.Count - 1 To 0 Step -1 + If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then + Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander) + If OpenedExpanderList(Index) Then + IndexedExpander.IsExpanded = True + End If + End If + Next + End Sub + + ' Funzione che permette di trovare il primo contenitore di tipo T di un elemento grafico dependencyObject + Public Function FindAncestor(Of T As Class)(dependencyObject As DependencyObject) As T + Dim target As DependencyObject = dependencyObject + Do + target = LogicalTreeHelper.GetParent(target) + Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T) + If IsNothing(target) Then + target = dependencyObject + Do + target = VisualTreeHelper.GetParent(target) + Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T) + End If + Return TryCast(target, T) + End Function + +End Class diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderV.xaml index b027228..61333e7 100644 --- a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderV.xaml +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderV.xaml @@ -75,490 +75,24 @@ 63 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - +