eis/eqpalg/.do_not_use/otheralg/dist_interval_alg.h

56 lines
1.4 KiB
C
Raw Permalink Normal View History

#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);
};