e2daebcb5a
- aggiornamenti e migliorie varie.
61 lines
2.6 KiB
VB.net
61 lines
2.6 KiB
VB.net
Imports EgtUILib
|
|
|
|
Public Class SingleCutUC
|
|
|
|
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
|
|
|
Private m_bPointOk As Boolean = False
|
|
Private m_ptTip As Point3d
|
|
|
|
Private Sub PointBtn_Click(sender As Object, e As RoutedEventArgs) Handles PointBtn.Click
|
|
SawTipTxBl.Text = String.Empty
|
|
' Recupero la posizione macchina
|
|
Dim nX As Integer = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
|
|
Dim dX As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nX)
|
|
Dim nY As Integer = GetPrivateProfileInt(S_AXES, K_L2ID, 1, m_MainWindow.GetMachIniFile())
|
|
Dim dY As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nY)
|
|
Dim nZ As Integer = GetPrivateProfileInt(S_AXES, K_L3ID, 2, m_MainWindow.GetMachIniFile())
|
|
Dim dZ As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nZ)
|
|
Dim nC As Integer = GetPrivateProfileInt(S_AXES, K_R1ID, 8, m_MainWindow.GetMachIniFile())
|
|
Dim dC As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nC)
|
|
Dim nB As Integer = GetPrivateProfileInt(S_AXES, K_R2ID, 7, m_MainWindow.GetMachIniFile())
|
|
Dim dB As Double = m_MainWindow.m_CNCommunication.m_CN.d_axis_position(nB)
|
|
' Imposto la lama corrente
|
|
Dim sSaw As String = String.Empty
|
|
GetPrivateProfileString(S_MACH, K_CURRSAW, "", sSaw, m_MainWindow.GetIniFile())
|
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then
|
|
m_bPointOk = False
|
|
Return
|
|
End If
|
|
' Trasformo in posizione punta utensile in basso
|
|
If Not EgtGetCalcTipFromPositions(dX, dY, dZ, dC, dB, True, m_ptTip) Then
|
|
m_bPointOk = False
|
|
Return
|
|
End If
|
|
' Recupero l'origine della tavola
|
|
Dim ptOri As Point3d
|
|
If Not EgtGetTableRef(1, ptOri) Then
|
|
m_bPointOk = False
|
|
Return
|
|
End If
|
|
' Porto il tip nell'origine tavola
|
|
m_ptTip.ToLoc(New Frame3d(ptOri))
|
|
m_bPointOk = True
|
|
' Visualizzo quote
|
|
Dim sSawTip As String = "X" & DoubleToString(m_ptTip.x, 0) & " Y" & DoubleToString(m_ptTip.y, 0) &
|
|
" Z" & DoubleToString(m_ptTip.z, 0) & " C" & DoubleToString(dC, 0) &
|
|
" B" & DoubleToString(dB, 0)
|
|
SawTipTxBl.Text = sSawTip
|
|
End Sub
|
|
|
|
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
|
|
|
End Sub
|
|
|
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
|
m_bPointOk = False
|
|
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
|
End Sub
|
|
|
|
End Class
|