EgtMachKernel :
- aggiunta possibilità di fresare e svuotare direttamente i testi - migliorata gestione PMIN e PMAX dei percorsi di lavoro - aggiunti MMIN e MMAX alle lavorazioni.
This commit is contained in:
+20
-8
@@ -570,8 +570,13 @@ Simulator::FindAndManageOperationStart( bool bStart, bool bFirst, int& nStatus)
|
||||
++ m_nOpInd ;
|
||||
// imposto la lavorazione come corrente
|
||||
m_pMchMgr->SetCurrMachining( m_nOpId) ;
|
||||
// recupero punti di minimo e massimo ingombro
|
||||
int nClId = m_pGeomDB->GetFirstNameInGroup( m_nOpId, MCH_CL) ;
|
||||
Point3d ptMin, ptMax ;
|
||||
m_pGeomDB->GetInfo( nClId, KEY_MMIN, ptMin) ;
|
||||
m_pGeomDB->GetInfo( nClId, KEY_MMAX, ptMax) ;
|
||||
// richiamo gestione evento inizio lavorazione
|
||||
if ( ! OnMachiningStart( m_nOpId, m_nOpInd)) {
|
||||
if ( ! OnMachiningStart( m_nOpId, m_nOpInd, ptMin, ptMax)) {
|
||||
if ( Stopped())
|
||||
return true ;
|
||||
else {
|
||||
@@ -727,9 +732,11 @@ Simulator::FindAndManagePathStart( int& nStatus)
|
||||
// se trovato nuovo CLpath con entità, gestisco inizio percorso di lavoro
|
||||
if ( m_nEntId != GDB_ID_NULL) {
|
||||
++ m_nCLPathInd ;
|
||||
// recupero punto di inizio del percorso
|
||||
// recupero punti di inizio e fine percorso
|
||||
Point3d ptStart ;
|
||||
m_pGeomDB->GetInfo( m_nCLPathId, KEY_START, ptStart) ;
|
||||
Point3d ptEnd ;
|
||||
m_pGeomDB->GetInfo( m_nCLPathId, KEY_END, ptEnd) ;
|
||||
// recupero versore estrusione associato al percorso (normale al piano di interpolazione)
|
||||
Vector3d vtExtr ;
|
||||
m_pGeomDB->GetInfo( m_nCLPathId, KEY_EXTR, vtExtr) ;
|
||||
@@ -748,7 +755,7 @@ Simulator::FindAndManagePathStart( int& nStatus)
|
||||
m_nAuxEInd = 0 ;
|
||||
m_nAuxETot = 0 ;
|
||||
// richiamo gestione evento inizio percorso di lavoro
|
||||
if ( ! OnPathStart( m_nCLPathId, m_nCLPathInd, m_nAuxSTot, ptStart, vtExtr, ptMin, ptMax, dElev)) {
|
||||
if ( ! OnPathStart( m_nCLPathId, m_nCLPathInd, m_nAuxSTot, ptStart, ptEnd, vtExtr, ptMin, ptMax, dElev)) {
|
||||
if ( Stopped())
|
||||
return true ;
|
||||
else {
|
||||
@@ -944,8 +951,8 @@ Simulator::ManageMove( int& nStatus)
|
||||
vtRot.Rotate( vtN, dPrevCoeff * dAngCen) ;
|
||||
// approssimo movimento con 1 o più step a seconda ci sia Vmill
|
||||
int nStep = 1 ;
|
||||
const double ANG_STEP = 5.0 ;
|
||||
const double LEN_STEP = 0.5 ;
|
||||
const double ANG_STEP = 15.0 ;
|
||||
const double LEN_STEP = 1.0 ;
|
||||
if ( m_nVmId != GDB_ID_NULL)
|
||||
nStep = int( max( max( abs( dDiffAng) / ANG_STEP, abs( dDiffAng * DEGTORAD * dRad) / LEN_STEP), 1.0)) ;
|
||||
for ( int i = 1 ; i <= nStep ; ++ i) {
|
||||
@@ -1263,12 +1270,16 @@ Simulator::OnToolDeselect( const std::string& sNextTool, const string& sNextHead
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Simulator::OnMachiningStart( int nOpId, int nOpInd)
|
||||
Simulator::OnMachiningStart( int nOpId, int nOpInd, const Point3d& ptMin, const Point3d& ptMax)
|
||||
{
|
||||
// assegno identificativo e indice lavorazione
|
||||
if ( ! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MCHID, nOpId) ||
|
||||
! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MCHIND, nOpInd))
|
||||
return false ;
|
||||
// assegno punti estremi dell'ingombro della lavorazione
|
||||
if ( ! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MMIN, ptMin) ||
|
||||
! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MMAX, ptMax) )
|
||||
return false ;
|
||||
// verifico esistenza funzione
|
||||
if ( ! m_pMachine->LuaExistsFunction( ON_SIMUL_MACHINING_START))
|
||||
return true ;
|
||||
@@ -1295,7 +1306,7 @@ Simulator::OnMachiningEnd( void)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Simulator::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart,
|
||||
Simulator::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
|
||||
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax, double dElev)
|
||||
{
|
||||
// assegno identificativo e indice percorso di lavorazione
|
||||
@@ -1303,8 +1314,9 @@ Simulator::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& p
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PATHIND, nClPathInd) ;
|
||||
// assegno numero di dati ausiliari iniziali
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_AUXTOT, nAS) ;
|
||||
// assegno punto iniziale e versore estrusione
|
||||
// assegno punti iniziale e finale e versore estrusione
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_START, ptStart) ;
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_END, ptEnd) ;
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_EXTR, vtExtr) ;
|
||||
// assegno punti estremi dell'ingombro del percorso di lavorazione
|
||||
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PMIN, ptMin) ;
|
||||
|
||||
Reference in New Issue
Block a user