12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #pragma once
- #include "afx.h"
- #include "stdafx.h"
- #include "OTSFileSys.h"
- #include "OTSHelper.h"
- #include "PosXray.h"
- #include "OTSParticle.h"
- #include "IncADataDB.h"
- #include "ElementChemistryDB.h"
- #include "SegmentDB.h"
- #include "DBStoreFile.h"
- #include "MsrSampleStatus.h"
- #include "MsrResults.h"
- namespace OTSMODEL {
- using namespace OTSTools;
- using namespace OTSDATA;
- using namespace OTSSQLITE;
- class __declspec(dllexport) CIncAFileMgr : public CDBStoreFile
- {
- public:
- CIncAFileMgr(CString fileName);
- virtual ~CIncAFileMgr();
- virtual void Close() override
- {
- m_datastorePtr.reset();
- }
- //Create
- BOOL CreateIncAFile();
- BOOL Save(CString a_strPathName = _T(""));
-
- BOOL Update(CString a_strPathName = _T(""));
- // file pathname
- CString GetPathName() { return m_strPathName; }
-
-
- // particle list
- COTSParticleList GetParticleList() { return m_listParticle; }
- void SetParticleList(COTSParticleList& a_listParticle, BOOL a_bClear);
- // X-ray list
- CPosXrayList GetPosXrayList() { return m_listPosXray; }
- void SetPosXrayList(CPosXrayList& a_listPosXray, BOOL a_bClear);
- bool GetAllFieldsFromDB(COTSFieldDataList & allFlds, CMsrSampleStatusPtr& status, CMsrResultsPtr& rst,double aFieldArea);
- void SetFieldPos(CPoint p) { m_FieldPos = p; }
- CPoint GetFieldPos() {return m_FieldPos; }
- void SetMsrStatus(CMsrSampleStatusPtr s) { msrStatus = s; }
- CMsrSampleStatusPtr GetMsrStatus() { return msrStatus; }
- protected:
- BOOL SaveIncAList();
- BOOL UpdateIncAList();
- //Get DB
- CIncADataDBPtr GetIncADB();
- CElementChemistryDBPtr GetElementChemistryDB();
- CSegmentDBPtr GetSegmentDB();
-
- // cleanup
- void Cleanup();
- // initialization
- void Init();
- // duplication
- void Duplicate(const CIncAFileMgr& a_oSource);
- // file pathname
- CString m_strPathName;
- // particle list
- COTSParticleList m_listParticle;
- // X-ray list
- CPosXrayList m_listPosXray;
- CPoint m_FieldPos;
- CMsrSampleStatusPtr msrStatus;
- //database
- CIncADataDBPtr m_pIncADataDB;
- CElementChemistryDBPtr m_pElementChemistryDB;
- CSegmentDBPtr m_pSegmentDB;
- };
- typedef std::shared_ptr<CIncAFileMgr> __declspec(dllexport) CIncAFileMgrPtr;
- }
|