From 4a0a398e9fe9e5d8db2957dc3ef90cf1c8e254bb Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 4 Mar 2025 15:30:25 +0100 Subject: [PATCH] -funzione per la visualizzazione delle lavorazioni --- CadCuts/SplitPageUC.xaml | 85 +++++++++++++++++++++++-------------- CadCuts/SplitPageUC.xaml.vb | 57 ++++++++++++++++++++++--- 2 files changed, 105 insertions(+), 37 deletions(-) diff --git a/CadCuts/SplitPageUC.xaml b/CadCuts/SplitPageUC.xaml index c8a109a..ec51f41 100644 --- a/CadCuts/SplitPageUC.xaml +++ b/CadCuts/SplitPageUC.xaml @@ -1,10 +1,10 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + mc:Ignorable="d" + d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="SplitPageUC_Initialized"> @@ -64,24 +64,45 @@ + SelectionMode="Extended"> - - - - - + + + + + + + + + + + + + + + + @@ -100,14 +121,14 @@ - - + + - + @@ -138,7 +159,7 @@ - + @@ -152,17 +173,17 @@ - + - + - + diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index 40eec69..3b87445 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -206,24 +206,34 @@ Public Class SplitPageUC sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°" End If If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING)) + Dim sSawing As String = String.Empty, sSaw As String = String.Empty + GetCurrSawingandSaw(Mach.m_nId, sSawing, sSaw) + ' Verifico che sia montata su un portautensile + EgtTdbSetCurrTool(sSaw) + Dim sTCPos As String = String.Empty + EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos) + If String.IsNullOrEmpty(sTCPos) Then + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING)) + Else + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING, sTCPos)) + End If ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura Dim sText As String = EgtMsg(90792) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING)) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING, "Pippo")) ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura Dim sText As String = EgtMsg(90793) & " " & i.ToString() If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText) If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING)) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING, "Pippo")) ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura Dim sText As String = EgtMsg(90796) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING)) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING, "Pippo")) ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet Dim sText As String = EgtMsg(90797) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING)) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING, "Pippo")) End If Next End Sub @@ -653,6 +663,20 @@ Public Class SplitPageUC End If End Sub + Public Sub GetCurrSawingandSaw(ByVal nMchId As Integer, ByRef sSawing As String, ByRef sNameTool As String) + Dim EntId As Integer = GDB_ID.NULL + Dim SubEntId As Integer = GDB_ID.NULL + EgtSetCurrMachining(nMchId) + If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return + ' Eventualmente recupero il nome della lavorazione + EgtGetInfo(EntId, "Def_Machining", sSawing) + If String.IsNullOrEmpty(sSawing) Then sSawing = m_MainWindow.m_CurrentMachine.sCurrSawing + ' Imposto la lavorazione corrente + EgtMdbSetCurrMachining(sSawing) + ' Recupero il nome dell'utensile della lavorazione + EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sNameTool) + End Sub + ' Dato l'id della lavorazione nel grezzo colora il taglio del colore assegnato Public Sub ColorsCut(nOperId As Integer, EgtCol As Color3d) ' Recupero la lavorazione @@ -2751,6 +2775,8 @@ Public Class SplitPageUC Private m_sName As String Private m_bIsActive As Boolean Private m_nType As Integer + ' Posizione porta utensile (parametro non obbligatorio) + Private m_sTCPos As String = "" Private m_IsSelected As Boolean @@ -2775,6 +2801,19 @@ Public Class SplitPageUC End Set End Property + '!!!!!!!!!!!!!!!!!!!! + Public Property TCPos As String + Get + Return m_sTCPos + End Get + Set(value As String) + If value <> m_sTCPos Then + m_sTCPos = value + NotifyPropertyChanged("TCPos") + End If + End Set + End Property + Public Property bIsActive As Boolean Get Return m_bIsActive @@ -2812,6 +2851,14 @@ Public Class SplitPageUC Me.m_nType = nType End Sub + Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer, sTCPos As String) + Me.m_sName = Name + Me.m_nInd = Ind + Me.m_bIsActive = bIsActive + Me.m_nType = nType + Me.m_sTCPos = sTCPos + End Sub + Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub