From 65daa04bc45b37f15ef3b3ea17839ec392e1d160 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 20 Feb 2020 11:26:13 +0000 Subject: [PATCH] EgtMachKernel 2.2b4 : - cambiata UpdateSetup in UpdateCurrSetup - aggiunta EraseCurrSetup. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes MachMgr.h | 3 ++- MachMgrMachGroups.cpp | 4 ++-- MachMgrSetup.cpp | 13 ++++++++++++- Processor.cpp | 2 +- SetupMgr.cpp | 8 ++++++++ SetupMgr.h | 1 + Simulator.cpp | 2 +- 8 files changed, 27 insertions(+), 6 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 3968e8b7611eaedde721796c25233b13be288e64..a2b0819e3bf50e831dc4e148cb3afa3335f46e2f 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/MachMgr.h b/MachMgr.h index c70bb35..cbaedf6 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -183,7 +183,8 @@ class MachMgr : public IMachMgr bool ImportSetup( const std::string& sName) override ; bool VerifyCurrSetup( STRVECTOR& vsErrors) override ; bool FindToolInCurrSetup( const std::string& sTool) override ; - bool UpdateSetup( void) override ; + bool UpdateCurrSetup( void) override ; + bool EraseCurrSetup( void) override ; // Machinings DataBase bool MdbGetMachiningNewName( std::string& sName) const override ; bool MdbAddMachining( const std::string& sName, int nType) ; diff --git a/MachMgrMachGroups.cpp b/MachMgrMachGroups.cpp index e25df57..13362eb 100644 --- a/MachMgrMachGroups.cpp +++ b/MachMgrMachGroups.cpp @@ -172,7 +172,7 @@ MachMgr::AddMachGroup( const string& sName, const string& sMachineName) pMch->ResetCurrTool() ; } // aggiorno attrezzaggio attivo - UpdateSetup() ; + UpdateCurrSetup() ; // nascondo i pezzi rimasti sotto la radice ShowRootParts( false) ; // rendo visibile il nuovo gruppo corrente e la relativa macchina @@ -326,7 +326,7 @@ MachMgr::SetCurrMachGroup( int nId) if ( ! PrepareCurrMachGroup( nId)) return false ; // aggiorno attrezzaggio attivo - UpdateSetup() ; + UpdateCurrSetup() ; // imposto la prima fase come corrente if ( ! SetCurrPhase( 1)) return false ; diff --git a/MachMgrSetup.cpp b/MachMgrSetup.cpp index 7f3203d..90d4d7f 100644 --- a/MachMgrSetup.cpp +++ b/MachMgrSetup.cpp @@ -121,7 +121,7 @@ MachMgr::FindToolInCurrSetup( const string& sTool) //---------------------------------------------------------------------------- bool -MachMgr::UpdateSetup( void) +MachMgr::UpdateCurrSetup( void) { // aggiorno attrezzaggio if ( ! m_stuMgr.Load()) @@ -132,3 +132,14 @@ MachMgr::UpdateSetup( void) return false ; return pMch->LoadAllTools() ; } + +//---------------------------------------------------------------------------- +bool +MachMgr::EraseCurrSetup( void) +{ + // pulisco attrezzaggio + if ( ! m_stuMgr.Clear()) + return false ; + // salvo i dati + return m_stuMgr.Save() ; +} diff --git a/Processor.cpp b/Processor.cpp index c99c5aa..9c2d04b 100644 --- a/Processor.cpp +++ b/Processor.cpp @@ -80,7 +80,7 @@ Processor::Run( const string& sOutFile, const string& sInfo) m_pMchMgr->ResetWarnings() ; // forzo aggiornamento attrezzaggio della macchinata - m_pMchMgr->UpdateSetup() ; + m_pMchMgr->UpdateCurrSetup() ; if ( ! VerifySetup()) return false ; diff --git a/SetupMgr.cpp b/SetupMgr.cpp index f9f9a04..22df4ef 100644 --- a/SetupMgr.cpp +++ b/SetupMgr.cpp @@ -55,6 +55,14 @@ SetupMgr::Reset( void) return true ; } +//---------------------------------------------------------------------------- +bool +SetupMgr::Clear( void) +{ + m_vStuData.clear() ; + return true ; +} + //---------------------------------------------------------------------------- bool SetupMgr::Load( void) diff --git a/SetupMgr.h b/SetupMgr.h index d187906..e8620cd 100644 --- a/SetupMgr.h +++ b/SetupMgr.h @@ -41,6 +41,7 @@ class SetupMgr SetupMgr( void) ; bool Init( MachMgr* pMchMgr) ; bool Reset( void) ; + bool Clear( void) ; bool Load( void) ; bool Save( void) const ; bool Import( const std::string& sFileName) ; diff --git a/Simulator.cpp b/Simulator.cpp index 6c7cbf4..6fc6739 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -112,7 +112,7 @@ Simulator::Start( bool bFirst) m_pMchMgr->ResetWarnings() ; // Forzo aggiornamento attrezzaggio della macchinata - bool bOk = m_pMchMgr->UpdateSetup() ; + bool bOk = m_pMchMgr->UpdateCurrSetup() ; // Se avvio vero, verifico attrezzaggio if ( bFirst && ! VerifySetup())