eis/eqpm/eqp_status.h

73 lines
2.2 KiB
C++
Raw Permalink 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
/**
* @file eqp_status.h
* @brief
* @author your name (you@domain.com)
* @version 0.1
* @date 2025-09-09
*
* Copyright: Baosight Co. Ltd.
* DO NOT COPY/USE WITHOUT PERMISSION
*
*/
#include <Ice/BuiltinSequences.h>
#include <chrono>
#include <eqpm/table_struct/t_eqp_data.h>
#include <glob/BinaryTele.h>
#include <log4cplus/LOG.h>
#include <map>
#include <memory>
#include <mix_cc/json.h>
using namespace baosight;
class EqpStatus {
public:
EqpStatus();
~EqpStatus();
string get_eqp_status();
/**
* @brief 处理ice消息
* @param event_no My Param doc
* @param seq My Param doc
* @param length My Param doc
*/
void dispose(int event_no, const ::Ice::ByteSeq &seq, ::Ice::Int length);
/**
* @brief 更新报警信息 遍历设备码
*/
void update_alarm_info();
/**
* @brief 更新钢卷信息表
*/
void update_coil_info();
private:
std::map<std::string, double> status_data_; ///<首页 数据项-数据值
std::map<std::string, int>
eqp_status_; ///<首页 设备状态 六位码-状态[0-正常;1-报警]
std::unique_ptr<LOG> logger_;
mix_cc::json eqp_status_json_; ///<给画面的数据
mix_cc::json eqp_status_config_json_; ///<数据项配置
void init();
bool is_init_ = false;
BinaryTele *p_btel;
private:
/**
* @brief 差报警次数
* @param eqpid 设备id
* @param dealresult 是否已处理:0-未处理1-已处理;-1 误报警
* @return int
*/
int select_alarm_count(string eqpid, int dealresult);
/**
* @brief 查报警次数
* @param eqpid 设备id
* @param statuscode 报警状态码abc,其中a:1-表示不跟踪2-跟踪;
* b:0-未处理1-误报警2-报警复位3-设备恢复;
* c:0-无状态1-跟踪开始2-跟踪结束3-跟踪中,区别跟踪开始与结束,且为已处理状态
* 这里主要查询待处理的报警100新报警/200跟踪待处理的报警
* @return int
*/
int select_alarm_count(string eqpid, short statuscode = 100);
};