/********************************************************************* * * file: MemZone.h * * copyright: Shanghai Baosight Software Co., Ltd. * * Version history * 1.0 2020-02-16 zoufuzhou create * *********************************************************************/ #ifndef _H_MEM_ZONE_H #define _H_MEM_ZONE_H #include #include #include using namespace baosight; class CMemZone { public: /************* * zone:track zone num * zonetable: collect data cache zone file name * islinear: true Linear interpolation, false neighbor interpolation **************/ CMemZone(int zone,const string& zonetable,bool islinear = false); public: ~CMemZone(void); public: //get by ti and coilid first row (memory zone) ZONE_ROW* operator()(int ti,const string& coilid); //get by coilid first row (memory zone) ZONE_ROW* operator()(const string& coilid); //get by ti first row (memory zone) ZONE_ROW* operator()(int ti); //get memory zone first row ZONE_ROW* operator()(void); public: //ָget next row bool next(void); void next(int ti); void next(const string& coilid); public: bool checkNext(void); bool check(const string& zonetable); const string& zonename(){return m_zonetable;} //get trk coil info char* getEntId(void); char* getExtId(void); // modify memory zone data by column row void ModifyValue(int zone,string entId,int column,int row,float value); // get memory zone data by column row float GetValue(int zone,string entId,int column,int row); private: void init(void); void setCurrent(int ti,bool newti); void shiftCoil(void); void shift(TRK_UNIT* trk,int length); void springShift(TRK_UNIT* trk,int length,bool islinear = false); void shiftCross(TRK_UNIT* trk,int length); private: int m_zone; std::string m_zonetable; bool m_islinear; long m_arrindex; ZONE_ROW* p_previous; ZONE_ROW* p_current; ZONE_ROW* p_base; static ZONE m_tmpzone; float collectLen; //m private: CMemTrk* p_memtrk; }; #endif