EgtMachKernel :
- in simulazione SP prime sviluppi per tooltip trace.
This commit is contained in:
+54
-20
@@ -29,9 +29,11 @@
|
||||
#include "/EgtDev/Include/EGkCDeClosedSurfTmClosedSurfTm.h"
|
||||
#include "/EgtDev/Include/EGkVolZmap.h"
|
||||
#include "/EgtDev/Include/EGkGeoVector3d.h"
|
||||
#include "/EgtDev/Include/EGkGeoPoint3d.h"
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
#include "/EgtDev/Include/EGkSurfLocal.h"
|
||||
#include "/EgtDev/Include/EXeCmdLogOff.h"
|
||||
#include "/EgtDev/Include/EXeSetModifiedOff.h"
|
||||
#include "/EgtDev/Include/EXeConst.h"
|
||||
#include "/EgtDev/Include/EMkToolConst.h"
|
||||
#include "/EgtDev/Include/EMkOperationConst.h"
|
||||
@@ -1108,6 +1110,10 @@ SimulatorSP::ManageSingleMove( int& nStatus, double& dMove)
|
||||
for ( int i = 0 ; i < int( m_VmId.size()) ; ++ i)
|
||||
bOkI = m_pGeomDB->GetGlobFrame( m_VmId[i], vFrVzmI[i]) && bOkI ;
|
||||
|
||||
// Eventuale primo tracciamento punto tip utensile
|
||||
if ( m_nCurrTrace == GDB_ID_NULL)
|
||||
TraceToolTipMove( nMoveType) ;
|
||||
|
||||
// Dati per eventuale verifica di collisione
|
||||
int nCdInd, nObjInd ;
|
||||
bool bCollCheck = true ;
|
||||
@@ -1204,26 +1210,8 @@ SimulatorSP::ManageSingleMove( int& nStatus, double& dMove)
|
||||
}
|
||||
// eseguo eventuale collision check
|
||||
bCollCheck = bCollCheck && ExecCollisionCheck( nCdInd, nObjInd, nMoveType) ;
|
||||
}
|
||||
// eventuale salvataggio punto tip utensile
|
||||
if ( nMoveType == 1) {
|
||||
int nTipTraceId ;
|
||||
if ( m_pMachine->LuaGetGlobVar( GLOB_VAR + ".TIPTRACE", nTipTraceId)) {
|
||||
int nHeadId = m_pMachine->GetHeadId( m_sHead) ;
|
||||
int nExitId = m_pMachine->GetExitId( m_sHead, m_nExit) ;
|
||||
Frame3d frExit ;
|
||||
if ( m_pGeomDB->GetGroupGlobFrame( nExitId, frExit)) {
|
||||
Point3d ptTip = frExit.Orig() - m_dTLen * frExit.VersZ() ;
|
||||
if ( m_nCurrTrace == GDB_ID_NULL) {
|
||||
PolyLine PL ;
|
||||
PL.AddUPoint( -1, ptTip + 10 * EPS_SMALL * frExit.VersZ()) ;
|
||||
PL.AddUPoint( 0, ptTip) ;
|
||||
m_nCurrTrace = ExeCreateCurveCompoFromPoints( nTipTraceId, PL, GDB_ID_ROOT) ;
|
||||
}
|
||||
else
|
||||
ExeAddCurveCompoLine( m_nCurrTrace, ptTip, true, GDB_ID_ROOT) ;
|
||||
}
|
||||
}
|
||||
// eventuale tracciamento punto tip utensile
|
||||
TraceToolTipMove( nMoveType) ;
|
||||
}
|
||||
}
|
||||
// Eseguo movimento su arco
|
||||
@@ -1308,6 +1296,8 @@ SimulatorSP::ManageSingleMove( int& nStatus, double& dMove)
|
||||
}
|
||||
// eseguo eventuale collision check
|
||||
bCollCheck = bCollCheck && ExecCollisionCheck( nCdInd, nObjInd, nMoveType) ;
|
||||
// eventuale tracciamento punto tip utensile
|
||||
TraceToolTipMove( nMoveType) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1368,6 +1358,8 @@ SimulatorSP::ManageSingleMove( int& nStatus, double& dMove)
|
||||
}
|
||||
// eseguo eventuale collision check
|
||||
bCollCheck = bCollCheck && ExecCollisionCheck( nCdInd, nObjInd, nMoveType) ;
|
||||
// eventuale tracciamento punto tip utensile
|
||||
TraceToolTipMove( nMoveType) ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1656,6 +1648,45 @@ SimulatorSP::ResetCollisionMark( void)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SimulatorSP::TraceToolTipMove( int nMoveType)
|
||||
{
|
||||
// per ora disabilito
|
||||
return true ;
|
||||
// tracciatura
|
||||
int nTipTraceId ;
|
||||
if ( m_pMachine->LuaGetGlobVar( GLOB_VAR + ".TIPTRACE", nTipTraceId)) {
|
||||
int nExitId = m_pMachine->GetExitId( m_sHead, m_nExit) ;
|
||||
Frame3d frExit ;
|
||||
if ( m_pGeomDB->GetGroupGlobFrame( nExitId, frExit)) {
|
||||
// disabilito gestione segnalazione modifiche progetto
|
||||
SetModifiedOff modOff ;
|
||||
Point3d ptTip = frExit.Orig() - m_dTLen * frExit.VersZ() ;
|
||||
if ( m_nCurrTrace == GDB_ID_NULL) {
|
||||
m_nCurrTrace = ExeCreateGeoPoint( nTipTraceId, ptTip, GDB_ID_ROOT) ;
|
||||
m_pGeomDB->SetInfo( m_nCurrTrace, "Move", nMoveType) ;
|
||||
m_pGeomDB->SetStipple( m_nCurrTrace, ( nMoveType == 0 ? 3 : 0), 0x8C8C) ;
|
||||
}
|
||||
else {
|
||||
int nTraMove ;
|
||||
m_pGeomDB->GetInfo( m_nCurrTrace, "Move", nTraMove) ;
|
||||
if ( ( nMoveType == 0) == ( nTraMove == 0))
|
||||
ExeAddCurveCompoLine( m_nCurrTrace, ptTip, true, GDB_ID_ROOT) ;
|
||||
else {
|
||||
Point3d ptPrev ; ExeEndPoint( m_nCurrTrace, GDB_ID_ROOT, ptPrev) ;
|
||||
m_nCurrTrace = ExeCreateGeoPoint( nTipTraceId, ptPrev, GDB_ID_ROOT) ;
|
||||
ExeAddCurveCompoLine( m_nCurrTrace, ptTip, true, GDB_ID_ROOT) ;
|
||||
m_pGeomDB->SetInfo( m_nCurrTrace, "Move", nMoveType) ;
|
||||
m_pGeomDB->SetStipple( m_nCurrTrace, ( nMoveType == 0 ? 3 : 0), 0x8C8C) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SimulatorSP::OnInit( void)
|
||||
@@ -2502,6 +2533,9 @@ SimulatorSP::MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt)
|
||||
// Verifico collisioni
|
||||
int nCdInd, nObjInd ;
|
||||
bool bCollCheck = ExecCollisionCheck( nCdInd, nObjInd, nMoveType) ;
|
||||
// eventuale tracciamento punto tip utensile
|
||||
TraceToolTipMove( nMoveType) ;
|
||||
// Se riscontrata collisione
|
||||
if ( ! bCollCheck) {
|
||||
// Richiamo funzione di convalida collisione
|
||||
int nPrevErr ;
|
||||
|
||||
Reference in New Issue
Block a user