Compare commits

...

1 Commits

Author SHA1 Message Date
NicolaP 973157a0de Milling in spianatura 2021-12-23 16:23:20 +01:00
3 changed files with 99 additions and 47 deletions
+25 -10
View File
@@ -444,8 +444,8 @@ Public Class FlatteningCut
StringToLen(WidthTxBx.Text, dWidth)
' Recupero lo spessore della lama corrente
EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw)
Dim dThick As Double = 0
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
Dim dThick As Double = GetFootPrintTool()
'EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
' La larghezza della spianatura nono può essere inferiore allo spessore della lama
m_dWid = Math.Max(dWidth, dThick)
WidthTxBx.Text = LenToString(m_dWid, 2)
@@ -472,8 +472,8 @@ Public Class FlatteningCut
Private Sub OverlapTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OverlapTxBx.EgtClosed
' Recupero spessore della lama correntemente attiva
Dim dThick As Double = 0
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
Dim dThick As Double = GetFootPrintTool()
'EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
' Verifico che la sovrapposizione non sia superiore allo spessore della lama (meno 1mm di offset)
Dim dOverlap As Double = 0
Const MIN_OFFSET As Double = 1.0
@@ -612,6 +612,22 @@ Public Class FlatteningCut
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
End Sub
' ricavo l'ingombro di lavorazione in funzione dell'utensile selezionato
Private Function GetFootPrintTool() As Double
Dim dFootPrint As Double = 0
' verifico quale lavorazione è attiva
If Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrSawing) Then
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)
' recupero informazioni della fresa in uso
EgtTdbSetCurrTool(sCurrMill)
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dFootPrint)
End If
Return dFootPrint
End Function
Private Function CreateFlatteningCut() As Boolean
' Verifico sia definito il punto iniziale e il grezzo
If Not m_bPointP1Ok Or Not m_bRawOk Then
@@ -670,22 +686,21 @@ Public Class FlatteningCut
RemoveFinalHome()
End If
UpdateSimulOkBtn()
Return m_bCutOk
End Function
Private Function MultiplyCut(nLayerId As Integer, nCutId As Integer) As Boolean
' Recupero spessore della lama correntemente attiva
Dim dThick As Double = 0
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
' Recupero spessore della lama (utensile) correntemente attiva
Dim dThick As Double = GetFootPrintTool()
If dThick = 0 Then Return False
' Imposto angolo di rotazione a seconda del lato dei tagli
Dim dRotAngO As Double = If(SideChBx.IsChecked(), -90, 90)
' Definisco vettore di spostamento
Dim vtDelta As Vector3d
vtDelta = Vector3d.FromPolar(1, m_dAngO)
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
' Calcolo numero di iterazioni necessarie a coprire l'area impostata e lunghezza vettore delta
Dim nStepNum As Integer
Dim dDelta As Double
+37 -37
View File
@@ -71,7 +71,7 @@ Public Class SingleDrillUC
Private Sub SingleDrill_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
m_sCurrDrill = m_CurrentMachine.sCurrDrill
GetDrillFromDrilling(m_sCurrDrill)
GetDrillFromDrilling(m_sCurrDrill, m_CurrentMachine.sCurrDrilling)
' recupero informazioni del foretto usato
EgtTdbSetCurrTool(m_sCurrDrill)
@@ -267,41 +267,41 @@ Public Class SingleDrillUC
Point1Btn.IsChecked = True
End Sub
Private Sub GetDrillFromDrilling(ByRef sCurrDrill As String)
If String.IsNullOrEmpty(sCurrDrill) Or String.IsNullOrWhiteSpace(sCurrDrill) Then
' creo l'elenco degli utensili di foratura
Dim sToolName As String = String.Empty
Dim nType As Integer = MCH_TY.NONE
Dim DrillToolList As New ObservableCollection(Of String)
DrillToolList.Clear()
If EgtTdbGetFirstTool(MCH_TF.DRILLBIT, sToolName, nType) Then
DrillToolList.Add(sToolName)
While EgtTdbGetNextTool(MCH_TF.DRILLBIT, sToolName, nType)
DrillToolList.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(sCurrDrilling)
' 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 DrillToolList
If CurrTool.ToString() = ToolString Then
bToolExist = True
Exit For
End If
Next
If bToolExist Then
sCurrDrill = ToolString
Else
sCurrDrill = String.Empty
End If
End If
End Sub
'Private Sub GetDrillFromDrilling(ByRef sCurrDrill As String)
' If String.IsNullOrEmpty(sCurrDrill) Or String.IsNullOrWhiteSpace(sCurrDrill) Then
' ' creo l'elenco degli utensili di foratura
' Dim sToolName As String = String.Empty
' Dim nType As Integer = MCH_TY.NONE
' Dim DrillToolList As New ObservableCollection(Of String)
' DrillToolList.Clear()
' If EgtTdbGetFirstTool(MCH_TF.DRILLBIT, sToolName, nType) Then
' DrillToolList.Add(sToolName)
' While EgtTdbGetNextTool(MCH_TF.DRILLBIT, sToolName, nType)
' DrillToolList.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(sCurrDrilling)
' ' 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 DrillToolList
' If CurrTool.ToString() = ToolString Then
' bToolExist = True
' Exit For
' End If
' Next
' If bToolExist Then
' sCurrDrill = ToolString
' Else
' sCurrDrill = String.Empty
' End If
' End If
'End Sub
Private Sub XcoordTxBx_EgtClosed(sender As Object, e As EventArgs) Handles XcoordTxBx.EgtClosed
' Recupero il valore della coordinata (in 0 Tab)
@@ -397,7 +397,7 @@ Public Class SingleDrillUC
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
' Recupero spessore lama corrente
Dim sDrill As String = m_sCurrDrill
GetDrillFromDrilling(sDrill)
GetDrillFromDrilling(sDrill, m_MainWindow.m_CurrentMachine.sCurrDrilling)
EgtTdbSetCurrTool(sDrill)
Dim dDiam As Double = 0
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dDiam)
+37
View File
@@ -1,4 +1,5 @@
Imports System.Globalization
Imports System.Collections.ObjectModel
Imports EgtUILib
Module Utility
@@ -273,4 +274,40 @@ Module Utility
Return BackBottomColor
End Function
Public Sub GetDrillFromDrilling(ByRef sCurrDrill As String, ByVal sCurrDrilling As String)
If String.IsNullOrEmpty(sCurrDrill) Or String.IsNullOrWhiteSpace(sCurrDrill) Then
' creo l'elenco degli utensili di foratura
Dim sToolName As String = String.Empty
Dim nType As Integer = MCH_TY.NONE
Dim DrillToolList As New ObservableCollection(Of String)
DrillToolList.Clear()
If EgtTdbGetFirstTool(MCH_TF.DRILLBIT, sToolName, nType) Then
DrillToolList.Add(sToolName)
While EgtTdbGetNextTool(MCH_TF.DRILLBIT, sToolName, nType)
DrillToolList.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(sCurrDrilling)
' 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 DrillToolList
If CurrTool.ToString() = ToolString Then
bToolExist = True
Exit For
End If
Next
If bToolExist Then
sCurrDrill = ToolString
Else
sCurrDrill = String.Empty
End If
End If
End Sub
End Module