OmagCUT :
- aggiunta simulazione dei tagli diretti.
This commit is contained in:
+3
-2
@@ -83,8 +83,6 @@ Module ConstGen
|
||||
|
||||
' Nome della superficie del grezzo
|
||||
Public Const NAME_RAW_SOLID As String = "RawSolid"
|
||||
' Nome del centro del grezzo
|
||||
Public Const NAME_RAW_CENTER As String = "RawCenter"
|
||||
' Nome del contorno di kerf nel grezzo
|
||||
Public Const NAME_KERF As String = "Kerf"
|
||||
' Chiave per info di kerf nel grezzo
|
||||
@@ -213,6 +211,9 @@ Module ConstGen
|
||||
' Nome della lavorazione di spatolatura cornici
|
||||
Public Const NAME_FRAME_SAWSIDEFIN As String = "FrameSawSideFin"
|
||||
|
||||
' Nome di pezzo per tagli diretti
|
||||
Public Const NAME_DIRECTCUT As String = "DirectCut"
|
||||
|
||||
' Nome di pezzo temporaneo che serve per copia dime
|
||||
Public Const NAME_COPYTEMPLATE As String = "CopyTemplate"
|
||||
|
||||
|
||||
@@ -101,11 +101,11 @@ Public Class CurrentProjectPageUC
|
||||
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
||||
Me.CurrentProjectPageGrid.Children.Remove(CurrentProjectSceneHost)
|
||||
Dim MissingKeyWnd As EgtMsgBox
|
||||
If m_MainWindow.IsSiemensPc Then
|
||||
MissingKeyWnd = New EgtMsgBox(m_MainWindow, Me.ActualWidth / 15 * 5, EgtMsgBox.WidthType.PIXEL, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
Else
|
||||
MissingKeyWnd = New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
End If
|
||||
#If TRIAL Then
|
||||
MissingKeyWnd = New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 5) & " " & EgtMsg(MSG_MISSINGKEYWD + 7), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 1)
|
||||
#Else
|
||||
MissingKeyWnd = New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
#End If
|
||||
m_MainWindow.Close()
|
||||
End If
|
||||
' dimensione lineare max in pixel delle textures
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Module DirectCut
|
||||
' Riferimenti a pagine
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
Friend Function CreateDirectCutPart() As Integer
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
Return nPartId
|
||||
End Function
|
||||
|
||||
Friend Function EraseDirectCutPart() As Boolean
|
||||
' Recupero identificativo del pezzo
|
||||
Dim nPartId As Integer = EgtGetFirstNameInGroup(m_MainWindow.m_CurrentProjectPageUC.m_nRawId, NAME_DIRECTCUT)
|
||||
If nPartId = GDB_ID.NULL Then Return True
|
||||
' Cancello le lavorazioni
|
||||
EraseMachinings(nPartId)
|
||||
' Tolgo il pezzo dal grezzo
|
||||
EgtRemovePartFromRawPart(nPartId)
|
||||
' Cancello il pezzo
|
||||
EgtErase(nPartId)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function GetDirectCutPart() As Integer
|
||||
Return EgtGetFirstNameInGroup(m_MainWindow.m_CurrentProjectPageUC.m_nRawId, NAME_DIRECTCUT)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
+22
-6
@@ -20,7 +20,7 @@ Public Class DirectCutPageUC
|
||||
Friend m_CN As CN_generico
|
||||
Private m_bFirst As Boolean = True
|
||||
' Riferimento alla pagina correntemente attiva
|
||||
Friend m_ActiveDirectCutPage As DirectCutPages
|
||||
Friend m_ActiveDirectCutPage As DirectCutPages = DirectCutPages.DirectCut
|
||||
|
||||
Enum DirectCutPages
|
||||
DirectCut
|
||||
@@ -72,14 +72,30 @@ Public Class DirectCutPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub DirectCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
|
||||
' Se rientro da simulazione
|
||||
If m_ActiveDirectCutPage = DirectCutPages.SingleCut Then
|
||||
LeftButtonGrid.Children.Add(m_SingleCut)
|
||||
Return
|
||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.MultipleCut Then
|
||||
LeftButtonGrid.Children.Add(m_MultipleCut)
|
||||
Return
|
||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.GridCut Then
|
||||
LeftButtonGrid.Children.Add(m_GridCut)
|
||||
Return
|
||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.FlatteningCut Then
|
||||
LeftButtonGrid.Children.Add(m_FlatteningCut)
|
||||
Return
|
||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.SawTest Then
|
||||
LeftButtonGrid.Children.Add(m_SawTest)
|
||||
Return
|
||||
End If
|
||||
|
||||
' Caso standard
|
||||
m_ActiveDirectCutPage = DirectCutPages.DirectCut
|
||||
|
||||
' Se macchina fotografica abilitata
|
||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO) Then
|
||||
PhotoBtn.IsEnabled = True
|
||||
Else
|
||||
PhotoBtn.IsEnabled = False
|
||||
End If
|
||||
PhotoBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO)
|
||||
|
||||
' Attivo le lavorazioni solo se esiste il grezzo
|
||||
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
||||
|
||||
+12
-4
@@ -85,11 +85,19 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="0" Grid.Row="10" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="ExitBtn" Grid.Column="2" Grid.Row="10" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="SimulBtn" Grid.Column="0" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="ExitBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
+82
-99
@@ -7,6 +7,8 @@ Public Class FlatteningCut
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Flag di simulazione in corso
|
||||
Private m_bSimul As Boolean = False
|
||||
|
||||
' Origine tavola e dati grezzo
|
||||
Private m_bRawOk As Boolean = False
|
||||
@@ -45,8 +47,6 @@ Public Class FlatteningCut
|
||||
Private Const MIN_CUT_LEN As Double = 10.0
|
||||
Private Const MIN_CUT_WID As Double = 10.0
|
||||
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||
Private Const DIRECTCUT As String = "DirectCut"
|
||||
Private Const RAW_CENTER As String = "RawCenter"
|
||||
' Costanti che indicano la modalità di acquisizione dei punti
|
||||
Private Enum PT_MODE As Integer
|
||||
SAW = 0
|
||||
@@ -71,12 +71,12 @@ Public Class FlatteningCut
|
||||
m_PointsModeArray(PT_MODE.DRAW) = EgtMsg(MSG_DIRECTCUTPAGEUC + 25)
|
||||
' la associo alla combobox
|
||||
PointModeCmBx.ItemsSource = m_PointsModeArray
|
||||
|
||||
' Creo lista tipo lavorazione
|
||||
m_TypeArray(MACH_TYPE.ONEWAY) = EgtMsg(MSG_COMBOBOXPARAM + 39)
|
||||
m_TypeArray(MACH_TYPE.ZIGZAG) = EgtMsg(MSG_COMBOBOXPARAM + 38)
|
||||
' la associo alla combobox
|
||||
TypeCmBx.ItemsSource = m_TypeArray
|
||||
|
||||
' assegno messaggi
|
||||
Point1Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 10)
|
||||
Point2Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 11)
|
||||
DepthTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 13)
|
||||
@@ -85,18 +85,25 @@ Public Class FlatteningCut
|
||||
WidthTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 26)
|
||||
OverlapTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 27)
|
||||
SideChBx.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 23)
|
||||
SimulBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||
OkBtn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub FlatteningCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' Attivo la pagina
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
m_bActive = True
|
||||
' Se rientro da simulazione
|
||||
If m_bSimul Then
|
||||
m_bSimul = False
|
||||
' Disabilito registrazione progetto modificato
|
||||
EgtDisableModified()
|
||||
Return
|
||||
End If
|
||||
' Reset punto acquisito
|
||||
m_bPointP1Ok = False
|
||||
' Inizializzo primo punto acquisito dal disegno come centro del grezzo
|
||||
Dim nRawPartCenter As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, RAW_CENTER)
|
||||
EgtStartPoint(nRawPartCenter, GDB_ID.ROOT, m_ptPrev)
|
||||
GetRawCenter(m_ptPrev)
|
||||
' Imposto modalità di acquisizione punti
|
||||
PointModeCmBx.SelectedIndex = PT_MODE.DRAW
|
||||
' Imposto tipo di lavorazione della spianatura
|
||||
@@ -121,7 +128,7 @@ Public Class FlatteningCut
|
||||
End If
|
||||
' Reset taglio e disabilito bottone esecuzione
|
||||
m_bCutOk = False
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
' Disabilito bottone secondo punto
|
||||
Point2Btn.IsEnabled = False
|
||||
' Deseleziono bottone primo punto
|
||||
@@ -134,27 +141,35 @@ Public Class FlatteningCut
|
||||
End Sub
|
||||
|
||||
Friend Sub FlatteningCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
If Not m_bSimul Then
|
||||
' Dichiaro sottopagina da non riattivare
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
End If
|
||||
' Dichiaro pagina non attiva
|
||||
m_bActive = False
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateOkBtn()
|
||||
Private Sub UpdateSimulOkBtn()
|
||||
If m_bCutOk Then
|
||||
SimulBtn.IsEnabled = True
|
||||
SimulBtn.Foreground = Brushes.Black
|
||||
OkBtn.IsEnabled = True
|
||||
OkBtn.Foreground = Brushes.Black
|
||||
Else
|
||||
SimulBtn.IsEnabled = False
|
||||
SimulBtn.Foreground = Brushes.DarkGray
|
||||
OkBtn.IsEnabled = False
|
||||
OkBtn.Foreground = Brushes.DarkGray
|
||||
End If
|
||||
@@ -195,48 +210,31 @@ Public Class FlatteningCut
|
||||
' Reset punto non acquisito
|
||||
m_bPointP1Ok = False
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then
|
||||
Return
|
||||
End If
|
||||
If Not m_bRawOk Then Return
|
||||
' Se acquisizone lama o laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then
|
||||
Return
|
||||
End If
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then
|
||||
Return
|
||||
End If
|
||||
' Altrimenti da lama
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Altrimenti da lama
|
||||
Else
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP1) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP1) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
@@ -264,6 +262,7 @@ Public Class FlatteningCut
|
||||
m_dAngO = dTAngO + 90
|
||||
m_dAngV = 90 - dTAngV
|
||||
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||
' Altrimenti da disegno
|
||||
Else
|
||||
' Assegno punto selezionato nel disegno a m_ptTipP1
|
||||
m_ptTipP1 = m_ptPrev
|
||||
@@ -273,9 +272,7 @@ Public Class FlatteningCut
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
'Disegno macchina nella sua posizione reale
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||
@@ -315,48 +312,31 @@ Public Class FlatteningCut
|
||||
' Reset punto non acquisito
|
||||
m_bPointP2Ok = False
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then
|
||||
Return
|
||||
End If
|
||||
If Not m_bRawOk Then Return
|
||||
' Se acquisizone lama o laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then
|
||||
Return
|
||||
End If
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then
|
||||
Return
|
||||
End If
|
||||
' Altrimenti da lama
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Altrimenti da lama
|
||||
Else
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP2Ok = True
|
||||
@@ -382,6 +362,7 @@ Public Class FlatteningCut
|
||||
Dim dTLen, dTAngV, dTAngO As Double
|
||||
m_vtToolP2.ToSpherical(dTLen, dTAngV, dTAngO)
|
||||
m_dAngV = 90 - dTAngV
|
||||
' Altrimenti da disegno
|
||||
Else
|
||||
' Assegno punto selezionato nel disegno a m_ptTipP2
|
||||
m_ptTipP2 = m_ptPrev
|
||||
@@ -391,9 +372,7 @@ Public Class FlatteningCut
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then
|
||||
Return
|
||||
End If
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
'Disegno macchina nella sua posizione reale
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||
@@ -491,6 +470,9 @@ Public Class FlatteningCut
|
||||
StringToDouble(DirectionTxBx.Text, dDirection)
|
||||
dDirection += m_MainWindow.m_CurrentMachine.dDeltaC
|
||||
m_dAngO = dDirection
|
||||
' Dichiaro non più usato P2
|
||||
m_bPointP2Ok = False
|
||||
Point2Btn.IsChecked = False
|
||||
' Disegno il taglio
|
||||
CreateFlatteningCut()
|
||||
EgtDraw()
|
||||
@@ -536,6 +518,23 @@ Public Class FlatteningCut
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub SimulBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulBtn.Click
|
||||
' Verifico ci sia un taglio valido
|
||||
If Not m_bCutOk Then Return
|
||||
' Salvo il progetto con le lavorazioni
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\" & "DirectProj.nge"
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveFile(sMchPath, False)
|
||||
' Predispongo passaggio a simulazione
|
||||
m_bSimul = True
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Simulation
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
#If TRIAL Then
|
||||
m_CurrProjPage.SetWarningMessage("Trial Version")
|
||||
@@ -564,7 +563,6 @@ Public Class FlatteningCut
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
End Sub
|
||||
|
||||
Private Function CreateFlatteningCut() As Boolean
|
||||
@@ -581,7 +579,7 @@ Public Class FlatteningCut
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, DIRECTCUT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio
|
||||
@@ -613,7 +611,7 @@ Public Class FlatteningCut
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
@@ -631,7 +629,7 @@ Public Class FlatteningCut
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, DIRECTCUT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
' Creo layer di taglio
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
@@ -667,7 +665,7 @@ Public Class FlatteningCut
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
@@ -716,21 +714,6 @@ Public Class FlatteningCut
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function EraseDirectCutPart() As Boolean
|
||||
' Recupero identificativo del pezzo
|
||||
Dim nDirPartId As Integer = EgtGetFirstNameInGroup(m_MainWindow.m_CurrentProjectPageUC.m_nRawId, DIRECTCUT)
|
||||
If nDirPartId = GDB_ID.NULL Then
|
||||
Return True
|
||||
End If
|
||||
' Cancello le lavorazioni
|
||||
EraseMachinings(nDirPartId)
|
||||
' Tolgo il pezzo dal grezzo
|
||||
EgtRemovePartFromRawPart(nDirPartId)
|
||||
' Cancello il pezzo
|
||||
EgtErase(nDirPartId)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
' Aggiungo crocette
|
||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||
|
||||
+12
-4
@@ -103,11 +103,19 @@
|
||||
|
||||
<CheckBox Name="SideChBx" Grid.Row="6" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox}" Margin="6,0,6,0"/>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="0" Grid.Row="11" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="ExitBtn" Grid.Column="2" Grid.Row="11" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="SimulBtn" Grid.Column="0" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="ExitBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
+59
-39
@@ -6,6 +6,8 @@ Public Class GridCut
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Flag di simulazione in corso
|
||||
Private m_bSimul As Boolean = False
|
||||
|
||||
' Origine tavola e dati grezzo
|
||||
Private m_bRawOk As Boolean = False
|
||||
@@ -39,8 +41,6 @@ Public Class GridCut
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
Private Const MIN_CUT_LEN As Double = 10.0
|
||||
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||
Private Const DIRECTCUT As String = "DirectCut"
|
||||
Private Const RAW_CENTER As String = "RawCenter"
|
||||
' Costanti che indicano la modalità di acquisizione dei punti
|
||||
Private Enum PT_MODE As Integer
|
||||
SAW = 0
|
||||
@@ -60,7 +60,7 @@ Public Class GridCut
|
||||
m_PointsModeArray(PT_MODE.DRAW) = EgtMsg(MSG_DIRECTCUTPAGEUC + 25)
|
||||
' la associo alla combobox
|
||||
PointModeCmBx.ItemsSource = m_PointsModeArray
|
||||
|
||||
' assegno messaggi
|
||||
Point1Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 10)
|
||||
Point2Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 11)
|
||||
DepthTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 13)
|
||||
@@ -71,17 +71,25 @@ Public Class GridCut
|
||||
NumPzYTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 21)
|
||||
DimPzYTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 22)
|
||||
SideChBx.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 23)
|
||||
SimulBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||
OkBtn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
||||
End Sub
|
||||
|
||||
Private Sub GridCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' Attivo la pagina
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
m_bActive = True
|
||||
' Se rientro da simulazione
|
||||
If m_bSimul Then
|
||||
m_bSimul = False
|
||||
' Disabilito registrazione progetto modificato
|
||||
EgtDisableModified()
|
||||
Return
|
||||
End If
|
||||
' Reset punto acquisito
|
||||
m_bPointP1Ok = False
|
||||
' Inizializzo primo punto acquisito dal disegno come centro del grezzo
|
||||
Dim nRawPartCenter As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, RAW_CENTER)
|
||||
EgtStartPoint(nRawPartCenter, GDB_ID.ROOT, m_ptPrev)
|
||||
GetRawCenter(m_ptPrev)
|
||||
' Imposto modalità di acquisizione punti
|
||||
PointModeCmBx.SelectedIndex = PT_MODE.DRAW
|
||||
' Assegno parametri di lavorazione già definiti
|
||||
@@ -102,7 +110,7 @@ Public Class GridCut
|
||||
End If
|
||||
' Reset taglio e disabilito bottone esecuzione
|
||||
m_bCutOk = False
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
' Disabilito bottone secondo punto
|
||||
Point2Btn.IsEnabled = False
|
||||
' Deseleziono bottone primo punto
|
||||
@@ -115,27 +123,35 @@ Public Class GridCut
|
||||
End Sub
|
||||
|
||||
Friend Sub GridCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
If Not m_bSimul Then
|
||||
' Dichiaro sottopagina da non riattivare
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
End If
|
||||
' Dichiaro pagina non attiva
|
||||
m_bActive = False
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateOkBtn()
|
||||
Private Sub UpdateSimulOkBtn()
|
||||
If m_bCutOk Then
|
||||
SimulBtn.IsEnabled = True
|
||||
SimulBtn.Foreground = Brushes.Black
|
||||
OkBtn.IsEnabled = True
|
||||
OkBtn.Foreground = Brushes.Black
|
||||
Else
|
||||
SimulBtn.IsEnabled = False
|
||||
SimulBtn.Foreground = Brushes.DarkGray
|
||||
OkBtn.IsEnabled = False
|
||||
OkBtn.Foreground = Brushes.DarkGray
|
||||
End If
|
||||
@@ -443,6 +459,9 @@ Public Class GridCut
|
||||
StringToDouble(DirectionTxBx.Text, dDirection)
|
||||
dDirection += m_MainWindow.m_CurrentMachine.dDeltaC
|
||||
m_dAngO = dDirection
|
||||
' Dichiaro non più usato P2
|
||||
m_bPointP2Ok = False
|
||||
Point2Btn.IsChecked = False
|
||||
' Disegno il taglio
|
||||
CreateGridCut()
|
||||
EgtDraw()
|
||||
@@ -465,6 +484,23 @@ Public Class GridCut
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub SimulBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulBtn.Click
|
||||
' Verifico ci sia un taglio valido
|
||||
If Not m_bCutOk Then Return
|
||||
' Salvo il progetto con le lavorazioni
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\" & "DirectProj.nge"
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveFile(sMchPath, False)
|
||||
' Predispongo passaggio a simulazione
|
||||
m_bSimul = True
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Simulation
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
#If TRIAL Then
|
||||
m_CurrProjPage.SetWarningMessage("Trial Version")
|
||||
@@ -493,7 +529,6 @@ Public Class GridCut
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
End Sub
|
||||
|
||||
Private Function CreateGridCut() As Boolean
|
||||
@@ -510,7 +545,7 @@ Public Class GridCut
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, DIRECTCUT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio parallelo alla lama
|
||||
@@ -536,7 +571,7 @@ Public Class GridCut
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
@@ -554,7 +589,7 @@ Public Class GridCut
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, DIRECTCUT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
' Creo layer di taglio
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
@@ -584,7 +619,7 @@ Public Class GridCut
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
@@ -652,21 +687,6 @@ Public Class GridCut
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function EraseDirectCutPart() As Boolean
|
||||
' Recupero identificativo del pezzo
|
||||
Dim nDirPartId As Integer = EgtGetFirstNameInGroup(m_MainWindow.m_CurrentProjectPageUC.m_nRawId, DIRECTCUT)
|
||||
If nDirPartId = GDB_ID.NULL Then
|
||||
Return True
|
||||
End If
|
||||
' Cancello le lavorazioni
|
||||
EraseMachinings(nDirPartId)
|
||||
' Tolgo il pezzo dal grezzo
|
||||
EgtRemovePartFromRawPart(nDirPartId)
|
||||
' Cancello il pezzo
|
||||
EgtErase(nDirPartId)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
' Aggiungo crocette
|
||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||
|
||||
+12
-4
@@ -108,11 +108,19 @@
|
||||
|
||||
<CheckBox Name="SideChBx" Grid.Row="7" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox}" Margin="6,0,6,0"/>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="0" Grid.Row="11" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="ExitBtn" Grid.Column="2" Grid.Row="11" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="SimulBtn" Grid.Column="0" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="ExitBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
+59
-40
@@ -7,6 +7,8 @@ Public Class MultipleCut
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Flag di simulazione in corso
|
||||
Private m_bSimul As Boolean = False
|
||||
|
||||
' Origine tavola e dati grezzo
|
||||
Private m_bRawOk As Boolean = False
|
||||
@@ -40,8 +42,6 @@ Public Class MultipleCut
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
Private Const MIN_CUT_LEN As Double = 10.0
|
||||
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||
Private Const DIRECTCUT As String = "DirectCut"
|
||||
Private Const RAW_CENTER As String = "RawCenter"
|
||||
' Costanti che indicano la modalità di acquisizione dei punti
|
||||
Private Enum PT_MODE As Integer
|
||||
SAW = 0
|
||||
@@ -61,7 +61,7 @@ Public Class MultipleCut
|
||||
m_PointsModeArray(PT_MODE.DRAW) = EgtMsg(MSG_DIRECTCUTPAGEUC + 25)
|
||||
' la associo alla combobox
|
||||
PointModeCmBx.ItemsSource = m_PointsModeArray
|
||||
|
||||
' assegno messaggi
|
||||
Point1Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 10)
|
||||
Point2Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 11)
|
||||
DepthTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 13)
|
||||
@@ -71,18 +71,25 @@ Public Class MultipleCut
|
||||
NumPzTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 17)
|
||||
DimPzTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 18)
|
||||
SideChBx.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 23)
|
||||
SimulBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||
OkBtn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub MultipleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' Attivo la pagina
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
m_bActive = True
|
||||
' Se rientro da simulazione
|
||||
If m_bSimul Then
|
||||
m_bSimul = False
|
||||
' Disabilito registrazione progetto modificato
|
||||
EgtDisableModified()
|
||||
Return
|
||||
End If
|
||||
' Reset punto acquisito
|
||||
m_bPointP1Ok = False
|
||||
' Inizializzo primo punto acquisito dal disegno come centro del grezzo
|
||||
Dim nRawPartCenter As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, RAW_CENTER)
|
||||
EgtStartPoint(nRawPartCenter, GDB_ID.ROOT, m_ptPrev)
|
||||
GetRawCenter(m_ptPrev)
|
||||
' Imposto modalità di acquisizione punti
|
||||
PointModeCmBx.SelectedIndex = PT_MODE.DRAW
|
||||
' Assegno parametri di lavorazione già definiti
|
||||
@@ -104,7 +111,7 @@ Public Class MultipleCut
|
||||
End If
|
||||
' Reset taglio e disabilito bottone esecuzione
|
||||
m_bCutOk = False
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
' Disabilito bottone secondo punto
|
||||
Point2Btn.IsEnabled = False
|
||||
' Deseleziono bottone primo punto
|
||||
@@ -117,27 +124,35 @@ Public Class MultipleCut
|
||||
End Sub
|
||||
|
||||
Friend Sub MultipleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
If Not m_bSimul Then
|
||||
' Dichiaro sottopagina da non riattivare
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
End If
|
||||
' Dichiaro pagina non attiva
|
||||
m_bActive = False
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateOkBtn()
|
||||
Private Sub UpdateSimulOkBtn()
|
||||
If m_bCutOk Then
|
||||
SimulBtn.IsEnabled = True
|
||||
SimulBtn.Foreground = Brushes.Black
|
||||
OkBtn.IsEnabled = True
|
||||
OkBtn.Foreground = Brushes.Black
|
||||
Else
|
||||
SimulBtn.IsEnabled = False
|
||||
SimulBtn.Foreground = Brushes.DarkGray
|
||||
OkBtn.IsEnabled = False
|
||||
OkBtn.Foreground = Brushes.DarkGray
|
||||
End If
|
||||
@@ -462,6 +477,9 @@ Public Class MultipleCut
|
||||
StringToDouble(DirectionTxBx.Text, dDirection)
|
||||
dDirection += m_MainWindow.m_CurrentMachine.dDeltaC
|
||||
m_dAngO = dDirection
|
||||
' Dichiaro non più usato P2
|
||||
m_bPointP2Ok = False
|
||||
Point2Btn.IsChecked = False
|
||||
' Disegno il taglio
|
||||
CreateMultipleCut()
|
||||
EgtDraw()
|
||||
@@ -484,6 +502,23 @@ Public Class MultipleCut
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub SimulBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulBtn.Click
|
||||
' Verifico ci sia un taglio valido
|
||||
If Not m_bCutOk Then Return
|
||||
' Salvo il progetto con le lavorazioni
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\" & "DirectProj.nge"
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveFile(sMchPath, False)
|
||||
' Predispongo passaggio a simulazione
|
||||
m_bSimul = True
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Simulation
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
#If TRIAL Then
|
||||
m_CurrProjPage.SetWarningMessage("Trial Version")
|
||||
@@ -512,7 +547,6 @@ Public Class MultipleCut
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
End Sub
|
||||
|
||||
Private Function CreateMultipleCut() As Boolean
|
||||
@@ -529,7 +563,7 @@ Public Class MultipleCut
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, DIRECTCUT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio
|
||||
@@ -559,7 +593,7 @@ Public Class MultipleCut
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
@@ -577,7 +611,7 @@ Public Class MultipleCut
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, DIRECTCUT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
' Creo layer di taglio
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
@@ -611,7 +645,7 @@ Public Class MultipleCut
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
@@ -678,21 +712,6 @@ Public Class MultipleCut
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function EraseDirectCutPart() As Boolean
|
||||
' Recupero identificativo del pezzo
|
||||
Dim nDirPartId As Integer = EgtGetFirstNameInGroup(m_MainWindow.m_CurrentProjectPageUC.m_nRawId, DIRECTCUT)
|
||||
If nDirPartId = GDB_ID.NULL Then
|
||||
Return True
|
||||
End If
|
||||
' Cancello le lavorazioni
|
||||
EraseMachinings(nDirPartId)
|
||||
' Tolgo il pezzo dal grezzo
|
||||
EgtRemovePartFromRawPart(nDirPartId)
|
||||
' Cancello il pezzo
|
||||
EgtErase(nDirPartId)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
' Aggiungo crocette
|
||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||
|
||||
@@ -194,6 +194,7 @@
|
||||
<Compile Include="CurrentProjectPageUC.xaml.vb">
|
||||
<DependentUpon>CurrentProjectPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DirectCut.vb" />
|
||||
<Compile Include="DirectCutPageUC.xaml.vb">
|
||||
<DependentUpon>DirectCutPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
+14
-6
@@ -74,12 +74,20 @@
|
||||
|
||||
<TextBlock Name="SawTipTxBl" Grid.Column="0" Grid.Row="10" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" Text=""/>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="0" Grid.Row="11" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
|
||||
<Button Name="ExitBtn" Grid.Column="2" Grid.Row="11" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="SimulBtn" Grid.Column="0" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="ExitBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
+56
-34
@@ -7,6 +7,8 @@ Public Class SawTestUC
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Flag di simulazione in corso
|
||||
Private m_bSimul As Boolean = False
|
||||
|
||||
' Origine tavola e dati grezzo
|
||||
Private m_bRawOk As Boolean = False
|
||||
@@ -40,7 +42,6 @@ Public Class SawTestUC
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
Private Const MIN_CUT_LEN As Double = 10.0
|
||||
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||
Private Const DIRECTCUT As String = "DirectCut"
|
||||
' Costanti che indicano la modalità di acquisizione dei punti
|
||||
Private Enum PT_MODE As Integer
|
||||
SAW = 0
|
||||
@@ -55,18 +56,27 @@ Public Class SawTestUC
|
||||
m_PointsModeArray(PT_MODE.DRAW) = EgtMsg(MSG_DIRECTCUTPAGEUC + 25)
|
||||
' la associo alla combobox
|
||||
PointModeCmBx.ItemsSource = m_PointsModeArray
|
||||
|
||||
' assegno messaggi
|
||||
Point1Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 10)
|
||||
Point2Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 11)
|
||||
DepthTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 13)
|
||||
LenghtTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 14)
|
||||
DirectionTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 15)
|
||||
SimulBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||
OkBtn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
||||
End Sub
|
||||
|
||||
Private Sub SawTest_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' Attivo la pagina
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
m_bActive = True
|
||||
' Se rientro da simulazione
|
||||
If m_bSimul Then
|
||||
m_bSimul = False
|
||||
' Disabilito registrazione progetto modificato
|
||||
EgtDisableModified()
|
||||
Return
|
||||
End If
|
||||
' Reset punto acquisito
|
||||
m_bPointP1Ok = False
|
||||
m_bPointP2Ok = False
|
||||
@@ -97,7 +107,7 @@ Public Class SawTestUC
|
||||
EgtMdbSetCurrMachining(m_sSawing)
|
||||
' Reset taglio e disabilito bottone esecuzione
|
||||
m_bCutOk = False
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
' Disabilito bottone secondo punto
|
||||
Point2Btn.IsEnabled = False
|
||||
' Deseleziono bottone primo punto
|
||||
@@ -110,27 +120,35 @@ Public Class SawTestUC
|
||||
End Sub
|
||||
|
||||
Friend Sub SawTest_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
If Not m_bSimul Then
|
||||
' Dichiaro sottopagina da non riattivare
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
End If
|
||||
' Dichiaro pagina non attiva
|
||||
m_bActive = False
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateOkBtn()
|
||||
Private Sub UpdateSimulOkBtn()
|
||||
If m_bCutOk Then
|
||||
SimulBtn.IsEnabled = True
|
||||
SimulBtn.Foreground = Brushes.Black
|
||||
OkBtn.IsEnabled = True
|
||||
OkBtn.Foreground = Brushes.Black
|
||||
Else
|
||||
SimulBtn.IsEnabled = False
|
||||
SimulBtn.Foreground = Brushes.DarkGray
|
||||
OkBtn.IsEnabled = False
|
||||
OkBtn.Foreground = Brushes.DarkGray
|
||||
End If
|
||||
@@ -451,11 +469,31 @@ Public Class SawTestUC
|
||||
StringToDouble(DirectionTxBx.Text, dDirection)
|
||||
dDirection += m_MainWindow.m_CurrentMachine.dDeltaC
|
||||
m_dAngO = dDirection
|
||||
' Dichiaro non più usato P2
|
||||
m_bPointP2Ok = False
|
||||
Point2Btn.IsChecked = False
|
||||
' Disegno il taglio
|
||||
CreateSingleCut()
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub SimulBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulBtn.Click
|
||||
' Verifico ci sia un taglio valido
|
||||
If Not m_bCutOk Then Return
|
||||
' Salvo il progetto con le lavorazioni
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\" & "DirectProj.nge"
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveFile(sMchPath, False)
|
||||
' Predispongo passaggio a simulazione
|
||||
m_bSimul = True
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Simulation
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
#If TRIAL Then
|
||||
m_CurrProjPage.SetWarningMessage("Trial Version")
|
||||
@@ -484,7 +522,6 @@ Public Class SawTestUC
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
End Sub
|
||||
|
||||
Private Function CreateSingleCut() As Boolean
|
||||
@@ -509,7 +546,7 @@ Public Class SawTestUC
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, DIRECTCUT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio
|
||||
@@ -558,25 +595,10 @@ Public Class SawTestUC
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
Private Function EraseDirectCutPart() As Boolean
|
||||
' Recupero identificativo del pezzo
|
||||
Dim nDirPartId As Integer = EgtGetFirstNameInGroup(m_MainWindow.m_CurrentProjectPageUC.m_nRawId, DIRECTCUT)
|
||||
If nDirPartId = GDB_ID.NULL Then
|
||||
Return True
|
||||
End If
|
||||
' Cancello le lavorazioni
|
||||
EraseMachinings(nDirPartId)
|
||||
' Tolgo il pezzo dal grezzo
|
||||
EgtRemovePartFromRawPart(nDirPartId)
|
||||
' Cancello il pezzo
|
||||
EgtErase(nDirPartId)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
' Aggiungo crocette
|
||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||
|
||||
@@ -75,19 +75,17 @@ Public Class SimulationPageUC
|
||||
UpdateUI()
|
||||
' Aggiorno flag per lavaggio
|
||||
m_CurrProjPage.UpdateWashingFlag()
|
||||
' Se pezzi piani e non c'è ordine delle lavorazioni, ricalcolo tutto e ne faccio uno automatico
|
||||
' Se pezzi piani e non taglio diretto e non c'è ordine delle lavorazioni, ricalcolo tutto e ne faccio uno automatico
|
||||
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
|
||||
Dim bDirectCut As Boolean = (GetDirectCutPart() <> GDB_ID.NULL)
|
||||
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
|
||||
Not bDirectCut And
|
||||
Not m_CurrProjPage.GetOrderMachiningFlag() Then
|
||||
RemoveFinalEmptyPhases()
|
||||
bOk = SortAllMachinings()
|
||||
If bOk Then
|
||||
m_CurrProjPage.SetOrderMachiningFlag()
|
||||
End If
|
||||
If bOk Then m_CurrProjPage.SetOrderMachiningFlag()
|
||||
Dim bModif As Boolean = TestAllMachiningsForStrict()
|
||||
If bModif Then
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||
End If
|
||||
If bModif Then m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||
End If
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
@@ -95,6 +93,10 @@ Public Class SimulationPageUC
|
||||
EgtDisableModified()
|
||||
' Aggiorno le lavorazioni
|
||||
bOk = UpdateAllMachiningsToolpaths() And bOk
|
||||
' Eventuale eliminazione Home finale
|
||||
If bDirectCut And Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
' Aggiorno posizionamento ventose sui pezzi per eventuali tagli da sotto con lama
|
||||
bOk = UpdateVacuumsForDrip() And bOk
|
||||
' Se errore in setup, lo segnalo
|
||||
@@ -423,9 +425,12 @@ Public Class SimulationPageUC
|
||||
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
Else
|
||||
ElseIf m_MainWindow.m_PrevActivePage = MainWindow.Pages.FrameCut Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut
|
||||
Else
|
||||
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_DirectCutPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.DirectCut
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
+15
-7
@@ -73,13 +73,21 @@
|
||||
|
||||
<TextBlock Name="SawTipTxBl" Grid.Column="0" Grid.Row="10" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" Text=""/>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="0" Grid.Row="11" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
|
||||
<Button Name="ExitBtn" Grid.Column="2" Grid.Row="11" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
|
||||
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="SimulBtn" Grid.Column="0" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{StaticResource OmagCut_GradientBlueTextButton}"/>
|
||||
<Button Name="ExitBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
+57
-38
@@ -7,6 +7,8 @@ Public Class SingleCutUC
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Flag di simulazione in corso
|
||||
Private m_bSimul As Boolean = False
|
||||
|
||||
' Origine tavola e dati grezzo
|
||||
Private m_bRawOk As Boolean = False
|
||||
@@ -38,8 +40,6 @@ Public Class SingleCutUC
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
Private Const MIN_CUT_LEN As Double = 10.0
|
||||
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||
Private Const DIRECTCUT As String = "DirectCut"
|
||||
Private Const RAW_CENTER As String = "RawCenter"
|
||||
' Costanti che indicano la modalità di acquisizione dei punti
|
||||
Private Enum PT_MODE As Integer
|
||||
SAW = 0
|
||||
@@ -54,25 +54,33 @@ Public Class SingleCutUC
|
||||
m_PointsModeArray(PT_MODE.DRAW) = EgtMsg(MSG_DIRECTCUTPAGEUC + 25)
|
||||
' la associo alla combobox
|
||||
PointModeCmBx.ItemsSource = m_PointsModeArray
|
||||
|
||||
' assegno messaggi
|
||||
Point1Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 10)
|
||||
Point2Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 11)
|
||||
DepthTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 13)
|
||||
LenghtTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 14)
|
||||
DirectionTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 15)
|
||||
SideAngleTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 16)
|
||||
SimulBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||
OkBtn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
||||
End Sub
|
||||
|
||||
Private Sub SingleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' Attivo la pagina
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
m_bActive = True
|
||||
' Se rientro da simulazione
|
||||
If m_bSimul Then
|
||||
m_bSimul = False
|
||||
' Disabilito registrazione progetto modificato
|
||||
EgtDisableModified()
|
||||
Return
|
||||
End If
|
||||
' Reset punto acquisito
|
||||
m_bPointP1Ok = False
|
||||
SawTipTxBl.Text = String.Empty
|
||||
' Inizializzo primo punto acquisito dal disegno come centro del grezzo
|
||||
Dim nRawPartCenter As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, RAW_CENTER)
|
||||
EgtStartPoint(nRawPartCenter, GDB_ID.ROOT, m_ptPrev)
|
||||
GetRawCenter(m_ptPrev)
|
||||
' Imposto modalità di acquisizione punti
|
||||
PointModeCmBx.SelectedIndex = PT_MODE.DRAW
|
||||
' Assegno parametri di lavorazione già definiti
|
||||
@@ -94,7 +102,7 @@ Public Class SingleCutUC
|
||||
End If
|
||||
' Reset taglio e disabilito bottone esecuzione
|
||||
m_bCutOk = False
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
' Disabilito bottone secondo punto
|
||||
Point2Btn.IsEnabled = False
|
||||
' Deseleziono bottone primo punto
|
||||
@@ -107,27 +115,35 @@ Public Class SingleCutUC
|
||||
End Sub
|
||||
|
||||
Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
If Not m_bSimul Then
|
||||
' Dichiaro sottopagina da non riattivare
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
' Rimuovo eventuale pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
End If
|
||||
' Dichiaro pagina non attiva
|
||||
m_bActive = False
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateOkBtn()
|
||||
Private Sub UpdateSimulOkBtn()
|
||||
If m_bCutOk Then
|
||||
SimulBtn.IsEnabled = True
|
||||
SimulBtn.Foreground = Brushes.Black
|
||||
OkBtn.IsEnabled = True
|
||||
OkBtn.Foreground = Brushes.Black
|
||||
Else
|
||||
SimulBtn.IsEnabled = False
|
||||
SimulBtn.Foreground = Brushes.DarkGray
|
||||
OkBtn.IsEnabled = False
|
||||
OkBtn.Foreground = Brushes.DarkGray
|
||||
End If
|
||||
@@ -460,6 +476,9 @@ Public Class SingleCutUC
|
||||
StringToDouble(DirectionTxBx.Text, dDirection)
|
||||
dDirection += m_MainWindow.m_CurrentMachine.dDeltaC
|
||||
m_dAngO = dDirection
|
||||
' Dichiaro non più usato P2
|
||||
m_bPointP2Ok = False
|
||||
Point2Btn.IsChecked = False
|
||||
' Disegno il taglio
|
||||
CreateSingleCut()
|
||||
EgtDraw()
|
||||
@@ -482,6 +501,23 @@ Public Class SingleCutUC
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub SimulBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulBtn.Click
|
||||
' Verifico ci sia un taglio valido
|
||||
If Not m_bCutOk Then Return
|
||||
' Salvo il progetto con le lavorazioni
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\" & "DirectProj.nge"
|
||||
m_MainWindow.m_CurrentProjectPageUC.SaveFile(sMchPath, False)
|
||||
' Predispongo passaggio a simulazione
|
||||
m_bSimul = True
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Simulation
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
#If TRIAL Then
|
||||
m_CurrProjPage.SetWarningMessage("Trial Version")
|
||||
@@ -510,7 +546,6 @@ Public Class SingleCutUC
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
||||
End Sub
|
||||
|
||||
Private Function CreateSingleCut() As Boolean
|
||||
@@ -528,8 +563,7 @@ Public Class SingleCutUC
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, DIRECTCUT)
|
||||
Dim nPartId = CreateDirectCutPart()
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio
|
||||
@@ -564,25 +598,10 @@ Public Class SingleCutUC
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
UpdateOkBtn()
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
Private Function EraseDirectCutPart() As Boolean
|
||||
' Recupero identificativo del pezzo
|
||||
Dim nDirPartId As Integer = EgtGetFirstNameInGroup(m_MainWindow.m_CurrentProjectPageUC.m_nRawId, DIRECTCUT)
|
||||
If nDirPartId = GDB_ID.NULL Then
|
||||
Return True
|
||||
End If
|
||||
' Cancello le lavorazioni
|
||||
EraseMachinings(nDirPartId)
|
||||
' Tolgo il pezzo dal grezzo
|
||||
EgtRemovePartFromRawPart(nDirPartId)
|
||||
' Cancello il pezzo
|
||||
EgtErase(nDirPartId)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
' Aggiungo crocette
|
||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||
|
||||
@@ -313,7 +313,12 @@ Public Class WorkInProgressPageUC
|
||||
If Not WorkInProgressScene.Init() Then
|
||||
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
||||
Me.WorkInProgressPageGrid.Children.Remove(WorkInProgressSceneHost)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
Dim MissingKeyWnd As EgtMsgBox
|
||||
#If TRIAL Then
|
||||
MissingKeyWnd = New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 5) & " " & EgtMsg(MSG_MISSINGKEYWD + 7), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 1)
|
||||
#Else
|
||||
MissingKeyWnd = New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
#End If
|
||||
m_MainWindow.Close()
|
||||
End If
|
||||
' dimensione lineare max in pixel delle textures
|
||||
|
||||
Reference in New Issue
Block a user