73 lines
3.0 KiB
C++
73 lines
3.0 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : MachiningsMgr.h Data : 02.06.15 Versione : 1.6f1
|
|
// Contenuto : Dichiarazione della classe MachiningsMgr.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 02.06.15 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "MachiningData.h"
|
|
#include <unordered_map>
|
|
#include <map>
|
|
|
|
class Scanner ;
|
|
class Writer ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class MachiningsMgr
|
|
{
|
|
public :
|
|
MachiningsMgr( void) ;
|
|
~MachiningsMgr( void) ;
|
|
bool Load( const std::string& sMachsFile, const ToolsMgr* pTsMgr) ;
|
|
bool Save( bool bCompressed = true) const ;
|
|
bool GetMachiningNewName( std::string& sName) const ;
|
|
bool AddMachining( const std::string& sName, int nType) ;
|
|
bool CopyMachining( const std::string& sSource, const std::string& sName) ;
|
|
bool RemoveMachining( const std::string& sName) ;
|
|
const MachiningData* GetMachining( const EgtUUID& Uuid) const ;
|
|
const MachiningData* GetMachining( const std::string& sName) const ;
|
|
bool GetFirstMachining( int nType, std::string& sName) const ;
|
|
bool GetNextMachining( int nType, std::string& sName) const ;
|
|
bool SetCurrMachining( const std::string& sName) ;
|
|
bool SaveCurrMachining( void) ;
|
|
bool IsCurrMachiningModified( void) const ;
|
|
bool SetCurrMachiningParam( int nType, bool bVal) ;
|
|
bool SetCurrMachiningParam( int nType, int nVal) ;
|
|
bool SetCurrMachiningParam( int nType, double dVal) ;
|
|
bool SetCurrMachiningParam( int nType, const std::string& sVal) ;
|
|
bool GetCurrMachiningParam( int nType, bool& bVal) const ;
|
|
bool GetCurrMachiningParam( int nType, int& nVal) const ;
|
|
bool GetCurrMachiningParam( int nType, double& dVal) const ;
|
|
bool GetCurrMachiningParam( int nType, std::string& sVal) const ;
|
|
|
|
private :
|
|
bool Clear( void) ;
|
|
bool LoadHeader( Scanner& TheScanner, int& nVersion, int& nTotal, bool& bEnd) ;
|
|
bool LoadOneMachining( Scanner& TheScanner, bool& bEnd) ;
|
|
bool SaveHeader( Writer& TheWriter) const ;
|
|
bool SaveOneMachining( const EgtUUID& Uuid, int& nCounter, Writer& TheWriter) const ;
|
|
bool VerifyCurrMachining( int nType, std::string& sName) const ;
|
|
|
|
private :
|
|
typedef std::unordered_map< EgtUUID, MachiningData*> UUIDPMDATA_UMAP ;
|
|
typedef std::map< std::string, EgtUUID> STRUUID_MAP ;
|
|
typedef STRUUID_MAP::const_iterator STRUUID_CITER ;
|
|
|
|
private :
|
|
std::string m_sMachsFile ;
|
|
const ToolsMgr* m_pTsMgr ;
|
|
UUIDPMDATA_UMAP m_umData ;
|
|
STRUUID_MAP m_suData ;
|
|
mutable STRUUID_CITER m_suCIter ;
|
|
MachiningData* m_pCurrMach ;
|
|
mutable bool m_bModified ;
|
|
|
|
} ; |