57 lines
1.6 KiB
C
57 lines
1.6 KiB
C
|
#pragma once
|
|||
|
#include "BaseClient.h"
|
|||
|
//#include "../config/ConfigManager.h"
|
|||
|
#include <map>
|
|||
|
#include "../config/bean/ExtCfg.h"
|
|||
|
class Oxygenstat
|
|||
|
{
|
|||
|
public:
|
|||
|
explicit Oxygenstat() {
|
|||
|
concentrationValue = 0.0f;
|
|||
|
valueUnit = "";
|
|||
|
scale = 1;
|
|||
|
tempValue = 0.0f;
|
|||
|
humidityValue = 0.0f;
|
|||
|
concentrationAgValue = 0.0f;
|
|||
|
}
|
|||
|
public:
|
|||
|
BaseStat baseStat;
|
|||
|
float concentrationValue; //Ũ<><C5A8>ֵ
|
|||
|
string valueUnit; //Ũ<>ȵ<EFBFBD>λ
|
|||
|
int scale; //<2F><>ֵ<EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
float tempValue; //<2F>¶<EFBFBD>ֵ
|
|||
|
float humidityValue; //ʪ<><CAAA>ֵ
|
|||
|
float concentrationAgValue; //ģ<><C4A3><EFBFBD><EFBFBD>
|
|||
|
};
|
|||
|
|
|||
|
class OxygenClient :public TcpClient
|
|||
|
{
|
|||
|
public:
|
|||
|
OxygenClient(CommunicationCfg* pconfig);
|
|||
|
~OxygenClient();
|
|||
|
void GetOxygenStat(unsigned char addr, Oxygenstat& stat);
|
|||
|
void GetOxygenStat(Oxygenstat& stat1, Oxygenstat& stat2, Oxygenstat& stat3);
|
|||
|
void InitCommand();
|
|||
|
|
|||
|
protected:
|
|||
|
virtual void ServerDisconnectProc();
|
|||
|
virtual void WriteSuccessProc(int wlength, unsigned char* buffer, Command* pcommand);
|
|||
|
virtual void WriteTimeoutProc(Command* pcommand);
|
|||
|
virtual void ReadTimeoutProc(Command* pcommand);
|
|||
|
virtual void ReadSuccessProc(int rlength, unsigned char* buffer, Command* pcommand);
|
|||
|
|
|||
|
|
|||
|
private:
|
|||
|
void static PorcOxygenValue(void* pobject, Command* pcommand);
|
|||
|
void static ProcPointInfo(void* pobject, Command* pcommand);
|
|||
|
void static PorcConcentrationValue(void* pobject, Command* pcommand);
|
|||
|
void static ProcTempInfo(void* pobject, Command* pcommand);
|
|||
|
void static ProcNewVersion(void* pobject, Command* pcommand);
|
|||
|
private:
|
|||
|
map<unsigned char, Oxygenstat*> m_Oxygens;
|
|||
|
ExtCfg* m_ExtCfg;
|
|||
|
//vector<Command*> m_PurifierOxygenCommands;
|
|||
|
//map<unsigned char, double> m_Oxygens;
|
|||
|
};
|
|||
|
|