#pragma once #include "BaseClient.h" class Upsstat { public: Upsstat() { inputVol = 0; lastVol = 0; outputVol = 0; outputLoad = 0; outputF = 0; unitVol = 0; tempValue = 0; isVolError = false; isBatteryVolLow = false; isBypassMode = false; isUpsError = false; upsType = false; isTesting = false; isShutdown = false; } ~Upsstat(){} public: BaseStat baseStat; float inputVol; //输入电压: MMM.M float lastVol; //上一次转电池放电时电压: NNN.N float outputVol; //输出电压: PPP.P int outputLoad; //输出负载百分比: QQQ float outputF; //输入频率: RR.R float unitVol; //电池单元电压: S.SS float tempValue; //温度: TT.T bool isVolError; //市电异常 bool isBatteryVolLow; //电池电压低 bool isBypassMode; //旁路模式 bool isUpsError; //UPS 故障 bool upsType; //UPS 后备式 (0 :在线式) bool isTesting; //测试进行中 bool isShutdown; //关机 }; class UPSClient :public TcpClient { public: UPSClient(CommunicationCfg* pconfig); ~UPSClient(); void InitCommand(); void ShutDownUps(float minute); void GetStat(Upsstat& stat); private: void static ProcInfo(void* pobject, Command* pcommand); void static ProcShutDown(void* pobject, Command* pcommand); private: Upsstat m_Stat; };