EgtExecutor :
- aggiunta funzione Exe e Lua VolZmapSetGenTool.
This commit is contained in:
+32
-9
@@ -168,7 +168,6 @@ ExeVolZmapSetStdTool( int nId, const string& sToolName, double dLen, double dDia
|
||||
// recupero lo Zmap e assegno i dati dell'utensile
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pVZM != nullptr && pVZM->SetStdTool( sToolName, dLen, 0.5 * dDiam, dCornR, nFlag)) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapSetStdTool(" + IdToString( nId) + "," +
|
||||
@@ -195,7 +194,6 @@ ExeVolZmapSetAdvTool( int nId, const string& sToolName,
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pVZM != nullptr &&
|
||||
pVZM->SetAdvTool( sToolName, dLen, dDiam / 2, dTipLen, dTipDiam / 2, dCornR, nFlag)) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapSetAdvTool(" + IdToString( nId) + "," +
|
||||
@@ -213,6 +211,33 @@ ExeVolZmapSetAdvTool( int nId, const string& sToolName,
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeVolZmapSetGenTool( int nId, const string& sToolName, int nToolSectId, int nFlag)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero lo Zmap
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pVZM != nullptr) ;
|
||||
// recupero la sezione dell'utensile
|
||||
const ICurveComposite* pCC = GetCurveComposite( pGeomDB->GetGeoObj( nToolSectId)) ;
|
||||
bOk = ( bOk && pCC != nullptr) ;
|
||||
// assegno i dati dell'utensile
|
||||
bOk = ( bOk && pVZM->SetGenTool( sToolName, pCC, nFlag)) ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapSetGenTool(" + IdToString( nId) + "," +
|
||||
sToolName + "," +
|
||||
IdToString( nToolSectId) + "," +
|
||||
ToString( nFlag) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeVolZmapSetMortiserTool( int nId, const string& sToolName,
|
||||
@@ -224,16 +249,15 @@ ExeVolZmapSetMortiserTool( int nId, const string& sToolName,
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pVZM != nullptr &&
|
||||
pVZM->SetMortiserTool( sToolName, dLen, dWidth, dThick, dCornR, nFlag)) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapSetMortiserTool(" + IdToString( nId) + "," +
|
||||
sToolName + "," +
|
||||
ToString( dLen) + "," +
|
||||
ToString( dWidth) + "," +
|
||||
ToString( dThick) + "," +
|
||||
ToString( dCornR) + "," +
|
||||
ToString( nFlag) + ")" +
|
||||
ToString( dLen) + "," +
|
||||
ToString( dWidth) + "," +
|
||||
ToString( dThick) + "," +
|
||||
ToString( dCornR) + "," +
|
||||
ToString( nFlag) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
@@ -252,7 +276,6 @@ ExeVolZmapSetChiselTool( int nId, const string& sToolName,
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pVZM != nullptr &&
|
||||
pVZM->SetChiselTool( sToolName, dLen, dWidth, dThick, nFlag)) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapSetChiselTool(" + IdToString( nId) + "," +
|
||||
|
||||
+23
-1
@@ -125,13 +125,34 @@ LuaVolZmapSetAdvTool( lua_State* L)
|
||||
int nFlag = 1 ;
|
||||
LuaGetParam( L, 8, nFlag) ;
|
||||
LuaClearStack( L) ;
|
||||
// imposto utensile standard a Zmap indicato
|
||||
// imposto utensile avanzato a Zmap indicato
|
||||
bool bOk = ExeVolZmapSetAdvTool( nId, sToolName, dLen, dDiam, dTipLen, dTipDiam, dCornR, nFlag) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaVolZmapSetGenTool( lua_State* L)
|
||||
{
|
||||
// 3 o 4 parametri : Id, sToolName, ToolSectId, nFlag
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
string sToolName ;
|
||||
LuaCheckParam( L, 2, sToolName)
|
||||
int nToolSectId ;
|
||||
LuaCheckParam( L, 3, nToolSectId)
|
||||
int nFlag = 1 ;
|
||||
LuaGetParam( L, 4, nFlag) ;
|
||||
LuaClearStack( L) ;
|
||||
// imposto utensile generico a Zmap indicato
|
||||
bool bOk = ExeVolZmapSetGenTool( nId, sToolName, nToolSectId, nFlag) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaVolZmapSetMortiserTool( lua_State* L)
|
||||
@@ -333,6 +354,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( "EgtVolZmapSetGenTool", LuaVolZmapSetGenTool) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetMortiserTool", LuaVolZmapSetMortiserTool) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetChiselTool", LuaVolZmapSetChiselTool) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapMillingStep", LuaVolZmapMillingStep) ;
|
||||
|
||||
Reference in New Issue
Block a user