fix: roller3.cpp 中 DetectMode enum class 的 LOG 输出和 stoi 赋值 cast 修复

This commit is contained in:
Huamonarch 2026-05-15 16:13:32 +08:00
parent ba0bf8ce21
commit 367802fc71

View File

@ -217,7 +217,7 @@ void Roller3::print_load_content() {
<< std::endl;
logger_->Debug() << "limit_error_:" << limit_error_
<< ",limit_warn_:" << limit_warn_ << ",单位unit_" << unit_
<< ",detect_mode_:" << detect_mode_
<< ",detect_mode_:" << static_cast<int>(detect_mode_)
<< ",hold_time:" << hold_time_.count() << "ms" << std::endl;
}
@ -286,12 +286,12 @@ int Roller3::init_X_exp() {
.at("input")
.at("param")
.contains("detect_mode")) {
detect_mode_ = std::stoi(rule_json_.at("function")
detect_mode_ = static_cast<DetectMode>(std::stoi(rule_json_.at("function")
.at("input")
.at("param")
.at("detect_mode")
.at("value")
.get<std::string>());
.get<std::string>()));
}
if (rule_json_.at("function")
.at("input")