EgtMachKernel :

- in simulazione aggiunta possibilità di gestire extra-corse di assi ausiliari in OnMoveStart
- aggiunta funzione lua EmtSetOutstrokeInfo.
This commit is contained in:
Dario Sassi
2018-04-16 16:10:37 +00:00
parent 5ec2993913
commit 77c476b1dc
6 changed files with 51 additions and 6 deletions
+14 -3
View File
@@ -891,11 +891,15 @@ Simulator::ManageMove( int& nStatus)
// Se inizio di nuova entità
if ( m_nEntId != GDB_ID_NULL && m_dCoeff < EPS_ZERO) {
++ m_nEntInd ;
if ( ! OnMoveStart( pCamData)) {
int nErr ;
if ( ! OnMoveStart( pCamData, nErr)) {
if ( Stopped())
return true ;
else {
nStatus = MCH_SIM_ERR ;
if ( nErr == 1)
nStatus = MCH_SIM_OUTSTROKE ;
else
nStatus = MCH_SIM_ERR ;
return false ;
}
}
@@ -1385,8 +1389,10 @@ Simulator::OnPathEndAux( int nInd, const string& sAE)
//----------------------------------------------------------------------------
bool
Simulator::OnMoveStart( const CamData* pCamData)
Simulator::OnMoveStart( const CamData* pCamData, int& nErr)
{
// reset stato di errore da script
nErr = 0 ;
// recupero e assegno i dati
// dati generali
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEID, m_nEntId) ;
@@ -1424,6 +1430,11 @@ Simulator::OnMoveStart( const CamData* pCamData)
return false ;
}
// verifico codice di errore
m_pMachine->LuaGetGlobVar( GLOB_VAR + GVAR_ERR, nErr) ;
if ( nErr != 0)
return false ;
// forzo aggiornamento posizione assi (possono essere stati mossi nello script)
UpdateAxesPos() ;