2024-06-27 10:56:50 +08:00
|
|
|
|
#pragma once
|
2024-03-19 17:45:12 +08:00
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
2024-06-27 10:56:50 +08:00
|
|
|
|
#include "../protobuf/stream.pb.h"
|
2024-06-27 14:39:53 +08:00
|
|
|
|
#include "../DataManage/RWData.h"
|
2024-03-19 17:45:12 +08:00
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
class PowerCompensate
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
PowerCompensate();
|
|
|
|
|
~PowerCompensate();
|
|
|
|
|
static void Generate(int cno,vector<string>& ins);
|
2024-06-27 10:56:50 +08:00
|
|
|
|
void SetPowerComp(stream::PowerCompensate* cp);
|
2024-03-19 17:45:12 +08:00
|
|
|
|
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);
|
2024-06-27 14:39:53 +08:00
|
|
|
|
void Update(const ReadData& rd);
|
2024-03-19 17:45:12 +08:00
|
|
|
|
public:
|
|
|
|
|
vector<PowerCompensate*> m_pcs;
|
|
|
|
|
};
|