EgtExecutor 1.8i1 :

- aggiunte funzioni ExeSetTempDir e ExeGetTempDir
- aggiunte funzioni Exe e Lua VolZmapSetMortiserTool e VolZmapSetChiselTool
- estesa funzione Lua VolZmapMillingStep.
This commit is contained in:
Dario Sassi
2017-09-07 09:22:36 +00:00
parent cfbe224372
commit 11ee55fb11
4 changed files with 205 additions and 15 deletions
+91 -14
View File
@@ -72,29 +72,104 @@ LuaVolZmapSetAdvTool( lua_State* L)
//----------------------------------------------------------------------------
static int
LuaVolZmapMillingStep( lua_State* L)
LuaVolZmapSetMortiserTool( lua_State* L)
{
// 5 o 6 parametri : nId, ptPs, vtDs, ptPe, vtDe [, nRefType]
// 6 parametri : Id, sToolName, dLen, dWidth, dThick, dCornR
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptPs ;
LuaCheckParam( L, 2, ptPs)
Vector3d vtDs ;
LuaCheckParam( L, 3, vtDs)
Point3d ptPe ;
LuaCheckParam( L, 4, ptPe)
Vector3d vtDe ;
LuaCheckParam( L, 5, vtDe)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
string sToolName ;
LuaCheckParam( L, 2, sToolName)
double dLen ;
LuaCheckParam( L, 3, dLen)
double dWidth ;
LuaCheckParam( L, 4, dWidth)
double dThick ;
LuaCheckParam( L, 5, dThick)
double dCornR ;
LuaCheckParam( L, 6, dCornR)
LuaClearStack( L) ;
// eseguo movimento di fresatura con l'utensile già associato a Zmap
bool bOk = ExeVolZmapMillingStep( nId, ptPs, vtDs, ptPe, vtDe, nRefType) ;
// imposto mortasatrice a Zmap indicato
bool bOk = ExeVolZmapSetMortiserTool( nId, sToolName, dLen, dWidth, dThick, dCornR) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaVolZmapSetChiselTool( lua_State* L)
{
// 5 parametri : Id, sToolName, dLen, dWidth, dThick
int nId ;
LuaCheckParam( L, 1, nId)
string sToolName ;
LuaCheckParam( L, 2, sToolName)
double dLen ;
LuaCheckParam( L, 3, dLen)
double dWidth ;
LuaCheckParam( L, 4, dWidth)
double dThick ;
LuaCheckParam( L, 5, dThick)
LuaClearStack( L) ;
// imposto scalpello a Zmap indicato
bool bOk = ExeVolZmapSetChiselTool( nId, sToolName, dLen, dWidth, dThick) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaVolZmapMillingStep( lua_State* L)
{
// 5 o 6 o 7 o 8 parametri : nId, ptPs, vtDs [, vtAs], ptPe, vtDe [, vtAe], [, nRefType]
int n = lua_gettop( L) ;
if ( n == 5 || n == 6) {
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptPs ;
LuaCheckParam( L, 2, ptPs)
Vector3d vtDs ;
LuaCheckParam( L, 3, vtDs)
Point3d ptPe ;
LuaCheckParam( L, 4, ptPe)
Vector3d vtDe ;
LuaCheckParam( L, 5, vtDe)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// eseguo movimento di fresatura con l'utensile già associato a Zmap
bool bOk = ExeVolZmapMillingStep( nId, ptPs, vtDs, ptPe, vtDe, nRefType) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
else {
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptPs ;
LuaCheckParam( L, 2, ptPs)
Vector3d vtDs ;
LuaCheckParam( L, 3, vtDs)
Vector3d vtAs ;
LuaCheckParam( L, 4, vtAs)
Point3d ptPe ;
LuaCheckParam( L, 5, ptPe)
Vector3d vtDe ;
LuaCheckParam( L, 6, vtDe)
Vector3d vtAe ;
LuaCheckParam( L, 7, vtAe)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 8, nRefType) ;
LuaClearStack( L) ;
// eseguo movimento di fresatura con l'utensile già associato a Zmap
bool bOk = ExeVolZmapMillingStep( nId, ptPs, vtDs, vtAs, ptPe, vtDe, vtAe, nRefType) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
}
//----------------------------------------------------------------------------
static int
LuaVolZmapGetDepth( lua_State* L)
@@ -152,6 +227,8 @@ LuaInstallGdbModifyVol( LuaMgr& luaMgr)
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetStdTool", LuaVolZmapSetStdTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetAdvTool", LuaVolZmapSetAdvTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetMortiserTool", LuaVolZmapSetMortiserTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetChiselTool", LuaVolZmapSetChiselTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapMillingStep", LuaVolZmapMillingStep) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapGetDepth", LuaVolZmapGetDepth) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapAvoidBox", LuaVolZmapAvoidBox) ;