4132e8684d
- Spostati file CurrMachining - Introdotto slider custom - Introdotti flag di modifica separati per slice ed operazioni successive - Gestito calcolo dei solidi separato dal resto - Gestito bottone from import su reference - Aggiornato logo - Migliorata gestione dell'interazione con la scena nelle modifiche grafiche( rib, start mach, ...) - Introdotta gestione grid da oggetto - Gestiti percorsi chiusi e con cap end in ShellNumber
89 lines
3.4 KiB
VB.net
89 lines
3.4 KiB
VB.net
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Module LuaExec
|
|
|
|
Friend Function ExecSlice(bSlice As Boolean, bCalcTFS As Boolean) As Boolean
|
|
EgtOutLog("-- Start ExecSlice --")
|
|
Dim bOk As Boolean = True
|
|
' eseguo slice
|
|
If bSlice Then
|
|
EgtLuaCreateGlobTable("PRINT")
|
|
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
|
|
bOk = bOk AndAlso EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\Slicing.lua")
|
|
' Cancello tavola globale
|
|
EgtLuaResetGlobVar("PRINT")
|
|
End If
|
|
If Not bCalcTFS Then Return True
|
|
' eseguo calcolo T,F,S da parametri materiale
|
|
Dim sExecPath As String = Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\CalcMachParamFromSW.lua"
|
|
If Not My.Computer.FileSystem.FileExists(sExecPath) Then
|
|
EgtOutLog("Not found 3DPrint script " & sExecPath)
|
|
Return False
|
|
End If
|
|
' Assegno i dati
|
|
Dim SelMaterialParam As Material = Map.refTopPanelVM.GetSelMaterialData()
|
|
EgtLuaCreateGlobTable("MATERIAL")
|
|
EgtLuaSetGlobNumVar("MATERIAL.K", SelMaterialParam.dK)
|
|
EgtLuaSetGlobNumVar("MATERIAL.C1", SelMaterialParam.dC1)
|
|
EgtLuaSetGlobNumVar("MATERIAL.C2", SelMaterialParam.dC2)
|
|
EgtLuaSetGlobNumVar("MATERIAL.Density", SelMaterialParam.dDensity)
|
|
EgtLuaSetGlobNumVar("MATERIAL.AMax", SelMaterialParam.dAMax)
|
|
EgtLuaSetGlobNumVar("MATERIAL.ATrg", SelMaterialParam.dATrg)
|
|
EgtLuaSetGlobNumVar("MATERIAL.AMin", SelMaterialParam.dAMin)
|
|
EgtLuaSetGlobNumVar("MATERIAL.BMax", SelMaterialParam.dBMax)
|
|
EgtLuaSetGlobNumVar("MATERIAL.BTrg", SelMaterialParam.dBTrg)
|
|
EgtLuaSetGlobNumVar("MATERIAL.BMin", SelMaterialParam.dBMin)
|
|
EgtLuaSetGlobNumVar("MATERIAL.KW", SelMaterialParam.dKW)
|
|
EgtLuaSetGlobNumVar("MATERIAL.KZ", SelMaterialParam.dKZ)
|
|
EgtLuaSetGlobNumVar("MATERIAL.KN", SelMaterialParam.dKN)
|
|
' Eseguo lo script
|
|
If EgtLuaExecFile(sExecPath) Then
|
|
bOk = True
|
|
'' Recupero i risultati
|
|
'Dim nErr As Integer = 999
|
|
'EgtLuaGetGlobIntVar("MATERIAL.ERR", nErr)
|
|
'bOk = (nErr <= 0)
|
|
'If Not bOk Then EgtOutLog("ExecSlice Err=" & nErr.ToString())
|
|
Else
|
|
EgtOutLog("Error executing Slice Exec script " & sExecPath)
|
|
bOk = False
|
|
End If
|
|
' Cancello tavola globale
|
|
EgtLuaResetGlobVar("MATERIAL")
|
|
Return bOk
|
|
End Function
|
|
|
|
Friend Function ExecGenerate() As Boolean
|
|
EgtOutLog("-- Start ExecGenerate --")
|
|
' eseguo generazione
|
|
EgtLuaCreateGlobTable("PRINT")
|
|
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
|
|
Dim bOk As Boolean = EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\GcodeGenerate.lua")
|
|
If bOk Then
|
|
Dim nErr As Integer = 999
|
|
EgtLuaGetGlobIntVar("PRINT.ERR", nErr)
|
|
bOk = (nErr <= 0)
|
|
End If
|
|
' Cancello tavola globale
|
|
EgtLuaResetGlobVar("PRINT")
|
|
Return bOk
|
|
End Function
|
|
|
|
Friend Function ExecSolid() As Boolean
|
|
EgtOutLog("-- Start ExecGenerate --")
|
|
' eseguo generazione
|
|
EgtLuaCreateGlobTable("PRINT")
|
|
Dim bOk As Boolean = EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\CalcSolids.lua")
|
|
If bOk Then
|
|
Dim nErr As Integer = 999
|
|
EgtLuaGetGlobIntVar("PRINT.ERR", nErr)
|
|
bOk = (nErr <= 0)
|
|
End If
|
|
' Cancello tavola globale
|
|
EgtLuaResetGlobVar("PRINT")
|
|
Return bOk
|
|
End Function
|
|
|
|
End Module
|