From c0e883839453eb86a9988c8ea2c160d821ec7dc3 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 10 Mar 2026 12:37:47 +0100 Subject: [PATCH] OmagCUT : - aggiustamenti per lama manuale con TC+SAW - vari altri aggiustamenti per scelta utensili e lavorazioni. --- CAM/CamAuto.vb | 20 ++++++++++++++------ DirectCuts/ControlsMachineButtonUC.xaml.vb | 3 +-- Machine/SetUpPage.xaml.vb | 7 ++++++- Machine/ToolsDbPageUC.xaml.vb | 7 +++---- RawPhoto/ChooseMachining.xaml.vb | 6 +++--- 5 files changed, 27 insertions(+), 16 deletions(-) diff --git a/CAM/CamAuto.vb b/CAM/CamAuto.vb index 466f9b3..aaca208 100644 --- a/CAM/CamAuto.vb +++ b/CAM/CamAuto.vb @@ -717,6 +717,15 @@ Friend Module CamAuto Return True End Function + Friend Function CanChangeTool() As Boolean + ' Se non è TC anche per lama, sempre possibile + If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then + Return True + End If + ' Altrimenti possibile solo se si può cambiare lama + Return CanChangeSaw() + End Function + Friend Function TestAllMachiningsForStrict() As Boolean Dim bModified As Boolean = False ' Affondamento ridotto @@ -1037,15 +1046,14 @@ Friend Module CamAuto End Function Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean - Dim bCanChangeTool As Boolean = CanChangeSaw() Dim sMaterial As String = m_MainWindow.m_CurrentMachine.CurrMat.sName Dim sSawMch As String = m_MainWindow.m_CurrentMachine.sCurrSawing - Dim sSawTiltedMch As String = If( bCanChangeTool, m_MainWindow.m_CurrentMachine.sCurrSawingTilted, sSawMch) - Dim sMillMch As String = If( bCanChangeTool, m_MainWindow.m_CurrentMachine.sCurrMilling, "") - Dim sDrillMch As String = If( bCanChangeTool, m_MainWindow.m_CurrentMachine.sCurrDrilling, "") - Dim sWaterJetMch As String = If( bCanChangeTool, m_MainWindow.m_CurrentMachine.sCurrWaterJetting, "") + Dim sSawTiltedMch As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted + Dim sMillMch As String = m_MainWindow.m_CurrentMachine.sCurrMilling + Dim sDrillMch As String = m_MainWindow.m_CurrentMachine.sCurrDrilling + Dim sWaterJetMch As String = m_MainWindow.m_CurrentMachine.sCurrWaterJetting Dim sWaterJetQual As String = m_MainWindow.m_CurrentMachine.sCurrWaterJettingQuality - Dim sPocketMch As String = If( bCanChangeTool, m_MainWindow.m_CurrentMachine.sCurrPocketing, "") + Dim sPocketMch As String = m_MainWindow.m_CurrentMachine.sCurrPocketing Dim sDripSawMch As String = If(bDripOk, m_MainWindow.m_CurrentMachine.sCurrDripSawing, "") Dim sDripDrillMch As String = If(bDripOk, m_MainWindow.m_CurrentMachine.sCurrDripDrilling, "") Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile()) diff --git a/DirectCuts/ControlsMachineButtonUC.xaml.vb b/DirectCuts/ControlsMachineButtonUC.xaml.vb index bdb3a09..1f00544 100644 --- a/DirectCuts/ControlsMachineButtonUC.xaml.vb +++ b/DirectCuts/ControlsMachineButtonUC.xaml.vb @@ -581,8 +581,7 @@ Public Class TwoStateButton End If Dim IsPressedShiftKey As Boolean = False - If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 And - GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_MainWindow.GetIniFile()) > 4 Then IsPressedShiftKey = True + If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 AndAlso m_MainWindow.GetDebug() > 4 Then IsPressedShiftKey = True ' procedo all'apertura del file CadCut1 appena generato (solo se generazione corretta) If IsPressedShiftKey Then Try diff --git a/Machine/SetUpPage.xaml.vb b/Machine/SetUpPage.xaml.vb index 98e9d12..81ef3ec 100644 --- a/Machine/SetUpPage.xaml.vb +++ b/Machine/SetUpPage.xaml.vb @@ -728,7 +728,12 @@ Public Class SetUpPage Dim ToolName As String = String.Empty Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType) While bFound - If nType = nTType Then ToolCathegory.Items.Add(New CustomItem(ToolName, nType)) + If nType = nTType Then + ' non aggiungo le Frese di nome "PROBE" + If nTType <> MCH_TY.MILL_STD OrElse ToolName.Trim.ToLower <> "probe" Then + ToolCathegory.Items.Add(New CustomItem(ToolName, nType)) + End If + End If bFound = EgtTdbGetNextTool(nTType, ToolName, nType) End While m_ToolTreeList.Add(ToolCathegory) diff --git a/Machine/ToolsDbPageUC.xaml.vb b/Machine/ToolsDbPageUC.xaml.vb index 1bff02e..1f17c5f 100644 --- a/Machine/ToolsDbPageUC.xaml.vb +++ b/Machine/ToolsDbPageUC.xaml.vb @@ -708,13 +708,12 @@ Public Class ToolsDbPageUC Dim ToolName As String = String.Empty Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType) While bFound - Dim nDebug As Integer = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile) If nType = nTType Then + ' se utensile diverso da MILL If nTType <> MCH_TY.MILL_STD Then - ' se utensile diverso da MILL ToolCathegory.Items.Add(New CustomItem(ToolName, nType)) - ElseIf nTType = MCH_TY.MILL_STD And (ToolName.Trim.ToLower <> "probe" Or nDebug > 4) Then - ' Se utensile MILL con nome "probe" aggiungo solo se livello debug maggiore di 4 + ' Se utensile MILL con nome "probe" aggiungo solo se livello debug maggiore di 4 + ElseIf nTType = MCH_TY.MILL_STD And (ToolName.Trim.ToLower <> "probe" Or m_MainWindow.GetDebug() > 4) Then ToolCathegory.Items.Add(New CustomItem(ToolName, nType)) End If End If diff --git a/RawPhoto/ChooseMachining.xaml.vb b/RawPhoto/ChooseMachining.xaml.vb index 0e29b6e..4b04140 100644 --- a/RawPhoto/ChooseMachining.xaml.vb +++ b/RawPhoto/ChooseMachining.xaml.vb @@ -130,7 +130,7 @@ Public Class ChooseMachining ' Il taglio è aggiunto sempre (all'inizio di questo metodo) ' -- FORATURA -- m_DrillingList.Clear() - If CanChangeSaw() Then CreateMachiningList(MCH_MY.DRILLING, m_DrillingList) + If CanChangeTool() Then CreateMachiningList(MCH_MY.DRILLING, m_DrillingList) ' Se la lista è vuota cancello la lavorazione corrente di questo tipo If m_DrillingList.Count = 0 Then m_CurrentMachine.sCurrDrilling = String.Empty @@ -140,7 +140,7 @@ Public Class ChooseMachining End If ' -- FRESATURA -- m_MillingList.Clear() - If CanChangeSaw() Then CreateMachiningList(MCH_MY.MILLING, m_MillingList) + If CanChangeTool() Then CreateMachiningList(MCH_MY.MILLING, m_MillingList) ' Se la lista è vuota cancello la lavorazione corrente di questo tipo If m_MillingList.Count = 0 Then m_CurrentMachine.sCurrMilling = String.Empty @@ -150,7 +150,7 @@ Public Class ChooseMachining End If ' -- SVUOTATURA -- m_PocketingList.Clear() - If CanChangeSaw() Then CreateMachiningList(MCH_MY.POCKETING, m_PocketingList) + If CanChangeTool() Then CreateMachiningList(MCH_MY.POCKETING, m_PocketingList) If m_PocketingList.Count = 0 Then m_CurrentMachine.sCurrPocketing = String.Empty Else