GrpcPrint/PrintS/Communication/TempCtrlClient.h
2024-03-19 17:45:12 +08:00

62 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "BaseClient.h"
struct TempAlarm
{
bool isOverLimit; //上限报警
bool isLowerLimit; //下限报警
bool isActiveAlarm; //正偏差报警
bool isInactiveAlarm; //负偏差报警
bool isInputLimit; //超量程报警
bool al1; //AL1状态0为动作
bool al2; //AL2状态0为动作
TempAlarm() {
isOverLimit = false;
isLowerLimit = false;
isActiveAlarm = false;
isInactiveAlarm = false;
isInputLimit = false;
al1 = false;
al2 = false;
}
};
class TempStat
{
public:
TempStat() {
measuredValue = 0;
settingValue = 0;
outputValue = 0;
scale = 0;
}
~TempStat(){}
public:
BaseStat baseStat;
float measuredValue; //测量值
float settingValue; //给定值
unsigned char outputValue; //输出值MV
TempAlarm alarm; //报警信息
int scale; //数值放大倍数
};
class TempCtrlClient :public TcpClient
{
public:
TempCtrlClient(CommunicationCfg* pconfig);
~TempCtrlClient();
void SetTargeValue(float value);
void GetStat(TempStat& stat);
private:
void InitCommand();
void static ProcTempInfo(void* pobject, Command* pcommand);
void static ProcSetTemp(void* pobject, Command* pcommand);
private:
TempStat m_Stat;
};