eis/eqpalg/utility/update_data.cc
Huamonarch 224c2c45c4 Remove irrelevant comments from eqpalg source files
Cleaned 66 files across all eqpalg subdirectories:
- Removed commented-out dead code
- Removed redundant Chinese inline comments that restate variable/function names
- Removed trailing ///< annotations on self-explanatory fields
- Removed namespace closing comments
- Preserved all file headers, Doxygen documentation, and logic explanations
- No code changes — only comment removal
2026-05-09 13:30:09 +08:00

66 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.

#include <eqpalg/utility/update_data.h>
UpDateData::UpDateData(string Jkey_data, string Jkey_rule_stat) {
this->Jkey_data_ = unitNo_ + "_" + Jkey_data;
this->Jkey_rule_stat_ = "EIS_Rule_stat";
if (logger_ == nullptr) {
logger_ = std::make_unique<LOG>("UpDateData");
}
if (eqp_status_ptr_ == nullptr) {
eqp_status_ptr_ = std::make_unique<EqpStatus>();
}
logger_->Debug() << "UpDateData::UpDateData(string Jkey_data, string "
"Jkey_rule_stat)"
<< endl;
}
UpDateData::UpDateData() {
this->Jkey_data_ = unitNo_ + "_" + "EIS_itemtag";
this->Jkey_rule_stat_ = unitNo_ + "_" + "Rule_stat";
this->Jkey_eqp_state_ = unitNo_ + "_" + "Eqp_status";
if (logger_ == nullptr) {
logger_ = std::make_unique<LOG>("UpDateData");
}
if (eqp_status_ptr_ == nullptr) {
eqp_status_ptr_ = std::make_unique<EqpStatus>();
}
logger_->Debug() << "UpDateData::UpDateData()" << endl;
}
UpDateData::~UpDateData() {
logger_->Debug() << "UpDateData::~UpDateData() " << endl;
}
void UpDateData::update_item_data() {
string Jvalue =
SingletonTemplate<GlobaltemSharedMemory>::GetInstance().get_data_json();
auto reSult = m_memclient.Insert(Jkey_data_.c_str(), Jvalue.c_str());
if (1 != reSult) {
this->logger_->Debug()
<< "update_item_data()"
<< "m_memclient.Insert异常[0,set data fail;-1,key=null or value=null]"
<< reSult << std::endl;
}
}
void UpDateData::update_rule_stat_data() {
SingletonTemp<EqpStat>::GetInstance().init();
string Jvalue = SingletonTemp<EqpStat>::GetInstance().get_stat_json();
auto reSult = m_memclient.Insert(Jkey_rule_stat_.c_str(), Jvalue.c_str());
if (1 != reSult) {
this->logger_->Debug()
<< "update_rule_stat_data()"
<< "m_memclient.Insert异常[0,set data fail;-1,key=null or value=null]"
<< reSult << std::endl;
}
}
void UpDateData::update_eqp_status() {
string Jvalue = eqp_status_ptr_->get_data_json();
auto reSult = m_memclient.Insert(Jkey_eqp_state_.c_str(), Jvalue.c_str());
if (1 != reSult) {
this->logger_->Debug()
<< "update_eqp_status()"
<< "m_memclient.Insert异常[0,set data fail;-1,key=null or value=null]"
<< reSult << std::endl;
}
}