EgtExecutor :

- aggiunte Exe e Lua CAvSetSawTool e VolZmapSetSawTool.
This commit is contained in:
Dario Sassi
2018-07-06 10:10:58 +00:00
parent be54bcf382
commit d3a24f1c9b
4 changed files with 91 additions and 0 deletions
+9
View File
@@ -49,6 +49,15 @@ ExeCAvSetAdvTool( double dToolLen, double dToolDiam, double dTipLen, double dTip
return s_pCAvTlStm->SetAdvTool( dToolLen, dToolDiam / 2, dTipLen, dTipDiam / 2, dToolCornR) ;
}
//----------------------------------------------------------------------------
bool
ExeCAvSetSawTool( double dToolLen, double dToolDiam, double dThickness, double dStemDiam, double dToolCornR)
{
if ( IsNull( s_pCAvTlStm))
return false ;
return s_pCAvTlStm->SetSawTool( dToolLen, dToolDiam / 2, dThickness, dStemDiam / 2, dToolCornR) ;
}
//----------------------------------------------------------------------------
bool
ExeCAvSetGenTool( int nToolSectId)
+28
View File
@@ -211,6 +211,34 @@ ExeVolZmapSetAdvTool( int nId, const string& sToolName,
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeVolZmapSetSawTool( int nId, const string& sToolName,
double dLen, double dDiam, double dThick, double dStemDiam, double dCornR, int nFlag)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero lo Zmap e assegno i dati dell'utensile
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
bool bOk = ( pVZM != nullptr &&
pVZM->SetSawTool( sToolName, dLen, dDiam / 2, dThick, dStemDiam / 2, dCornR, nFlag)) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtVolZmapSetSawTool(" + IdToString( nId) + "," +
sToolName + "," +
ToString( dLen) + "," +
ToString( dDiam) + "," +
ToString( dThick) + "," +
ToString( dStemDiam) + "," +
ToString( dCornR) + "," +
ToString( nFlag) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeVolZmapSetGenTool( int nId, const string& sToolName, int nToolSectId, int nFlag)
+24
View File
@@ -63,6 +63,29 @@ LuaCAvSetAdvTool( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCAvSetSawTool( lua_State* L)
{
// 5 parametri : dToolLen, dToolDiam, dThickness, dStemDiam, dToolCornR
double dToolLen ;
LuaCheckParam( L, 1, dToolLen)
double dToolDiam ;
LuaCheckParam( L, 2, dToolDiam)
double dThickness ;
LuaCheckParam( L, 3, dThickness)
double dStemDiam ;
LuaCheckParam( L, 4, dStemDiam)
double dToolCornR ;
LuaCheckParam( L, 5, dToolCornR)
LuaClearStack( L) ;
// assegno dati utensile lama per Collision Avoidance
bool bOk = ExeCAvSetSawTool( dToolLen, dToolDiam, dThickness, dStemDiam, dToolCornR) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCAvSetGenTool( lua_State* L)
@@ -148,6 +171,7 @@ LuaInstallCAvTool( LuaMgr& luaMgr)
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvSetStdTool", LuaCAvSetStdTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvSetAdvTool", LuaCAvSetAdvTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvSetSawTool", LuaCAvSetSawTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvSetGenTool", LuaCAvSetGenTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvGetToolOutline", LuaCAvGetToolOutline) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvToolPosStm", LuaCAvToolPosStm) ;
+30
View File
@@ -132,6 +132,35 @@ LuaVolZmapSetAdvTool( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaVolZmapSetSawTool( lua_State* L)
{
// 7 o 8 parametri : Id, sToolName, dLen, dDiam, dThick, dStemDiam, dCornR, nFlag
int nId ;
LuaCheckParam( L, 1, nId)
string sToolName ;
LuaCheckParam( L, 2, sToolName)
double dLen ;
LuaCheckParam( L, 3, dLen)
double dDiam ;
LuaCheckParam( L, 4, dDiam)
double dThick ;
LuaCheckParam( L, 5, dThick)
double dStemDiam ;
LuaCheckParam( L, 6, dStemDiam)
double dCornR ;
LuaCheckParam( L, 7, dCornR)
int nFlag = 1 ;
LuaGetParam( L, 8, nFlag) ;
LuaClearStack( L) ;
// imposto utensile avanzato a Zmap indicato
bool bOk = ExeVolZmapSetSawTool( nId, sToolName, dLen, dDiam, dThick, dStemDiam, dCornR, nFlag) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaVolZmapSetGenTool( lua_State* L)
@@ -375,6 +404,7 @@ LuaInstallGdbModifyVol( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveVolZmapPart", LuaRemoveVolZmapPart) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetStdTool", LuaVolZmapSetStdTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetAdvTool", LuaVolZmapSetAdvTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetSawTool", LuaVolZmapSetSawTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetGenTool", LuaVolZmapSetGenTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetMortiserTool", LuaVolZmapSetMortiserTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetChiselTool", LuaVolZmapSetChiselTool) ;