| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #pragma once
- #include "PartSizeItem.h"
- namespace OTSMODEL {
- // particle size file mark
- const int PART_SIZE_FILE_MARK = 'P' + 'A' + 'R' + 'T' + 'S' + 'I' + 'Z' + 'E';
- // particle size file version
- const CString PART_SIZE_FILE_VERSION = _T("1.1.1");
- // particle size file extension
- const CString PART_SIZE_FILE_EXT = _T(".psf");
- const CString PART_SIZE_FILE_FILTER = _T("Particle Size Files (*.psf)|*.psf||");
- // part size components
- typedef enum class __declspec(dllexport) PART_SIZE_ITEMS
- {
- INVALID = -1,
- MIN = 0,
- NAME = 0,
- MAX = 0
- } PART_SIZE_ITEMS;
- typedef __declspec(dllexport) std::vector<double> CPartSizeList;
- class __declspec(dllexport) CPartSizeFile :public xmls::ISlo
- {
- public:
- CPartSizeFile(); // constructor
- CPartSizeFile(const CPartSizeFile&); // copy constructor
- CPartSizeFile(CPartSizeFile*); // copy constructor
- CPartSizeFile& operator=(const CPartSizeFile&); // =operator
- BOOL operator==(const CPartSizeFile&); // ==operator
- virtual ~CPartSizeFile(); // destructor
- // serialization
- void Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode);
- // name
- CString GetName() { return m_strName; }
- void SetName(CString a_strName) { m_strName = a_strName; }
- // version
- CString GetVersion() { return m_strVersion; }
- void SetVersion(CString a_strVersion) { m_strVersion = a_strVersion; }
- // double parts
- CPartSizeList GetSizes() { return m_listSizes; }
- void SetSizes(CPartSizeList& a_listPartSize, BOOL a_bClear = TRUE);
-
- // part size list
- CPartSizeItemList& GetPartSizeList() { return m_listPartSize; }
- void SetPartSizeList(CPartSizeItemList& a_listPartSize, BOOL a_bClear = TRUE);
- CPartSizeItemPtr GetPartSizeByIndex(int a_nIndex);
- CPartSizeItemPtr GetPartSizeByName(CString a_strPartSizeName);
- BOOL ChangDoubleToItem();
-
- protected:
- // cleanup
- void Cleanup();
- // initialization
- void Init();
- // duplication
- void Duplicate(const CPartSizeFile& a_oSource);
- // name
- CString m_strName;
- // version
- CString m_strVersion;
- // double parts
- CPartSizeList m_listSizes;
-
- // part size list
- CPartSizeItemList m_listPartSize;
- };
- typedef std::shared_ptr<CPartSizeFile> CPartSizeFilePtr;
- typedef std::vector<CPartSizeFilePtr> CPartSizeFileList;
-
- }
|