EgtMachKernel 2.3d2 :

- aggiunta gestione Dist e StemDiam in utensili
- aggiunta funzione EmtModifyExitPosition
- aggiunta gestione Dist a OnSetHead e aggiornamento posizione uscita.
This commit is contained in:
Dario Sassi
2021-04-06 06:40:06 +00:00
parent 239ef2f5de
commit 50e2127a41
9 changed files with 100 additions and 21 deletions
+24 -15
View File
@@ -29,21 +29,23 @@ using namespace std ;
//----------------------------------------------------------------------------
static const string EMC_VAR = "EMC" ; // tabella variabili locali per calcolo
static const string EVAR_TABNAME = ".TABNAME" ; // (string) nome della tavola macchina
static const string EVAR_HEAD = ".HEAD" ; // (string) nome della testa
static const string EVAR_EXIT = ".EXIT" ; // (int) numero dell'uscita
static const string EVAR_TOOL = ".TOOL" ; // (string) nome dell'utensile
static const string EVAR_TOTDIAM = ".TOTDIAM" ; // (num) diametro di ingombro dell'utensile
static const string EVAR_TOTLEN = ".TOTLEN" ; // (num) lunghezza di ingombro dell'utensile
static const string EVAR_L1 = ".L1" ; // (num) valore del primo asse lineare
static const string EVAR_L2 = ".L2" ; // (num) valore del secondo asse lineare
static const string EVAR_L3 = ".L3" ; // (num) valore del terzo asse lineare
static const string EVAR_R1 = ".R1" ; // (num) valore del primo asse rotante
static const string EVAR_R2 = ".R2" ; // (num) valore del secondo asse rotante
static const string EVAR_R3 = ".R3" ; // (num) valore del terzo asse rotante
static const string EVAR_R4 = ".R4" ; // (num) valore del quarto asse rotante
static const string EVAR_ERROR = ".ERR" ; // OUT (int) codice di errore ( 0 = ok)
static const string EVAR_STAT = ".STAT" ; // OUT (int) codice di stato ( 0 = ok)
static const string EVAR_TABNAME = ".TABNAME" ; // (string) nome della tavola macchina
static const string EVAR_HEAD = ".HEAD" ; // (string) nome della testa
static const string EVAR_EXIT = ".EXIT" ; // (int) numero dell'uscita
static const string EVAR_TOOL = ".TOOL" ; // (string) nome dell'utensile
static const string EVAR_TOTDIAM = ".TOTDIAM" ; // (num) diametro di ingombro dell'utensile
static const string EVAR_TOTLEN = ".TOTLEN" ; // (num) lunghezza di ingombro dell'utensile
static const string EVAR_DIST = ".DIST" ; // (num) distanza dell'utensile (per seghe a catena)
static const string EVAR_EXITPOS = ".EXITPOS" ; // (point) posizione attuale dell'uscita
static const string EVAR_L1 = ".L1" ; // (num) valore del primo asse lineare
static const string EVAR_L2 = ".L2" ; // (num) valore del secondo asse lineare
static const string EVAR_L3 = ".L3" ; // (num) valore del terzo asse lineare
static const string EVAR_R1 = ".R1" ; // (num) valore del primo asse rotante
static const string EVAR_R2 = ".R2" ; // (num) valore del secondo asse rotante
static const string EVAR_R3 = ".R3" ; // (num) valore del terzo asse rotante
static const string EVAR_R4 = ".R4" ; // (num) valore del quarto asse rotante
static const string EVAR_ERROR = ".ERR" ; // OUT (int) codice di errore ( 0 = ok)
static const string EVAR_STAT = ".STAT" ; // OUT (int) codice di stato ( 0 = ok)
static const string EVAR_AUXINFO = ".AUXINFO" ; // OUT (string) stringa con info ausiliarie
static const string EMC_VAR_BACKUP = "QQQ_EMC" ; // nome del backup della tabella sopra indicata
static const string AXIS_NAME_PROTECTEDAREAS = "PRA" ;
@@ -226,6 +228,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
double dTDiam = 0 ;
double dTOvLen = 0 ;
double dTOvDiam = 0 ;
double dTDist = 0 ;
// se definito
if ( ! sTool.empty()) {
// carico anche gli utensili su eventuali altre uscite della testa
@@ -245,6 +248,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
! m_pMchMgr->TdbGetCurrToolParam( TPA_TOTLEN, dTOvLen) ||
! m_pMchMgr->TdbGetCurrToolParam( TPA_TOTDIAM, dTOvDiam))
return false ;
m_pMchMgr->TdbGetCurrToolParam( TPA_DIST, dTDist) ; // opzionale
}
// altrimenti casi speciali senza utensile
else {
@@ -256,6 +260,7 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
dTDiam = 0 ;
dTOvLen = 0 ;
dTOvDiam = 0 ;
dTDist = 0 ;
m_pMchMgr->TdbSetCurrTool( "") ;
}
// assegno tutti i dati
@@ -280,8 +285,10 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_HEAD, sHead) ;
bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_EXIT, nExit) ;
bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_TOOL, sTool) ;
bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_EXITPOS, m_ptCalcPos) ;
bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_TOTDIAM, dTOvDiam) ;
bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_TOTLEN, dTOvLen) ;
bOk = bOk && LuaSetGlobVar( EMC_VAR + EVAR_DIST, dTDist) ;
// chiamo funzione
bOk = bOk && LuaCallFunction( ON_SET_HEAD) ;
// reset variabili
@@ -292,6 +299,8 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
// in caso di errore esco
if ( ! bOk)
return false ;
// aggiorno
m_ptCalcPos = pExit->GetPos() ;
}
// determino la catena cinematica
return CalculateKinematicChain() ;