//---------------------------------------------------------------------------- // 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 #include class Scanner ; class Writer ; //---------------------------------------------------------------------------- class MachiningsMgr { public : MachiningsMgr( void) ; ~MachiningsMgr( void) ; bool Load( const std::string& sMachsFile, const ToolsMgr* pTsMgr) ; bool Reload( void) ; 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 ; bool Set3AxComp( bool b3AxComp) ; bool Get3AxComp( void) const { return m_b3AxComp ; } bool Set5AxComp( bool b5AxComp) ; bool Get5AxComp( void) const { return m_b5AxComp ; } bool SetSafeZ( double dSafeZ) ; double GetSafeZ( void) const { return m_dSafeZ ; } bool SetSafeAggrBottZ( double dSafeAggrBottZ) ; double GetSafeAggrBottZ( void) const { return m_dSafeAggrBottZ ; } bool SetExtraLOnCutRegion( double dExtraL) ; double GetExtraLOnCutRegion( void) { return m_dExtraLOnCutRegion ; } bool SetExtraROnDrillRegion( double dExtraR) ; double GetExtraROnDrillRegion( void) { return m_dExtraROnDrillRegion ; } bool SetHoleDiamToler( double dToler) ; double GetHoleDiamToler( void) { return m_dHoleDiamToler ; } bool SetExtSawArcMinRad( double dRad) ; double GetExtSawArcMinRad( void) { return m_dExtSawArcMinRad ; } bool SetIntSawArcMaxSideAng( double dSideAng) ; double GetIntSawArcMaxSideAng( void) { return m_dIntSawArcMaxSideAng ; } bool SetSplitArcs( int nFlag) ; int GetSplitArcs( void) { return m_nSplitArcs ; } private : bool Clear( bool bReset) ; bool LoadHeader( Scanner& TheScanner, int& nVersion, int& nTotal, bool& bEnd) ; bool LoadGeneral( Scanner& TheScanner, bool& bEnd) ; bool LoadOneMachining( Scanner& TheScanner, bool& bEnd) ; bool SaveHeader( Writer& TheWriter) const ; bool SaveGeneral( 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 : // path file lavorazioni std::string m_sMachsFile ; // flag di dati modificati mutable bool m_bModified ; // database lavorazioni UUIDPMDATA_UMAP m_umData ; STRUUID_MAP m_suData ; // iteratore corrente per First/Next mutable STRUUID_CITER m_suCIter ; // lavorazione corrente MachiningData* m_pCurrMach ; // gestore utensili const ToolsMgr* m_pTsMgr ; // dati generali bool m_b3AxComp ; bool m_b5AxComp ; double m_dSafeZ ; double m_dSafeAggrBottZ ; double m_dExtraLOnCutRegion ; double m_dExtraROnDrillRegion ; double m_dHoleDiamToler ; double m_dExtSawArcMinRad ; double m_dIntSawArcMaxSideAng ; int m_nSplitArcs ; } ;