OmagCUT 2.1j3 :

- Aumentato il numero di TextBox Numero e Dimensioni nei Tagli Multipli. Da 3x2 si è passati ora a 10x2, con indici e scrollbar.
- Uniformati i metodi CreateMultipleCut, CreateFlatteningCut, CreateGridCut al modello di CreateSingleCut, eliminando Create2PointsMultipleCut, Create2PointsFlatteningCut, Create2PointsGridCut.
- Aggiunta costante MIN_OFFSET al metodo OverlapTxBx_EgtClosed di FlatteningCut
This commit is contained in:
Renzo Lanza
2019-10-11 11:33:48 +00:00
parent d68a61b58d
commit 3b7af73ef2
5 changed files with 291 additions and 205 deletions
+15 -77
View File
@@ -356,7 +356,7 @@ Public Class FlatteningCut
LenghtTxBx.Text = LenToString(dLen, 1)
m_dAngO = dAngOrizzDeg
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
Create2PointsFlatteningCut()
CreateFlatteningCut()
' Disegno la macchina nella sua posizione reale
SetMachineInCurrPos()
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
@@ -442,13 +442,14 @@ Public Class FlatteningCut
' Recupero spessore della lama correntemente attiva
Dim dThick As Double = 0
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
' Verifico che la sovrapposizione non sia superiore allo spessore della lama
' 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
StringToLen(OverlapTxBx.Text, dOverlap)
If dOverlap < 0 Then
m_dOverlap = 0
ElseIf dOverlap > dThick Then
m_dOverlap = dThick
ElseIf dOverlap > dThick - MIN_OFFSET Then
m_dOverlap = dThick - MIN_OFFSET
Else
m_dOverlap = dOverlap
End If
@@ -461,33 +462,21 @@ Public Class FlatteningCut
Private Sub SideChBx_Click(sender As Object, e As EventArgs) Handles SideChBx.Click
' Disegno il taglio
If m_bPointP2Ok Then
Create2PointsFlatteningCut()
Else
CreateFlatteningCut()
End If
CreateFlatteningCut()
SetMachineInCurrPos()
EgtDraw()
End Sub
Private Sub TypeCmBx_SelectionChanged(sender As Object, e As EventArgs) Handles TypeCmBx.SelectionChanged
' Disegno il taglio
If m_bPointP2Ok Then
Create2PointsFlatteningCut()
Else
CreateFlatteningCut()
End If
CreateFlatteningCut()
SetMachineInCurrPos()
EgtDraw()
End Sub
Private Sub RotLockChBx_Click(sender As Object, e As EventArgs) Handles RotLockChBx.Click
' Disegno il taglio
If m_bPointP2Ok Then
Create2PointsFlatteningCut()
Else
CreateFlatteningCut()
End If
CreateFlatteningCut()
SetMachineInCurrPos()
EgtDraw()
End Sub
@@ -601,66 +590,15 @@ Public Class FlatteningCut
MultiplyCut(nLayerId, nCutId)
' Creo layer per crocetta di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocetta
CreateCross(nCrossLayerId, ptStart)
' Calcolo punto di inserimento nel grezzo
Dim ptMin, ptMax As Point3d
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, ptMin, ptMax)
Dim ptIns As Point3d = ptMin + (m_ptTabOri - m_ptRawMin)
ptIns.z = dRawHeight
' Inserisco il pezzo nel grezzo
EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId)
' Inserisco la lavorazione
m_bCutOk = AddMachinings(nPartId) AndAlso UpdateAllMachiningsToolpaths()
EgtSetCurrPhase(1)
' Eventuale eliminazione Home finale
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
RemoveFinalHome()
' Aggiungo crocetta/e
If m_bPointP1Ok Then
CreateCross(nCrossLayerId, ptStart)
End If
UpdateSimulOkBtn()
Return m_bCutOk
End Function
Private Function Create2PointsFlatteningCut() As Boolean
' Verifico siano definiti punto iniziale punto finale e grezzo
If Not m_bPointP1Ok Or Not m_bPointP2Ok Or Not m_bRawOk Then
m_bCutOk = False
Return False
If m_bPointP2Ok Then
Dim ptEnd As Point3d = m_ptTipP2
ptEnd.z = 0
CreateCross(nCrossLayerId, ptEnd)
End If
' Spessore grezzo
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
' Rimuovo eventuale vecchio pezzo per taglio diretto
EraseDirectCutPart()
' Disattivo eventuali lavorazioni presenti
DeactivateAllMachinings()
' Creo nuovo pezzo per il taglio diretto
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
EgtSetName(nPartId, NAME_DIRECTCUT)
' Creo layer di taglio
Dim nLayerId = EgtCreateGroup(nPartId)
EgtSetName(nLayerId, NAME_OUTLOOP)
' Creo il taglio
Dim ptStart As Point3d = m_ptTipP1
Dim ptEnd As Point3d = m_ptTipP2
ptStart.z = 0
ptEnd.z = 0
Dim nCutId = EgtCreateLine(nLayerId, ptStart, ptEnd)
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
' Imposto prima direzione
EgtSetInfo(nCutId, INFO_DIR, 1)
' Eventuale bloccaggio rotazione asse C tra le passate
If RotLockChBx.IsChecked Then
EgtSetInfo(nCutId, INFO_ENABLE_INVERT, False)
End If
' Funzione che crea i tagli successivi al primo
MultiplyCut(nLayerId, nCutId)
' Creo layer per crocette di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocette
CreateCross(nCrossLayerId, ptStart)
CreateCross(nCrossLayerId, ptEnd)
' Calcolo punto di inserimento nel grezzo
Dim ptMin, ptMax As Point3d
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, ptMin, ptMax)
+9 -54
View File
@@ -340,7 +340,7 @@ Public Class GridCut
If dLen > EPS_SMALL Then
m_dAngO = dAngOrizzDeg
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
Create2PointsGridCut()
CreateGridCut()
' Disegno la macchina nella sua posizione reale
SetMachineInCurrPos()
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
@@ -506,56 +506,15 @@ Public Class GridCut
MultiplyCut(nLayerId)
' Creo layer per crocetta di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocetta
CreateCross(nCrossLayerId, ptStart)
' Calcolo punto di inserimento nel grezzo
Dim ptMin, ptMax As Point3d
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, ptMin, ptMax)
Dim ptIns As Point3d = ptMin + (m_ptTabOri - m_ptRawMin)
ptIns.z = dRawHeight
' Inserisco il pezzo nel grezzo
EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId)
' Inserisco la lavorazione
m_bCutOk = AddMachinings(nPartId) AndAlso UpdateAllMachiningsToolpaths()
EgtSetCurrPhase(1)
' Eventuale eliminazione Home finale
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
RemoveFinalHome()
' Aggiungo crocetta/e
If m_bPointP1Ok Then
CreateCross(nCrossLayerId, ptStart)
End If
UpdateSimulOkBtn()
Return m_bCutOk
End Function
Private Function Create2PointsGridCut() As Boolean
' Verifico siano definiti punto iniziale punto finale e grezzo
If Not m_bPointP1Ok Or Not m_bPointP2Ok Or Not m_bRawOk Then
m_bCutOk = False
Return False
If m_bPointP2Ok Then
Dim ptEnd As Point3d = m_ptTipP2
ptEnd.z = 0
CreateCross(nCrossLayerId, ptEnd)
End If
' Spessore grezzo
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
' Rimuovo eventuale vecchio pezzo per taglio diretto
EraseDirectCutPart()
' Disattivo eventuali lavorazioni presenti
DeactivateAllMachinings()
' Creo nuovo pezzo per il taglio diretto
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
EgtSetName(nPartId, NAME_DIRECTCUT)
' Creo layer di taglio
Dim nLayerId = EgtCreateGroup(nPartId)
EgtSetName(nLayerId, NAME_OUTLOOP)
' Creo il taglio
Dim ptStart As Point3d = m_ptTipP1
Dim ptEnd As Point3d = m_ptTipP2
ptStart.z = 0
ptEnd.z = 0
' Funzione che crea i tagli successivi al primo
MultiplyCut(nLayerId)
' Creo layer per crocette di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocette
CreateCross(nCrossLayerId, ptStart)
CreateCross(nCrossLayerId, ptEnd)
' Calcolo punto di inserimento nel grezzo
Dim ptMin, ptMax As Point3d
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, ptMin, ptMax)
@@ -651,11 +610,7 @@ Public Class GridCut
Private Sub NumPz1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles NumPzXTxBx.EgtClosed, NumPzYTxBx.EgtClosed, DimPzXTxBx.EgtClosed, DimPzYTxBx.EgtClosed, SideChBx.Click
' Disegno il taglio
If m_bPointP2Ok Then
Create2PointsGridCut()
Else
CreateGridCut()
End If
CreateGridCut()
SetMachineInCurrPos()
EgtDraw()
End Sub
+122 -3
View File
@@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="597.3" d:DesignWidth="256">
<!--<Border CornerRadius="{StaticResource Page_CornerRadius}" Background="{DynamicResource OmagCut_LightGray}">-->
@@ -71,7 +71,126 @@
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<Grid Grid.Row="6" Grid.ColumnSpan="2">
<Grid Grid.Row="6" Grid.ColumnSpan="2" Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="0.2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Border Grid.Column="1" Grid.Row="0" Grid.RowSpan="10" Background="Black" />
<TextBlock Name="NumPzTxBl" Grid.Column="2" Grid.Row="0"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<TextBlock Name="DimPzTxBl" Grid.Column="4" Grid.Row="0"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<Border Grid.Column="3" Grid.Row="0" Grid.RowSpan="10" Background="Black" />
<ScrollViewer VerticalScrollBarVisibility="Visible" Grid.Row="6" Grid.ColumnSpan="6" Visibility="Visible">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="2"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
</Grid.RowDefinitions>
<Border Grid.Column="2" Grid.Row="0" Grid.RowSpan="10" Background="Black" Visibility="Hidden"/>
<TextBlock Name="Num1TxBl" Grid.Column="0" Grid.Row="0"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz1TxBx" Grid.Column="1" Grid.Row="0" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz1TxBx" Grid.Column="3" Grid.Row="0" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Num2TxBl" Grid.Column="0" Grid.Row="1"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz2TxBx" Grid.Column="1" Grid.Row="1" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz2TxBx" Grid.Column="3" Grid.Row="1" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Num3TxBl" Grid.Column="0" Grid.Row="2"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz3TxBx" Grid.Column="1" Grid.Row="2" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz3TxBx" Grid.Column="3" Grid.Row="2" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Num4TxBl" Grid.Column="0" Grid.Row="3"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz4TxBx" Grid.Column="1" Grid.Row="3" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz4TxBx" Grid.Column="3" Grid.Row="3" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Num5TxBl" Grid.Column="0" Grid.Row="4"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz5TxBx" Grid.Column="1" Grid.Row="4" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz5TxBx" Grid.Column="3" Grid.Row="4" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Num6TxBl" Grid.Column="0" Grid.Row="5"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz6TxBx" Grid.Column="1" Grid.Row="5" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz6TxBx" Grid.Column="3" Grid.Row="5" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Num7TxBl" Grid.Column="0" Grid.Row="6"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz7TxBx" Grid.Column="1" Grid.Row="6" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz7TxBx" Grid.Column="3" Grid.Row="6" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Num8TxBl" Grid.Column="0" Grid.Row="7"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz8TxBx" Grid.Column="1" Grid.Row="7" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz8TxBx" Grid.Column="3" Grid.Row="7" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Num9TxBl" Grid.Column="0" Grid.Row="8"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz9TxBx" Grid.Column="1" Grid.Row="8" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz9TxBx" Grid.Column="3" Grid.Row="8" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Num10TxBl" Grid.Column="0" Grid.Row="9"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="NumPz10TxBx" Grid.Column="1" Grid.Row="9" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="DimPz10TxBx" Grid.Column="3" Grid.Row="9" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
</Grid>
</ScrollViewer>
</Grid>
<!--<Grid Grid.Row="6" Grid.ColumnSpan="2" Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="2"/>
@@ -106,7 +225,7 @@
<EgtWPFLib:EgtTextBox Name="DimPz3TxBx" Grid.Column="2" Grid.Row="3" Width="75"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
</Grid>
</Grid>-->
<TextBlock Name="SideTxBl" Grid.Row="7" Grid.ColumnSpan="2"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
+136 -62
View File
@@ -73,6 +73,16 @@ Public Class MultipleCut
SideTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 23)
SimulBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 1)
OkBtn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
Num1TxBl.Text = "1"
Num2TxBl.Text = "2"
Num3TxBl.Text = "3"
Num4TxBl.Text = "4"
Num5TxBl.Text = "5"
Num6TxBl.Text = "6"
Num7TxBl.Text = "7"
Num8TxBl.Text = "8"
Num9TxBl.Text = "9"
Num10TxBl.Text = "10"
End Sub
Private Sub MultipleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -341,7 +351,7 @@ Public Class MultipleCut
LenghtTxBx.Text = LenToString(dLen, 1)
m_dAngO = dAngOrizzDeg
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
Create2PointsMultipleCut()
CreateMultipleCut()
' Disegno la macchina nella sua posizione reale
SetMachineInCurrPos()
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
@@ -500,56 +510,8 @@ Public Class MultipleCut
End Sub
Private Function CreateMultipleCut() As Boolean
' Verifico sia definito il punto iniziale e il grezzo
If Not m_bPointP1Ok Or Not m_bRawOk Then
m_bCutOk = False
Return False
End If
' Spessore grezzo
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
' Rimuovo eventuale vecchio pezzo per taglio diretto
EraseDirectCutPart()
' Disattivo eventuali lavorazioni presenti
DeactivateAllMachinings()
' Creo nuovo pezzo per il taglio diretto
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
EgtSetName(nPartId, NAME_DIRECTCUT)
Dim nLayerId = EgtCreateGroup(nPartId)
EgtSetName(nLayerId, NAME_OUTLOOP)
' Creo il taglio
Dim ptStart As Point3d = m_ptTipP1
ptStart.z = 0
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
' Funzione che crea i tagli successivi al primo
MultiplyCut(nLayerId, nCutId)
' Creo layer per crocetta di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocetta
CreateCross(nCrossLayerId, ptStart)
' Calcolo punto di inserimento nel grezzo
Dim ptMin, ptMax As Point3d
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, ptMin, ptMax)
Dim ptIns As Point3d = ptMin + (m_ptTabOri - m_ptRawMin)
ptIns.z = dRawHeight
' Inserisco il pezzo nel grezzo
EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId)
' Inserisco la lavorazione
m_bCutOk = AddMachinings(nPartId) AndAlso UpdateAllMachiningsToolpaths()
EgtSetCurrPhase(1)
' Eventuale eliminazione Home finale
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
RemoveFinalHome()
End If
UpdateSimulOkBtn()
Return m_bCutOk
End Function
Private Function Create2PointsMultipleCut() As Boolean
' Verifico siano definiti punto iniziale punto finale e grezzo
If Not m_bPointP1Ok Or Not m_bPointP2Ok Or Not m_bRawOk Then
If Not m_bPointP1Ok Or Not m_bRawOk Then
m_bCutOk = False
Return False
End If
@@ -567,10 +529,8 @@ Public Class MultipleCut
EgtSetName(nLayerId, NAME_OUTLOOP)
' Creo il taglio
Dim ptStart As Point3d = m_ptTipP1
Dim ptEnd As Point3d = m_ptTipP2
ptStart.z = 0
ptEnd.z = 0
Dim nCutId = EgtCreateLine(nLayerId, ptStart, ptEnd)
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
@@ -578,9 +538,15 @@ Public Class MultipleCut
MultiplyCut(nLayerId, nCutId)
' Creo layer per crocette di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocette
CreateCross(nCrossLayerId, ptStart)
CreateCross(nCrossLayerId, ptEnd)
' Aggiungo crocetta/e
If m_bPointP1Ok Then
CreateCross(nCrossLayerId, ptStart)
End If
If m_bPointP2Ok Then
Dim ptEnd As Point3d = m_ptTipP2
ptEnd.z = 0
CreateCross(nCrossLayerId, ptEnd)
End If
' Calcolo punto di inserimento nel grezzo
Dim ptMin, ptMax As Point3d
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, ptMin, ptMax)
@@ -659,6 +625,118 @@ Public Class MultipleCut
Next
dTotPerpMove += vtDelta * nNumPz3
End If
' Calcolo quarto vettore di spostamento
Dim dDimPz4 As Double = 0
Dim nNumPz4 As Integer = 0
StringToLen(DimPz4TxBx.Text, dDimPz4)
StringToInt(NumPz4TxBx.Text, nNumPz4)
If dDimPz4 <> 0 And nNumPz4 > 0 Then
vtDelta = Vector3d.FromPolar((dDimPz4 + dThick), m_dAngO)
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
For Index As Integer = 1 To nNumPz4
Dim vtPerpMove As Vector3d = dTotPerpMove + vtDelta * Index
' Creo copie
Dim nCut5Id = EgtCopyGlob(nCutId, nLayerId)
EgtMove(nCut5Id, vtPerpMove, GDB_RT.GLOB)
Next
dTotPerpMove += vtDelta * nNumPz4
End If
' Calcolo quinto vettore di spostamento
Dim dDimPz5 As Double = 0
Dim nNumPz5 As Integer = 0
StringToLen(DimPz5TxBx.Text, dDimPz5)
StringToInt(NumPz5TxBx.Text, nNumPz5)
If dDimPz5 <> 0 And nNumPz5 > 0 Then
vtDelta = Vector3d.FromPolar((dDimPz5 + dThick), m_dAngO)
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
For Index As Integer = 1 To nNumPz5
Dim vtPerpMove As Vector3d = dTotPerpMove + vtDelta * Index
' Creo copie
Dim nCut6Id = EgtCopyGlob(nCutId, nLayerId)
EgtMove(nCut6Id, vtPerpMove, GDB_RT.GLOB)
Next
dTotPerpMove += vtDelta * nNumPz5
End If
' Calcolo sesto vettore di spostamento
Dim dDimPz6 As Double = 0
Dim nNumPz6 As Integer = 0
StringToLen(DimPz6TxBx.Text, dDimPz6)
StringToInt(NumPz6TxBx.Text, nNumPz6)
If dDimPz6 <> 0 And nNumPz6 > 0 Then
vtDelta = Vector3d.FromPolar((dDimPz6 + dThick), m_dAngO)
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
For Index As Integer = 1 To nNumPz6
Dim vtPerpMove As Vector3d = dTotPerpMove + vtDelta * Index
' Creo copie
Dim nCut7Id = EgtCopyGlob(nCutId, nLayerId)
EgtMove(nCut7Id, vtPerpMove, GDB_RT.GLOB)
Next
dTotPerpMove += vtDelta * nNumPz6
End If
' Calcolo settimo vettore di spostamento
Dim dDimPz7 As Double = 0
Dim nNumPz7 As Integer = 0
StringToLen(DimPz7TxBx.Text, dDimPz7)
StringToInt(NumPz7TxBx.Text, nNumPz7)
If dDimPz7 <> 0 And nNumPz7 > 0 Then
vtDelta = Vector3d.FromPolar((dDimPz7 + dThick), m_dAngO)
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
For Index As Integer = 1 To nNumPz7
Dim vtPerpMove As Vector3d = dTotPerpMove + vtDelta * Index
' Creo copie
Dim nCut8Id = EgtCopyGlob(nCutId, nLayerId)
EgtMove(nCut8Id, vtPerpMove, GDB_RT.GLOB)
Next
dTotPerpMove += vtDelta * nNumPz7
End If
' Calcolo ottavo vettore di spostamento
Dim dDimPz8 As Double = 0
Dim nNumPz8 As Integer = 0
StringToLen(DimPz8TxBx.Text, dDimPz8)
StringToInt(NumPz8TxBx.Text, nNumPz8)
If dDimPz8 <> 0 And nNumPz8 > 0 Then
vtDelta = Vector3d.FromPolar((dDimPz8 + dThick), m_dAngO)
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
For Index As Integer = 1 To nNumPz8
Dim vtPerpMove As Vector3d = dTotPerpMove + vtDelta * Index
' Creo copie
Dim nCut9Id = EgtCopyGlob(nCutId, nLayerId)
EgtMove(nCut9Id, vtPerpMove, GDB_RT.GLOB)
Next
dTotPerpMove += vtDelta * nNumPz8
End If
' Calcolo nono vettore di spostamento
Dim dDimPz9 As Double = 0
Dim nNumPz9 As Integer = 0
StringToLen(DimPz9TxBx.Text, dDimPz9)
StringToInt(NumPz9TxBx.Text, nNumPz9)
If dDimPz9 <> 0 And nNumPz9 > 0 Then
vtDelta = Vector3d.FromPolar((dDimPz9 + dThick), m_dAngO)
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
For Index As Integer = 1 To nNumPz9
Dim vtPerpMove As Vector3d = dTotPerpMove + vtDelta * Index
' Creo copie
Dim nCut10Id = EgtCopyGlob(nCutId, nLayerId)
EgtMove(nCut10Id, vtPerpMove, GDB_RT.GLOB)
Next
dTotPerpMove += vtDelta * nNumPz9
End If
' Calcolo decimo vettore di spostamento
Dim dDimPz10 As Double = 0
Dim nNumPz10 As Integer = 0
StringToLen(DimPz10TxBx.Text, dDimPz10)
StringToInt(NumPz10TxBx.Text, nNumPz10)
If dDimPz10 <> 0 And nNumPz10 > 0 Then
vtDelta = Vector3d.FromPolar((dDimPz10 + dThick), m_dAngO)
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
For Index As Integer = 1 To nNumPz10
Dim vtPerpMove As Vector3d = dTotPerpMove + vtDelta * Index
' Creo copie
Dim nCut11Id = EgtCopyGlob(nCutId, nLayerId)
EgtMove(nCut11Id, vtPerpMove, GDB_RT.GLOB)
Next
dTotPerpMove += vtDelta * nNumPz10
End If
Return True
End Function
@@ -673,13 +751,9 @@ Public Class MultipleCut
Return True
End Function
Private Sub NumPz1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles NumPz1TxBx.EgtClosed, NumPz2TxBx.EgtClosed, NumPz3TxBx.EgtClosed, DimPz1TxBx.EgtClosed, DimPz2TxBx.EgtClosed, DimPz3TxBx.EgtClosed, SideChBx.Click
Private Sub NumPz1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles NumPz1TxBx.EgtClosed, NumPz2TxBx.EgtClosed, NumPz3TxBx.EgtClosed, NumPz4TxBx.EgtClosed, NumPz5TxBx.EgtClosed, NumPz6TxBx.EgtClosed, NumPz7TxBx.EgtClosed, NumPz8TxBx.EgtClosed, NumPz9TxBx.EgtClosed, NumPz10TxBx.EgtClosed, DimPz1TxBx.EgtClosed, DimPz2TxBx.EgtClosed, DimPz3TxBx.EgtClosed, DimPz4TxBx.EgtClosed, DimPz5TxBx.EgtClosed, DimPz6TxBx.EgtClosed, DimPz7TxBx.EgtClosed, DimPz8TxBx.EgtClosed, DimPz9TxBx.EgtClosed, DimPz10TxBx.EgtClosed, SideChBx.Click
' Disegno il taglio
If m_bPointP2Ok Then
Create2PointsMultipleCut()
Else
CreateMultipleCut()
End If
CreateMultipleCut()
SetMachineInCurrPos()
EgtDraw()
End Sub
+9 -9
View File
@@ -17,14 +17,14 @@ Imports System.Windows
<Assembly: AssemblyTitle("OmagCUTD32.exe")>
<Assembly: AssemblyDescription("OmagCUT Debug 32 bit")>
#Else
<Assembly: AssemblyTitle("OmagCUTR32.exe")>
<Assembly: AssemblyDescription("OmagCUT 32 bit")>
<Assembly: AssemblyTitle("OmagCUTR32.exe")>
<Assembly: AssemblyDescription("OmagCUT 32 bit")>
#End If
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
<Assembly: AssemblyProduct("OmagCUT")>
<Assembly: AssemblyCopyright("Copyright © 2015-2019 by EgalTech s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
<Assembly: AssemblyProduct("OmagCUT")>
<Assembly: AssemblyCopyright("Copyright © 2015-2019 by EgalTech s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'In order to begin building localizable applications, set
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.1.10.2")>
<Assembly: AssemblyFileVersion("2.1.10.2")>
<Assembly: AssemblyVersion("2.1.10.3")>
<Assembly: AssemblyFileVersion("2.1.10.3")>