From 9d1b2d8d608827f5a8fb3575b9c2e9f560b0f97f Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 30 Jan 2017 08:06:33 +0000 Subject: [PATCH] EgtMachKernel 1.6x10 : - aggiunta GetAllHeadsNames - aggiunto nome asse a SimGetAxisInfoPos. --- EgtMachKernel.rc | Bin 11782 -> 11798 bytes MachMgr.h | 14 +++++++++----- MachMgrMachines.cpp | 14 ++++++++++++++ MachMgrSimulation.cpp | 4 ++-- Machine.h | 3 ++- MachineHeads.cpp | 16 ++++++++++++++++ Simulator.cpp | 3 +-- Simulator.h | 2 +- 8 files changed, 45 insertions(+), 11 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index e9562c205ba4a6c189d22e07c545ffee521edb3a..f9b3961d8b9f1dbd806c9e86dc10f7f7f514b80f 100644 GIT binary patch delta 121 zcmZpRnHIC*4;!-~gTdy%Y_`mdhLbOHNKP)`6x*C7R@@+`L2B2gt`%?7_Hs PkF*y=3RTAe| diff --git a/MachMgr.h b/MachMgr.h index 964fdf0..6b22dee 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -242,7 +242,7 @@ class MachMgr : public IMachMgr // Simulation bool SimStart( void) override ; bool SimMove( int& nStatus) override ; - bool SimGetAxisInfoPos( int nI, std::string& sToken, bool& bLinear, double& dVal) override ; + bool SimGetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) override ; bool SimGetToolInfo( std::string& sName, double& dSpeed) override ; bool SimGetMoveInfo( int& nGmove, double& dFeed) override ; bool SimSetStep( double dStep) override ; @@ -285,6 +285,7 @@ class MachMgr : public IMachMgr bool GetAxisHomePos( const std::string& sAxis, double& dHomeVal) const override ; bool ResetAxisPos( const std::string& sAxis) override ; bool ResetAllAxesPos( void) override ; + bool GetAllHeadsNames( STRVECTOR& vNames) const override ; bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) override ; bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const override ; bool UnloadTool( const std::string& sHead, int nExit) override ; @@ -306,13 +307,16 @@ class MachMgr : public IMachMgr { return m_sLuaLibsDir ; } std::string GetLuaLastRequire( void) const { return m_sLuaLastRequire ; } + // Current Machine + std::string GetCurrSetupDir( void) const + { Machine* pMch = GetCurrMachine() ; + return ( pMch != nullptr ? pMch->GetMachineDir() + "\\" + SETUP_DIR : "") ; } + std::string GetCurrFixtDir( void) const + { Machine* pMch = GetCurrMachine() ; + return ( pMch != nullptr ? pMch->GetMachineDir() + "\\" + FIXTURES_DIR : "") ; } // MachGroups std::string GetCurrMGeoName( void) const { return ( ExistsCurrMachGroup() ? m_cCurrMGrp.MGeoName : "") ; } - std::string GetCurrSetupDir( void) const - { return ( ExistsCurrMachGroup() ? m_sMachinesDir + "\\" + m_cCurrMGrp.MGeoName + "\\" + SETUP_DIR : "") ; } - std::string GetCurrFixtDir( void) const - { return ( ExistsCurrMachGroup() ? m_sMachinesDir + "\\" + m_cCurrMGrp.MGeoName + "\\" + FIXTURES_DIR : "") ; } int GetCurrSetupGroupId( void) const { return ( ExistsCurrMachGroup() ? m_cCurrMGrp.SetupGroupId : GDB_ID_NULL) ; } int GetCurrFixtGroupId( void) const diff --git a/MachMgrMachines.cpp b/MachMgrMachines.cpp index 920fcf0..ea6079d 100644 --- a/MachMgrMachines.cpp +++ b/MachMgrMachines.cpp @@ -386,6 +386,20 @@ MachMgr::GetCalcRot1W( void) const return ( ( pMch != nullptr) ? pMch->GetCurrRot1W() : false) ; } +//---------------------------------------------------------------------------- +bool +MachMgr::GetAllHeadsNames( STRVECTOR& vNames) const +{ + // pulisco il vettore + vNames.clear() ; + // recupero la macchina corrente + Machine* pMch = GetCurrMachine() ; + if ( pMch == nullptr) + return false ; + // richiedo elenco teste alla macchina + return pMch->GetAllHeadsNames( vNames) ; +} + //---------------------------------------------------------------------------- int MachMgr::GetCurrLinAxes( void) const diff --git a/MachMgrSimulation.cpp b/MachMgrSimulation.cpp index 40da572..9aaf9c7 100644 --- a/MachMgrSimulation.cpp +++ b/MachMgrSimulation.cpp @@ -52,13 +52,13 @@ MachMgr::SimMove( int& nStatus) //---------------------------------------------------------------------------- bool -MachMgr::SimGetAxisInfoPos( int nI, string& sToken, bool& bLinear, double& dVal) +MachMgr::SimGetAxisInfoPos( int nI, string& sName, string& sToken, bool& bLinear, double& dVal) { // verifico simulatore if ( m_pSimul == nullptr) return false ; // recupero dati - return m_pSimul->GetAxisInfoPos( nI, sToken, bLinear, dVal) ; + return m_pSimul->GetAxisInfoPos( nI, sName, sToken, bLinear, dVal) ; } //---------------------------------------------------------------------------- diff --git a/Machine.h b/Machine.h index 622f15e..331ed8e 100644 --- a/Machine.h +++ b/Machine.h @@ -52,7 +52,7 @@ class Machine int GetHeadId( const std::string& sHead) const { int nId = GetGroup( sHead) ; return ( IsHeadGroup( nId) ? nId : GDB_ID_NULL) ; } - bool SetLook( int nFlag) ; + bool GetAllHeadsNames( STRVECTOR& vNames) const ; int GetHeadExitCount( const std::string& sHead) const ; bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) ; bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const ; @@ -112,6 +112,7 @@ class Machine bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, int& nStat) const ; const std::string& GetOutstrokeInfo( void) const { return m_sOutstrokeInfo ; } + bool SetLook( int nFlag) ; bool LinkRawPartToGroup( int nRawPartId, const std::string& sGroupName) ; bool IsLinkedRawPart( int nRawId) const ; bool UnlinkRawPartFromGroup( int nRawPartId) ; diff --git a/MachineHeads.cpp b/MachineHeads.cpp index 637898c..1a4b6b0 100644 --- a/MachineHeads.cpp +++ b/MachineHeads.cpp @@ -23,6 +23,22 @@ using namespace std ; +//---------------------------------------------------------------------------- +bool +Machine::GetAllHeadsNames( STRVECTOR& vNames) const +{ + // reset lista nomi + vNames.clear() ; + // ricerca delle teste + for each ( const auto& snGro in m_mapGroups) { + if ( IsHeadGroup( snGro.second)) + vNames.push_back( snGro.first) ; + } + // ordino alfabeticamente + std::sort( vNames.begin(), vNames.end()) ; + return true ; +} + //---------------------------------------------------------------------------- int Machine::GetHeadExitCount( const string& sHead) const diff --git a/Simulator.cpp b/Simulator.cpp index 5225ad6..1168476 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -166,7 +166,7 @@ Simulator::Move( int& nStatus) //---------------------------------------------------------------------------- bool -Simulator::GetAxisInfoPos( int nI, string& sToken, bool& bLinear, double& dVal) const +Simulator::GetAxisInfoPos( int nI, string& sName, string& sToken, bool& bLinear, double& dVal) const { // Verifiche if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr) @@ -177,7 +177,6 @@ Simulator::GetAxisInfoPos( int nI, string& sToken, bool& bLinear, double& dVal) // recupero i dati dell'asse if ( nI < 0 || nI >= nAxisCount + nAuxAxisCount) return false ; - string sName ; if ( nI < nAxisCount) { sName = m_AxesName[nI] ; sToken = m_AxesToken[nI] ; diff --git a/Simulator.h b/Simulator.h index 728cf5f..b5f3c19 100644 --- a/Simulator.h +++ b/Simulator.h @@ -30,7 +30,7 @@ class Simulator bool Init( MachMgr* pMchMgr) ; bool Start( void) ; bool Move( int& nStatus) ; - bool GetAxisInfoPos( int nI, std::string& sToken, bool& bLinear, double& dVal) const ; + bool GetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) const ; bool GetToolInfo( std::string& sName, double& dSpeed) const ; bool GetMoveInfo( int& nGmove, double& dFeed) const ; bool SetStep( double dStep) ;