176833cb5SWludzik, Jozef #pragma once 276833cb5SWludzik, Jozef 376833cb5SWludzik, Jozef #include "interfaces/trigger_types.hpp" 476833cb5SWludzik, Jozef 5*1477fe6aSWludzik, Jozef #include <chrono> 676833cb5SWludzik, Jozef #include <utility> 776833cb5SWludzik, Jozef 876833cb5SWludzik, Jozef class TriggerParams 976833cb5SWludzik, Jozef { 1076833cb5SWludzik, Jozef public: 1176833cb5SWludzik, Jozef TriggerParams& name(std::string val) 1276833cb5SWludzik, Jozef { 1376833cb5SWludzik, Jozef nameProperty = std::move(val); 1476833cb5SWludzik, Jozef return *this; 1576833cb5SWludzik, Jozef } 1676833cb5SWludzik, Jozef 1776833cb5SWludzik, Jozef const std::string& name() const 1876833cb5SWludzik, Jozef { 1976833cb5SWludzik, Jozef return nameProperty; 2076833cb5SWludzik, Jozef } 2176833cb5SWludzik, Jozef 2276833cb5SWludzik, Jozef bool isDiscrete() const 2376833cb5SWludzik, Jozef { 2476833cb5SWludzik, Jozef return discreteProperty; 2576833cb5SWludzik, Jozef } 2676833cb5SWludzik, Jozef 2776833cb5SWludzik, Jozef bool logToJournal() const 2876833cb5SWludzik, Jozef { 2976833cb5SWludzik, Jozef return logToJournalProperty; 3076833cb5SWludzik, Jozef } 3176833cb5SWludzik, Jozef 3276833cb5SWludzik, Jozef bool logToRedfish() const 3376833cb5SWludzik, Jozef { 3476833cb5SWludzik, Jozef return logToRedfishProperty; 3576833cb5SWludzik, Jozef } 3676833cb5SWludzik, Jozef 3776833cb5SWludzik, Jozef bool updateReport() const 3876833cb5SWludzik, Jozef { 3976833cb5SWludzik, Jozef return updateReportProperty; 4076833cb5SWludzik, Jozef } 4176833cb5SWludzik, Jozef 4276833cb5SWludzik, Jozef const std::vector<std::pair<sdbusplus::message::object_path, std::string>>& 4376833cb5SWludzik, Jozef sensors() const 4476833cb5SWludzik, Jozef { 4576833cb5SWludzik, Jozef return sensorsProperty; 4676833cb5SWludzik, Jozef } 4776833cb5SWludzik, Jozef 4876833cb5SWludzik, Jozef const std::vector<std::string>& reportNames() const 4976833cb5SWludzik, Jozef { 5076833cb5SWludzik, Jozef return reportNamesProperty; 5176833cb5SWludzik, Jozef } 5276833cb5SWludzik, Jozef 53*1477fe6aSWludzik, Jozef const TriggerThresholdParams& thresholdParams() const 5476833cb5SWludzik, Jozef { 5576833cb5SWludzik, Jozef return thresholdsProperty; 5676833cb5SWludzik, Jozef } 5776833cb5SWludzik, Jozef 5876833cb5SWludzik, Jozef private: 5976833cb5SWludzik, Jozef std::string nameProperty = "Trigger1"; 6076833cb5SWludzik, Jozef bool discreteProperty = false; 6176833cb5SWludzik, Jozef bool logToJournalProperty = false; 6276833cb5SWludzik, Jozef bool logToRedfishProperty = false; 6376833cb5SWludzik, Jozef bool updateReportProperty = false; 6476833cb5SWludzik, Jozef std::vector<std::pair<sdbusplus::message::object_path, std::string>> 65*1477fe6aSWludzik, Jozef sensorsProperty = { 66*1477fe6aSWludzik, Jozef {sdbusplus::message::object_path( 67*1477fe6aSWludzik, Jozef "/xyz/openbmc_project/sensors/temperature/BMC_Temp"), 68*1477fe6aSWludzik, Jozef ""}}; 69*1477fe6aSWludzik, Jozef std::vector<std::string> reportNamesProperty = {"Report1"}; 70*1477fe6aSWludzik, Jozef TriggerThresholdParams thresholdsProperty = 71*1477fe6aSWludzik, Jozef std::vector<numeric::ThresholdParam>{ 72*1477fe6aSWludzik, Jozef {static_cast<int>(numeric::Type::lowerCritical), 73*1477fe6aSWludzik, Jozef std::chrono::milliseconds(10).count(), 74*1477fe6aSWludzik, Jozef static_cast<int>(numeric::Direction::decreasing), 0.0}, 75*1477fe6aSWludzik, Jozef {static_cast<int>(numeric::Type::upperCritical), 76*1477fe6aSWludzik, Jozef std::chrono::milliseconds(10).count(), 77*1477fe6aSWludzik, Jozef static_cast<int>(numeric::Direction::increasing), 90.0}}; 7876833cb5SWludzik, Jozef }; 79