f8e2af23d3
- gestione baffi su tagli di lama - sistemazione nesting rettangoli.
68 lines
2.5 KiB
VB.net
68 lines
2.5 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_CURRMACHINING, "", sSawMch, m_MainWindow.GetIniFile())
|
|
EgtLuaCreateGlobTable("CAM")
|
|
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
|
|
EgtLuaSetGlobIntVar("CAM.PARTID", nPartId)
|
|
EgtLuaSetGlobStringVar("CAM.CMD", "Add")
|
|
EgtLuaSetGlobBoolVar("CAM.PREVIEW", bPreview)
|
|
EgtLuaSetGlobBoolVar("CAM.TOOLPATH", bToolpath)
|
|
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
|
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 EraseMachinings(nPartId As Integer) As Boolean
|
|
EgtLuaCreateGlobTable("CAM")
|
|
EgtLuaSetGlobIntVar("CAM.PARTID", nPartId)
|
|
EgtLuaSetGlobStringVar("CAM.CMD", "Erase")
|
|
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
|
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 UpdateMachinings(nPartId As Integer, bPreview As Boolean, bToolpath As Boolean) As Boolean
|
|
EgtLuaCreateGlobTable("CAM")
|
|
EgtLuaSetGlobIntVar("CAM.PARTID", nPartId)
|
|
EgtLuaSetGlobStringVar("CAM.CMD", "Update")
|
|
EgtLuaSetGlobBoolVar("CAM.PREVIEW", bPreview)
|
|
EgtLuaSetGlobBoolVar("CAM.TOOLPATH", bToolpath)
|
|
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
|
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
|