diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index e4b0c66..f215a72 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -181,6 +181,7 @@ Module ConstIni Public Const K_SELGEOMGENMACHINING As String = "SelGeomGenMachining" Public Const K_SELGEOMCHISELING As String = "SelGeomChiseling" Public Const K_SELGEOMSURFFINISHING As String = "SelGeomSurfFinishing" + Public Const K_SELGEOMFIVEAXMACHINING As String = "SelGeomFiveAxMachining" Public Const K_MACHININGGROUP As String = "MachiningGroup" Public Const K_SHOWONLYTABLE As String = "ShowOnlyTable" Public Const K_MOVETHROUGHDISPS As String = "MoveThroughDisps" diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj index bf2ac46..220d32c 100644 --- a/EgtCAM5.vbproj +++ b/EgtCAM5.vbproj @@ -170,6 +170,9 @@ EstimationsExpanderV.xaml + + FiveAxisMachinigParameterExpanderV.xaml + SurfFinishingParameterExpanderV.xaml @@ -466,6 +469,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderVM.vb b/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderVM.vb index 7d3a894..2dfa088 100644 --- a/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderVM.vb +++ b/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderVM.vb @@ -150,6 +150,8 @@ Public Class MachiningTreeExpanderVM Return EgtMsg(MSG_MACHININGSDBPAGE + 11) Case MCH_MY.WATERJETTING Return EgtMsg(MSG_MACHININGSDBPAGE + 12) + Case MCH_MY.FIVEAXISMILLING + Return EgtMsg(31213) Case Else Return "Mach" End Select diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/FiveAxisMachinigParameterExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/FiveAxisMachinigParameterExpanderV.xaml new file mode 100644 index 0000000..b8fcb2a --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/FiveAxisMachinigParameterExpanderV.xaml @@ -0,0 +1,286 @@ + + + + + + 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/FiveAxisMachinigParameterExpanderV.xaml.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/FiveAxisMachinigParameterExpanderV.xaml.vb new file mode 100644 index 0000000..acaa0fa --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/FiveAxisMachinigParameterExpanderV.xaml.vb @@ -0,0 +1,83 @@ +Imports EgtWPFLib5.EgtFloating + +Public Class FiveAxisMachinigParameterExpanderV + + Private m_RightTrayV As RightTrayV + 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 + m_RightTrayV = FindAncestor(Of RightTrayV)(Me) + EgtFloatingPanel = FindAncestor(Of EgtFloatingPanel)(Me) + AddHandler m_RightTrayV.SizeChanged, AddressOf RightTrayV_SizeChanged + PanelHeight = EgtFloatingPanel.DesiredSize.Height + Me.AutomaticCloseExpanderStackPanelHeight = AutomaticCloseExpanderStackPanel.ActualHeight + m_bFirst = False + End If + CalculateOperationParametersStackPanelMaxHeight() + End Sub + + Dim m_bSizeChanging As Boolean = False + + Private Sub RightTrayV_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 + + ' ricalcola spazio utilizzabile quando modificata dimensione finestra e quindi dimensione della tray + 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 = m_RightTrayV.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/MachiningParameterExpanderVM.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderVM.vb index 1f36d7f..2841fc3 100644 --- a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderVM.vb +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderVM.vb @@ -84,6 +84,7 @@ Public Class MachiningParameterExpanderVM Dim StoneDrillParamExpanderV As StoneDrillingParameterExpanderV Dim SurfFinishParamExpanderV As SurfFinishingParameterExpanderV Dim WjParamExpanderV As WaterjettingParameterExpanderV + Dim FiveAxExpanderV As FiveAxisMachinigParameterExpanderV Private Sub Dummy() @@ -212,6 +213,10 @@ Public Class MachiningParameterExpanderVM If IsNothing(WjParamExpanderV) Then WjParamExpanderV = New WaterjettingParameterExpanderV WjParamExpanderV.DataContext = m_CurrOperation Return WjParamExpanderV + Case MCH_OY.FIVEAXISMILLING + If IsNothing(FiveAxExpanderV) Then FiveAxExpanderV = New FiveAxisMachinigParameterExpanderV + FiveAxExpanderV.DataContext = m_CurrOperation + Return FiveAxExpanderV End Select 'MachiningParameterExpanderItem.ReadOperationParam() @@ -505,6 +510,8 @@ Public Class OperationParamVisibilityConverter Return TMDbParamVisibility.SurfFinishing(CInt(parameter)) Case MCH_OY.WATERJETTING Return TMDbParamVisibility.WaterJetting(CInt(parameter)) + Case MCH_OY.FIVEAXISMILLING + Return TMDbParamVisibility.FiveAxMachining(CInt(parameter)) Case Else Return Visibility.Hidden End Select diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/MachiningOpListBoxItem.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/MachiningOpListBoxItem.vb index 4504b49..05bd66c 100644 --- a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/MachiningOpListBoxItem.vb +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/MachiningOpListBoxItem.vb @@ -170,6 +170,8 @@ Public Class MachiningOpListBoxItem Return "" Case MCH_OY.CHISELING Return "" + Case MCH_OY.FIVEAXISMILLING + Return "" Case Else Return String.Empty End Select diff --git a/OptionPanel/MachiningOptionPanel/OperationParametersExpander/OperationParametersExpanderVM.vb b/OptionPanel/MachiningOptionPanel/OperationParametersExpander/OperationParametersExpanderVM.vb index 64a0bd9..1c35e94 100644 --- a/OptionPanel/MachiningOptionPanel/OperationParametersExpander/OperationParametersExpanderVM.vb +++ b/OptionPanel/MachiningOptionPanel/OperationParametersExpander/OperationParametersExpanderVM.vb @@ -172,6 +172,8 @@ Public Class OperationParametersExpanderVM Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomSurfFinishing Case MCH_OY.WATERJETTING Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomWaterJetting + Case MCH_OY.FIVEAXISMILLING + Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomFiveAxMachinig End Select ' Imposto visualizzazione utensile DirectCast(m_MachiningParameterExpander.DataContext, MachiningParameterExpanderVM).ViewTool = True diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index b047000..47e7aaa 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -54,6 +54,7 @@ Friend Module OptionModule Friend m_SelGeomChiseling As SceneSelModeOpt Friend m_SelGeomSurfFinishing As SceneSelModeOpt Friend m_SelGeomWaterJetting As SceneSelModeOpt + Friend m_SelGeomFiveAxMachinig As SceneSelModeOpt ' Flag per aggiungere una nuova lavorazione alla fine della fase o subito dopo la lavorazione selezionata Friend m_bNewMachiningIsLastOne As Boolean ' Variabile che indica se usare lo script per calcolare automaticamente la disposizione quando si passa in lavorazione @@ -141,6 +142,8 @@ Friend Module OptionModule m_SelGeomChiseling = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt)) Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMSURFFINISHING, -1) m_SelGeomSurfFinishing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt)) + Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMFIVEAXMACHINING, -1) + m_SelGeomFiveAxMachinig = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt)) m_SelGeomWaterJetting = SceneSelModeOpt.PARTCURVES ' Inizializzo variabile che indica posizione nuova operazione di lavorazione m_bNewMachiningIsLastOne = (GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0) diff --git a/Utility/MachineModel.vb b/Utility/MachineModel.vb index ca0631b..a9ae80c 100644 --- a/Utility/MachineModel.vb +++ b/Utility/MachineModel.vb @@ -44,12 +44,12 @@ Public Module MachineModel If IniFile.IsKeyEnabledAdvancedMachining() AndAlso EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SURFFINISHING, 0, m_sCurrMachIniFilePath) <> 0 Then ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SURFFINISHING, .TypeName = EgtMsg(31211)}) End If - If IniFile.IsKeyEnabledAdvancedMachining() AndAlso EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_5AXMACHINING, 0, m_sCurrMachIniFilePath) <> 0 Then - ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY._5AXMACHINING, .TypeName = EgtMsg(31213)}) - End If If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_WATERJETTING, 0, m_sCurrMachIniFilePath) <> 0 Then ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.WATERJETTING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 12)}) End If + If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_5AXMACHINING, 0, m_sCurrMachIniFilePath) <> 0 Then + ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.FIVEAXISMILLING, .TypeName = EgtMsg(31213)}) + End If Return ActiveMachiningsFamiliesList.ToArray End Function @@ -88,12 +88,12 @@ Public Module MachineModel If IniFile.IsKeyEnabledAdvancedMachining() AndAlso EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SURFFINISHING, 0, sMachineName) <> 0 Then ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SURFFINISHING, .TypeName = EgtMsg(31211)}) End If - If IniFile.IsKeyEnabledAdvancedMachining() AndAlso EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_5AXMACHINING, 0, sMachineName) <> 0 Then - ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY._5AXMACHINING, .TypeName = EgtMsg(31213)}) - End If If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_WATERJETTING, 0, sMachineName) <> 0 Then ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.WATERJETTING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 12)}) End If + If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_5AXMACHINING, 0, sMachineName) <> 0 Then + ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.FIVEAXISMILLING, .TypeName = EgtMsg(31213)}) + End If Return ActiveMachiningsFamiliesList.ToArray End Function diff --git a/Utility/TMDbParamVisibility.vb b/Utility/TMDbParamVisibility.vb index b111b81..45f9330 100644 --- a/Utility/TMDbParamVisibility.vb +++ b/Utility/TMDbParamVisibility.vb @@ -27,6 +27,7 @@ Friend Chiseling(63) As Visibility Friend SurfFinishing(63) As Visibility Friend WaterJetting(63) As Visibility + Friend FiveAxMachining(63) As Visibility ' Array che contiene il valore della proprietà visibility per ogni campo delle operazioni Friend OperationDisposition(49) As Visibility @@ -1056,6 +1057,72 @@ OperationDisposition(14) = Visibility.Collapsed OperationDisposition(15) = Visibility.Collapsed + ' Parametri FiveAxMachining + FiveAxMachining(0) = Visibility.Visible ' Invert + FiveAxMachining(1) = Visibility.Collapsed ' LeaveTab + FiveAxMachining(2) = Visibility.Collapsed ' WorkSide + FiveAxMachining(3) = Visibility.Collapsed ' HeadSide + FiveAxMachining(4) = Visibility.Collapsed ' LeadInType + FiveAxMachining(5) = Visibility.Collapsed ' ExtLinkType + FiveAxMachining(6) = Visibility.Collapsed ' LeadOutType + FiveAxMachining(7) = Visibility.Collapsed ' CurveUse + FiveAxMachining(8) = Visibility.Collapsed ' StepType + FiveAxMachining(9) = Visibility.Collapsed ' LeadLinkType + FiveAxMachining(10) = Visibility.Visible ' Speed + FiveAxMachining(11) = Visibility.Visible ' Feed + FiveAxMachining(12) = Visibility.Visible ' StartFeed + FiveAxMachining(13) = Visibility.Visible ' EndFeed + FiveAxMachining(14) = Visibility.Visible ' TipFeed + FiveAxMachining(15) = Visibility.Visible ' OffSr + FiveAxMachining(16) = Visibility.Visible ' OffSl + FiveAxMachining(17) = Visibility.Collapsed ' SideAngle + FiveAxMachining(18) = Visibility.Collapsed ' Approx + FiveAxMachining(19) = Visibility.Visible ' StartPos + FiveAxMachining(20) = Visibility.Collapsed ' StartSlowLen + FiveAxMachining(21) = Visibility.Collapsed ' EndSlowLen + FiveAxMachining(22) = Visibility.Collapsed ' ThroughAddlen + FiveAxMachining(23) = Visibility.Collapsed ' StepPar + FiveAxMachining(24) = Visibility.Collapsed ' Returnpos + FiveAxMachining(25) = Visibility.Collapsed ' TabLen + FiveAxMachining(26) = Visibility.Collapsed ' TabDist + FiveAxMachining(27) = Visibility.Collapsed ' TabHeight + FiveAxMachining(28) = Visibility.Collapsed ' TabAngle + FiveAxMachining(29) = Visibility.Collapsed ' LiTang + FiveAxMachining(30) = Visibility.Collapsed ' LiPerp + FiveAxMachining(31) = Visibility.Collapsed ' LiElev + FiveAxMachining(32) = Visibility.Collapsed ' LiCompLen + FiveAxMachining(33) = Visibility.Collapsed ' LoTang + FiveAxMachining(34) = Visibility.Collapsed ' LoPerp + FiveAxMachining(35) = Visibility.Collapsed ' LoElev + FiveAxMachining(36) = Visibility.Collapsed ' LoCompLen + FiveAxMachining(37) = Visibility.Collapsed ' StartAddLen + FiveAxMachining(38) = Visibility.Collapsed ' EndAddLen + FiveAxMachining(39) = Visibility.Collapsed ' StepExtArc + FiveAxMachining(40) = Visibility.Collapsed ' StepIntArc + FiveAxMachining(41) = Visibility.Collapsed ' SideStep + FiveAxMachining(42) = Visibility.Collapsed ' VertFeed + FiveAxMachining(43) = Visibility.Visible ' Name + FiveAxMachining(44) = Visibility.Visible ' Tool + FiveAxMachining(45) = Visibility.Visible ' DepthStr + FiveAxMachining(46) = Visibility.Visible ' UserNotes + FiveAxMachining(47) = Visibility.Collapsed ' OverLapStr + FiveAxMachining(48) = Visibility.Collapsed ' OffsetStr + FiveAxMachining(49) = Visibility.Visible ' SubType + FiveAxMachining(50) = Visibility.Visible ' SelectedSolChoiceType + FiveAxMachining(51) = Visibility.Visible ' AxRotRef + FiveAxMachining(52) = Visibility.Visible ' BlockedAxesRef + FiveAxMachining(53) = Visibility.Collapsed ' FaceUseType + FiveAxMachining(54) = Visibility.Visible ' InvertToolDir + FiveAxMachining(55) = Visibility.Collapsed ' Expander LeadIn + FiveAxMachining(56) = Visibility.Collapsed ' Expander LeadOut + FiveAxMachining(57) = Visibility.Collapsed ' ApproxGen + FiveAxMachining(58) = Visibility.Collapsed ' OscEnable + FiveAxMachining(59) = Visibility.Collapsed ' OscHeight + FiveAxMachining(60) = Visibility.Collapsed ' OscRampLen + FiveAxMachining(61) = Visibility.Collapsed ' OscFlatLen + FiveAxMachining(62) = Visibility.Collapsed ' TabMax + FiveAxMachining(63) = Visibility.Collapsed ' TabMin + End Sub End Module