EgtMachKernel 1.6u1 :

- aggiunto richiamo di OnSimulDispositionStarting con nuova disposizione in simulazione.
This commit is contained in:
Dario Sassi
2016-09-12 06:43:33 +00:00
parent 50a3ab4ebf
commit 381d58494d
5 changed files with 36 additions and 3 deletions
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -977,7 +977,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
// recupero il box del grezzo in globale
BBox3d b3Raw ;
if ( ! GetRawGlobBox( m_nPhase, nPathId, b3Raw) || b3Raw.IsEmpty()) {
LOG_INFO( GetEMkLogger(), "Error in SawFinishing : Empty RawBox") ;
LOG_INFO( GetEMkLogger(), "Error in Milling : Empty RawBox") ;
return false ;
}
+1
View File
@@ -126,6 +126,7 @@ static const std::string ON_RAPID = "OnRapid" ;
static const std::string ON_LINEAR = "OnLinear" ;
static const std::string ON_ARC = "OnArc" ;
// Funzioni simulazione
static const std::string ON_SIMUL_DISPOSITION_STARTING = "OnSimulDispositionStarting" ;
static const std::string ON_SIMUL_DISPOSITION_START = "OnSimulDispositionStart" ;
static const std::string ON_SIMUL_DISPOSITION_END = "OnSimulDispositionEnd" ;
static const std::string ON_SIMUL_TOOL_SELECT = "OnSimulToolSelect" ;
+32 -2
View File
@@ -208,8 +208,6 @@ Simulator::Move( int& nStatus)
// se disposizione con cambio di fase
Disposition* pDisp = GetDisposition( m_pGeomDB->GetUserObj( m_nOpId)) ;
if ( pDisp != nullptr) {
// cambio fase
m_pMchMgr->SetCurrPhase( pDisp->GetPhase()) ;
// recupero dati tavola
string sTable ;
pDisp->GetTable( sTable) ;
@@ -217,6 +215,13 @@ Simulator::Move( int& nStatus)
pDisp->GetTableRef1( ptOri1) ;
// se con movimenti autonomi
if ( ! pDisp->IsEmpty()) {
// richiamo gestione evento appena prima di inizio disposizione
if ( ! OnDispositionStarting( m_nOpId, m_nOpInd, pDisp->GetPhase(), sTable, ptOri1, false)) {
nStatus = MCH_SIM_ERR ;
return false ;
}
// cambio fase
m_pMchMgr->SetCurrPhase( pDisp->GetPhase()) ;
// aggiorno utensile e assi conseguenti
if ( ! UpdateTool()) {
nStatus = MCH_SIM_ERR ;
@@ -234,6 +239,8 @@ Simulator::Move( int& nStatus)
}
// altrimenti disposizione passiva
else {
// cambio fase
m_pMchMgr->SetCurrPhase( pDisp->GetPhase()) ;
++ m_nOpInd ;
// richiamo gestione evento inizio e fine disposizione
if ( ! OnDispositionStart( m_nOpId, m_nOpInd, pDisp->GetPhase(), sTable, ptOri1, true) ||
@@ -602,6 +609,29 @@ Simulator::OnOperationEnd( void)
return false ;
}
//----------------------------------------------------------------------------
bool
Simulator::OnDispositionStarting( int nOpId, int nOpInd, int nPhase,
const string& sTable, const Point3d& ptOri1, bool bEmpty)
{
// assegno identificativo e indice disposizione
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_DISPID, nOpId) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_DISPIND, nOpInd) ;
// assegno nuovo indice di fase
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PHASE, nPhase) ;
// assegno nome e valore riferimento della tavola corrente
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TABNAME, sTable) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TABORI1, ptOri1) ;
// assegno flag disposizione passiva
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_EMPTY, bEmpty) ;
// verifico esistenza funzione
if ( ! m_pMachine->LuaExistsFunction( ON_SIMUL_DISPOSITION_STARTING))
return true ;
// chiamo la funzione di inizio disposizione
bOk = bOk && m_pMachine->LuaCallFunction( ON_SIMUL_DISPOSITION_STARTING) ;
return bOk ;
}
//----------------------------------------------------------------------------
bool
Simulator::OnDispositionStart( int nOpId, int nOpInd, int nPhase,
+2
View File
@@ -43,6 +43,8 @@ class Simulator
private :
bool OnOperationEnd( void) ;
bool OnDispositionStarting( int nOpId, int nOpInd, int nPhase,
const std::string& sTable, const Point3d& ptOri1, bool bEmpty) ;
bool OnDispositionStart( int nOpId, int nOpInd, int nPhase,
const std::string& sTable, const Point3d& ptOri1, bool bEmpty) ;
bool OnDispositionEnd( void) ;