56 lines
1.4 KiB
C
56 lines
1.4 KiB
C
|
|
#pragma once
|
||
|
|
/**
|
||
|
|
* @file dist_interval_alg.h
|
||
|
|
* @brief 表达式-动作反馈-区间
|
||
|
|
* @author your name (you@domain.com)
|
||
|
|
* @version 0.1
|
||
|
|
* @date 2023-12-22
|
||
|
|
*
|
||
|
|
* Copyright: Baosight Co. Ltd.
|
||
|
|
* DO NOT COPY/USE WITHOUT PERMISSION
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
#include <eqpalg/algs/exp_sample.h>
|
||
|
|
#include <memory>
|
||
|
|
#include <sstream>
|
||
|
|
#include <string>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
using namespace nlohmann;
|
||
|
|
/**
|
||
|
|
* @brief 表达式-动作反馈-区间的实现
|
||
|
|
* @tparam dims
|
||
|
|
*/
|
||
|
|
class DistInterval : public ExpSample {
|
||
|
|
public:
|
||
|
|
DistInterval(const string& name, const mix_cc::json& rule_json,
|
||
|
|
const string& ruleId, size_t dims, double padding_low,
|
||
|
|
double padding_up)
|
||
|
|
: ExpSample(name, rule_json, ruleId, dims, padding_low, padding_up) {}
|
||
|
|
~DistInterval() override;
|
||
|
|
|
||
|
|
int init() override;
|
||
|
|
// AlarmInfo mon_proc() override
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief 执行监控
|
||
|
|
* @return AlarmInfo
|
||
|
|
*/
|
||
|
|
AlarmInfo exec_mon() override;
|
||
|
|
bool get_is_to_detect();
|
||
|
|
int reload_config_vars();
|
||
|
|
AlarmInfo exec_normal_task(mix_cc::time_range_t time_range) override;
|
||
|
|
int update_show_interval();
|
||
|
|
|
||
|
|
protected:
|
||
|
|
// std::unique_ptr<mix_cc::matheval::Expression> exp_act_mon_; ///<
|
||
|
|
// 动作表达式
|
||
|
|
bool is_to_detect_ = false;
|
||
|
|
int interval_source_; // 0,导入 1训练
|
||
|
|
double dist_left_;
|
||
|
|
double dist_right_;
|
||
|
|
std::string dist_interval_input_;
|
||
|
|
TimePoint last_select_db2_time_; ///< 上一次读db2的时间
|
||
|
|
vector<double> intervalToDouble(string& str);
|
||
|
|
};
|