diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index f1fdc52..c1a6f4f 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/MachMgr.h b/MachMgr.h index 5d3a5bb..8e23dfb 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -342,6 +342,7 @@ class MachMgr : public IMachMgr bool SimGetMoveInfo( int& nGmove, double& dFeed) const override ; bool SimSetStep( double dStep) override ; bool SimSetUiStatus( int nUiStatus) override ; + bool SimShowVMill( bool bShow) override ; bool SimEnableToolTipTrace( bool bEnable) override ; bool SimGoHome( void) override ; bool SimExit( void) override ; diff --git a/MachMgrSimulation.cpp b/MachMgrSimulation.cpp index 35e1cef..abe9583 100644 --- a/MachMgrSimulation.cpp +++ b/MachMgrSimulation.cpp @@ -130,6 +130,17 @@ MachMgr::SimSetUiStatus( int nUiStatus) return m_pSimul->SetUiStatus( nUiStatus) ; } +//---------------------------------------------------------------------------- +bool +MachMgr::SimShowVMill( bool bShow) +{ + // verifico simulatore + if ( m_pSimul == nullptr) + return false ; + // imposto visualizzazione solidi Vmill + return m_pSimul->ShowVMill( bShow) ; +} + //---------------------------------------------------------------------------- bool MachMgr::SimEnableToolTipTrace( bool bEnable) diff --git a/Simulator.h b/Simulator.h index 2ce446d..01ffea2 100644 --- a/Simulator.h +++ b/Simulator.h @@ -61,6 +61,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 ShowVMill( bool bShow) = 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 ; diff --git a/SimulatorMP.h b/SimulatorMP.h index 9060e32..8a3d7c9 100644 --- a/SimulatorMP.h +++ b/SimulatorMP.h @@ -48,6 +48,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 ShowVMill( bool bShow) override + { return false ; } bool EnableToolTipTrace( bool bEnable) override { return false ; } int MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) override ; diff --git a/SimulatorSP.cpp b/SimulatorSP.cpp index 6d84a36..244c0d1 100644 --- a/SimulatorSP.cpp +++ b/SimulatorSP.cpp @@ -1681,6 +1681,44 @@ SimulatorSP::ResetCollisionMark( void) return true ; } +//---------------------------------------------------------------------------- +bool +SimulatorSP::ShowVMill( bool bShow) +{ + // recupero tutti i grezzi collegati agli assi macchina + INTVECTOR vRawId = m_pMachine->GetAllLinkedRawParts() ; + // recupero gli altri grezzi + int nRawId = m_pMchMgr->GetFirstRawPart() ; + while ( nRawId != GDB_ID_NULL) { + vRawId.push_back( nRawId) ; + nRawId = m_pMchMgr->GetNextRawPart( nRawId) ; + } + // recupero eventuale gruppo delle curve di traccia + if ( ! m_pMachine->LuaGetGlobVar( GLOB_VAR + GVAR_TOOLTRACE, m_nTraceGroup)) + m_nTraceGroup = GDB_ID_NULL ; + // ciclo sui grezzi + for ( int nRawId : vRawId) { + // se grezzo attivo nella fase corrente + if ( m_pMchMgr->VerifyRawPartPhase( nRawId, m_pMchMgr->GetCurrPhase())) { + // ciclo sugli oggetti del grezzo + int nId = m_pGeomDB->GetFirstInGroup( nRawId) ; + while ( nId != GDB_ID_NULL) { + // se è il VMill + if ( find( m_VmId.begin(), m_VmId.end(), nId) != m_VmId.end()) + m_pGeomDB->SetStatus( nId, ( bShow ? GDB_ST_ON : GDB_ST_OFF)) ; + // se altrimenti è il gruppo di tracciatura + else if ( nId == m_nTraceGroup) + m_pGeomDB->SetStatus( nId, GDB_ST_ON) ; + // altro + else + m_pGeomDB->SetStatus( nId, ( bShow ? GDB_ST_OFF : GDB_ST_ON)) ; + nId = m_pGeomDB->GetNext( nId) ; + } + } + } + return true ; +} + //---------------------------------------------------------------------------- bool SimulatorSP::EnableToolTipTrace( bool bEnable) diff --git a/SimulatorSP.h b/SimulatorSP.h index 115fe40..de49ca7 100644 --- a/SimulatorSP.h +++ b/SimulatorSP.h @@ -48,6 +48,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 ShowVMill( bool bShow) 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