EgtMachKernel 1.6r8 :
- aggiunta gestione SCC (Solution Choice Criterion) nelle lavorazioni - possibilità di calcolo Tip con dimensioni massime anzichè quelle di lavoro - migliorato controllo pezzi prima di inserimento nei grezzi - migliorato caricamento tavola al cambio di gruppo di lavoro - aggiunta prima versione di risalita tra i percorsi di lavorazione in base a controllo collisioni (ora solo box) - in simulazione imposto variabile nome tavola prima di OnDispositionStart.
This commit is contained in:
+25
-13
@@ -87,8 +87,12 @@ Simulator::Start( void)
|
||||
return false ;
|
||||
// definisco tavola variabili globali
|
||||
bool bOk = m_pMachine->LuaCreateGlobTable( GLOB_VAR) ;
|
||||
// recupero dati tavola macchina
|
||||
Disposition* pDisp = GetDisposition( m_pGeomDB->GetUserObj( m_nOpId)) ;
|
||||
string sTable ;
|
||||
pDisp->GetTable( sTable) ;
|
||||
// richiamo gestione evento inizio e fine disposizione
|
||||
if ( ! OnDispositionStart( m_nOpId, m_nOpInd, 1, true) ||
|
||||
if ( ! OnDispositionStart( m_nOpId, m_nOpInd, 1, sTable, true) ||
|
||||
! OnDispositionEnd())
|
||||
return false ;
|
||||
// cerco la prima lavorazione valida
|
||||
@@ -202,6 +206,9 @@ Simulator::Move( int& nStatus)
|
||||
if ( pDisp != nullptr) {
|
||||
// cambio fase
|
||||
m_pMchMgr->SetCurrPhase( pDisp->GetPhase()) ;
|
||||
// recupero dati tavola
|
||||
string sTable ;
|
||||
pDisp->GetTable( sTable) ;
|
||||
// se con movimenti autonomi
|
||||
if ( ! pDisp->IsEmpty()) {
|
||||
// aggiorno utensile e assi conseguenti
|
||||
@@ -211,7 +218,7 @@ Simulator::Move( int& nStatus)
|
||||
}
|
||||
++ m_nOpInd ;
|
||||
// richiamo gestione evento inizio disposizione
|
||||
if ( ! OnDispositionStart( m_nOpId, m_nOpInd, pDisp->GetPhase(), false)) {
|
||||
if ( ! OnDispositionStart( m_nOpId, m_nOpInd, pDisp->GetPhase(), sTable, false)) {
|
||||
nStatus = MCH_SIM_ERR ;
|
||||
return false ;
|
||||
}
|
||||
@@ -223,7 +230,7 @@ Simulator::Move( int& nStatus)
|
||||
else {
|
||||
++ m_nOpInd ;
|
||||
// richiamo gestione evento inizio e fine disposizione
|
||||
if ( ! OnDispositionStart( m_nOpId, m_nOpInd, pDisp->GetPhase(), true) ||
|
||||
if ( ! OnDispositionStart( m_nOpId, m_nOpInd, pDisp->GetPhase(), sTable, true) ||
|
||||
! OnDispositionEnd()) {
|
||||
nStatus = MCH_SIM_ERR ;
|
||||
return false ;
|
||||
@@ -320,17 +327,20 @@ Simulator::Move( int& nStatus)
|
||||
m_pMachine->SetAxisPos( m_AxesName[i], dVal) ;
|
||||
}
|
||||
}
|
||||
// Eseguo movimento su arco (per ora sempre nel piano XY)
|
||||
// Eseguo movimento su arco
|
||||
else {
|
||||
// primi due assi lineari
|
||||
Point3d ptCen = pCamData->GetAxesCen() ;
|
||||
double dAngCen = pCamData->GetAxesAngCen() ;
|
||||
Vector3d vtCurr = Point3d( m_AxesVal[0], m_AxesVal[1], ptCen.z) - ptCen ;
|
||||
vtCurr.Rotate( Z_AX, m_dCoeff * dAngCen) ;
|
||||
m_pMachine->SetAxisPos( m_AxesName[0], ptCen.x + vtCurr.x) ;
|
||||
m_pMachine->SetAxisPos( m_AxesName[1], ptCen.y + vtCurr.y) ;
|
||||
Vector3d vtN = pCamData->GetAxesNormDir() ;
|
||||
Vector3d vtRot = Point3d( m_AxesVal[0], m_AxesVal[1], m_AxesVal[2]) - ptCen ;
|
||||
vtRot.Rotate( vtN, m_dCoeff * dAngCen) ;
|
||||
double dDeltaN = ( Point3d( AxesEnd[0], AxesEnd[1], AxesEnd[2]) - ptCen) * vtN ;
|
||||
m_pMachine->SetAxisPos( m_AxesName[0], ptCen.x + vtRot.x + m_dCoeff * dDeltaN * vtN.x) ;
|
||||
m_pMachine->SetAxisPos( m_AxesName[1], ptCen.y + vtRot.y + m_dCoeff * dDeltaN * vtN.y) ;
|
||||
m_pMachine->SetAxisPos( m_AxesName[2], ptCen.z + vtRot.z + m_dCoeff * dDeltaN * vtN.z) ;
|
||||
// altri assi
|
||||
for ( size_t i = 2 ; i < m_AxesName.size() ; ++ i) {
|
||||
for ( size_t i = 3 ; i < m_AxesName.size() ; ++ i) {
|
||||
double dVal = m_AxesVal[i] * ( 1 - m_dCoeff) + AxesEnd[i] * m_dCoeff ;
|
||||
m_pMachine->SetAxisPos( m_AxesName[i], dVal) ;
|
||||
}
|
||||
@@ -581,18 +591,20 @@ Simulator::OnOperationEnd( void)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Simulator::OnDispositionStart( int nOpId, int nOpInd, int nPhase, bool bEmpty)
|
||||
Simulator::OnDispositionStart( int nOpId, int nOpInd, int nPhase, const string& sTable, bool bEmpty)
|
||||
{
|
||||
// verifico esistenza funzione
|
||||
if ( ! m_pMachine->LuaExistsFunction( ON_SIMUL_DISPOSITION_START))
|
||||
return true ;
|
||||
// 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 della tavola corrente
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TABNAME, sTable) ;
|
||||
// assegno flag disposizione passiva
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_EMPTY, bEmpty) ;
|
||||
// verifico esistenza funzione
|
||||
if ( ! m_pMachine->LuaExistsFunction( ON_SIMUL_DISPOSITION_START))
|
||||
return true ;
|
||||
// chiamo la funzione di inizio disposizione
|
||||
bOk = bOk && m_pMachine->LuaCallFunction( ON_SIMUL_DISPOSITION_START) ;
|
||||
return bOk ;
|
||||
|
||||
Reference in New Issue
Block a user