c205e83b3d
- in tagli diretti si conserva l'ultima scelta della sorgente dei punti (utensile, laser, disegno) #2793 - in tagli diretti piccole sistemazioni e razionalizzazioni.
65 lines
2.1 KiB
VB.net
65 lines
2.1 KiB
VB.net
Imports EgtUILib
|
|
|
|
Module DirectCut
|
|
' Riferimenti a pagine
|
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
|
|
|
' Polishing attivo
|
|
Friend m_bPolishingOn As Boolean = False
|
|
|
|
' Modalità scelta punto
|
|
Friend Enum PT_MODE As Integer
|
|
TOOL = 0
|
|
LASER = 1
|
|
DRAW = 2
|
|
End Enum
|
|
|
|
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
|
|
|
|
Friend Function IsDirectCutOn() As Boolean
|
|
Return ( GetDirectCutPart() <> GDB_ID.NULL OrElse m_bPolishingOn)
|
|
End Function
|
|
|
|
Friend Function GetCurrentPointMode() As Integer
|
|
Dim nPointMode As Integer = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_POINT_MODE, 0, m_MainWindow.GetIniFile())
|
|
If nPointMode < PT_MODE.TOOL Then
|
|
Return PT_MODE.TOOL
|
|
ElseIf nPointMode > PT_MODE.DRAW Then
|
|
Return PT_MODE.DRAW
|
|
Else
|
|
Return nPointMode
|
|
End If
|
|
End Function
|
|
|
|
Friend Sub SaveCurrentPointMode(nPointMode As Integer)
|
|
If nPointMode < PT_MODE.TOOL Then
|
|
nPointMode = PT_MODE.TOOL
|
|
ElseIf nPointMode > PT_MODE.DRAW Then
|
|
nPointMode = PT_MODE.DRAW
|
|
End If
|
|
WritePrivateProfileString( S_DIRECTCUTS, K_DC_POINT_MODE, nPointMode.ToString(), m_MainWindow.GetIniFile())
|
|
End Sub
|
|
|
|
End Module
|