From bb9f2bd2a3293165635e08d3c7b6840b02bfa16c Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 9 Mar 2017 10:53:00 +0000 Subject: [PATCH] EgtMachKernel 1.8c4 : - aggiunta GetAllTablesNames. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes EgtMachKernel.vcxproj | 1 + EgtMachKernel.vcxproj.filters | 3 +++ MachMgr.h | 1 + MachMgrMachines.cpp | 14 ++++++++++++ Machine.h | 1 + MachineTables.cpp | 40 ++++++++++++++++++++++++++++++++++ 7 files changed, 60 insertions(+) create mode 100644 MachineTables.cpp diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 6ef0470e8d8b5b2fd06063d0b7aedd319060b734..e21ec0f77a3bb6de61e8ae69cf15305d9c527123 100644 GIT binary patch delta 97 zcmewt{V#gMFE&P#&A-`fnHfzcKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUI`BbWdH delta 97 zcmewt{V#gMFE&Qw&A-`fnHh~IKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUD-Bai?9 diff --git a/EgtMachKernel.vcxproj b/EgtMachKernel.vcxproj index cb0e958..5f38eb6 100644 --- a/EgtMachKernel.vcxproj +++ b/EgtMachKernel.vcxproj @@ -232,6 +232,7 @@ copy $(TargetPath) \EgtProg\Dll64 + diff --git a/EgtMachKernel.vcxproj.filters b/EgtMachKernel.vcxproj.filters index 2dd0d06..3b4ecdf 100644 --- a/EgtMachKernel.vcxproj.filters +++ b/EgtMachKernel.vcxproj.filters @@ -201,6 +201,9 @@ Source Files\Operations + + Source Files\Machine + diff --git a/MachMgr.h b/MachMgr.h index a2b7d76..cea3dd9 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -296,6 +296,7 @@ class MachMgr : public IMachMgr bool ResetAxisPos( const std::string& sAxis) override ; bool ResetAllAxesPos( void) override ; bool GetAllHeadsNames( STRVECTOR& vNames) const override ; + bool GetAllTablesNames( 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 ; diff --git a/MachMgrMachines.cpp b/MachMgrMachines.cpp index 2a1f42f..59d3f34 100644 --- a/MachMgrMachines.cpp +++ b/MachMgrMachines.cpp @@ -428,6 +428,20 @@ MachMgr::GetAllHeadsNames( STRVECTOR& vNames) const return pMch->GetAllHeadsNames( vNames) ; } +//---------------------------------------------------------------------------- +bool +MachMgr::GetAllTablesNames( STRVECTOR& vNames) const +{ + // pulisco il vettore + vNames.clear() ; + // recupero la macchina corrente + Machine* pMch = GetCurrMachine() ; + if ( pMch == nullptr) + return false ; + // richiedo elenco tavole alla macchina + return pMch->GetAllTablesNames( vNames) ; +} + //---------------------------------------------------------------------------- int MachMgr::GetCurrLinAxes( void) const diff --git a/Machine.h b/Machine.h index 5337454..2cde62e 100644 --- a/Machine.h +++ b/Machine.h @@ -53,6 +53,7 @@ class Machine { int nId = GetGroup( sHead) ; return ( IsHeadGroup( nId) ? nId : GDB_ID_NULL) ; } bool GetAllHeadsNames( STRVECTOR& vNames) const ; + bool GetAllTablesNames( 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 ; diff --git a/MachineTables.cpp b/MachineTables.cpp new file mode 100644 index 0000000..7dbb8c1 --- /dev/null +++ b/MachineTables.cpp @@ -0,0 +1,40 @@ +//---------------------------------------------------------------------------- +// EgalTech 2017-2017 +//---------------------------------------------------------------------------- +// File : MachineTables.cpp Data : 09.03.15 Versione : 1.8c4 +// Contenuto : Implementazione gestione macchina : funzioni per tavole. +// +// +// +// Modifiche : 09.03.17 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +//--------------------------- Include ---------------------------------------- +#include "stdafx.h" +#include "MachMgr.h" +#include "DllMain.h" +#include "Head.h" +#include "Exit.h" +#include "/EgtDev/Include/EMkToolConst.h" +#include "/EgtDev/Include/EGnStringUtils.h" +#include "/EgtDev/Include/EGnFileUtils.h" + +using namespace std ; + +//---------------------------------------------------------------------------- +bool +Machine::GetAllTablesNames( STRVECTOR& vNames) const +{ + // reset lista nomi + vNames.clear() ; + // ricerca delle tavole + for each ( const auto& snGro in m_mapGroups) { + if ( IsTableGroup( snGro.second)) + vNames.push_back( snGro.first) ; + } + // ordino alfabeticamente + std::sort( vNames.begin(), vNames.end()) ; + return true ; +}