Merge commit '1178e479e3e6127f821e0c964afb66ca637a4f61' into feature/Svuotature
This commit is contained in:
Binary file not shown.
@@ -333,6 +333,7 @@ class MachMgr : public IMachMgr
|
||||
bool SimGetMoveInfo( int& nGmove, double& dFeed) const override ;
|
||||
bool SimSetStep( double dStep) override ;
|
||||
bool SimSetUiStatus( int nUiStatus) override ;
|
||||
bool SimEnableToolTipTrace( bool bEnable) override ;
|
||||
bool SimGoHome( void) override ;
|
||||
bool SimExit( void) override ;
|
||||
// Generation
|
||||
|
||||
@@ -130,6 +130,17 @@ MachMgr::SimSetUiStatus( int nUiStatus)
|
||||
return m_pSimul->SetUiStatus( nUiStatus) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimEnableToolTipTrace( bool bEnable)
|
||||
{
|
||||
// verifico simulatore
|
||||
if ( m_pSimul == nullptr)
|
||||
return false ;
|
||||
// imposto abilitazione disegno traccia della punta utensile
|
||||
return m_pSimul->EnableToolTipTrace( bEnable) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimGoHome( void)
|
||||
|
||||
@@ -191,6 +191,7 @@ static const std::string GVAR_SIMUISTAT = ".SIMUISTAT" ; // (num) stato sim
|
||||
static const std::string GVAR_SAFEDIST = ".SAFEDIST" ; // (num) distanza di sicurezza per verifica di collisione
|
||||
static const std::string GVAR_SIMVMID = ".SIMVMID" ; // (int) identificativo grezzo Vmill in collisione
|
||||
static const std::string GVAR_SIMCOBIND = ".SIMCOBIND" ; // (int) indice oggetto in collisione
|
||||
static const std::string GVAR_TOOLTRACE = ".TOOLTRACE" ; // (int) identificativo gruppo di tracciatura utensile
|
||||
static const std::string GVAR_MPSIM = ".MPSIM" ; // (bool) flag simulazione multiprocesso
|
||||
static const std::string GVAR_MPSEST = ".MPSEST" ; // (string) path del file di stima speciale per simulazione multiprocesso
|
||||
static const std::string GVAR_RECORD = ".RECORD" ; // (bool) flag modalità registrazione comandi in simulazione
|
||||
|
||||
@@ -58,6 +58,7 @@ class __declspec( novtable) ISimulator
|
||||
virtual bool SetToolForVmill( const std::string& sTool, const std::string& sHead, int nExit, int nFlag,
|
||||
double dPar1, double dPar2, const INTVECTOR& vVmill, bool bFirst) = 0 ;
|
||||
virtual bool EnableToolsForVmill( bool bEnable) = 0 ;
|
||||
virtual bool EnableToolTipTrace( bool bEnable) = 0 ;
|
||||
virtual int MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) = 0 ;
|
||||
virtual bool SaveCmd( int nType, int nPar, const std::string& sPar, const std::string& sPar2) = 0 ;
|
||||
} ;
|
||||
|
||||
@@ -45,6 +45,8 @@ class SimulatorMP : public ISimulator
|
||||
bool SetToolForVmill( const std::string& sTool, const std::string& sHead, int nExit, int nFlag,
|
||||
double dPar1, double dPar2, const INTVECTOR& vVmill, bool bFirst) override ;
|
||||
bool EnableToolsForVmill( bool bEnable) override ;
|
||||
bool EnableToolTipTrace( bool bEnable) override
|
||||
{ return false ; }
|
||||
int MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) override ;
|
||||
bool SaveCmd( int nType, int nPar, const std::string& sPar, const std::string& sPar2) override ;
|
||||
|
||||
|
||||
+81
-21
@@ -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"
|
||||
@@ -90,9 +92,10 @@ SimulatorSP::SimulatorSP( void)
|
||||
m_dTDiam = 0 ;
|
||||
m_dTLen = 0 ;
|
||||
m_bCutOnTip = false ;
|
||||
m_nCurrTrace = GDB_ID_NULL ;
|
||||
m_bEnableVm = false ;
|
||||
m_dSafeDist = SAFEDIST_STD ;
|
||||
m_bEnableTrace = false ;
|
||||
m_nCurrTrace = GDB_ID_NULL ;
|
||||
m_nAxesMask = 0 ;
|
||||
m_bEnabAxes = true ;
|
||||
m_bShowAxes = true ;
|
||||
@@ -1108,6 +1111,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 +1211,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 +1297,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 +1359,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 +1649,70 @@ SimulatorSP::ResetCollisionMark( void)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SimulatorSP::EnableToolTipTrace( bool bEnable)
|
||||
{
|
||||
if ( bEnable != m_bEnableTrace) {
|
||||
if ( bEnable) {
|
||||
|
||||
}
|
||||
else {
|
||||
int nTraceCrvId = m_nCurrTrace ;
|
||||
while ( nTraceCrvId != GDB_ID_NULL) {
|
||||
m_pGeomDB->SetStatus( nTraceCrvId, GDB_ST_OFF) ;
|
||||
nTraceCrvId = m_pGeomDB->GetPrev( nTraceCrvId) ;
|
||||
}
|
||||
m_nCurrTrace = GDB_ID_NULL ;
|
||||
}
|
||||
}
|
||||
m_bEnableTrace = bEnable ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SimulatorSP::TraceToolTipMove( int nMoveType)
|
||||
{
|
||||
// verifico che la tracciatura sia abilitata
|
||||
if ( ! m_bEnableTrace)
|
||||
return true ;
|
||||
// recupero il gruppo per le curve di traccia
|
||||
int nTraceGrpId ;
|
||||
if ( ! m_pMachine->LuaGetGlobVar( GLOB_VAR + GVAR_TOOLTRACE, nTraceGrpId))
|
||||
return false ;
|
||||
// recupero posizione utensile corrente
|
||||
int nExitId = m_pMachine->GetExitId( m_sHead, m_nExit) ;
|
||||
Frame3d frExit ;
|
||||
if ( ! m_pGeomDB->GetGroupGlobFrame( nExitId, frExit))
|
||||
return false ;
|
||||
Point3d ptTip = frExit.Orig() - m_dTLen * frExit.VersZ() ;
|
||||
// disabilito gestione segnalazione modifiche progetto
|
||||
SetModifiedOff modOff ;
|
||||
// eseguo tracciatura
|
||||
static string TRACE_MOVE = "Move" ;
|
||||
if ( m_nCurrTrace == GDB_ID_NULL) {
|
||||
m_nCurrTrace = ExeCreateGeoPoint( nTraceGrpId, ptTip, GDB_ID_ROOT) ;
|
||||
m_pGeomDB->SetInfo( m_nCurrTrace, TRACE_MOVE, nMoveType) ;
|
||||
m_pGeomDB->SetStipple( m_nCurrTrace, ( nMoveType == 0 ? 3 : 0), 0x8C8C) ;
|
||||
}
|
||||
else {
|
||||
int nTraMove ;
|
||||
m_pGeomDB->GetInfo( m_nCurrTrace, TRACE_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( nTraceGrpId, ptPrev, GDB_ID_ROOT) ;
|
||||
ExeAddCurveCompoLine( m_nCurrTrace, ptTip, true, GDB_ID_ROOT) ;
|
||||
m_pGeomDB->SetInfo( m_nCurrTrace, TRACE_MOVE, nMoveType) ;
|
||||
m_pGeomDB->SetStipple( m_nCurrTrace, ( nMoveType == 0 ? 3 : 0), 0x8C8C) ;
|
||||
}
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SimulatorSP::OnInit( void)
|
||||
@@ -2502,6 +2559,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 ;
|
||||
|
||||
+4
-1
@@ -45,6 +45,7 @@ class SimulatorSP : public ISimulator
|
||||
bool SetToolForVmill( const std::string& sTool, const std::string& sHead, int nExit, int nFlag,
|
||||
double dPar1, double dPar2, const INTVECTOR& vVmill, bool bFirst) override ;
|
||||
bool EnableToolsForVmill( bool bEnable) override ;
|
||||
bool EnableToolTipTrace( bool bEnable) override ;
|
||||
int MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) override ;
|
||||
bool SaveCmd( int nType, int nPar, const std::string& sPar, const std::string& sPar2) override
|
||||
{ return false ; }
|
||||
@@ -81,6 +82,7 @@ class SimulatorSP : public ISimulator
|
||||
{ return ( m_nUiStatus == MCH_UISIM_STOP) ; }
|
||||
bool SetCollisionMark( int nCdInd, int nObjInd) ;
|
||||
bool ResetCollisionMark( void) ;
|
||||
bool TraceToolTipMove( int nMoveType) ;
|
||||
bool OnInit( void) ;
|
||||
bool OnExit( void) ;
|
||||
bool OnProgramStart( bool bFirst) ;
|
||||
@@ -163,7 +165,6 @@ class SimulatorSP : public ISimulator
|
||||
double m_dTDiam ; // diametro dell'utensile corrente
|
||||
double m_dTLen ; // lunghezza dell'utensile corrente
|
||||
bool m_bCutOnTip ; // flag capacità di lavorare di testa dell'utensile corrente
|
||||
int m_nCurrTrace ; // Id della curva composita corrente di trace
|
||||
bool m_bEnableVm ; // flag abilitazione Virtual Milling
|
||||
INTVECTOR m_VmId ; // vettore identificativi Zmap per Virtual Milling
|
||||
INTVECTOR m_CdId ; // vettore identificativi Zmap per Collision Detection
|
||||
@@ -171,6 +172,8 @@ class SimulatorSP : public ISimulator
|
||||
COBVECTOR m_CollObj ; // vettore oggetti da testare per collisione con grezzo
|
||||
double m_dSafeDist ; // distanza di sicurezza per verifica collisioni
|
||||
INTVECTOR m_nCollMarkId ; // elenco oggetti marcati per visualizzare meglio la collisione rilevata
|
||||
bool m_bEnableTrace ; // flag abilitazione tool tip trace
|
||||
int m_nCurrTrace ; // Id della curva composita corrente di trace
|
||||
int m_nAxesMask ; // maschera a bit di abilitazione movimento assi (solo se rapido)
|
||||
bool m_bEnabAxes ; // flag abilitazione movimento assi attivi
|
||||
bool m_bShowAxes ; // flag visualizzazione assi attivi
|
||||
|
||||
Reference in New Issue
Block a user