EgtMachKernel 1.6n3 :

- prima versione della gestione delle fasi di lavorazione.
This commit is contained in:
Dario Sassi
2016-02-11 10:20:54 +00:00
parent 63f3492566
commit a8c34397be
30 changed files with 488 additions and 133 deletions
+11 -4
View File
@@ -44,6 +44,7 @@ static const string GVAR_FILE = ".FILE" ; // (string) path file di ou
static const string GVAR_INFO = ".INFO" ; // (string) informazioni iniziali
static const string GVAR_DISPID = ".DISPID" ; // (int) identificativo disposizione
static const string GVAR_DISPIND = ".DISPIND" ; // (int) indice disposizione
static const string GVAR_PHASE = ".PHASE" ; // (int) indice fase
static const string GVAR_TABNAME = ".TABNAME" ; // (string) nome tavola
static const string GVAR_TABORI1 = ".TABORI1" ; // (Point3d) prima origine di tavola
static const string GVAR_FIXID = ".FIXID" ; // (int) identificativo bloccaggio (fixture)
@@ -220,12 +221,16 @@ bool
Generator::ProcessDisposition( int nOpId, int nOpInd)
{
// Parametri della disposizione
Disposition* pDisp = dynamic_cast<Disposition*>( m_pGeomDB->GetUserObj( nOpId)) ;
Disposition* pDisp = GetDisposition( m_pGeomDB->GetUserObj( nOpId)) ;
if ( pDisp == nullptr)
return false ;
// Imposto la fase
int nPhase = pDisp->GetPhase() ;
m_pMchMgr->SetCurrPhase( nPhase) ;
// Emetto inizio disposizione
if ( ! OnDispositionStart( nOpId, nOpInd))
if ( ! OnDispositionStart( nOpId, nOpInd, nPhase))
return false ;
// Emetto dati tavola
@@ -359,7 +364,7 @@ bool
Generator::ProcessClEnt( int nEntId, int nEntInd, int nClPathId, int nClPathInd, int nOpId, int nOpInd)
{
// Recupero i dati Cam
CamData* pCamData = dynamic_cast<CamData*>( m_pGeomDB->GetUserObj( nEntId)) ;
CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
if ( pCamData == nullptr || pCamData->GetAxesStatus() != CamData::AS_OK)
return false ;
const DBLVECTOR& AxesEnd = pCamData->GetAxisVal() ;
@@ -481,13 +486,15 @@ Generator::OnProgramEnd( void)
//----------------------------------------------------------------------------
bool
Generator::OnDispositionStart( int nOpId, int nOpInd)
Generator::OnDispositionStart( int nOpId, int nOpInd, int nPhase)
{
// definisco tavola variabili locali (temporanee)
bool bOk = m_pMachine->LuaCreateGlobTable( TEMP_VAR) ;
// assegno identificativo e indice disposizione
bOk = 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) ;
// chiamo la funzione di inizio disposizione
bOk = bOk && m_pMachine->LuaCallFunction( ON_DISPOSITION_START) ;
// cancello variabili locali