PartSizeFileMgr.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #pragma once
  2. #include "stdafx.h"
  3. #include "PartSizeFile.h"
  4. #include "RptParamFileMgr.h"
  5. namespace OTSMODEL {
  6. using namespace OTSDATA;
  7. // CPartSTDFileMnr command target
  8. class __declspec(dllexport) CPartSizeFileMgr
  9. {
  10. public:
  11. CPartSizeFileMgr(); // constructor
  12. CPartSizeFileMgr(const CPartSizeFileMgr&); // copy constructor
  13. CPartSizeFileMgr(CPartSizeFileMgr*); // copy constructor
  14. CPartSizeFileMgr& operator=(const CPartSizeFileMgr&); // =operator
  15. BOOL operator==(const CPartSizeFileMgr&); // ==operator
  16. virtual ~CPartSizeFileMgr(); // destructor
  17. // LoadAll/SaveAll
  18. BOOL LoadAll(CString a_strPathName = _T(""), BOOL a_bClear = TRUE);
  19. BOOL SaveAll(CString a_strPathName = _T(""), CString a_SizeName = _T(""));
  20. // Load/Save
  21. BOOL Load(CString a_strPathName = _T(""), BOOL a_bClear = TRUE);
  22. BOOL Save(CString a_strPathName = _T(""));
  23. // load/save a part size from a text file
  24. BOOL LoadPartSizeFromTextFile(CString a_strFilePathName = _T(""));
  25. BOOL SavePartSizeTextFile(CString a_strFilePathName = _T(""));
  26. // std items list
  27. void SetPartSizeItemList(std::vector<double>& a_listSTDItems, BOOL a_bClear = TRUE);
  28. CPartSizeItemPtr GetPartSizeItemByIndex(int a_nIndex);
  29. CPartSizeItemPtr GetPartSizeItemByName(CString a_strName);
  30. BOOL DeletePartSizeItemByIndex(int a_nIndex);
  31. BOOL DeletePartSizeItemByPart(double d_Part);
  32. BOOL AddPartSizeItem(double a_poPartSizeItem);
  33. BOOL EditPartSizeItem(int a_nIndex, CPartSizeItemPtr a_poPartSizeItem);
  34. // particle analysis standard data
  35. CPartSizeFilePtr GetPartSizeFile() { return m_poPartSizeFile; }
  36. void SetPartSizeFile(CPartSizeFilePtr);
  37. // file pathname
  38. CString GetPathName() { return m_strPathName; }
  39. void SetPathName(CString a_strPathName) { m_strPathName = a_strPathName; }
  40. // modify flag
  41. BOOL IsModified() { return m_bModify; }
  42. void SetModify(BOOL a_bModify = TRUE) { m_bModify = a_bModify; }
  43. protected:
  44. // cleanup
  45. void Cleanup();
  46. // initialization
  47. void Init();
  48. // duplication
  49. void Duplicate(const CPartSizeFileMgr& a_oSource);
  50. // get part size
  51. CPartSizeItemPtr GetLevel(CString a_strValue);
  52. // get part size body
  53. CString GetPartSizeTextBody(CPartSizeFilePtr a_pPartSizeFile);
  54. // particle size level data
  55. CPartSizeFilePtr m_poPartSizeFile;
  56. // file pathname
  57. CString m_strPathName;
  58. // modify flag
  59. BOOL m_bModify;
  60. };
  61. typedef std::shared_ptr<CPartSizeFileMgr> __declspec(dllexport) CPartSizeFileMgrPtr;
  62. }