辅机参数功能重构
This commit is contained in:
parent
8e304f87e3
commit
02f8764bf8
@ -30,9 +30,11 @@ enum DATATYPE {
|
||||
iFLOAT
|
||||
};
|
||||
|
||||
|
||||
struct Item {
|
||||
std::string nameKey; //参数key
|
||||
std::string strValue; //value
|
||||
//bool isOutPut; //是否只读 false:只读
|
||||
DATATYPE valueType; //数据类型
|
||||
};
|
||||
|
||||
|
@ -1770,6 +1770,7 @@ public:
|
||||
keyStr = it->nameKey;
|
||||
if (m_IOCfgMap.find(keyStr) != m_IOCfgMap.end() && it->valueType == iBOOL) {
|
||||
m_IOCfgMap[keyStr]->m_IsActive = (bool)atoi(it->strValue.c_str());
|
||||
//m_IOCfgMap[keyStr]->m_IsOutput = it->isOutPut;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
|
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
#include "BaseClient.h"
|
||||
#include "BaseClient.h"
|
||||
#include "S7Command.h"
|
||||
#include "../global.h"
|
||||
|
||||
#include "../Config/ConfigManager.h"
|
||||
|
||||
BaseClient::BaseClient()
|
||||
:m_Thread(INVALID_HANDLE_VALUE)
|
||||
@ -33,8 +33,18 @@ BaseClient::~BaseClient()
|
||||
pcommand = NULL;
|
||||
m_CycleCommands.pop_back();
|
||||
}
|
||||
|
||||
EnterCriticalSection(&m_ValueCS);
|
||||
for (auto item = m_baseMp.begin(); item != m_baseMp.end(); ++item) {
|
||||
delete item->second;
|
||||
}
|
||||
m_baseMp.clear();
|
||||
LeaveCriticalSection(&m_ValueCS);
|
||||
|
||||
DeleteCriticalSection(&m_ValueCS);
|
||||
DeleteCriticalSection(&m_RtcCS);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void BaseClient::Startup()
|
||||
@ -116,6 +126,33 @@ void BaseClient::UpdateCycleCommands()
|
||||
}
|
||||
}
|
||||
|
||||
void BaseClient::InsertMp(void* startPtr, size_t count) {
|
||||
size_t ptrSize = sizeof(nullptr); //指针大小
|
||||
for (int i = 0; i < count; ++i) {
|
||||
BaseData* bd = *((BaseData**)((char*)startPtr + ptrSize * i));
|
||||
if (m_baseMp.find(bd->GetCode()) != m_baseMp.end()) {
|
||||
printf("%s is repeated...\n", bd->GetCode().data());
|
||||
}
|
||||
else { m_baseMp.insert(make_pair(bd->GetCode(), bd)); }
|
||||
}
|
||||
}
|
||||
|
||||
void BaseClient::SendToClients() {
|
||||
string valStr = "";
|
||||
DATATYPE dataType;
|
||||
list<Item> its;
|
||||
|
||||
EnterCriticalSection(&m_ValueCS);
|
||||
auto baseItem = m_baseMp.begin();
|
||||
while (baseItem != m_baseMp.end()) {
|
||||
its.emplace_back(Item{ baseItem->first,baseItem->second->GetValueStr(),baseItem->second->GetDataType() });
|
||||
++baseItem;
|
||||
}
|
||||
ClientWrapper::Instance()->PushAllClient(new WriteData(SYSPARAMDATA, its));
|
||||
LeaveCriticalSection(&m_ValueCS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
S7Client::S7Client(CommunicationCfg* pconfig)
|
||||
:m_S7Client(nullptr)
|
||||
@ -458,6 +495,8 @@ TcpClient::TcpClient(CommunicationCfg* pconfig, int freq)
|
||||
TcpClient::~TcpClient()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void TcpClient::Init()
|
||||
@ -604,3 +643,5 @@ void TcpClient::Shutdown()
|
||||
if (m_Client.IsOpen())m_Client.Close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -9,6 +9,9 @@
|
||||
#include <queue>
|
||||
#include <list>
|
||||
#include "ConnectInterface.h"
|
||||
#include "BaseData.h"
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
class BaseStat {
|
||||
public:
|
||||
@ -45,6 +48,7 @@ public:
|
||||
virtual bool IsComConnected() { return m_BaseStat.isConnected; }
|
||||
|
||||
void ClearCycleCommand();
|
||||
void SendToClients();
|
||||
protected:
|
||||
virtual void InitCommand() = 0;
|
||||
virtual unsigned int GetInterval() { return 600; }
|
||||
@ -63,6 +67,7 @@ protected:
|
||||
|
||||
virtual void CycleBegin() {};
|
||||
|
||||
void InsertMp(void* startPtr, size_t count);
|
||||
|
||||
protected:
|
||||
HANDLE m_Thread;
|
||||
@ -75,6 +80,8 @@ protected:
|
||||
//CSocketHandle m_Client;
|
||||
uint64_t m_LastCycleTickcount;
|
||||
BaseStat m_BaseStat;
|
||||
|
||||
unordered_map<std::string, BaseData*> m_baseMp;
|
||||
};
|
||||
|
||||
class S7Client :public BaseClient
|
||||
@ -160,10 +167,13 @@ private:
|
||||
virtual void ReadTimeoutProc(Command* pcommand);
|
||||
virtual void ReadSuccessProc(int rlength, unsigned char* buffer, Command* pcommand);
|
||||
unsigned int GetInterval() { return m_Config->m_Interval; }
|
||||
|
||||
protected:
|
||||
CSocketHandle m_Client;
|
||||
CommunicationCfg* m_Config;
|
||||
int m_Freq;
|
||||
int m_ReadTimeout;
|
||||
int m_WriteTimeout;
|
||||
|
||||
|
||||
};
|
||||
|
165
PrintS/Communication/BaseData.h
Normal file
165
PrintS/Communication/BaseData.h
Normal file
@ -0,0 +1,165 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "../DataManage/RWData.h"
|
||||
|
||||
class BaseData {
|
||||
public:
|
||||
BaseData(const std::string& code,const std::string& context):m_code(code),m_context(context){}
|
||||
virtual ~BaseData() {}
|
||||
|
||||
virtual void SetValue(float f) {}
|
||||
virtual void SetValue(int i) {}
|
||||
virtual void SetValue(unsigned short us) {}
|
||||
virtual void SetValue(short s) {}
|
||||
virtual void SetValue(bool b) {}
|
||||
|
||||
//virtual void GetValue(DATATYPE& dataType, float& f) {}
|
||||
//virtual void GetValue(DATATYPE& dataType, int& i) {}
|
||||
//virtual void GetValue(DATATYPE& dataType, unsigned short& us) {}
|
||||
//virtual void GetValue(DATATYPE& dataType, short& s) {}
|
||||
//virtual void GetValue(DATATYPE& dataType, bool& b) {}
|
||||
|
||||
std::string GetCode() { return m_code; }
|
||||
virtual std::string GetValueStr() { return ""; }
|
||||
virtual DATATYPE GetDataType() { return UNKNOW; }
|
||||
private:
|
||||
std::string m_code; //key编码
|
||||
std::string m_context; //中文内容
|
||||
|
||||
};
|
||||
|
||||
class FloatData : public BaseData {
|
||||
public:
|
||||
FloatData(const std::string& code, const std::string& context/*, float val*/)
|
||||
: BaseData(code, context), m_value(0.0f) {
|
||||
//if (m_baseMp.find(code) != m_baseMp.end()) {
|
||||
// printf("%s is repeated...", code.c_str());
|
||||
//}
|
||||
//else {
|
||||
// m_baseMp.insert(make_pair(code, this));
|
||||
//}
|
||||
}
|
||||
~FloatData() {}
|
||||
|
||||
void SetValue(float f) { m_value = f; }
|
||||
//void GetValue(DATATYPE& dataType, float& f) { dataType = iFLOAT; f = m_value; }
|
||||
DATATYPE GetDataType() { return iFLOAT; }
|
||||
float GetValue() { return m_value; }
|
||||
virtual std::string GetValueStr() { return to_string(m_value); }
|
||||
private:
|
||||
float m_value;
|
||||
};
|
||||
|
||||
|
||||
class IntData : public BaseData {
|
||||
public:
|
||||
IntData(const std::string& code, const std::string& context/*, int val*/)
|
||||
: BaseData(code, context), m_value(0) {
|
||||
//if (m_baseMp.find(code) != m_baseMp.end()) {
|
||||
// printf("%s is repeated...", code.c_str());
|
||||
//}
|
||||
//else {
|
||||
// m_baseMp.insert(make_pair(code, this));
|
||||
//}
|
||||
}
|
||||
~IntData() {}
|
||||
|
||||
void SetValue(int i) { m_value = i; }
|
||||
//void GetValue(DATATYPE& dataType,int& i) { dataType = iINT; i = m_value; }
|
||||
DATATYPE GetDataTypeI() { return iINT; }
|
||||
int GetValue() { return m_value; }
|
||||
virtual std::string GetValueStr() { return to_string(m_value); }
|
||||
private:
|
||||
int m_value;
|
||||
};
|
||||
|
||||
|
||||
class ShortData : public BaseData {
|
||||
public:
|
||||
ShortData(const std::string& code, const std::string& context/*, short val*/)
|
||||
: BaseData(code, context), m_value(0) {
|
||||
//if (m_baseMp.find(code) != m_baseMp.end()) {
|
||||
// printf("%s is repeated...", code.c_str());
|
||||
//}
|
||||
//else {
|
||||
// m_baseMp.insert(make_pair(code, this));
|
||||
//}
|
||||
}
|
||||
~ShortData() {}
|
||||
|
||||
void SetValue(short s) { m_value = s; }
|
||||
//void GetValue(DATATYPE& dataType, short& s) { dataType = iSHORT; s = m_value; }
|
||||
DATATYPE GetDataType() { return iSHORT; }
|
||||
short GetValue() { return m_value; }
|
||||
virtual std::string GetValueStr() { return to_string(m_value); }
|
||||
private:
|
||||
short m_value;
|
||||
};
|
||||
|
||||
class UShortData : public BaseData {
|
||||
public:
|
||||
UShortData(const std::string& code, const std::string& context/*, unsigned short val*/)
|
||||
: BaseData(code, context), m_value(0) {
|
||||
//if (m_baseMp.find(code) != m_baseMp.end()) {
|
||||
// printf("%s is repeated...", code.c_str());
|
||||
//}
|
||||
//else {
|
||||
// m_baseMp.insert(make_pair(code, this));
|
||||
//}
|
||||
}
|
||||
~UShortData() {}
|
||||
|
||||
void SetValue(unsigned short us) { m_value = us; }
|
||||
//void GetValue(DATATYPE& dataType, unsigned short& us) { dataType = iUSHORT; us = m_value; }
|
||||
DATATYPE GetDataType() { return iUSHORT; }
|
||||
unsigned short GetValue() { return m_value; }
|
||||
virtual std::string GetValueStr() { return to_string(m_value); }
|
||||
private:
|
||||
unsigned short m_value;
|
||||
};
|
||||
|
||||
|
||||
class BoolData : public BaseData {
|
||||
public:
|
||||
BoolData(const std::string& code, const std::string& context/*, bool val*/)
|
||||
: BaseData(code, context), m_value(0) {
|
||||
//if (m_baseMp.find(code) != m_baseMp.end()) {
|
||||
// printf("%s is repeated...", code.c_str());
|
||||
//}
|
||||
//else {
|
||||
// m_baseMp.insert(make_pair(code, this));
|
||||
//}
|
||||
}
|
||||
~BoolData() {}
|
||||
|
||||
void SetValue(bool b) { m_value = b; }
|
||||
//string GetValueStr() { return to_string(m_value); }
|
||||
DATATYPE GetDataType() { return iBOOL; }
|
||||
bool GetValue() { return m_value; }
|
||||
virtual std::string GetValueStr() { return to_string(m_value); }
|
||||
private:
|
||||
bool m_value;
|
||||
};
|
||||
|
||||
|
||||
class UcharData : public BaseData {
|
||||
public:
|
||||
UcharData(const std::string& code, const std::string& context/*, bool val*/)
|
||||
: BaseData(code, context), m_value(0) {
|
||||
//if (m_baseMp.find(code) != m_baseMp.end()) {
|
||||
// printf("%s is repeated...", code.c_str());
|
||||
//}
|
||||
//else {
|
||||
// m_baseMp.insert(make_pair(code, this));
|
||||
//}
|
||||
}
|
||||
~UcharData() {}
|
||||
|
||||
void SetValue(UCHAR uc) { m_value = uc; }
|
||||
//void GetValue(DATATYPE& dataType, UCHAR& uc) { dataType = iUCHAR; uc = m_value; }
|
||||
DATATYPE GetDataType() { return iUCHAR; }
|
||||
UCHAR GetValue() { return m_value; }
|
||||
virtual std::string GetValueStr() { return to_string(m_value); }
|
||||
private:
|
||||
UCHAR m_value;
|
||||
};
|
@ -8,8 +8,22 @@ ChillerClient::ChillerClient(CommunicationCfg* pconfig,int* tp) :TcpClient(pconf
|
||||
{
|
||||
m_Freq = 150;
|
||||
m_Type = tp;
|
||||
}
|
||||
|
||||
size_t ptrSize = sizeof(nullptr); //指针大小
|
||||
|
||||
void* startPtr = &m_DoluyoChillerStat.m_startFlag + 1;
|
||||
size_t count = ((size_t)&m_DoluyoChillerStat.m_endFlag - (size_t)&startPtr) / ptrSize;
|
||||
InsertMp(startPtr, count);
|
||||
|
||||
startPtr = &m_HansChillerstat.m_startFlag + 1;
|
||||
count = ((size_t)&m_HansChillerstat.m_endFlag - (size_t)&startPtr) / ptrSize;
|
||||
InsertMp(startPtr, count);
|
||||
|
||||
startPtr = &m_TongFeiStat.m_startFlag + 1;
|
||||
count = ((size_t)&m_TongFeiStat.m_endFlag - (size_t)&startPtr) / ptrSize;
|
||||
InsertMp(startPtr, count);
|
||||
|
||||
}
|
||||
|
||||
ChillerClient::~ChillerClient()
|
||||
{
|
||||
@ -112,15 +126,15 @@ void ChillerClient::ProcDoluyoInfo(void* pobject, Command* pcommand)
|
||||
//pDlc->m_ValueMutex.lock();
|
||||
|
||||
EnterCriticalSection(&pDlc->m_ValueCS);
|
||||
pDlc->m_DoluyoChillerStat.tempRealtimeValue = (float)watertempValue / 10.0f;
|
||||
pDlc->m_DoluyoChillerStat.runInfo = runinfo;
|
||||
pDlc->m_DoluyoChillerStat.m_tempRealtimeValue->SetValue((float)watertempValue / 10.0f);
|
||||
pDlc->m_DoluyoChillerStat.m_runInfo->SetValue(runinfo);
|
||||
switch (runs) {
|
||||
case 0:pDlc->m_DoluyoChillerStat.isRun = false; break;
|
||||
case 1:pDlc->m_DoluyoChillerStat.isRun = true; break;
|
||||
case 2:pDlc->m_DoluyoChillerStat.isRun = false; break;
|
||||
case 0:pDlc->m_DoluyoChillerStat.m_isRun->SetValue(false); break;
|
||||
case 1:pDlc->m_DoluyoChillerStat.m_isRun->SetValue(true); break;
|
||||
case 2:pDlc->m_DoluyoChillerStat.m_isRun->SetValue(false); break;
|
||||
}
|
||||
pDlc->m_DoluyoChillerStat.alarmInfo = alarminfo;
|
||||
pDlc->m_DoluyoChillerStat.isLevelAlarm= ((levelalarm == 0) ? false : true);
|
||||
pDlc->m_DoluyoChillerStat.m_alarmInfo->SetValue(alarminfo);
|
||||
pDlc->m_DoluyoChillerStat.m_isLevelAlarm->SetValue(((levelalarm == 0) ? false : true));
|
||||
//stat->tempSettingValue = (float)tempSetValue / 10.0f;
|
||||
LeaveCriticalSection(&pDlc->m_ValueCS);
|
||||
}
|
||||
@ -135,7 +149,7 @@ void ChillerClient::ProcDoluyoReadTargeValue(void* pobject, Command* pcommand)
|
||||
//unsigned char* rseq = pcommand->m_RespSeq;
|
||||
short tempValue = (((rseq[3] & 0xff) << 8) + (rseq[4] & 0xff));
|
||||
EnterCriticalSection(&pDlc->m_ValueCS);
|
||||
pDlc->m_DoluyoChillerStat.tempSettingValue = (float)tempValue / 10.0f;
|
||||
pDlc->m_DoluyoChillerStat.m_tempSettingValue->SetValue((float)tempValue / 10.0f);
|
||||
LeaveCriticalSection(&pDlc->m_ValueCS);
|
||||
}
|
||||
|
||||
@ -152,110 +166,110 @@ void ChillerClient::ProcDoluyoSettingValue(void* pobject, Command* pcommand)
|
||||
}
|
||||
|
||||
|
||||
void ChillerClient::GetDoluyoStat(DoluyoChillerstat& stat1)
|
||||
{
|
||||
EnterCriticalSection(&m_ValueCS);
|
||||
stat1.baseStat = m_BaseStat;
|
||||
stat1.alarmInfo = m_DoluyoChillerStat.alarmInfo;
|
||||
stat1.isRun = m_DoluyoChillerStat.isRun;
|
||||
stat1.runInfo = m_DoluyoChillerStat.runInfo;
|
||||
stat1.tempRealtimeValue = m_DoluyoChillerStat.tempRealtimeValue;
|
||||
stat1.tempSettingValue = m_DoluyoChillerStat.tempSettingValue;
|
||||
stat1.isLevelAlarm = m_DoluyoChillerStat.isLevelAlarm;
|
||||
LeaveCriticalSection(&m_ValueCS);
|
||||
}
|
||||
//void ChillerClient::GetDoluyoStat(DoluyoChillerstat& stat1)
|
||||
//{
|
||||
// EnterCriticalSection(&m_ValueCS);
|
||||
// stat1.baseStat = m_BaseStat;
|
||||
// stat1.alarmInfo = m_DoluyoChillerStat.alarmInfo;
|
||||
// stat1.isRun = m_DoluyoChillerStat.isRun;
|
||||
// stat1.runInfo = m_DoluyoChillerStat.runInfo;
|
||||
// stat1.tempRealtimeValue = m_DoluyoChillerStat.tempRealtimeValue;
|
||||
// stat1.tempSettingValue = m_DoluyoChillerStat.tempSettingValue;
|
||||
// stat1.isLevelAlarm = m_DoluyoChillerStat.isLevelAlarm;
|
||||
// LeaveCriticalSection(&m_ValueCS);
|
||||
//}
|
||||
|
||||
void ChillerClient::GetHansStat(HansChillerstat& stat)
|
||||
{
|
||||
EnterCriticalSection(&m_ValueCS);
|
||||
/*stat.baseStat = m_BaseStat;
|
||||
stat.alarmInfo = m_Stat.alarmInfo;
|
||||
stat.isRun = m_Stat.isRun;
|
||||
stat.runInfo = m_Stat.runInfo;
|
||||
stat.tempRealtimeValue = m_Stat.tempRealtimeValue;
|
||||
stat.tempSettingValue = m_Stat.tempSettingValue;
|
||||
stat.isLevelAlarm = m_Stat.isLevelAlarm;*/
|
||||
stat.baseStat = m_BaseStat;
|
||||
stat.m_WaterOutTemp = m_HansChillerstat.m_WaterOutTemp;
|
||||
stat.m_Flow = m_HansChillerstat.m_Flow;
|
||||
stat.m_SettingTemp = m_HansChillerstat.m_SettingTemp;
|
||||
stat.m_RunIndicate = m_HansChillerstat.m_RunIndicate;
|
||||
stat.m_WorkIndicate = m_HansChillerstat.m_WorkIndicate;
|
||||
stat.m_CompressorIndicate = m_HansChillerstat.m_CompressorIndicate;
|
||||
stat.m_WaterPumpIndicate = m_HansChillerstat.m_WaterPumpIndicate;
|
||||
stat.m_HeaterIndicate = m_HansChillerstat.m_HeaterIndicate;
|
||||
stat.m_FanIndicate = m_HansChillerstat.m_FanIndicate;
|
||||
stat.m_SolenoidValveIndicate = m_HansChillerstat.m_SolenoidValveIndicate;
|
||||
stat.m_LowTempErrorIndicate = m_HansChillerstat.m_LowTempErrorIndicate;
|
||||
stat.m_TempUndulateIndicate = m_HansChillerstat.m_TempUndulateIndicate;
|
||||
stat.m_HeaterExceptionIndicate = m_HansChillerstat.m_HeaterExceptionIndicate;
|
||||
stat.m_IOSignalIndicate = m_HansChillerstat.m_IOSignalIndicate;
|
||||
stat.m_IsAlarm = m_HansChillerstat.m_IsAlarm;
|
||||
stat.m_FlowAlarm = m_HansChillerstat.m_FlowAlarm;
|
||||
stat.m_TempAlarm = m_HansChillerstat.m_TempAlarm;
|
||||
stat.m_PressureAlarm = m_HansChillerstat.m_PressureAlarm;
|
||||
stat.m_WaterLevelAlarm = m_HansChillerstat.m_WaterLevelAlarm;
|
||||
stat.m_TempSensorAlarm = m_HansChillerstat.m_TempSensorAlarm;
|
||||
stat.m_SolenoidValveAlarm = m_HansChillerstat.m_SolenoidValveAlarm;
|
||||
stat.m_PhaseSeqAlarm = m_HansChillerstat.m_PhaseSeqAlarm;
|
||||
stat.m_CompressorStartFreqAlarm = m_HansChillerstat.m_CompressorStartFreqAlarm;
|
||||
stat.m_IO0Alarm = m_HansChillerstat.m_IO0Alarm;
|
||||
stat.m_IO1Alarm = m_HansChillerstat.m_IO1Alarm;
|
||||
stat.m_IO2Alarm = m_HansChillerstat.m_IO2Alarm;
|
||||
stat.m_IO3Alarm = m_HansChillerstat.m_IO3Alarm;
|
||||
stat.m_IO4Alarm = m_HansChillerstat.m_IO4Alarm;
|
||||
LeaveCriticalSection(&m_ValueCS);
|
||||
}
|
||||
//void ChillerClient::GetHansStat(HansChillerstat& stat)
|
||||
//{
|
||||
// EnterCriticalSection(&m_ValueCS);
|
||||
// /*stat.baseStat = m_BaseStat;
|
||||
// stat.alarmInfo = m_Stat.alarmInfo;
|
||||
// stat.isRun = m_Stat.isRun;
|
||||
// stat.runInfo = m_Stat.runInfo;
|
||||
// stat.tempRealtimeValue = m_Stat.tempRealtimeValue;
|
||||
// stat.tempSettingValue = m_Stat.tempSettingValue;
|
||||
// stat.isLevelAlarm = m_Stat.isLevelAlarm;*/
|
||||
// stat.baseStat = m_BaseStat;
|
||||
// stat.m_WaterOutTemp = m_HansChillerstat.m_WaterOutTemp;
|
||||
// stat.m_Flow = m_HansChillerstat.m_Flow;
|
||||
// stat.m_SettingTemp = m_HansChillerstat.m_SettingTemp;
|
||||
// stat.m_RunIndicate = m_HansChillerstat.m_RunIndicate;
|
||||
// stat.m_WorkIndicate = m_HansChillerstat.m_WorkIndicate;
|
||||
// stat.m_CompressorIndicate = m_HansChillerstat.m_CompressorIndicate;
|
||||
// stat.m_WaterPumpIndicate = m_HansChillerstat.m_WaterPumpIndicate;
|
||||
// stat.m_HeaterIndicate = m_HansChillerstat.m_HeaterIndicate;
|
||||
// stat.m_FanIndicate = m_HansChillerstat.m_FanIndicate;
|
||||
// stat.m_SolenoidValveIndicate = m_HansChillerstat.m_SolenoidValveIndicate;
|
||||
// stat.m_LowTempErrorIndicate = m_HansChillerstat.m_LowTempErrorIndicate;
|
||||
// stat.m_TempUndulateIndicate = m_HansChillerstat.m_TempUndulateIndicate;
|
||||
// stat.m_HeaterExceptionIndicate = m_HansChillerstat.m_HeaterExceptionIndicate;
|
||||
// stat.m_IOSignalIndicate = m_HansChillerstat.m_IOSignalIndicate;
|
||||
// stat.m_IsAlarm = m_HansChillerstat.m_IsAlarm;
|
||||
// stat.m_FlowAlarm = m_HansChillerstat.m_FlowAlarm;
|
||||
// stat.m_TempAlarm = m_HansChillerstat.m_TempAlarm;
|
||||
// stat.m_PressureAlarm = m_HansChillerstat.m_PressureAlarm;
|
||||
// stat.m_WaterLevelAlarm = m_HansChillerstat.m_WaterLevelAlarm;
|
||||
// stat.m_TempSensorAlarm = m_HansChillerstat.m_TempSensorAlarm;
|
||||
// stat.m_SolenoidValveAlarm = m_HansChillerstat.m_SolenoidValveAlarm;
|
||||
// stat.m_PhaseSeqAlarm = m_HansChillerstat.m_PhaseSeqAlarm;
|
||||
// stat.m_CompressorStartFreqAlarm = m_HansChillerstat.m_CompressorStartFreqAlarm;
|
||||
// stat.m_IO0Alarm = m_HansChillerstat.m_IO0Alarm;
|
||||
// stat.m_IO1Alarm = m_HansChillerstat.m_IO1Alarm;
|
||||
// stat.m_IO2Alarm = m_HansChillerstat.m_IO2Alarm;
|
||||
// stat.m_IO3Alarm = m_HansChillerstat.m_IO3Alarm;
|
||||
// stat.m_IO4Alarm = m_HansChillerstat.m_IO4Alarm;
|
||||
// LeaveCriticalSection(&m_ValueCS);
|
||||
//}
|
||||
|
||||
void ChillerClient::GetTongFeiStat(TongFeiStat& stat)
|
||||
{
|
||||
EnterCriticalSection(&m_ValueCS);
|
||||
stat.m_BaseStat = m_BaseStat;
|
||||
stat.m_IsLowVoltageAlarm = m_TongFeiStat.m_IsLowVoltageAlarm;
|
||||
stat.m_IsHydraulicFailure = m_TongFeiStat.m_IsHydraulicFailure;
|
||||
stat.m_IsLevelFailure = m_TongFeiStat.m_IsLevelFailure;
|
||||
stat.m_IsLiquidPumpAlarm = m_TongFeiStat.m_IsLiquidPumpAlarm;
|
||||
stat.m_IsPressAlarm = m_TongFeiStat.m_IsPressAlarm;
|
||||
stat.m_IsElectricHeatingFailure = m_TongFeiStat.m_IsElectricHeatingFailure;
|
||||
stat.m_IsAntifreezeAlarm = m_TongFeiStat.m_IsAntifreezeAlarm;
|
||||
stat.m_IsLiquidTempTooHigh = m_TongFeiStat.m_IsLiquidTempTooHigh;
|
||||
stat.m_IsLiquidTempProbeFailure = m_TongFeiStat.m_IsLiquidTempProbeFailure;
|
||||
stat.m_IsEffluentTempProbeFailure = m_TongFeiStat.m_IsEffluentTempProbeFailure;
|
||||
stat.m_IsAmbientTempProbeFailure = m_TongFeiStat.m_IsAmbientTempProbeFailure;
|
||||
stat.m_IsCondensationTempProbeFailure = m_TongFeiStat.m_IsCondensationTempProbeFailure;
|
||||
stat.m_IsEvaporationInletTempProbeFailure = m_TongFeiStat.m_IsEvaporationInletTempProbeFailure;
|
||||
stat.m_IsEvaporationOutletTempProbeFailure = m_TongFeiStat.m_IsEvaporationOutletTempProbeFailure;
|
||||
stat.m_IsCondensationTempTooHigh = m_TongFeiStat.m_IsCondensationTempTooHigh;
|
||||
stat.m_IsPhaseOrderError = m_TongFeiStat.m_IsPhaseOrderError;
|
||||
stat.m_IsPowerFailure = m_TongFeiStat.m_IsPowerFailure;
|
||||
stat.m_IsCompressorFailure = m_TongFeiStat.m_IsCompressorFailure;
|
||||
stat.m_IsAmbientTempTooHigh = m_TongFeiStat.m_IsAmbientTempTooHigh;
|
||||
stat.m_IsAmbientTempException = m_TongFeiStat.m_IsAmbientTempException;
|
||||
|
||||
stat.m_AlarmState = m_TongFeiStat.m_AlarmState;
|
||||
stat.m_RoomTempSettingValue = m_TongFeiStat.m_RoomTempSettingValue;
|
||||
stat.m_ConstantTempSettingValue = m_TongFeiStat.m_ConstantTempSettingValue;
|
||||
stat.m_WorkMode = m_TongFeiStat.m_WorkMode;
|
||||
stat.m_RefrigerationMethod = m_TongFeiStat.m_RefrigerationMethod;
|
||||
stat.m_LiquidAlarmTemp = m_TongFeiStat.m_LiquidAlarmTemp;
|
||||
stat.m_UnitStatus = m_TongFeiStat.m_UnitStatus;
|
||||
|
||||
stat.m_LiquidTempProbe = m_TongFeiStat.m_LiquidTempProbe;
|
||||
stat.m_EffluentTempProbe = m_TongFeiStat.m_EffluentTempProbe;
|
||||
stat.m_AmbientTempProbe = m_TongFeiStat.m_AmbientTempProbe;
|
||||
stat.m_CondensationTempProbe = m_TongFeiStat.m_CondensationTempProbe;
|
||||
stat.m_EvaporationInletTempProbe = m_TongFeiStat.m_EvaporationInletTempProbe;
|
||||
stat.m_EvaporationOutletTempProbe = m_TongFeiStat.m_EvaporationOutletTempProbe;
|
||||
|
||||
stat.m_WorkingFrequency = m_TongFeiStat.m_WorkingFrequency;
|
||||
stat.m_OverHeatingValue = m_TongFeiStat.m_OverHeatingValue;
|
||||
stat.m_EEV1 = m_TongFeiStat.m_EEV1;
|
||||
stat.m_EEV2 = m_TongFeiStat.m_EEV2;
|
||||
stat.m_CondensingFanRatio = m_TongFeiStat.m_CondensingFanRatio;
|
||||
stat.m_ElectricHeatingRatio = m_TongFeiStat.m_ElectricHeatingRatio;
|
||||
stat.m_FlowRate = m_TongFeiStat.m_FlowRate;
|
||||
LeaveCriticalSection(&m_ValueCS);
|
||||
}
|
||||
//void ChillerClient::GetTongFeiStat(TongFeiStat& stat)
|
||||
//{
|
||||
// EnterCriticalSection(&m_ValueCS);
|
||||
// stat.m_BaseStat = m_BaseStat;
|
||||
// stat.m_IsLowVoltageAlarm = m_TongFeiStat.m_IsLowVoltageAlarm;
|
||||
// stat.m_IsHydraulicFailure = m_TongFeiStat.m_IsHydraulicFailure;
|
||||
// stat.m_IsLevelFailure = m_TongFeiStat.m_IsLevelFailure;
|
||||
// stat.m_IsLiquidPumpAlarm = m_TongFeiStat.m_IsLiquidPumpAlarm;
|
||||
// stat.m_IsPressAlarm = m_TongFeiStat.m_IsPressAlarm;
|
||||
// stat.m_IsElectricHeatingFailure = m_TongFeiStat.m_IsElectricHeatingFailure;
|
||||
// stat.m_IsAntifreezeAlarm = m_TongFeiStat.m_IsAntifreezeAlarm;
|
||||
// stat.m_IsLiquidTempTooHigh = m_TongFeiStat.m_IsLiquidTempTooHigh;
|
||||
// stat.m_IsLiquidTempProbeFailure = m_TongFeiStat.m_IsLiquidTempProbeFailure;
|
||||
// stat.m_IsEffluentTempProbeFailure = m_TongFeiStat.m_IsEffluentTempProbeFailure;
|
||||
// stat.m_IsAmbientTempProbeFailure = m_TongFeiStat.m_IsAmbientTempProbeFailure;
|
||||
// stat.m_IsCondensationTempProbeFailure = m_TongFeiStat.m_IsCondensationTempProbeFailure;
|
||||
// stat.m_IsEvaporationInletTempProbeFailure = m_TongFeiStat.m_IsEvaporationInletTempProbeFailure;
|
||||
// stat.m_IsEvaporationOutletTempProbeFailure = m_TongFeiStat.m_IsEvaporationOutletTempProbeFailure;
|
||||
// stat.m_IsCondensationTempTooHigh = m_TongFeiStat.m_IsCondensationTempTooHigh;
|
||||
// stat.m_IsPhaseOrderError = m_TongFeiStat.m_IsPhaseOrderError;
|
||||
// stat.m_IsPowerFailure = m_TongFeiStat.m_IsPowerFailure;
|
||||
// stat.m_IsCompressorFailure = m_TongFeiStat.m_IsCompressorFailure;
|
||||
// stat.m_IsAmbientTempTooHigh = m_TongFeiStat.m_IsAmbientTempTooHigh;
|
||||
// stat.m_IsAmbientTempException = m_TongFeiStat.m_IsAmbientTempException;
|
||||
//
|
||||
// stat.m_AlarmState = m_TongFeiStat.m_AlarmState;
|
||||
// stat.m_RoomTempSettingValue = m_TongFeiStat.m_RoomTempSettingValue;
|
||||
// stat.m_ConstantTempSettingValue = m_TongFeiStat.m_ConstantTempSettingValue;
|
||||
// stat.m_WorkMode = m_TongFeiStat.m_WorkMode;
|
||||
// stat.m_RefrigerationMethod = m_TongFeiStat.m_RefrigerationMethod;
|
||||
// stat.m_LiquidAlarmTemp = m_TongFeiStat.m_LiquidAlarmTemp;
|
||||
// stat.m_UnitStatus = m_TongFeiStat.m_UnitStatus;
|
||||
//
|
||||
// stat.m_LiquidTempProbe = m_TongFeiStat.m_LiquidTempProbe;
|
||||
// stat.m_EffluentTempProbe = m_TongFeiStat.m_EffluentTempProbe;
|
||||
// stat.m_AmbientTempProbe = m_TongFeiStat.m_AmbientTempProbe;
|
||||
// stat.m_CondensationTempProbe = m_TongFeiStat.m_CondensationTempProbe;
|
||||
// stat.m_EvaporationInletTempProbe = m_TongFeiStat.m_EvaporationInletTempProbe;
|
||||
// stat.m_EvaporationOutletTempProbe = m_TongFeiStat.m_EvaporationOutletTempProbe;
|
||||
//
|
||||
// stat.m_WorkingFrequency = m_TongFeiStat.m_WorkingFrequency;
|
||||
// stat.m_OverHeatingValue = m_TongFeiStat.m_OverHeatingValue;
|
||||
// stat.m_EEV1 = m_TongFeiStat.m_EEV1;
|
||||
// stat.m_EEV2 = m_TongFeiStat.m_EEV2;
|
||||
// stat.m_CondensingFanRatio = m_TongFeiStat.m_CondensingFanRatio;
|
||||
// stat.m_ElectricHeatingRatio = m_TongFeiStat.m_ElectricHeatingRatio;
|
||||
// stat.m_FlowRate = m_TongFeiStat.m_FlowRate;
|
||||
// LeaveCriticalSection(&m_ValueCS);
|
||||
//}
|
||||
|
||||
void ChillerClient::ProcHansInfo(void* pobject, Command* pcommand)
|
||||
{
|
||||
@ -271,35 +285,35 @@ void ChillerClient::ProcHansInfo(void* pobject, Command* pcommand)
|
||||
float settingTemp = (float)(((rseq[33] & 0xff) << 8) + (rseq[34] & 0xff)) / 10.0f;
|
||||
|
||||
EnterCriticalSection(&pDlc->m_ValueCS);
|
||||
pDlc->m_HansChillerstat.m_WaterOutTemp = waterOutTemp;
|
||||
pDlc->m_HansChillerstat.m_Flow = flow;
|
||||
pDlc->m_HansChillerstat.m_SettingTemp = settingTemp;
|
||||
pDlc->m_HansChillerstat.m_RunIndicate = (state1 & 0x01) ? true : false; //运行指示
|
||||
pDlc->m_HansChillerstat.m_WorkIndicate = (state1 & 0x02) ? true : false; //工作正常指示
|
||||
pDlc->m_HansChillerstat.m_IsAlarm = (state1 & 0x04) ? true : false; //报警
|
||||
pDlc->m_HansChillerstat.m_CompressorIndicate = (state1 & 0x08) ? true : false; //压缩机指示
|
||||
pDlc->m_HansChillerstat.m_WaterPumpIndicate = (state1 & 0x10) ? true : false; //水泵指示
|
||||
pDlc->m_HansChillerstat.m_HeaterIndicate = (state1 & 0x20) ? true : false; //加热器指示
|
||||
pDlc->m_HansChillerstat.m_FanIndicate = (state1 & 0x40) ? true : false; //风机指示
|
||||
pDlc->m_HansChillerstat.m_SolenoidValveIndicate = (state1 & 0x80) ? true : false; //电磁阀指示
|
||||
pDlc->m_HansChillerstat.m_FlowAlarm = (state1 & 0x100) ? true : false; //流量报警
|
||||
pDlc->m_HansChillerstat.m_TempAlarm = (state1 & 0x200) ? true : false; //温度报警
|
||||
pDlc->m_HansChillerstat.m_PressureAlarm = (state1 & 0x400) ? true : false; //压力报警
|
||||
pDlc->m_HansChillerstat.m_WaterLevelAlarm = (state1 & 0x800) ? true : false; //液位报警
|
||||
pDlc->m_HansChillerstat.m_LowTempErrorIndicate = (state1 & 0x1000) ? true : false; //低温错误指示
|
||||
pDlc->m_HansChillerstat.m_TempUndulateIndicate = (state1 & 0x2000) ? true : false; //温度波动指示
|
||||
pDlc->m_HansChillerstat.m_WaterOutTemp->SetValue(waterOutTemp);
|
||||
pDlc->m_HansChillerstat.m_Flow->SetValue(flow);
|
||||
pDlc->m_HansChillerstat.m_SettingTemp->SetValue(settingTemp);
|
||||
pDlc->m_HansChillerstat.m_RunIndicate->SetValue((state1 & 0x01) ? true : false); //运行指示
|
||||
pDlc->m_HansChillerstat.m_WorkIndicate->SetValue((state1 & 0x02) ? true : false); //工作正常指示
|
||||
pDlc->m_HansChillerstat.m_IsAlarm->SetValue((state1 & 0x04) ? true : false); //报警
|
||||
pDlc->m_HansChillerstat.m_CompressorIndicate->SetValue((state1 & 0x08) ? true : false); //压缩机指示
|
||||
pDlc->m_HansChillerstat.m_WaterPumpIndicate->SetValue((state1 & 0x10) ? true : false); //水泵指示
|
||||
pDlc->m_HansChillerstat.m_HeaterIndicate->SetValue((state1 & 0x20) ? true : false); //加热器指示
|
||||
pDlc->m_HansChillerstat.m_FanIndicate->SetValue((state1 & 0x40) ? true : false); //风机指示
|
||||
pDlc->m_HansChillerstat.m_SolenoidValveIndicate->SetValue((state1 & 0x80) ? true : false); //电磁阀指示
|
||||
pDlc->m_HansChillerstat.m_FlowAlarm->SetValue((state1 & 0x100) ? true : false); //流量报警
|
||||
pDlc->m_HansChillerstat.m_TempAlarm->SetValue((state1 & 0x200) ? true : false); //温度报警
|
||||
pDlc->m_HansChillerstat.m_PressureAlarm->SetValue((state1 & 0x400) ? true : false); //压力报警
|
||||
pDlc->m_HansChillerstat.m_WaterLevelAlarm->SetValue((state1 & 0x800) ? true : false); //液位报警
|
||||
pDlc->m_HansChillerstat.m_LowTempErrorIndicate->SetValue((state1 & 0x1000) ? true : false); //低温错误指示
|
||||
pDlc->m_HansChillerstat.m_TempUndulateIndicate->SetValue((state1 & 0x2000) ? true : false); //温度波动指示
|
||||
|
||||
pDlc->m_HansChillerstat.m_TempSensorAlarm = (state2 & 0x01) ? true : false; //温度传感器故障报警
|
||||
pDlc->m_HansChillerstat.m_SolenoidValveAlarm = (state2 & 0x02) ? true : false; //电磁阀故障报警
|
||||
pDlc->m_HansChillerstat.m_HeaterExceptionIndicate = (state2 & 0x04) ? true : false; //加热器异常指示
|
||||
pDlc->m_HansChillerstat.m_IOSignalIndicate = (state2 & 0x08) ? true : false; //IO信号指示
|
||||
pDlc->m_HansChillerstat.m_PhaseSeqAlarm = (state2 & 0x10) ? true : false; //相序报警
|
||||
pDlc->m_HansChillerstat.m_CompressorStartFreqAlarm = (state2 & 0x20) ? true : false; //压缩机起动频繁报警
|
||||
pDlc->m_HansChillerstat.m_IO0Alarm = (state2 & 0x100) ? true : false; //IO0错误报警
|
||||
pDlc->m_HansChillerstat.m_IO1Alarm = (state2 & 0x200) ? true : false; //IO0错误报警
|
||||
pDlc->m_HansChillerstat.m_IO2Alarm = (state2 & 0x400) ? true : false; //IO0错误报警
|
||||
pDlc->m_HansChillerstat.m_IO3Alarm = (state2 & 0x800) ? true : false; //IO0错误报警
|
||||
pDlc->m_HansChillerstat.m_IO4Alarm = (state2 & 0x1000) ? true : false; //IO0错误报警
|
||||
pDlc->m_HansChillerstat.m_TempSensorAlarm->SetValue((state2 & 0x01) ? true : false); //温度传感器故障报警
|
||||
pDlc->m_HansChillerstat.m_SolenoidValveAlarm->SetValue((state2 & 0x02) ? true : false); //电磁阀故障报警
|
||||
pDlc->m_HansChillerstat.m_HeaterExceptionIndicate->SetValue((state2 & 0x04) ? true : false); //加热器异常指示
|
||||
pDlc->m_HansChillerstat.m_IOSignalIndicate->SetValue((state2 & 0x08) ? true : false); //IO信号指示
|
||||
pDlc->m_HansChillerstat.m_PhaseSeqAlarm->SetValue((state2 & 0x10) ? true : false); //相序报警
|
||||
pDlc->m_HansChillerstat.m_CompressorStartFreqAlarm->SetValue((state2 & 0x20) ? true : false); //压缩机起动频繁报警
|
||||
pDlc->m_HansChillerstat.m_IO0Alarm->SetValue((state2 & 0x100) ? true : false); //IO0错误报警
|
||||
pDlc->m_HansChillerstat.m_IO1Alarm->SetValue((state2 & 0x200) ? true : false); //IO0错误报警
|
||||
pDlc->m_HansChillerstat.m_IO2Alarm->SetValue((state2 & 0x400) ? true : false); //IO0错误报警
|
||||
pDlc->m_HansChillerstat.m_IO3Alarm->SetValue((state2 & 0x800) ? true : false); //IO0错误报警
|
||||
pDlc->m_HansChillerstat.m_IO4Alarm->SetValue((state2 & 0x1000) ? true : false); //IO0错误报警
|
||||
LeaveCriticalSection(&pDlc->m_ValueCS);
|
||||
|
||||
//g_SystemInfo->LockInfo();
|
||||
@ -601,28 +615,28 @@ void ChillerClient::ProcTongfeiAlarmInputInfo(void* pobject, Command* pcommand)
|
||||
bitset<8> arr2(rseq[4]);
|
||||
bitset<8> arr3(rseq[5]);
|
||||
EnterCriticalSection(&cc->m_ValueCS);
|
||||
cc->m_TongFeiStat.m_IsLowVoltageAlarm = arr1[0];
|
||||
cc->m_TongFeiStat.m_IsHydraulicFailure = arr1[1];
|
||||
cc->m_TongFeiStat.m_IsLevelFailure = arr1[2];
|
||||
cc->m_TongFeiStat.m_IsLiquidPumpAlarm = arr1[3];
|
||||
cc->m_TongFeiStat.m_IsPressAlarm = arr1[4];
|
||||
cc->m_TongFeiStat.m_IsElectricHeatingFailure = arr1[5];
|
||||
cc->m_TongFeiStat.m_IsAntifreezeAlarm = arr1[6];
|
||||
cc->m_TongFeiStat.m_IsLiquidTempTooHigh = arr1[7];
|
||||
cc->m_TongFeiStat.m_IsLowVoltageAlarm->SetValue(arr1[0]);
|
||||
cc->m_TongFeiStat.m_IsHydraulicFailure->SetValue(arr1[1]);
|
||||
cc->m_TongFeiStat.m_IsLevelFailure->SetValue(arr1[2]);
|
||||
cc->m_TongFeiStat.m_IsLiquidPumpAlarm->SetValue(arr1[3]);
|
||||
cc->m_TongFeiStat.m_IsPressAlarm->SetValue(arr1[4]);
|
||||
cc->m_TongFeiStat.m_IsElectricHeatingFailure->SetValue(arr1[5]);
|
||||
cc->m_TongFeiStat.m_IsAntifreezeAlarm->SetValue(arr1[6]);
|
||||
cc->m_TongFeiStat.m_IsLiquidTempTooHigh->SetValue(arr1[7]);
|
||||
|
||||
cc->m_TongFeiStat.m_IsLiquidTempProbeFailure = arr2[0];
|
||||
cc->m_TongFeiStat.m_IsEffluentTempProbeFailure = arr2[1];
|
||||
cc->m_TongFeiStat.m_IsAmbientTempProbeFailure = arr2[2];
|
||||
cc->m_TongFeiStat.m_IsCondensationTempProbeFailure = arr2[3];
|
||||
cc->m_TongFeiStat.m_IsEvaporationInletTempProbeFailure = arr2[4];
|
||||
cc->m_TongFeiStat.m_IsEvaporationOutletTempProbeFailure = arr2[5];
|
||||
cc->m_TongFeiStat.m_IsCondensationTempTooHigh = arr2[6];
|
||||
cc->m_TongFeiStat.m_IsPhaseOrderError = arr2[7];
|
||||
cc->m_TongFeiStat.m_IsLiquidTempProbeFailure->SetValue(arr2[0]);
|
||||
cc->m_TongFeiStat.m_IsEffluentTempProbeFailure->SetValue(arr2[1]);
|
||||
cc->m_TongFeiStat.m_IsAmbientTempProbeFailure->SetValue(arr2[2]);
|
||||
cc->m_TongFeiStat.m_IsCondensationTempProbeFailure->SetValue(arr2[3]);
|
||||
cc->m_TongFeiStat.m_IsEvaporationInletTempProbeFailure->SetValue(arr2[4]);
|
||||
cc->m_TongFeiStat.m_IsEvaporationOutletTempProbeFailure->SetValue(arr2[5]);
|
||||
cc->m_TongFeiStat.m_IsCondensationTempTooHigh->SetValue(arr2[6]);
|
||||
cc->m_TongFeiStat.m_IsPhaseOrderError->SetValue(arr2[7]);
|
||||
|
||||
cc->m_TongFeiStat.m_IsPowerFailure = arr3[0];
|
||||
cc->m_TongFeiStat.m_IsCompressorFailure = arr3[1];
|
||||
cc->m_TongFeiStat.m_IsAmbientTempTooHigh = arr3[2];
|
||||
cc->m_TongFeiStat.m_IsAmbientTempException = arr3[3];
|
||||
cc->m_TongFeiStat.m_IsPowerFailure->SetValue(arr3[0]);
|
||||
cc->m_TongFeiStat.m_IsCompressorFailure->SetValue(arr3[1]);
|
||||
cc->m_TongFeiStat.m_IsAmbientTempTooHigh->SetValue(arr3[2]);
|
||||
cc->m_TongFeiStat.m_IsAmbientTempException->SetValue(arr3[3]);
|
||||
LeaveCriticalSection(&cc->m_ValueCS);
|
||||
}
|
||||
|
||||
@ -634,7 +648,7 @@ void ChillerClient::ProcTongfeiAlarmStateInfo(void* pobject, Command* pcommand)
|
||||
|
||||
short state1 = (((rseq[3] & 0xff) << 8) + (rseq[4] & 0xff));
|
||||
EnterCriticalSection(&cc->m_ValueCS);
|
||||
cc->m_TongFeiStat.m_AlarmState = state1;
|
||||
cc->m_TongFeiStat.m_AlarmState->SetValue(state1);
|
||||
LeaveCriticalSection(&cc->m_ValueCS);
|
||||
}
|
||||
|
||||
@ -651,11 +665,11 @@ void ChillerClient::ProcTongfeiUserParamsInfo(void* pobject, Command* pcommand)
|
||||
short liquidAlarmTemp = (((rseq[11] & 0xff) << 8) + (rseq[12] & 0xff));
|
||||
|
||||
EnterCriticalSection(&cc->m_ValueCS);
|
||||
cc->m_TongFeiStat.m_RoomTempSettingValue = (float)roomTempSettingValue/10.0f;
|
||||
cc->m_TongFeiStat.m_ConstantTempSettingValue = (float)constantTempSettingValue / 10.0f;
|
||||
cc->m_TongFeiStat.m_WorkMode = workMode;
|
||||
cc->m_TongFeiStat.m_RefrigerationMethod = refrigerationMethod;
|
||||
cc->m_TongFeiStat.m_LiquidAlarmTemp = (float)liquidAlarmTemp / 10.0f;
|
||||
cc->m_TongFeiStat.m_RoomTempSettingValue->SetValue((float)roomTempSettingValue/10.0f);
|
||||
cc->m_TongFeiStat.m_ConstantTempSettingValue->SetValue((float)constantTempSettingValue / 10.0f);
|
||||
cc->m_TongFeiStat.m_WorkMode->SetValue((int)workMode);
|
||||
cc->m_TongFeiStat.m_RefrigerationMethod->SetValue(refrigerationMethod);
|
||||
cc->m_TongFeiStat.m_LiquidAlarmTemp->SetValue((float)liquidAlarmTemp / 10.0f);
|
||||
LeaveCriticalSection(&cc->m_ValueCS);
|
||||
}
|
||||
void ChillerClient::ProcTongfeiAnaShowInfo(void* pobject, Command* pcommand)
|
||||
@ -673,13 +687,13 @@ void ChillerClient::ProcTongfeiAnaShowInfo(void* pobject, Command* pcommand)
|
||||
|
||||
short unitStatus = (((rseq[19] & 0xff) << 8) + (rseq[20] & 0xff));
|
||||
EnterCriticalSection(&cc->m_ValueCS);
|
||||
cc->m_TongFeiStat.m_LiquidTempProbe = (float)liquidTempProbe/10.0f;
|
||||
cc->m_TongFeiStat.m_EffluentTempProbe = (float)effluentTempProbe / 10.0f;
|
||||
cc->m_TongFeiStat.m_AmbientTempProbe = (float)ambientTempProbe / 10.0f;
|
||||
cc->m_TongFeiStat.m_CondensationTempProbe = (float)condensationTempProbe / 10.0f;
|
||||
cc->m_TongFeiStat.m_EvaporationInletTempProbe = (float)evaporationInletTempProbe / 10.0f;
|
||||
cc->m_TongFeiStat.m_EvaporationOutletTempProbe = (float)evaporationOutletTempProbe / 10.0f;
|
||||
cc->m_TongFeiStat.m_UnitStatus = unitStatus;
|
||||
cc->m_TongFeiStat.m_LiquidTempProbe->SetValue((float)liquidTempProbe/10.0f);
|
||||
cc->m_TongFeiStat.m_EffluentTempProbe->SetValue((float)effluentTempProbe / 10.0f);
|
||||
cc->m_TongFeiStat.m_AmbientTempProbe->SetValue((float)ambientTempProbe / 10.0f);
|
||||
cc->m_TongFeiStat.m_CondensationTempProbe->SetValue((float)condensationTempProbe / 10.0f);
|
||||
cc->m_TongFeiStat.m_EvaporationInletTempProbe->SetValue((float)evaporationInletTempProbe / 10.0f);
|
||||
cc->m_TongFeiStat.m_EvaporationOutletTempProbe->SetValue((float)evaporationOutletTempProbe / 10.0f);
|
||||
cc->m_TongFeiStat.m_UnitStatus->SetValue(unitStatus);
|
||||
LeaveCriticalSection(&cc->m_ValueCS);
|
||||
}
|
||||
|
||||
@ -695,10 +709,10 @@ void ChillerClient::ProcTongfeiAnaShowInfo2(void* pobject, Command* pcommand)
|
||||
short EEV2 = (((rseq[9] & 0xff) << 8) + (rseq[10] & 0xff));
|
||||
|
||||
EnterCriticalSection(&cc->m_ValueCS);
|
||||
cc->m_TongFeiStat.m_WorkingFrequency = (float)WorkingFrequency / 10.0f;
|
||||
cc->m_TongFeiStat.m_OverHeatingValue = (float)OverHeatingValue / 10.0f;
|
||||
cc->m_TongFeiStat.m_EEV1 = (float)EEV1/10.0f;
|
||||
cc->m_TongFeiStat.m_EEV2 = (float)EEV2/10.0f;
|
||||
cc->m_TongFeiStat.m_WorkingFrequency->SetValue((float)WorkingFrequency / 10.0f);
|
||||
cc->m_TongFeiStat.m_OverHeatingValue->SetValue((float)OverHeatingValue / 10.0f);
|
||||
cc->m_TongFeiStat.m_EEV1->SetValue((float)EEV1/10.0f);
|
||||
cc->m_TongFeiStat.m_EEV2->SetValue((float)EEV2/10.0f);
|
||||
LeaveCriticalSection(&cc->m_ValueCS);
|
||||
}
|
||||
|
||||
@ -713,8 +727,8 @@ void ChillerClient::ProcTongfeianaShowInfo3(void* pobject, Command* pcommand)
|
||||
short FlowRate = (((rseq[11] & 0xff) << 8) + (rseq[12] & 0xff));
|
||||
|
||||
EnterCriticalSection(&cc->m_ValueCS);
|
||||
cc->m_TongFeiStat.m_CondensingFanRatio = (float)CondensingFanRatio / 10.0f;
|
||||
cc->m_TongFeiStat.m_ElectricHeatingRatio = (float)ElectricHeatingRatio / 10.0f;
|
||||
cc->m_TongFeiStat.m_FlowRate = (float)FlowRate/10.0f;
|
||||
cc->m_TongFeiStat.m_CondensingFanRatio->SetValue((float)CondensingFanRatio / 10.0f);
|
||||
cc->m_TongFeiStat.m_ElectricHeatingRatio->SetValue((float)ElectricHeatingRatio / 10.0f);
|
||||
cc->m_TongFeiStat.m_FlowRate->SetValue((float)FlowRate/10.0f);
|
||||
LeaveCriticalSection(&cc->m_ValueCS);
|
||||
}
|
@ -2,22 +2,30 @@
|
||||
#include "BaseClient.h"
|
||||
#include "../config/ConfigManager.h"
|
||||
#include "../LanguageManager.h"
|
||||
#include <unordered_map>
|
||||
|
||||
#pragma pack(1)
|
||||
class DoluyoChillerstat
|
||||
{
|
||||
public:
|
||||
explicit DoluyoChillerstat() {
|
||||
tempRealtimeValue = 0;
|
||||
runInfo = 0;
|
||||
isRun = false;
|
||||
alarmInfo = 0;
|
||||
tempSettingValue = 0;
|
||||
isLevelAlarm = false;
|
||||
explicit DoluyoChillerstat()
|
||||
: m_tempRealtimeValue(new FloatData("tempRealtimeValue",u8"水箱温度"))
|
||||
, m_runInfo(new UShortData("runInfo",u8"水箱温度"))
|
||||
, m_isRun(new BoolData("isRun","水箱温度"))
|
||||
, m_alarmInfo(new UShortData("alarmInfo","水箱温度"))
|
||||
, m_tempSettingValue(new FloatData("tempSettingValue","水箱温度"))
|
||||
, m_isLevelAlarm(new BoolData("isLevelAlarm","水箱温度")){
|
||||
//tempRealtimeValue = 0;
|
||||
//runInfo = 0;
|
||||
//isRun = false;
|
||||
//alarmInfo = 0;
|
||||
//tempSettingValue = 0;
|
||||
//isLevelAlarm = false;
|
||||
}
|
||||
|
||||
string GetRunInfo() {
|
||||
string str = "";
|
||||
switch (runInfo) {
|
||||
switch (m_runInfo->GetValue()) {
|
||||
case 0:str = _(u8"待机"); break;
|
||||
case 2:str = _(u8"关机过程"); break;
|
||||
case 4:str = _(u8"制冷运行"); break;
|
||||
@ -29,7 +37,7 @@ public:
|
||||
|
||||
string GetAlarmInfo() {
|
||||
string str = "";
|
||||
switch (alarmInfo)
|
||||
switch (m_alarmInfo->GetValue())
|
||||
{
|
||||
case 0:str = _(u8"无故障"); break;
|
||||
case 1:str = _(u8"提示故障"); break;
|
||||
@ -40,19 +48,58 @@ public:
|
||||
|
||||
public:
|
||||
BaseStat baseStat;
|
||||
float tempRealtimeValue; //水箱温度
|
||||
unsigned short runInfo; //运行消息 0:待机 2:关机过程 4:制冷运行 5:制热运行 6:化霜运行
|
||||
unsigned char isRun; //开关机
|
||||
unsigned short alarmInfo; //故障消息 0:无故障 1:提示故障 2:停机故障
|
||||
float tempSettingValue; //设定温度
|
||||
bool isLevelAlarm; //液位报警
|
||||
|
||||
char m_startFlag; //成员变量开始标记
|
||||
//float tempRealtimeValue; //水箱温度
|
||||
FloatData* m_tempRealtimeValue; //水箱温度
|
||||
//unsigned short runInfo; //运行消息 0:待机 2:关机过程 4:制冷运行 5:制热运行 6:化霜运行
|
||||
UShortData* m_runInfo; //运行消息 0:待机 2:关机过程 4:制冷运行 5:制热运行 6:化霜运行
|
||||
//bool isRun; //开关机
|
||||
BoolData* m_isRun; //开关机
|
||||
//unsigned short alarmInfo; //故障消息 0:无故障 1:提示故障 2:停机故障
|
||||
UShortData* m_alarmInfo; //故障消息 0:无故障 1:提示故障 2:停机故障
|
||||
//float tempSettingValue; //设定温度
|
||||
FloatData* m_tempSettingValue; //设定温度
|
||||
//bool isLevelAlarm; //液位报警
|
||||
BoolData* m_isLevelAlarm; //液位报警
|
||||
char m_endFlag; //成员变量结束标记
|
||||
};
|
||||
|
||||
class HansChillerstat //冷水机
|
||||
{
|
||||
public:
|
||||
HansChillerstat() {
|
||||
m_WaterOutTemp=0.0f;
|
||||
HansChillerstat()
|
||||
: m_WaterOutTemp(new FloatData("WaterOutTemp", u8"出水温度"))
|
||||
, m_Flow(new FloatData("Flow", u8"流量"))
|
||||
, m_SettingTemp(new FloatData("SettingTemp", u8"设置温度"))
|
||||
, m_RunIndicate(new BoolData("RunIndicate", u8"运行指示"))
|
||||
, m_WorkIndicate(new BoolData("WorkIndicate", u8"工作正常指示"))
|
||||
, m_IsAlarm(new BoolData("IsAlarm", u8"报警"))
|
||||
, m_CompressorIndicate(new BoolData("CompressorIndicate", u8"压缩机指示"))
|
||||
, m_WaterPumpIndicate(new BoolData("WaterPumpIndicate", u8"水泵指示"))
|
||||
, m_HeaterIndicate(new BoolData("HeaterIndicate", u8"加热器指示"))
|
||||
, m_FanIndicate(new BoolData("FanIndicate", u8"风机指示"))
|
||||
, m_SolenoidValveIndicate(new BoolData("SolenoidValveIndicate", u8"电磁阀指示"))
|
||||
, m_FlowAlarm(new BoolData("FlowAlarm", u8"流量报警"))
|
||||
, m_TempAlarm(new BoolData("TempAlarm", u8"温度报警"))
|
||||
, m_PressureAlarm(new BoolData("PressureAlarm", u8"压力报警"))
|
||||
, m_WaterLevelAlarm(new BoolData("WaterLevelAlarm", u8"液位报警"))
|
||||
, m_LowTempErrorIndicate(new BoolData("LowTempErrorIndicate", u8"低温错误指示"))
|
||||
, m_TempUndulateIndicate(new BoolData("TempUndulateIndicate", u8"温度波动指示"))
|
||||
, m_TempSensorAlarm(new BoolData("TempSensorAlarm", u8"温度传感器故障报警"))
|
||||
, m_SolenoidValveAlarm(new BoolData("SolenoidValveAlarm", u8"电磁阀故障报警"))
|
||||
, m_HeaterExceptionIndicate(new BoolData("HeaterExceptionIndicate", u8"加热器异常指示"))
|
||||
, m_IOSignalIndicate(new BoolData("IOSignalIndicate", u8"IO信号指示"))
|
||||
, m_PhaseSeqAlarm(new BoolData("PhaseSeqAlarm", u8"相序报警"))
|
||||
, m_CompressorStartFreqAlarm(new BoolData("CompressorStartFreqAlarm", u8"压缩机起动频繁报警"))
|
||||
, m_IO0Alarm(new BoolData("IO0Alarm", u8"IO0错误报警"))
|
||||
, m_IO1Alarm(new BoolData("IO1Alarm", u8"IO1错误报警"))
|
||||
, m_IO2Alarm(new BoolData("IO2Alarm", u8"IO2错误报警"))
|
||||
, m_IO3Alarm(new BoolData("IO3Alarm", u8"IO3错误报警"))
|
||||
, m_IO4Alarm(new BoolData("IO4Alarm", u8"IO4错误报警"))
|
||||
|
||||
{
|
||||
/* m_WaterOutTemp=0.0f;
|
||||
m_Flow=0.0f;
|
||||
m_SettingTemp=0.0f;
|
||||
|
||||
@ -81,92 +128,144 @@ public:
|
||||
m_IO1Alarm = false;
|
||||
m_IO2Alarm = false;
|
||||
m_IO3Alarm = false;
|
||||
m_IO4Alarm = false;
|
||||
m_IO4Alarm = false;*/
|
||||
}
|
||||
~HansChillerstat(){}
|
||||
public:
|
||||
BaseStat baseStat;
|
||||
|
||||
float m_WaterOutTemp; //出水温度
|
||||
float m_Flow; //流量
|
||||
float m_SettingTemp; //设置温度
|
||||
char m_startFlag; //成员变量开始标记
|
||||
|
||||
bool m_RunIndicate; //运行指示
|
||||
bool m_WorkIndicate; //工作正常指示
|
||||
bool m_IsAlarm; //报警
|
||||
bool m_CompressorIndicate; //压缩机指示
|
||||
bool m_WaterPumpIndicate; //水泵指示
|
||||
bool m_HeaterIndicate; //加热器指示
|
||||
bool m_FanIndicate; //风机指示
|
||||
bool m_SolenoidValveIndicate; //电磁阀指示
|
||||
bool m_FlowAlarm; //流量报警
|
||||
bool m_TempAlarm; //温度报警
|
||||
bool m_PressureAlarm; //压力报警
|
||||
bool m_WaterLevelAlarm; //液位报警
|
||||
bool m_LowTempErrorIndicate; //低温错误指示
|
||||
bool m_TempUndulateIndicate; //温度波动指示
|
||||
FloatData* m_WaterOutTemp; //出水温度
|
||||
FloatData* m_Flow; //流量
|
||||
FloatData* m_SettingTemp; //设置温度
|
||||
|
||||
BoolData* m_RunIndicate; //运行指示
|
||||
BoolData* m_WorkIndicate; //工作正常指示
|
||||
BoolData* m_IsAlarm; //报警
|
||||
BoolData* m_CompressorIndicate; //压缩机指示
|
||||
BoolData* m_WaterPumpIndicate; //水泵指示
|
||||
BoolData* m_HeaterIndicate; //加热器指示
|
||||
|
||||
bool m_TempSensorAlarm; //温度传感器故障报警
|
||||
bool m_SolenoidValveAlarm; //电磁阀故障报警
|
||||
bool m_HeaterExceptionIndicate; //加热器异常指示
|
||||
bool m_IOSignalIndicate; //IO信号指示
|
||||
bool m_PhaseSeqAlarm; //相序报警
|
||||
bool m_CompressorStartFreqAlarm; //压缩机起动频繁报警
|
||||
bool m_IO0Alarm; //IO0错误报警
|
||||
bool m_IO1Alarm; //IO1错误报警
|
||||
bool m_IO2Alarm; //IO2错误报警
|
||||
bool m_IO3Alarm; //IO3错误报警
|
||||
bool m_IO4Alarm; //IO4错误报警
|
||||
BoolData* m_FanIndicate; //风机指示
|
||||
BoolData* m_SolenoidValveIndicate; //电磁阀指示
|
||||
BoolData* m_FlowAlarm; //流量报警
|
||||
BoolData* m_TempAlarm; //温度报警
|
||||
BoolData* m_PressureAlarm; //压力报警
|
||||
BoolData* m_WaterLevelAlarm; //液位报警
|
||||
BoolData* m_LowTempErrorIndicate; //低温错误指示
|
||||
BoolData* m_TempUndulateIndicate; //温度波动指示
|
||||
|
||||
BoolData* m_TempSensorAlarm; //温度传感器故障报警
|
||||
BoolData* m_SolenoidValveAlarm; //电磁阀故障报警
|
||||
BoolData* m_HeaterExceptionIndicate; //加热器异常指示
|
||||
BoolData* m_IOSignalIndicate; //IO信号指示
|
||||
BoolData* m_PhaseSeqAlarm; //相序报警
|
||||
BoolData* m_CompressorStartFreqAlarm; //压缩机起动频繁报警
|
||||
BoolData* m_IO0Alarm; //IO0错误报警
|
||||
BoolData* m_IO1Alarm; //IO1错误报警
|
||||
BoolData* m_IO2Alarm; //IO2错误报警
|
||||
BoolData* m_IO3Alarm; //IO3错误报警
|
||||
BoolData* m_IO4Alarm; //IO4错误报警
|
||||
|
||||
char m_endFlag; //成员变量结束标记
|
||||
};
|
||||
|
||||
class TongFeiStat {
|
||||
|
||||
public:
|
||||
TongFeiStat()
|
||||
: m_IsLowVoltageAlarm(new BoolData("IsLowVoltageAlarm", u8"低压报警"))
|
||||
, m_IsHydraulicFailure(new BoolData("IsHydraulicFailure", u8"液路故障"))
|
||||
, m_IsLevelFailure(new BoolData("IsLevelFailure", u8"液位故障"))
|
||||
, m_IsLiquidPumpAlarm(new BoolData("IsLiquidPumpAlarm", u8"液泵热继电器报警"))
|
||||
, m_IsPressAlarm(new BoolData("IsPressAlarm", u8"压机热继电器报警"))
|
||||
, m_IsElectricHeatingFailure(new BoolData("IsElectricHeatingFailure", u8"电加热故障"))
|
||||
, m_IsAntifreezeAlarm(new BoolData("IsAntifreezeAlarm", u8"防冻报警"))
|
||||
, m_IsLiquidTempTooHigh(new BoolData("IsLiquidTempTooHigh", u8"液温太高"))
|
||||
, m_IsLiquidTempProbeFailure(new BoolData("IsLiquidTempProbeFailure", u8"液温温度探头故障"))
|
||||
, m_IsEffluentTempProbeFailure(new BoolData("IsEffluentTempProbeFailure", u8"出液温度探头故障"))
|
||||
, m_IsAmbientTempProbeFailure(new BoolData("IsAmbientTempProbeFailure", u8"环境温度探头故障"))
|
||||
, m_IsCondensationTempProbeFailure(new BoolData("IsCondensationTempProbeFailure", u8"冷凝温度探头故障"))
|
||||
, m_IsEvaporationInletTempProbeFailure(new BoolData("IsEvaporationInletTempProbeFailure", u8"蒸发进口温度探头故障"))
|
||||
, m_IsEvaporationOutletTempProbeFailure(new BoolData("IsEvaporationOutletTempProbeFailure", u8"蒸发出口温度探头故障"))
|
||||
, m_IsCondensationTempTooHigh(new BoolData("IsCondensationTempTooHigh", u8"冷凝温度过高"))
|
||||
, m_IsPhaseOrderError(new BoolData("IsPhaseOrderError", u8"相序错误"))
|
||||
, m_IsPowerFailure(new BoolData("IsPowerFailure", u8"电源故障"))
|
||||
, m_IsCompressorFailure(new BoolData("IsCompressorFailure", u8"压缩机故障"))
|
||||
, m_IsAmbientTempTooHigh(new BoolData("IsAmbientTempTooHigh", u8"环境温度太高"))
|
||||
, m_IsAmbientTempException(new BoolData("IsAmbientTempException", u8"环境温度异常"))
|
||||
, m_AlarmState(new IntData("AlarmState", u8"故障状态"))
|
||||
, m_RoomTempSettingValue(new FloatData("RoomTempSettingValue", u8"室温同调预设温度"))
|
||||
, m_ConstantTempSettingValue(new FloatData("ConstantTempSettingValue", u8"恒温预设温度"))
|
||||
, m_WorkMode(new IntData("WorkMode", u8"工作模式"))
|
||||
, m_RefrigerationMethod(new IntData("RefrigerationMethod", u8"制冷方式"))
|
||||
, m_LiquidAlarmTemp(new FloatData("LiquidAlarmTemp", u8"出液报警温度"))
|
||||
, m_UnitStatus(new IntData("UnitStatus", u8"机组状态"))
|
||||
, m_LiquidTempProbe(new FloatData("LiquidTempProbe", u8"液温温度探头"))
|
||||
, m_EffluentTempProbe(new FloatData("EffluentTempProbe", u8"出液温度探头"))
|
||||
, m_AmbientTempProbe(new FloatData("AmbientTempProbe", u8"环境温度探头"))
|
||||
, m_CondensationTempProbe(new FloatData("CondensationTempProbe", u8"冷凝温度探头"))
|
||||
, m_EvaporationInletTempProbe(new FloatData("EvaporationInletTempProbe", u8"蒸发进口温度探头"))
|
||||
, m_EvaporationOutletTempProbe(new FloatData("EvaporationOutletTempProbe", u8"蒸发出口温度探头"))
|
||||
, m_WorkingFrequency(new FloatData("WorkingFrequency", u8"运行频率"))
|
||||
, m_OverHeatingValue(new FloatData("OverHeatingValue", u8"过热度"))
|
||||
, m_EEV1(new FloatData("EEV1", u8"蒸发出口温度探头"))
|
||||
, m_EEV2(new FloatData("EEV2", u8"蒸发出口温度探头"))
|
||||
, m_CondensingFanRatio(new FloatData("CondensingFanRatio", u8"冷凝风机比例"))
|
||||
, m_ElectricHeatingRatio(new FloatData("ElectricHeatingRatio", u8"电加热比例"))
|
||||
, m_FlowRate(new FloatData("FlowRate", u8"流量"))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BaseStat m_BaseStat;
|
||||
|
||||
bool m_IsLowVoltageAlarm; //低压报警
|
||||
bool m_IsHydraulicFailure; //液路故障
|
||||
bool m_IsLevelFailure; //液位故障
|
||||
bool m_IsLiquidPumpAlarm; //液泵热继电器报警
|
||||
bool m_IsPressAlarm; //压机热继电器报警
|
||||
bool m_IsElectricHeatingFailure; //电加热故障
|
||||
bool m_IsAntifreezeAlarm; //防冻报警
|
||||
bool m_IsLiquidTempTooHigh; //液温太高
|
||||
bool m_IsLiquidTempProbeFailure; //液温温度探头故障
|
||||
bool m_IsEffluentTempProbeFailure; //出液温度探头故障
|
||||
bool m_IsAmbientTempProbeFailure; //环境温度探头故障
|
||||
bool m_IsCondensationTempProbeFailure; //冷凝温度探头故障
|
||||
bool m_IsEvaporationInletTempProbeFailure; //蒸发进口温度探头故障
|
||||
bool m_IsEvaporationOutletTempProbeFailure; //蒸发出口温度探头故障
|
||||
bool m_IsCondensationTempTooHigh; //冷凝温度过高
|
||||
bool m_IsPhaseOrderError; //相序错误
|
||||
bool m_IsPowerFailure; //电源故障
|
||||
bool m_IsCompressorFailure; //压缩机故障
|
||||
bool m_IsAmbientTempTooHigh; //环境温度太高
|
||||
bool m_IsAmbientTempException; //环境温度异常
|
||||
char m_startFlag; //成员变量开始标记
|
||||
BoolData* m_IsLowVoltageAlarm; //低压报警
|
||||
BoolData* m_IsHydraulicFailure; //液路故障
|
||||
BoolData* m_IsLevelFailure; //液位故障
|
||||
BoolData* m_IsLiquidPumpAlarm; //液泵热继电器报警
|
||||
BoolData* m_IsPressAlarm; //压机热继电器报警
|
||||
BoolData* m_IsElectricHeatingFailure; //电加热故障
|
||||
BoolData* m_IsAntifreezeAlarm; //防冻报警
|
||||
BoolData* m_IsLiquidTempTooHigh; //液温太高
|
||||
BoolData* m_IsLiquidTempProbeFailure; //液温温度探头故障
|
||||
BoolData* m_IsEffluentTempProbeFailure; //出液温度探头故障
|
||||
BoolData* m_IsAmbientTempProbeFailure; //环境温度探头故障
|
||||
BoolData* m_IsCondensationTempProbeFailure; //冷凝温度探头故障
|
||||
BoolData* m_IsEvaporationInletTempProbeFailure; //蒸发进口温度探头故障
|
||||
BoolData* m_IsEvaporationOutletTempProbeFailure; //蒸发出口温度探头故障
|
||||
BoolData* m_IsCondensationTempTooHigh; //冷凝温度过高
|
||||
BoolData* m_IsPhaseOrderError; //相序错误
|
||||
BoolData* m_IsPowerFailure; //电源故障
|
||||
BoolData* m_IsCompressorFailure; //压缩机故障
|
||||
BoolData* m_IsAmbientTempTooHigh; //环境温度太高
|
||||
BoolData* m_IsAmbientTempException; //环境温度异常
|
||||
IntData* m_AlarmState; //故障状态
|
||||
FloatData* m_RoomTempSettingValue; //室温同调预设温度
|
||||
FloatData* m_ConstantTempSettingValue; //恒温预设温度
|
||||
IntData* m_WorkMode; //工作模式
|
||||
IntData* m_RefrigerationMethod; //制冷方式
|
||||
FloatData* m_LiquidAlarmTemp; //出液报警温度
|
||||
IntData* m_UnitStatus; //机组状态
|
||||
FloatData* m_LiquidTempProbe; //液温温度探头
|
||||
FloatData* m_EffluentTempProbe; //出液温度探头
|
||||
FloatData* m_AmbientTempProbe; //环境温度探头
|
||||
FloatData* m_CondensationTempProbe; //冷凝温度探头
|
||||
FloatData* m_EvaporationInletTempProbe; //蒸发进口温度探头
|
||||
FloatData* m_EvaporationOutletTempProbe; //蒸发出口温度探头
|
||||
FloatData* m_WorkingFrequency; //运行频率
|
||||
FloatData* m_OverHeatingValue; //过热度
|
||||
FloatData* m_EEV1;
|
||||
FloatData* m_EEV2;
|
||||
FloatData* m_CondensingFanRatio; //冷凝风机比例
|
||||
FloatData* m_ElectricHeatingRatio; //电加热比例
|
||||
FloatData* m_FlowRate; //流量
|
||||
|
||||
int m_AlarmState; //故障状态
|
||||
float m_RoomTempSettingValue; //室温同调预设温度
|
||||
float m_ConstantTempSettingValue; //恒温预设温度
|
||||
int m_WorkMode; //工作模式
|
||||
int m_RefrigerationMethod; //制冷方式
|
||||
float m_LiquidAlarmTemp; //出液报警温度
|
||||
int m_UnitStatus; //机组状态
|
||||
|
||||
float m_LiquidTempProbe; //液温温度探头
|
||||
float m_EffluentTempProbe; //出液温度探头
|
||||
float m_AmbientTempProbe; //环境温度探头
|
||||
float m_CondensationTempProbe; //冷凝温度探头
|
||||
float m_EvaporationInletTempProbe; //蒸发进口温度探头
|
||||
float m_EvaporationOutletTempProbe; //蒸发出口温度探头
|
||||
float m_WorkingFrequency; //运行频率
|
||||
float m_OverHeatingValue; //过热度
|
||||
float m_EEV1;
|
||||
float m_EEV2;
|
||||
float m_CondensingFanRatio; //冷凝风机比例
|
||||
float m_ElectricHeatingRatio; //电加热比例
|
||||
float m_FlowRate; //流量
|
||||
char m_endFlag; //成员变量开始标记
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
class ChillerClient:public TcpClient
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "BaseClient.h"
|
||||
#include "../config/bean/AlarmCfg.h"
|
||||
class IPGLaserState {
|
||||
@ -38,39 +38,40 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
float currentSetpoint; //激光二极管电流设置
|
||||
float laserTemperature; //内部实际温度
|
||||
string outputPower; //输出功率W
|
||||
int moduleErrorCode; //模块错误代码
|
||||
bool isOverheat; //温度过热
|
||||
bool isEmissionOn; //使能
|
||||
bool isHighBackReflectionLevel; //高反报警
|
||||
bool isExtCtrlEnable; //外部控制模式
|
||||
bool isModuleDisconnected; //激光模块失连
|
||||
bool isModuleAlarm; //激光模块故障
|
||||
bool isAimingBeamON; //红光开
|
||||
//bool isPulseTooShort; //脉冲宽度太小
|
||||
//bool isPulseMode; //脉冲模式
|
||||
bool isPowerSupplyOff; //模块主电源关闭
|
||||
bool isModulationEnabled; //调制模式开启
|
||||
bool isEmission; //激光发射
|
||||
// bool isGateModeEnabled; //Gate模式开启
|
||||
// bool isHighPulseEnergy; //脉冲能量太大
|
||||
bool isExtEmissionCtrlEnabled; //外部Emission控制开启
|
||||
bool isPowerSupplyFailure; //模块主电源故障
|
||||
//bool isLockFrontPanel; //前显示面板锁定
|
||||
//bool isKeyswitchInREMPosition; //钥匙开关REM位置
|
||||
//bool isWaveformPulseModeEnabled;//波形脉冲模式开启
|
||||
//bool isHighDutyCycle; //脉冲周期太长
|
||||
bool isLowTemperature; //温度过低
|
||||
bool isPowerSupplyVotageAlarm; //模块主电源电压超范围
|
||||
bool isLeakageCurrentTooHigh; //漏电流过大
|
||||
bool isExtRedLightCtrlEnabled; //外部红光控制开启
|
||||
bool isCritialError; //关键错误
|
||||
bool isOpticalInterlockActive; //光学回路安全互锁开路
|
||||
//bool isAveragePowerTooHigh; //平均功率太高
|
||||
float currentSetpoint; //激光二极管电流设置
|
||||
float laserTemperature; //内部实际温度
|
||||
string outputPower; //输出功率W
|
||||
int moduleErrorCode; //模块错误代码
|
||||
bool isOverheat; //温度过热
|
||||
bool isEmissionOn; //使能
|
||||
bool isHighBackReflectionLevel; //高反报警
|
||||
bool isExtCtrlEnable; //外部控制模式
|
||||
bool isModuleDisconnected; //激光模块失连
|
||||
bool isModuleAlarm; //激光模块故障
|
||||
bool isAimingBeamON; //红光开
|
||||
//bool isPulseTooShort; //脉冲宽度太小
|
||||
//bool isPulseMode; //脉冲模式
|
||||
bool isPowerSupplyOff; //模块主电源关闭
|
||||
bool isModulationEnabled; //调制模式开启
|
||||
bool isEmission; //激光发射
|
||||
// bool isGateModeEnabled; //Gate模式开启
|
||||
// bool isHighPulseEnergy; //脉冲能量太大
|
||||
bool isExtEmissionCtrlEnabled; //外部Emission控制开启
|
||||
bool isPowerSupplyFailure; //模块主电源故障
|
||||
//bool isLockFrontPanel; //前显示面板锁定
|
||||
//bool isKeyswitchInREMPosition; //钥匙开关REM位置
|
||||
//bool isWaveformPulseModeEnabled;//波形脉冲模式开启
|
||||
//bool isHighDutyCycle; //脉冲周期太长
|
||||
bool isLowTemperature; //温度过低
|
||||
bool isPowerSupplyVotageAlarm; //模块主电源电压超范围
|
||||
bool isLeakageCurrentTooHigh; //漏电流过大
|
||||
bool isExtRedLightCtrlEnabled; //外部红光控制开启
|
||||
bool isCritialError; //关键错误
|
||||
bool isOpticalInterlockActive; //光学回路安全互锁开路
|
||||
//bool isAveragePowerTooHigh; //平均功率太高
|
||||
};
|
||||
|
||||
|
||||
class IPGLaserClient:public TcpClient
|
||||
{
|
||||
public:
|
||||
@ -121,29 +122,30 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
float currentSetpoint; //激光二极管电流设置
|
||||
float laserTemperature; //内部实际温度
|
||||
string outputPower; //输出功率W
|
||||
int moduleErrorCode; //模块错误代码
|
||||
bool isCommandBufferOverload; //指令溢出
|
||||
bool isOverheat; //温度过热
|
||||
bool isEmissionOn; //使能
|
||||
bool isHighBackReflectionLevel; //高反报警
|
||||
bool isAnalogPowerControlEnable; //功率外控
|
||||
bool isAimingBeamON; //红光开
|
||||
bool isPowerSupplyOff; //模块主电源关闭
|
||||
bool isModulationEnabled; //调制模式开启
|
||||
bool isEmission; //激光发射
|
||||
bool isGateModeEnable; //门模式开启
|
||||
bool isHardwareEmissionCtrlEnabled; //硬控发射开启
|
||||
bool isPowerSupplyFailure; //模块主电源故障
|
||||
bool isLowTemperature; //温度过低
|
||||
bool isPowerSupplyAlarm; //供电报警
|
||||
bool isHardwareAimingBeanControlEnable; //硬控红光开启
|
||||
bool isCritialError; //关键错误
|
||||
bool isFiberInterlockActive; //光路内部锁定
|
||||
float currentSetpoint; //激光二极管电流设置
|
||||
float laserTemperature; //内部实际温度
|
||||
string outputPower; //输出功率W
|
||||
int moduleErrorCode; //模块错误代码
|
||||
bool isCommandBufferOverload; //指令溢出
|
||||
bool isOverheat; //温度过热
|
||||
bool isEmissionOn; //使能
|
||||
bool isHighBackReflectionLevel; //高反报警
|
||||
bool isAnalogPowerControlEnable; //功率外控
|
||||
bool isAimingBeamON; //红光开
|
||||
bool isPowerSupplyOff; //模块主电源关闭
|
||||
bool isModulationEnabled; //调制模式开启
|
||||
bool isEmission; //激光发射
|
||||
bool isGateModeEnable; //门模式开启
|
||||
bool isHardwareEmissionCtrlEnabled; //硬控发射开启
|
||||
bool isPowerSupplyFailure; //模块主电源故障
|
||||
bool isLowTemperature; //温度过低
|
||||
bool isPowerSupplyAlarm; //供电报警
|
||||
bool isHardwareAimingBeanControlEnable; //硬控红光开启
|
||||
bool isCritialError; //关键错误
|
||||
bool isFiberInterlockActive; //光路内部锁定
|
||||
};
|
||||
|
||||
|
||||
class IPGLaserClientV1 :public TcpClient
|
||||
{
|
||||
public:
|
||||
|
@ -1,12 +1,19 @@
|
||||
#include "TempCtrlClient.h"
|
||||
#include "TempCtrlClient.h"
|
||||
#include "Aibus.h"
|
||||
#include <bitset>
|
||||
#include "../SystemInfo.h"
|
||||
//#include "../config/ConfigManager.h"
|
||||
//#include "../global.h"
|
||||
|
||||
TempCtrlClient::TempCtrlClient(CommunicationCfg* pconfig):TcpClient(pconfig)
|
||||
{
|
||||
size_t ptrSize = sizeof(nullptr); //指针大小
|
||||
|
||||
void* startPtr = &m_Stat.m_startFlag + 1;
|
||||
size_t count = ((size_t)&m_Stat.m_endFlag - (size_t)&startPtr) / ptrSize;
|
||||
InsertMp(startPtr, count);
|
||||
|
||||
startPtr = &m_Stat.alarm.m_startFlag + 1;
|
||||
count = ((size_t)&m_Stat.alarm.m_endFlag - (size_t)&startPtr) / ptrSize;
|
||||
InsertMp(startPtr, count);
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +35,7 @@ void TempCtrlClient::InitCommand()
|
||||
void TempCtrlClient::SetTargeValue(float value)
|
||||
{
|
||||
EnterCriticalSection(&m_RtcCS);
|
||||
float targevalue = value*m_Stat.scale;
|
||||
float targevalue = value*m_Stat.scale->GetValue();
|
||||
Command* pCommand = new Aibus(SET_TARGE_VALUE, 0x1, 0x0, (short)targevalue, false);
|
||||
pCommand->m_Fun = &TempCtrlClient::ProcSetTemp;
|
||||
pCommand->m_Ref = this;
|
||||
@ -49,21 +56,21 @@ void TempCtrlClient::ProcTempInfo(void* pobject, Command* pcommand)
|
||||
scale *= 10;
|
||||
}
|
||||
EnterCriticalSection(&pTc->m_ValueCS);
|
||||
pTc->m_Stat.scale = scale;
|
||||
pTc->m_Stat.measuredValue = (float)((short)(rseq[1] << 8) + rseq[0]) / scale;
|
||||
pTc->m_Stat.settingValue = (float)((short)(rseq[3] << 8) + rseq[2]) / scale;
|
||||
pTc->m_Stat.outputValue = rseq[4];
|
||||
pTc->m_Stat.scale->SetValue( scale);
|
||||
pTc->m_Stat.measuredValue->SetValue((float)((short)(rseq[1] << 8) + rseq[0]) / scale);
|
||||
pTc->m_Stat.settingValue->SetValue((float)((short)(rseq[3] << 8) + rseq[2]) / scale);
|
||||
pTc->m_Stat.outputValue->SetValue(rseq[4]);
|
||||
bitset<8> bitStatus(rseq[5]);
|
||||
pTc->m_Stat.alarm.isOverLimit = bitStatus[0];
|
||||
pTc->m_Stat.alarm.isLowerLimit = bitStatus[1];
|
||||
pTc->m_Stat.alarm.isActiveAlarm = bitStatus[2];
|
||||
pTc->m_Stat.alarm.isInactiveAlarm = bitStatus[3];
|
||||
pTc->m_Stat.alarm.isInputLimit = bitStatus[4];
|
||||
pTc->m_Stat.alarm.al1 = bitStatus[5];
|
||||
pTc->m_Stat.alarm.al2 = bitStatus[6];
|
||||
pTc->m_Stat.alarm.isOverLimit->SetValue(bitStatus[0]);
|
||||
pTc->m_Stat.alarm.isLowerLimit->SetValue(bitStatus[1]);
|
||||
pTc->m_Stat.alarm.isActiveAlarm->SetValue(bitStatus[2]);
|
||||
pTc->m_Stat.alarm.isInactiveAlarm->SetValue(bitStatus[3]);
|
||||
pTc->m_Stat.alarm.isInputLimit->SetValue(bitStatus[4]);
|
||||
pTc->m_Stat.alarm.al1->SetValue(bitStatus[5]);
|
||||
pTc->m_Stat.alarm.al2->SetValue(bitStatus[6]);
|
||||
EnterCriticalSection(&g_SystemInfo->m_InfoCs);
|
||||
g_SystemInfo->m_PlatformTemp = pTc->m_Stat.measuredValue;
|
||||
g_SystemInfo->m_PlatformTempSettingValue = pTc->m_Stat.settingValue;
|
||||
g_SystemInfo->m_PlatformTemp = pTc->m_Stat.measuredValue->GetValue();
|
||||
g_SystemInfo->m_PlatformTempSettingValue = pTc->m_Stat.settingValue->GetValue();
|
||||
LeaveCriticalSection(&g_SystemInfo->m_InfoCs);
|
||||
LeaveCriticalSection(&pTc->m_ValueCS);
|
||||
|
||||
@ -77,32 +84,32 @@ void TempCtrlClient::ProcSetTemp(void* pobject, Command* pcommand)
|
||||
unsigned char* rseq = pcommand->m_RespSeq;
|
||||
float fvalue = 0;
|
||||
EnterCriticalSection(&pTc->m_ValueCS);
|
||||
int scale = (pTc->m_Stat.scale == 0 ? 1 : pTc->m_Stat.scale);
|
||||
int scale = (pTc->m_Stat.scale->GetValue() == 0 ? 1 : pTc->m_Stat.scale->GetValue());
|
||||
fvalue = (float)((short)(rseq[7] << 8) + rseq[6]) / scale;
|
||||
|
||||
pTc->m_Stat.measuredValue = (float)((short)(rseq[1] << 8) + rseq[0]) / scale;
|
||||
pTc->m_Stat.settingValue = (float)((short)(rseq[3] << 8) + rseq[2]) / scale;
|
||||
pTc->m_Stat.outputValue = rseq[4];
|
||||
pTc->m_Stat.measuredValue->SetValue((float)((short)(rseq[1] << 8) + rseq[0]) / scale);
|
||||
pTc->m_Stat.settingValue->SetValue((float)((short)(rseq[3] << 8) + rseq[2]) / scale);
|
||||
pTc->m_Stat.outputValue->SetValue(rseq[4]);
|
||||
bitset<8> bitStatus(rseq[5]);
|
||||
pTc->m_Stat.alarm.isOverLimit = bitStatus[0];
|
||||
pTc->m_Stat.alarm.isLowerLimit = bitStatus[1];
|
||||
pTc->m_Stat.alarm.isActiveAlarm = bitStatus[2];
|
||||
pTc->m_Stat.alarm.isInactiveAlarm = bitStatus[3];
|
||||
pTc->m_Stat.alarm.isInputLimit = bitStatus[4];
|
||||
pTc->m_Stat.alarm.al1 = bitStatus[5];
|
||||
pTc->m_Stat.alarm.al2 = bitStatus[6];
|
||||
pTc->m_Stat.alarm.isOverLimit->SetValue(bitStatus[0]);
|
||||
pTc->m_Stat.alarm.isLowerLimit->SetValue(bitStatus[1]);
|
||||
pTc->m_Stat.alarm.isActiveAlarm->SetValue(bitStatus[2]);
|
||||
pTc->m_Stat.alarm.isInactiveAlarm->SetValue(bitStatus[3]);
|
||||
pTc->m_Stat.alarm.isInputLimit->SetValue(bitStatus[4]);
|
||||
pTc->m_Stat.alarm.al1->SetValue(bitStatus[5]);
|
||||
pTc->m_Stat.alarm.al2->SetValue(bitStatus[6]);
|
||||
|
||||
LeaveCriticalSection(&pTc->m_ValueCS);
|
||||
}
|
||||
|
||||
void TempCtrlClient::GetStat(TempStat& stat)
|
||||
{
|
||||
EnterCriticalSection(&m_ValueCS);
|
||||
memcpy_s(&stat.alarm, sizeof(TempAlarm), &m_Stat.alarm, sizeof(TempAlarm));
|
||||
stat.baseStat = m_BaseStat;
|
||||
stat.measuredValue = m_Stat.measuredValue;
|
||||
stat.outputValue = m_Stat.outputValue;
|
||||
stat.scale = m_Stat.scale;
|
||||
stat.settingValue = m_Stat.settingValue;
|
||||
LeaveCriticalSection(&m_ValueCS);
|
||||
}
|
||||
//void TempCtrlClient::GetStat(TempStat& stat)
|
||||
//{
|
||||
// EnterCriticalSection(&m_ValueCS);
|
||||
// memcpy_s(&stat.alarm, sizeof(TempAlarm), &m_Stat.alarm, sizeof(TempAlarm));
|
||||
// stat.baseStat = m_BaseStat;
|
||||
// stat.measuredValue = m_Stat.measuredValue;
|
||||
// stat.outputValue = m_Stat.outputValue;
|
||||
// stat.scale = m_Stat.scale;
|
||||
// stat.settingValue = m_Stat.settingValue;
|
||||
// LeaveCriticalSection(&m_ValueCS);
|
||||
//}
|
||||
|
@ -1,45 +1,65 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "BaseClient.h"
|
||||
|
||||
#pragma pack(1)
|
||||
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;
|
||||
char m_startFlag; //开始标记
|
||||
BoolData* isOverLimit; //上限报警
|
||||
BoolData* isLowerLimit; //下限报警
|
||||
BoolData* isActiveAlarm; //正偏差报警
|
||||
BoolData* isInactiveAlarm; //负偏差报警
|
||||
BoolData* isInputLimit; //超量程报警
|
||||
BoolData* al1; //AL1状态,0为动作
|
||||
BoolData* al2; //AL2状态,0为动作
|
||||
|
||||
char m_endFlag; //结束标记
|
||||
TempAlarm()
|
||||
: isOverLimit(new BoolData("isOverLimit", u8"上限报警"))
|
||||
, isLowerLimit(new BoolData("isLowerLimit", u8"下限报警"))
|
||||
, isActiveAlarm(new BoolData("isActiveAlarm", u8"正偏差报警"))
|
||||
, isInactiveAlarm(new BoolData("isInactiveAlarm", u8"负偏差报警"))
|
||||
, isInputLimit(new BoolData("isInputLimit", u8"超量程报警"))
|
||||
, al1(new BoolData("al1", u8"AL1状态,0为动作"))
|
||||
, al2(new BoolData("al2", u8"AL2状态,0为动作")){
|
||||
//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()
|
||||
: measuredValue(new FloatData("measuredValue", u8"测量值"))
|
||||
, settingValue(new FloatData("settingValue", u8"给定值"))
|
||||
, outputValue(new UcharData("outputValue", u8"输出值MV"))
|
||||
, scale(new IntData("scale", u8"数值放大倍数")){
|
||||
//measuredValue = 0;
|
||||
//settingValue = 0;
|
||||
//outputValue = 0;
|
||||
//scale = 0;
|
||||
}
|
||||
~TempStat(){}
|
||||
public:
|
||||
BaseStat baseStat;
|
||||
float measuredValue; //测量值
|
||||
float settingValue; //给定值
|
||||
unsigned char outputValue; //输出值MV
|
||||
TempAlarm alarm; //报警信息
|
||||
int scale; //数值放大倍数
|
||||
};
|
||||
|
||||
char m_startFlag; //开始标记
|
||||
FloatData* measuredValue; //测量值
|
||||
FloatData* settingValue; //给定值
|
||||
UcharData* outputValue; //输出值MV
|
||||
IntData* scale; //数值放大倍数
|
||||
char m_endFlag; //开始标记
|
||||
|
||||
TempAlarm alarm; //报警信息
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
class TempCtrlClient :public TcpClient
|
||||
{
|
||||
@ -48,7 +68,7 @@ public:
|
||||
~TempCtrlClient();
|
||||
|
||||
void SetTargeValue(float value);
|
||||
void GetStat(TempStat& stat);
|
||||
//void GetStat(TempStat& stat);
|
||||
|
||||
private:
|
||||
void InitCommand();
|
||||
|
@ -1,10 +1,16 @@
|
||||
#include "UPSClient.h"
|
||||
#include "UPSClient.h"
|
||||
#include "../utils/StringHelper.h"
|
||||
#include "UpsComand.h"
|
||||
|
||||
UPSClient::UPSClient(CommunicationCfg* pconfig) :TcpClient(pconfig)
|
||||
{
|
||||
m_Freq = 500;
|
||||
|
||||
size_t ptrSize = sizeof(nullptr); //指针大小
|
||||
void* startPtr = &m_Stat.m_startFlag + 1;
|
||||
size_t count = ((size_t)&m_Stat.m_endFlag - (size_t)&startPtr) / ptrSize;
|
||||
InsertMp(startPtr, count);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +55,7 @@ void UPSClient::ProcInfo(void* pobject, Command* pcommand)
|
||||
UPSClient* pUw = (UPSClient*)pobject;
|
||||
unsigned char* rseq = pcommand->m_RespSeq;
|
||||
unsigned int dlength = pcommand->m_RespLen;
|
||||
|
||||
|
||||
float inputVol = (float)((rseq[1] - '0') * 1000 + (rseq[2] - '0') * 100 + (rseq[3] - '0') * 10 + (rseq[5] - '0')) / 10.0f;
|
||||
float lastVol = (float)((rseq[7] - '0') * 1000 + (rseq[8] - '0') * 100 + (rseq[9] - '0') * 10 + (rseq[11] - '0')) / 10.0f;
|
||||
float outputVol = (float)((rseq[13] - '0') * 1000 + (rseq[14] - '0') * 100 + (rseq[15] - '0') * 10 + (rseq[17] - '0')) / 10.0f;
|
||||
@ -57,23 +63,23 @@ void UPSClient::ProcInfo(void* pobject, Command* pcommand)
|
||||
float outputF = (float)((rseq[23] - '0') * 100 + (rseq[24] - '0') * 10 + (rseq[26] - '0')) / 10.0f;
|
||||
float unitVol = (float)((rseq[28] - '0') * 100 + (rseq[30] - '0') * 10 + (rseq[31] - '0')) / 100.0f;
|
||||
float tempValue = (float)((rseq[33] - '0') * 100 + (rseq[34] - '0') * 10 + (rseq[36] - '0')) / 10.0f;
|
||||
|
||||
EnterCriticalSection(&pUw->m_ValueCS);
|
||||
pUw->m_Stat.inputVol = inputVol;
|
||||
pUw->m_Stat.lastVol = lastVol;
|
||||
pUw->m_Stat.outputVol = outputVol;
|
||||
pUw->m_Stat.outputLoad = outputLoad;
|
||||
pUw->m_Stat.outputF = outputF;
|
||||
pUw->m_Stat.unitVol = unitVol;
|
||||
pUw->m_Stat.tempValue = tempValue;
|
||||
|
||||
pUw->m_Stat.isVolError = (rseq[38] == '1' ? true : false);
|
||||
pUw->m_Stat.isBatteryVolLow = (rseq[39] == '1' ? true : false);
|
||||
pUw->m_Stat.isBypassMode = (rseq[40] == '1' ? true : false);
|
||||
pUw->m_Stat.isUpsError = (rseq[41] == '1' ? true : false);
|
||||
pUw->m_Stat.upsType = (rseq[42] == '1' ? true : false);
|
||||
pUw->m_Stat.isTesting = (rseq[43] == '1' ? true : false);
|
||||
pUw->m_Stat.isShutdown = (rseq[44] == '1' ? true : false);
|
||||
EnterCriticalSection(&pUw->m_ValueCS);
|
||||
pUw->m_Stat.inputVol->SetValue(inputVol);
|
||||
pUw->m_Stat.lastVol->SetValue(lastVol);
|
||||
pUw->m_Stat.outputVol->SetValue(outputVol);
|
||||
pUw->m_Stat.outputLoad->SetValue(outputLoad);
|
||||
pUw->m_Stat.outputF->SetValue(outputF);
|
||||
pUw->m_Stat.unitVol->SetValue(unitVol);
|
||||
pUw->m_Stat.tempValue->SetValue(tempValue);
|
||||
|
||||
pUw->m_Stat.isVolError->SetValue((rseq[38] == '1' ? true : false));
|
||||
pUw->m_Stat.isBatteryVolLow->SetValue((rseq[39] == '1' ? true : false));
|
||||
pUw->m_Stat.isBypassMode->SetValue((rseq[40] == '1' ? true : false));
|
||||
pUw->m_Stat.isUpsError->SetValue((rseq[41] == '1' ? true : false));
|
||||
pUw->m_Stat.upsType->SetValue((rseq[42] == '1' ? true : false));
|
||||
pUw->m_Stat.isTesting->SetValue((rseq[43] == '1' ? true : false));
|
||||
pUw->m_Stat.isShutdown->SetValue((rseq[44] == '1' ? true : false));
|
||||
|
||||
LeaveCriticalSection(&pUw->m_ValueCS);
|
||||
}
|
||||
@ -83,23 +89,24 @@ void UPSClient::ProcShutDown(void* pobject, Command* pcommand)
|
||||
|
||||
}
|
||||
|
||||
void UPSClient::GetStat(Upsstat& stat)
|
||||
{
|
||||
EnterCriticalSection(&m_ValueCS);
|
||||
stat.baseStat = m_BaseStat;
|
||||
stat.inputVol = m_Stat.inputVol;
|
||||
stat.isBatteryVolLow = m_Stat.isBatteryVolLow;
|
||||
stat.isBypassMode = m_Stat.isBypassMode;
|
||||
stat.isShutdown = m_Stat.isShutdown;
|
||||
stat.isTesting = m_Stat.isTesting;
|
||||
stat.isUpsError = m_Stat.isUpsError;
|
||||
stat.isVolError = m_Stat.isVolError;
|
||||
stat.lastVol = m_Stat.lastVol;
|
||||
stat.outputF = m_Stat.outputF;
|
||||
stat.outputLoad = m_Stat.outputLoad;
|
||||
stat.outputVol = m_Stat.outputVol;
|
||||
stat.tempValue = m_Stat.tempValue;
|
||||
stat.unitVol = m_Stat.unitVol;
|
||||
stat.upsType = m_Stat.upsType;
|
||||
LeaveCriticalSection(&m_ValueCS);
|
||||
}
|
||||
//void UPSClient::GetStat(Upsstat& stat)
|
||||
//{
|
||||
// EnterCriticalSection(&m_ValueCS);
|
||||
// stat.baseStat = m_BaseStat;
|
||||
// stat.inputVol = m_Stat.inputVol;
|
||||
// stat.isBatteryVolLow = m_Stat.isBatteryVolLow;
|
||||
// stat.isBypassMode = m_Stat.isBypassMode;
|
||||
// stat.isShutdown = m_Stat.isShutdown;
|
||||
// stat.isTesting = m_Stat.isTesting;
|
||||
// stat.isUpsError = m_Stat.isUpsError;
|
||||
// stat.isVolError = m_Stat.isVolError;
|
||||
// stat.lastVol = m_Stat.lastVol;
|
||||
// stat.outputF = m_Stat.outputF;
|
||||
// stat.outputLoad = m_Stat.outputLoad;
|
||||
// stat.outputVol = m_Stat.outputVol;
|
||||
// stat.tempValue = m_Stat.tempValue;
|
||||
// stat.unitVol = m_Stat.unitVol;
|
||||
// stat.upsType = m_Stat.upsType;
|
||||
// LeaveCriticalSection(&m_ValueCS);
|
||||
//}
|
||||
|
||||
|
@ -1,44 +1,67 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "BaseClient.h"
|
||||
|
||||
#pragma pack(1)
|
||||
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()
|
||||
: inputVol(new FloatData("inputVol", u8"输入电压: MMM.M"))
|
||||
, lastVol(new FloatData("lastVol", u8"上一次转电池放电时电压: NNN.N"))
|
||||
, outputVol(new FloatData("outputVol", u8"输出电压: PPP.P"))
|
||||
, outputLoad(new IntData("outputLoad", u8"输出负载百分比: QQQ"))
|
||||
, outputF(new FloatData("outputF", u8"输入频率: RR.R"))
|
||||
, unitVol(new FloatData("unitVol", u8"电池单元电压: S.SS"))
|
||||
, tempValue(new FloatData("tempValue", u8"温度: TT.T"))
|
||||
, isVolError(new BoolData("isVolError", u8"市电异常"))
|
||||
, isBatteryVolLow(new BoolData("isBatteryVolLow", u8"电池电压低"))
|
||||
, isBypassMode(new BoolData("isBypassMode", u8"旁路模式"))
|
||||
, isUpsError(new BoolData("isUpsError", u8"UPS 故障"))
|
||||
, upsType(new BoolData("upsType", u8"UPS 后备式 (0 :在线式)"))
|
||||
, isTesting(new BoolData("isTesting", u8"测试进行中"))
|
||||
, isShutdown(new BoolData("isShutdown", u8"关机"))
|
||||
{
|
||||
//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; //关机
|
||||
char m_startFlag; //开始标记
|
||||
FloatData* inputVol; //输入电压: MMM.M
|
||||
FloatData* lastVol; //上一次转电池放电时电压: NNN.N
|
||||
FloatData* outputVol; //输出电压: PPP.P
|
||||
IntData* outputLoad; //输出负载百分比: QQQ
|
||||
FloatData* outputF; //输入频率: RR.R
|
||||
|
||||
|
||||
FloatData* unitVol; //电池单元电压: S.SS
|
||||
FloatData* tempValue; //温度: TT.T
|
||||
BoolData* isVolError; //市电异常
|
||||
BoolData* isBatteryVolLow; //电池电压低
|
||||
BoolData* isBypassMode; //旁路模式
|
||||
BoolData* isUpsError; //UPS 故障
|
||||
BoolData* upsType; //UPS 后备式 (0 :在线式)
|
||||
BoolData* isTesting; //测试进行中
|
||||
BoolData* isShutdown; //关机
|
||||
|
||||
|
||||
char m_endFlag; //结束标记
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
class UPSClient :public TcpClient
|
||||
{
|
||||
@ -47,7 +70,9 @@ public:
|
||||
~UPSClient();
|
||||
void InitCommand();
|
||||
void ShutDownUps(float minute);
|
||||
void GetStat(Upsstat& stat);
|
||||
//void GetStat(Upsstat& stat);
|
||||
|
||||
//void SendToClients();
|
||||
private:
|
||||
void static ProcInfo(void* pobject, Command* pcommand);
|
||||
void static ProcShutDown(void* pobject, Command* pcommand);
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
bool m_IsActive;
|
||||
|
||||
int m_AuthLess; //用户等级
|
||||
string m_ShowContent;
|
||||
string m_ShowContent; //无用
|
||||
private:
|
||||
PLCReveiver* m_cc;
|
||||
S7Command* m_CtrlCommand;
|
||||
@ -1726,6 +1726,7 @@ public:
|
||||
IOCfg* m_CylinderHandDoorClose; //缸体吊装门关位
|
||||
};
|
||||
|
||||
class TempCtrlClient;
|
||||
class IOCfgWrapper {
|
||||
public:
|
||||
enum SafeDoorState
|
||||
|
@ -47,4 +47,17 @@ void ClientWrapper::PushAllClient(WriteData* wd) {
|
||||
(*client)->PushMsg(wd);
|
||||
++client;
|
||||
}
|
||||
}
|
||||
|
||||
bool ClientWrapper::IsExist(ClientInfo* ci) {
|
||||
std::lock_guard<std::mutex> lck(m_mux);
|
||||
bool flag = false;
|
||||
auto client = m_clientList.begin();
|
||||
while (client != m_clientList.end()) {
|
||||
if (*client == ci){
|
||||
flag = true; break;
|
||||
}
|
||||
++client;
|
||||
}
|
||||
return flag;
|
||||
}
|
@ -75,6 +75,8 @@ public:
|
||||
|
||||
void PushAllClient(WriteData* wd);
|
||||
|
||||
bool IsExist(ClientInfo* ci);
|
||||
|
||||
private:
|
||||
ClientWrapper() {}
|
||||
~ClientWrapper() {}
|
||||
|
@ -50,8 +50,11 @@ enum DATATYPE {
|
||||
iUINT,
|
||||
iFLOAT,
|
||||
iSTRING,
|
||||
|
||||
iCHAR,
|
||||
iUCHAR,
|
||||
iWORD,
|
||||
|
||||
UNKNOW,
|
||||
};
|
||||
|
||||
class ClientInfo;
|
||||
|
@ -409,24 +409,30 @@ void CoreCommunication::GetEnvState(EnvState& envState)
|
||||
|
||||
|
||||
void CoreCommunication::SendProc() {
|
||||
string keyStr, valStr;
|
||||
string valStr;
|
||||
DATATYPE dataType;
|
||||
list<Item> its;
|
||||
while (!m_sendTdExitFlag) {
|
||||
std::unique_lock<std::shared_mutex> lock(m_ValueMtx);
|
||||
keyStr = valStr = "";
|
||||
valStr = "";
|
||||
its.clear();
|
||||
auto param = SysParam::m_sysParamMp.begin();
|
||||
while (param != SysParam::m_sysParamMp.end()) {
|
||||
keyStr = param->first;
|
||||
valStr = param->second.GetValue(dataType);
|
||||
its.emplace_back(Item{keyStr,valStr,dataType});
|
||||
its.emplace_back(Item{ param->first,valStr,dataType});
|
||||
++param;
|
||||
}
|
||||
ClientWrapper::Instance()->PushAllClient(new WriteData(SYSPARAMDATA, its));
|
||||
|
||||
keyStr = valStr = "";
|
||||
|
||||
valStr = "";
|
||||
its.clear();
|
||||
auto ioItem = m_IOCfgWrapper->m_IOCfgMap.begin();
|
||||
while (ioItem != m_IOCfgWrapper->m_IOCfgMap.end()) {
|
||||
valStr = to_string(ioItem->second->IsActive());
|
||||
its.emplace_back(Item{ ioItem->first,valStr,iBOOL });
|
||||
++param;
|
||||
}
|
||||
ClientWrapper::Instance()->PushAllClient(new WriteData(SYSPARAMDATA, its));
|
||||
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
|
@ -53,7 +53,12 @@ SysParamFloat::SysParamFloat(int addr, int num, PLCReveiver* cc, const string& c
|
||||
m_CtrlCommand->m_Ref = this;
|
||||
m_CtrlCommand->isNeedDel = false;
|
||||
|
||||
m_sysParamMp.insert(make_pair(code,DValue(this)));
|
||||
if (m_sysParamMp.find(code) != m_sysParamMp.end()) {
|
||||
printf("%s is repeated...", code.c_str());
|
||||
}
|
||||
else {
|
||||
m_sysParamMp.insert(make_pair(code, DValue(this)));
|
||||
}
|
||||
}
|
||||
|
||||
void SysParamFloat::SetValue(float value)
|
||||
@ -79,11 +84,22 @@ SysParamFloat::~SysParamFloat()
|
||||
|
||||
|
||||
SysParamFloatUI::SysParamFloatUI(SysParamFloat* sp) :SysParamFloat(sp) {
|
||||
m_sysParamMp.insert(make_pair("UI"+sp->GetCode(), DValue(this)));
|
||||
|
||||
if (m_sysParamMp.find("UI" + sp->GetCode()) != m_sysParamMp.end()) {
|
||||
printf("%s is repeated...", ("UI" + sp->GetCode()).c_str());
|
||||
}
|
||||
else {
|
||||
m_sysParamMp.insert(make_pair("UI" + sp->GetCode(), DValue(this)));
|
||||
}
|
||||
}
|
||||
|
||||
SysParamWordUI::SysParamWordUI(SysParamWord* sp) :SysParamWord(sp) {
|
||||
m_sysParamMp.insert(make_pair("UI" + sp->GetCode(), DValue(this)));
|
||||
if (m_sysParamMp.find("UI" + sp->GetCode()) != m_sysParamMp.end()) {
|
||||
printf("%s is repeated...", ("UI" + sp->GetCode()).c_str());
|
||||
}
|
||||
else {
|
||||
m_sysParamMp.insert(make_pair("UI" + sp->GetCode(), DValue(this)));
|
||||
}
|
||||
}
|
||||
|
||||
SysParamWord::SysParamWord(int addr, int num, PLCReveiver* cc, const string& context, const string& code )
|
||||
@ -101,7 +117,12 @@ SysParamWord::SysParamWord(int addr, int num, PLCReveiver* cc, const string& con
|
||||
m_CtrlCommand->m_Ref = this;
|
||||
m_CtrlCommand->isNeedDel = false;
|
||||
|
||||
m_sysParamMp.insert(make_pair(code, DValue(this)));
|
||||
if (m_sysParamMp.find(code) != m_sysParamMp.end()) {
|
||||
printf("%s is repeated...", code.c_str());
|
||||
}
|
||||
else {
|
||||
m_sysParamMp.insert(make_pair(code, DValue(this)));
|
||||
}
|
||||
}
|
||||
|
||||
void SysParamWord::SetValue(short value)
|
||||
@ -138,7 +159,12 @@ SysParamBool::SysParamBool(int addr, int num, PLCReveiver* cc,const string& cont
|
||||
m_CtrlCommand->m_Ref = this;
|
||||
m_CtrlCommand->isNeedDel = false;
|
||||
|
||||
m_sysParamMp.insert(make_pair(code, DValue(this)));
|
||||
if (m_sysParamMp.find(code) != m_sysParamMp.end()) {
|
||||
printf("%s is repeated...", code.c_str());
|
||||
}
|
||||
else {
|
||||
m_sysParamMp.insert(make_pair(code, DValue(this)));
|
||||
}
|
||||
}
|
||||
|
||||
SysParamBool:: ~SysParamBool()
|
||||
@ -170,7 +196,12 @@ SysParamInt::SysParamInt(int addr, int num, PLCReveiver* cc, const string& conte
|
||||
m_CtrlCommand->m_Ref = this;
|
||||
m_CtrlCommand->isNeedDel = false;
|
||||
|
||||
m_sysParamMp.insert(make_pair(code, DValue(this)));
|
||||
if (m_sysParamMp.find(code) != m_sysParamMp.end()) {
|
||||
printf("%s is repeated...", code.c_str());
|
||||
}
|
||||
else {
|
||||
m_sysParamMp.insert(make_pair(code, DValue(this)));
|
||||
}
|
||||
}
|
||||
|
||||
SysParamInt:: ~SysParamInt()
|
||||
|
@ -347,6 +347,7 @@
|
||||
<ClInclude Include="ChartletManager.h" />
|
||||
<ClInclude Include="Communication\Aibus.h" />
|
||||
<ClInclude Include="Communication\BaseClient.h" />
|
||||
<ClInclude Include="Communication\BaseData.h" />
|
||||
<ClInclude Include="Communication\BaseServoClient.h" />
|
||||
<ClInclude Include="Communication\ChillerClient.h" />
|
||||
<ClInclude Include="Communication\Command.h" />
|
||||
|
@ -1744,6 +1744,9 @@
|
||||
<ClInclude Include="DataManage\ClientInfo.h">
|
||||
<Filter>DataManage</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Communication\BaseData.h">
|
||||
<Filter>Communication</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="说明.txt" />
|
||||
|
@ -467,15 +467,15 @@ public:
|
||||
void UnLockPart() { LeaveCriticalSection(&partCs); }
|
||||
|
||||
string GetJobTitle(void) { return general_info->job_name; }
|
||||
unsigned int GetLayerCount(void) { return layers->vector_layers.size(); }
|
||||
unsigned int GetComponentCount(void) { return partsMap.size(); }
|
||||
unsigned int GetLayerCount(void) { return (UINT)layers->vector_layers.size(); }
|
||||
unsigned int GetComponentCount(void) { return (UINT)partsMap.size(); }
|
||||
Layer* GetLayer(unsigned int id);
|
||||
string GetJobUid(void) { return job_id; }
|
||||
void GetPartId(int layerIndex, set<int>& partIds);
|
||||
// float GetProgress(void) { return m_ProgressValue; }
|
||||
//string GetProgressInfo();
|
||||
float PowderRequiretment(void);
|
||||
unsigned int GetNumOfScanField() { return machine_type->scanFields.size(); }
|
||||
unsigned int GetNumOfScanField() { return (UINT)machine_type->scanFields.size(); }
|
||||
vector<ScanField*>* GetScanFields() {
|
||||
return &machine_type->scanFields;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#define NOMINMAX
|
||||
#define NOMINMAX
|
||||
#include "VolumeCalc.h"
|
||||
|
||||
#define CLIPPER_SCALE 1.0e9
|
||||
@ -157,7 +157,7 @@ void VolumeCalc::GetLayerBorders(MetaData* metadata, unsigned int layer, PolyTre
|
||||
}
|
||||
if (poly_found)
|
||||
break;
|
||||
int end_idx = contour.size() - 1;
|
||||
size_t end_idx = contour.size() - 1;
|
||||
for (size_t j = 0; j < 10 && j < contour.size() - 1; j++) {
|
||||
if (isBetween(contour[end_idx - j], contour[end_idx - j - 1], closed->Contour.back())) {
|
||||
if (!isBetween(closed->Contour.back(), closed->Contour[closed->Contour.size() - 2], contour[end_idx - j - 1]) ||
|
||||
|
@ -22,6 +22,7 @@ enum TYPE{
|
||||
message ParamInfo{
|
||||
bytes nameKey = 1; //参数key
|
||||
bytes strValue = 2; //value
|
||||
//bool isOutput = 2; //是否只读
|
||||
TYPE valueType = 3; //数据类型
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user