38a8dced17
- corretto movimento grezzo con mouse (ora si blocca la Z) - aggiunta rotazione automatica testa per cercare di evitare extra-corsa - in simulazione, con extra-corsa se ne segnala il valore - in simulazione, migliorato comportamento quando in pausa.
84 lines
3.1 KiB
VB.net
84 lines
3.1 KiB
VB.net
Imports EgtUILib
|
|
|
|
Public Module CamAuto
|
|
|
|
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
|
|
|
Public Function AddMachinings(nPartId As Integer, bPreview As Boolean, bToolpath As Boolean) As Boolean
|
|
Dim sSawMch As String = String.Empty
|
|
GetPrivateProfileString(S_MACH, K_CURRSAWING, "", sSawMch, m_MainWindow.GetIniFile())
|
|
Dim sDrillMch As String = String.Empty
|
|
GetPrivateProfileString(S_MACH, K_CURRDRILLING, "", sDrillMch, m_MainWindow.GetIniFile())
|
|
EgtLuaCreateGlobTable("CAM")
|
|
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
|
|
EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch)
|
|
EgtLuaSetGlobIntVar("CAM.PARTID", nPartId)
|
|
EgtLuaSetGlobBoolVar("CAM.PREVIEW", bPreview)
|
|
EgtLuaSetGlobBoolVar("CAM.TOOLPATH", bToolpath)
|
|
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
|
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Add")
|
|
Dim nErr As Integer = 999
|
|
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
|
EgtLuaResetGlobVar("CAM")
|
|
If nErr <> 0 Then
|
|
bOk = False
|
|
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
|
End If
|
|
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
|
|
Return bOk
|
|
End Function
|
|
|
|
Public Function EraseMachinings(nPartId As Integer) As Boolean
|
|
EgtLuaCreateGlobTable("CAM")
|
|
EgtLuaSetGlobIntVar("CAM.PARTID", nPartId)
|
|
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
|
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Erase")
|
|
Dim nErr As Integer = 999
|
|
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
|
EgtLuaResetGlobVar("CAM")
|
|
If nErr <> 0 Then
|
|
bOk = False
|
|
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
|
End If
|
|
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
|
|
Return bOk
|
|
End Function
|
|
|
|
Public Function UpdateAllMachiningsToolpaths() As Boolean
|
|
EgtLuaCreateGlobTable("CAM")
|
|
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
|
bOk = bOk AndAlso EgtLuaCallFunction("CAM.UpdateAllTp")
|
|
Dim nErr As Integer = 999
|
|
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
|
EgtLuaResetGlobVar("CAM")
|
|
If nErr <> 0 Then
|
|
bOk = False
|
|
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
|
End If
|
|
Return bOk
|
|
End Function
|
|
|
|
Public Function SortAllMachinings() As Boolean
|
|
EgtLuaCreateGlobTable("CAM")
|
|
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
|
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Sort")
|
|
Dim nErr As Integer = 999
|
|
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
|
EgtLuaResetGlobVar("CAM")
|
|
If nErr <> 0 Then
|
|
bOk = False
|
|
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
|
End If
|
|
Return bOk
|
|
End Function
|
|
|
|
Public Function DeactivateAllMachinings() As Boolean
|
|
Return EgtSetAllOperationsMode(False)
|
|
End Function
|
|
|
|
Public Function ActivateAllMachinings() As Boolean
|
|
Return EgtSetAllOperationsMode(True)
|
|
End Function
|
|
|
|
End Module
|