90 lines
2.3 KiB
C
90 lines
2.3 KiB
C
|
#pragma once
|
|||
|
#include "BaseClient.h"
|
|||
|
|
|||
|
|
|||
|
class HBDPurifierStat
|
|||
|
{
|
|||
|
public:
|
|||
|
enum ValveStat {
|
|||
|
OnPosition = 0,
|
|||
|
OpenPosition,
|
|||
|
ClosePosition
|
|||
|
};
|
|||
|
HBDPurifierStat() {
|
|||
|
isDedusting = false;
|
|||
|
isBlowBack = false;
|
|||
|
isDeoxygen = false;
|
|||
|
temperature = 0;
|
|||
|
difPressure = 0.0f;
|
|||
|
filterJamPressure = 0.0f;
|
|||
|
filterTotalUseTime = 0;
|
|||
|
spinFilterTotalUseTime = 0;
|
|||
|
spinFilterAlarmTime = 0;
|
|||
|
//cycleEnter = OnPosition;
|
|||
|
//cycleExit = OnPosition;
|
|||
|
cycleEnter = OpenPosition;
|
|||
|
cycleExit = OpenPosition;
|
|||
|
hasExcept = false;
|
|||
|
isDifPressureAlarm = false;
|
|||
|
isDeoxygenEnterCloseExcept = false;
|
|||
|
isBlowBackEnterCloseExcept = false;
|
|||
|
isDeoxygenExitCloseExcept = false;
|
|||
|
isBlowBackExitCloseExcept = false;
|
|||
|
isEnterGapOpenExcept = false;
|
|||
|
isExitGapOpenExcept = false;
|
|||
|
isOverTemp = false;
|
|||
|
}
|
|||
|
~HBDPurifierStat() {
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public:
|
|||
|
BaseStat baseStat;
|
|||
|
bool isDeoxygen; //除氧
|
|||
|
bool isBlowBack; //反吹
|
|||
|
bool isDedusting; //除尘
|
|||
|
|
|||
|
int temperature; //温度
|
|||
|
float difPressure; //压差
|
|||
|
float filterJamPressure; //滤筒堵塞值
|
|||
|
int filterTotalUseTime; //滤芯使用时长(小时)
|
|||
|
int spinFilterTotalUseTime; //旋转滤芯使用时长(小时)
|
|||
|
int spinFilterAlarmTime; //旋风滤筒报警时间(小时)
|
|||
|
|
|||
|
ValveStat cycleEnter; //循环进气阀状态
|
|||
|
ValveStat cycleExit; //循环出气阀状态
|
|||
|
|
|||
|
bool hasExcept; //有异常
|
|||
|
bool isDifPressureAlarm; //压差报警
|
|||
|
bool isDeoxygenEnterCloseExcept; //除氧进气阀关闭异常
|
|||
|
bool isBlowBackEnterCloseExcept; //反吹进气阀关闭异常
|
|||
|
bool isDeoxygenExitCloseExcept; //除氧出气阀关闭异常
|
|||
|
bool isBlowBackExitCloseExcept; //反吹出气阀关闭异常
|
|||
|
bool isEnterGapOpenExcept; //正常循环_进气阀打开异常
|
|||
|
bool isExitGapOpenExcept; //正常循环_出气阀打开异常
|
|||
|
bool isOverTemp; //温度过高
|
|||
|
};
|
|||
|
|
|||
|
class HBDPurifierClient :public S7Client
|
|||
|
{
|
|||
|
public:
|
|||
|
HBDPurifierClient(void* pconfig = nullptr);
|
|||
|
~HBDPurifierClient();
|
|||
|
|
|||
|
void SetDeoxygen(bool enable);
|
|||
|
void SetBlowBack(bool enable);
|
|||
|
void SetDedusting(bool enable);
|
|||
|
void ResetSpinFilterUseTime(bool enable);
|
|||
|
void GetStat(HBDPurifierStat& stat);
|
|||
|
private:
|
|||
|
//void InitCommand();
|
|||
|
|
|||
|
static void ProcReadInfo(void *pobject, Command* pcommand);
|
|||
|
static void ProcWriteValue(void *pobject, Command* pcommand);
|
|||
|
|
|||
|
private:
|
|||
|
HBDPurifierStat m_Stat;
|
|||
|
static const unsigned int READ_ITEM_COUNT = 7;
|
|||
|
};
|
|||
|
|