From 7bf96be3896d6bc5a9942f63c65300a1995692df Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 16 Nov 2015 08:16:45 +0000 Subject: [PATCH] EgtMachKernel 1.6k6 : - aggiunta a simulazione funzione per info e posizione assi. --- EgtMachKernel.rc | Bin 11782 -> 11782 bytes MachMgr.h | 1 + MachMgrSimulation.cpp | 11 +++++++++++ Simulator.cpp | 19 ++++++++++++++++++- Simulator.h | 1 + 5 files changed, 31 insertions(+), 1 deletion(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 08c73123ba44231e0cb69ca0a053fcb47fe7de47..2544f2cdc0192b61d05883e2968713daea4a05e1 100644 GIT binary patch delta 97 zcmZpRX^YwLhmFx}^ItYwW=6Bgj>5W|vxM9jH?QON0rG*u7nvrX5iEd9O=7{OSQ@Kh Hr8(RHR2d*z delta 97 zcmZpRX^YwLhmFy6^ItYwW=7M=j>5W|vxM9jH?QON0rG*u7nvrX5iEd9O=7{OSQ@Kh Hr8(RHQiUK= diff --git a/MachMgr.h b/MachMgr.h index 1de6d26..1c62147 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -166,6 +166,7 @@ class MachMgr : public IMachMgr // Simulation virtual bool SimStart( void) ; virtual bool SimMove( void) ; + virtual bool SimGetAxisInfoPos( int nI, std::string& sName, double& dVal) ; virtual bool SimSetStep( double dStep) ; virtual bool SimStop( void) ; // Generation diff --git a/MachMgrSimulation.cpp b/MachMgrSimulation.cpp index ac113e6..c46398a 100644 --- a/MachMgrSimulation.cpp +++ b/MachMgrSimulation.cpp @@ -48,6 +48,17 @@ MachMgr::SimMove( void) return m_pSimul->Move() ; } +//---------------------------------------------------------------------------- +bool +MachMgr::SimGetAxisInfoPos( int nI, string& sName, double& dVal) +{ + // verifico simulatore + if ( m_pSimul == nullptr) + return false ; + // recupero quote + return m_pSimul->GetAxisInfoPos( nI, sName, dVal) ; +} + //---------------------------------------------------------------------------- bool MachMgr::SimSetStep( double dStep) diff --git a/Simulator.cpp b/Simulator.cpp index a2b8f23..b943aac 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -70,7 +70,7 @@ Simulator::Start( void) return false ; // cerco la prima lavorazione nOpId = m_pMchMgr->GetNextOperation( nOpId) ; - while ( nOpId != GDB_ID_NULL && ( m_pMchMgr->GetOperationType( nOpId) & OPER_MACH) == 0) + while ( nOpId != GDB_ID_NULL && ! IsValidMachiningType( m_pMchMgr->GetOperationType( nOpId))) nOpId = m_pMchMgr->GetNextOperation( nOpId) ; if ( nOpId == GDB_ID_NULL) return false ; @@ -97,6 +97,9 @@ Simulator::Start( void) bool Simulator::Move( void) { + // Verifiche + if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr) + return false ; // Se arrivato alla fine dell'interpolazione, recupero una nuova entità if ( m_dCoeff > 0.999) { m_nEntId = m_pGeomDB->GetNext( m_nEntId) ; @@ -152,6 +155,20 @@ Simulator::Move( void) return true ; } +//---------------------------------------------------------------------------- +bool +Simulator::GetAxisInfoPos( int nI, string& sName, double& dVal) +{ + // Verifiche + if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr) + return false ; + // recupero i dati dell'asse + if ( nI < 0 || nI >= int( m_AxesName.size())) + return false ; + sName = m_AxesName[nI] ; + return m_pMchMgr->GetAxisPos( sName, dVal) ; +} + //---------------------------------------------------------------------------- bool Simulator::SetStep( double dStep) diff --git a/Simulator.h b/Simulator.h index 8ba9d94..2b2bf1c 100644 --- a/Simulator.h +++ b/Simulator.h @@ -27,6 +27,7 @@ class Simulator bool Init( MachMgr* pMchMgr) ; bool Start( void) ; bool Move( void) ; + bool GetAxisInfoPos( int nI, std::string& sName, double& dVal) ; bool SetStep( double dStep) ; bool Stop( void) ;