/****************************************************************************************************************** * Action instruction algorithm * * arg[0] data determination expression * * * * 1.0 2020-12-17 zoufuzhou ******************************************************************************************************************/ #pragma once /** * @file exp_cpc.h * @brief CPC跑偏检测的类 * @author Cat (null.null.null@qq.com) * @version 0.1 * @date 2021-09-13 * * Copyright: Baosight Co. Ltd. * DO NOT COPY/USE WITHOUT PERMISSION * */ #include #include #include #include #include #include #include #include struct StringCpcPdo { float offset[2]; string endId; string endId_saved; }; /** * @brief 表达式-CPC算法 */ class ExpCpc : public Exp { public: ExpCpc(const string name, const mix_cc::json& rule_json, const string ruleId); virtual ~ExpCpc(); public: int init() override; AlarmInfo mon_proc() override; private: int proc_cpc(const double& act_triggered_); private: // GbItemsMemSingleInstance mem_items_; std::unique_ptr mem_trk_; string m_entId; int m_startpos; int m_endpos; int m_zone; StringCpcPdo m_cpc; std::map tags_value_ = {{"tag1", 0}, {"tag2", 0}}; std::map max_deviation_ = {{"tag1", 0}, {"tag2", 0}}; ///< 最大跑偏量 };