2026-05-09 11:23:45 +08:00
|
|
|
#pragma once
|
|
|
|
|
/**
|
|
|
|
|
* @file roller2.h
|
|
|
|
|
* @brief 同组离群监测
|
|
|
|
|
* @author your name (you@domain.com)
|
|
|
|
|
* @version 0.1
|
|
|
|
|
* @date 2025-01-20
|
|
|
|
|
*
|
|
|
|
|
* Copyright: Baosight Co. Ltd.
|
|
|
|
|
* DO NOT COPY/USE WITHOUT PERMISSION
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
#include <eqpalg/algs/exp_base.h>
|
|
|
|
|
#include <eqpalg/define/public.h>
|
|
|
|
|
#include <array>
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
|
|
using std::string;
|
|
|
|
|
class Roller2 : public ExpBase {
|
|
|
|
|
public:
|
|
|
|
|
Roller2(const string& name, const mix_cc::json& rule_json,
|
|
|
|
|
const string& ruleId, size_t exp_type);
|
|
|
|
|
|
|
|
|
|
virtual ~Roller2();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
const vector<string> ExpStr = {"pre_exp", "X1", "X2", "X3", "X4",
|
|
|
|
|
"X5", "X6", "X7", "X8", "X9"};
|
|
|
|
|
int init() override;
|
|
|
|
|
virtual AlarmInfo mon_proc() override;
|
|
|
|
|
std::vector<AlarmInfo> exec_task(mix_cc::time_range_t time_range) override;
|
2026-05-09 13:30:09 +08:00
|
|
|
const array<string, 2> BIG_SMALL = {"过大", "过小"};
|
|
|
|
|
double limit_over_;
|
2026-05-09 11:23:45 +08:00
|
|
|
private:
|
2026-05-09 13:30:09 +08:00
|
|
|
std::unique_ptr<mix_cc::matheval::Expression> pre_exp_;
|
2026-05-09 11:23:45 +08:00
|
|
|
map<std::string, std::unique_ptr<mix_cc::matheval::Expression>>
|
2026-05-09 13:30:09 +08:00
|
|
|
var_exp_;
|
|
|
|
|
map<std::string, std::string> var_name_;
|
2026-05-09 11:23:45 +08:00
|
|
|
map<std::string, std::string> var_exp_str_;
|
2026-05-09 13:30:09 +08:00
|
|
|
map<std::string, double> var_Xdouble_;
|
|
|
|
|
bool pre_exp_flag_;
|
2026-05-09 11:23:45 +08:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int init_X_exp();
|
|
|
|
|
void print_load_content();
|
|
|
|
|
|
|
|
|
|
void refresh_var_result();
|
|
|
|
|
};
|