EgtMachKernel 1.6l2 :
- possibile rendere corrente testa con utensile nullo (per laser e simili).
This commit is contained in:
Binary file not shown.
+23
-9
@@ -93,17 +93,31 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
|
||||
if ( pExit == nullptr)
|
||||
return false ;
|
||||
// recupero i dati dell'utensile
|
||||
if ( ! LoadTool( sHead, nExit, sTool))
|
||||
return false ;
|
||||
int nToolId = m_pGeomDB->GetFirstNameInGroup( nExitId, sTool) ;
|
||||
if ( nToolId == GDB_ID_NULL || m_pGeomDB->GetGdbType( nToolId) != GDB_TY_GROUP)
|
||||
return false ;
|
||||
int nToolId = GDB_ID_NULL ;
|
||||
double dTLen = 0 ;
|
||||
double dTDiam = 0 ;
|
||||
if ( ! m_pMchMgr->TdbSetCurrTool( sTool) ||
|
||||
! m_pMchMgr->TdbGetCurrToolParam( TPA_LEN, dTLen) ||
|
||||
! m_pMchMgr->TdbGetCurrToolParam( TPA_DIAM, dTDiam))
|
||||
return false ;
|
||||
// se definito
|
||||
if ( ! sTool.empty()) {
|
||||
if ( ! LoadTool( sHead, nExit, sTool))
|
||||
return false ;
|
||||
nToolId = m_pGeomDB->GetFirstNameInGroup( nExitId, sTool) ;
|
||||
if ( nToolId == GDB_ID_NULL || m_pGeomDB->GetGdbType( nToolId) != GDB_TY_GROUP)
|
||||
return false ;
|
||||
if ( ! m_pMchMgr->TdbSetCurrTool( sTool) ||
|
||||
! m_pMchMgr->TdbGetCurrToolParam( TPA_LEN, dTLen) ||
|
||||
! m_pMchMgr->TdbGetCurrToolParam( TPA_DIAM, dTDiam))
|
||||
return false ;
|
||||
}
|
||||
// altrimenti casi speciali senza utensile
|
||||
else {
|
||||
// tolgo eventuale utensile dalla testa
|
||||
if ( ! ResetHeadSet( sHead))
|
||||
return false ;
|
||||
nToolId = GDB_ID_NULL ;
|
||||
dTLen = 0 ;
|
||||
dTDiam = 0 ;
|
||||
m_pMchMgr->TdbSetCurrTool( sTool) ;
|
||||
}
|
||||
// assegno tutti i dati
|
||||
m_nCalcHeadId = nHeadId ;
|
||||
m_nCalcExitId = nExitId ;
|
||||
|
||||
+3
-3
@@ -352,9 +352,9 @@ Machine::LuaEmtStdHead( lua_State* L)
|
||||
// lettura campo 'TDir' dalla tabella
|
||||
Vector3d vtTDir ;
|
||||
LuaCheckTabFieldParam( L, 1, "TDir", vtTDir)
|
||||
// lettura campo 'ADir' dalla tabella
|
||||
// lettura eventuale campo 'ADir' dalla tabella
|
||||
Vector3d vtADir ;
|
||||
LuaCheckTabFieldParam( L, 1, "ADir", vtADir)
|
||||
LuaGetTabFieldParam( L, 1, "ADir", vtADir) ;
|
||||
// lettura eventuale campo 'Rot1W' dalla tabella (default 1)
|
||||
double dRot1W = 1 ;
|
||||
LuaGetTabFieldParam( L, 1, "Rot1W", dRot1W) ;
|
||||
@@ -420,7 +420,7 @@ Machine::LuaEmtMultiHead( lua_State* L)
|
||||
}
|
||||
// lettura campo 'ADir' dalla tabella
|
||||
Vector3d vtADir ;
|
||||
LuaCheckTabFieldParam( L, 1, "ADir", vtADir)
|
||||
LuaGetTabFieldParam( L, 1, "ADir", vtADir) ;
|
||||
// lettura eventuale campo 'Rot1W' dalla tabella (default 1)
|
||||
double dRot1W = 1 ;
|
||||
LuaGetTabFieldParam( L, 1, "Rot1W", dRot1W) ;
|
||||
|
||||
@@ -467,6 +467,11 @@ ToolsMgr::VerifyTool( int nFamily, string& sName, int& nType) const
|
||||
bool
|
||||
ToolsMgr::SetCurrTool( const std::string& sName)
|
||||
{
|
||||
// se nome vuoto, faccio reset
|
||||
if ( sName.empty()) {
|
||||
m_bCurrTool = false ;
|
||||
return false ;
|
||||
}
|
||||
// recupero i dati dell'utensile
|
||||
const ToolData* ptData = GetTool( sName) ;
|
||||
if ( ptData == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user