From f7bcdff766def911d0ec31b782b2d6b73c00c2eb Mon Sep 17 00:00:00 2001 From: NicolaP Date: Wed, 14 Dec 2022 12:04:24 +0100 Subject: [PATCH] Correzione fresatura in SPIANATURA --- DirectCuts/FlatteningCut.xaml.vb | 3 ++- Utility/Utility.vb | 36 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/DirectCuts/FlatteningCut.xaml.vb b/DirectCuts/FlatteningCut.xaml.vb index 187d27d..63fa4a2 100644 --- a/DirectCuts/FlatteningCut.xaml.vb +++ b/DirectCuts/FlatteningCut.xaml.vb @@ -623,7 +623,8 @@ Public Class FlatteningCut EgtTdbGetCurrToolParam(MCH_TP.THICK, dFootPrint) ElseIf Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrMilling) Then Dim sCurrMill = m_MainWindow.m_CurrentMachine.sCurrMill - GetDrillFromDrilling(sCurrMill, m_MainWindow.m_CurrentMachine.sCurrMilling) + 'GetDrillFromDrilling(sCurrMill, m_MainWindow.m_CurrentMachine.sCurrMilling) + GetMillFromMilling(sCurrMill, m_MainWindow.m_CurrentMachine.sCurrMilling) ' recupero informazioni della fresa in uso EgtTdbSetCurrTool(sCurrMill) EgtTdbGetCurrToolParam(MCH_TP.DIAM, dFootPrint) diff --git a/Utility/Utility.vb b/Utility/Utility.vb index 71d0e3f..f8ac4ab 100644 --- a/Utility/Utility.vb +++ b/Utility/Utility.vb @@ -373,4 +373,40 @@ Module Utility End If End Sub + Public Sub GetMillFromMilling(ByRef sCurrMill As String, ByVal sCurrMilling As String) + If String.IsNullOrEmpty(sCurrMill) Or String.IsNullOrWhiteSpace(sCurrMill) Then + ' creo l'elenco degli utensili di foratura + Dim sToolName As String = String.Empty + Dim nType As Integer = MCH_TY.NONE + Dim MillToolList As New ObservableCollection(Of String) + MillToolList.Clear() + If EgtTdbGetFirstTool(MCH_TF.MILL, sToolName, nType) Then + MillToolList.Add(sToolName) + While EgtTdbGetNextTool(MCH_TF.MILL, sToolName, nType) + MillToolList.Add(sToolName) + End While + End If + ' recupero l'utensile associato alla lavorazione + 'Dim sCurrDrilling As String = m_MainWindow.m_CurrentMachine.sCurrDrilling + Dim ToolString As String = String.Empty + EgtMdbSetCurrMachining(sCurrMilling) + ' Recupero nome utensile tramite TUUID + Dim sTuuid As String = String.Empty + EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid) + EgtTdbGetToolFromUUID(sTuuid, ToolString) + Dim bToolExist As Boolean = False + For Each CurrTool As IEnumerable In MillToolList + If CurrTool.ToString() = ToolString Then + bToolExist = True + Exit For + End If + Next + If bToolExist Then + sCurrMill = ToolString + Else + sCurrMill = String.Empty + End If + End If + End Sub + End Module