EgtrExecutor :

- aggiunta a Exe e Lua VolZmapSetAdvTool.
This commit is contained in:
Dario Sassi
2017-03-09 12:42:33 +00:00
parent ffb55dcda2
commit c157f55f23
2 changed files with 58 additions and 2 deletions
+28
View File
@@ -48,6 +48,34 @@ ExeVolZmapSetStdTool( int nId, const string& sToolName, double dLen, double dDia
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeVolZmapSetAdvTool( int nId, const string& sToolName,
double dLen, double dDiam, double dTipLen, double dTipDiam, double dCornR)
{
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->SetAdvTool( sToolName, dLen, dDiam / 2, dTipLen, dTipDiam / 2, dCornR)) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtVolZmapSetAdvTool(" + IdToString( nId) + "," +
sToolName + "," +
ToString( dLen) + "," +
ToString( dDiam) + "," +
ToString( dTipLen) + "," +
ToString( dTipDiam) + "," +
ToString( dCornR) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeVolZmapMillingStep( int nId, const Point3d& ptPs, const Vector3d& vtDs,
+30 -2
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2016-2016
// EgalTech 2016-2017
//----------------------------------------------------------------------------
// File : LUA_GdbModifyVol.cpp Data : 27.10.16 Versione : 1.6v7
// File : LUA_GdbModifyVol.cpp Data : 09.03.17 Versione : 1.8c4
// Contenuto : Funzioni di modifica dei solidi per LUA.
//
//
@@ -43,6 +43,33 @@ LuaVolZmapSetStdTool( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaVolZmapSetAdvTool( lua_State* L)
{
// 7 parametri : Id, sToolName, dLen, dDiam, dTipLen, dTipDiam, dCornR
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 dTipLen ;
LuaCheckParam( L, 5, dTipLen)
double dTipDiam ;
LuaCheckParam( L, 6, dTipDiam)
double dCornR ;
LuaCheckParam( L, 7, dCornR)
LuaClearStack( L) ;
// imposto utensile standard a Zmap indicato
bool bOk = ExeVolZmapSetAdvTool( nId, sToolName, dLen, dDiam, dTipLen, dTipDiam, dCornR) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaVolZmapMillingStep( lua_State* L)
@@ -124,6 +151,7 @@ LuaInstallGdbModifyVol( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetStdTool", LuaVolZmapSetStdTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetAdvTool", LuaVolZmapSetAdvTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapMillingStep", LuaVolZmapMillingStep) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapGetDepth", LuaVolZmapGetDepth) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapAvoidBox", LuaVolZmapAvoidBox) ;