#pragma once #include #include #include "../protobuf/stream.pb.h" #include "../DataManage/RWData.h" using namespace std; class PowerCompensate { public: PowerCompensate(); ~PowerCompensate(); static void Generate(int cno,vector& ins); void SetPowerComp(stream::PowerCompensate* cp); public: int m_cno; unsigned short m_percent; float m_value; float m_value_min; float m_value_max; public: static const string TABLE_NAME; static const string FIELD_CNO; static const string FIELD_PERCENT; static const string FIELD_VALUE; static const string FIELD_VALUE_MIN; static const string FIELD_VALUE_MAX; }; bool PowerCompensateLess(const PowerCompensate * m1, const PowerCompensate * m2); class PowerCompensateCfg { public: PowerCompensateCfg(); ~PowerCompensateCfg(); float CalcPowerCompensate(float power); void Update(const ReadData& rd); public: vector m_pcs; };