2026-05-09 11:23:45 +08:00
|
|
|
#pragma once
|
|
|
|
|
#include <array>
|
|
|
|
|
#include <eqpalg/alg_base.h>
|
|
|
|
|
#include <eqpalg/define/public.h>
|
|
|
|
|
#include <eqpalg/utility/proxy_py.h>
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
|
|
const int MAXLEN = ProxPyMapConfig::dataMaxLen;
|
|
|
|
|
using std::string;
|
|
|
|
|
class GlitchDetection : public AlgBase {
|
|
|
|
|
public:
|
|
|
|
|
GlitchDetection(const string name, const mix_cc::json &rule_json,
|
|
|
|
|
const string ruleId);
|
|
|
|
|
|
|
|
|
|
virtual ~GlitchDetection();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
int init() override;
|
|
|
|
|
AlarmInfo exec_mon() override;
|
|
|
|
|
std::vector<AlarmInfo> exec_task(mix_cc::time_range_t time_range) override;
|
|
|
|
|
void save_rule_norm_data() override;
|
|
|
|
|
bool get_prr() override;
|
|
|
|
|
|
|
|
|
|
private:
|
2026-05-09 13:30:09 +08:00
|
|
|
std::array<double, MAXLEN> data_;
|
|
|
|
|
int data_index_ = 0;
|
|
|
|
|
int data_size_ = 0;
|
|
|
|
|
double glitch_per_ = 0.1;
|
2026-05-09 11:23:45 +08:00
|
|
|
mix_cc::time_range_t run_time_range_;
|
2026-05-09 13:30:09 +08:00
|
|
|
string exp_str_;
|
|
|
|
|
mix_cc::json py_param_;
|
|
|
|
|
std::string error_content_;
|
2026-05-09 11:23:45 +08:00
|
|
|
private:
|
|
|
|
|
/**
|
|
|
|
|
* @brief 加载表达式
|
|
|
|
|
* @return int
|
|
|
|
|
*/
|
|
|
|
|
int load_exp();
|
|
|
|
|
};
|