18#include <unordered_map>
20#include "UniSetObject.h"
23#include "DebugStream.h"
25#include "LogAgregator.h"
43 inline std::shared_ptr<DebugStream> log()
noexcept {
return mylog; }
44 inline std::shared_ptr<uniset::LogAgregator> logAgregator()
noexcept {
return loga; }
46 void init_dlog( std::shared_ptr<DebugStream> d )
noexcept;
50 #define myinfo if( log()->debugging(Debug::INFO) ) log()->info()
53 #define mywarn if( log()->debugging(Debug::WARN) ) log()->warn()
56 #define mycrit if( log()->debugging(Debug::CRIT) ) log()->crit()
59 #define mylog1 if( log()->debugging(Debug::LEVEL1) ) log()->level1()
62 #define mylog2 if( log()->debugging(Debug::LEVEL2) ) log()->level2()
65 #define mylog3 if( log()->debugging(Debug::LEVEL3) ) log()->level3()
68 #define mylog4 if( log()->debugging(Debug::LEVEL4) ) log()->level4()
71 #define mylog5 if( log()->debugging(Debug::LEVEL5) ) log()->level5()
74 #define mylog6 if( log()->debugging(Debug::LEVEL6) ) log()->level6()
77 #define mylog7 if( log()->debugging(Debug::LEVEL7) ) log()->level7()
80 #define mylog8 if( log()->debugging(Debug::LEVEL8) ) log()->level8()
83 #define mylog9 if( log()->debugging(Debug::LEVEL9) ) log()->level9()
86 #define mylogany log()->any()
89 #define vmonit( var ) vmon.add( #var, var )
95 std::string help() const noexcept;
98#ifndef DISABLE_REST_API
100 virtual Poco::JSON::Object::Ptr httpGet(
const Poco::URI::QueryParameters& p )
override;
101 virtual Poco::JSON::Object::Ptr httpRequest(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
102 virtual Poco::JSON::Object::Ptr httpHelp(
const Poco::URI::QueryParameters& p )
override;
109 virtual
void sysCommand( const
uniset::SystemMessage* sm )
override {}
110 virtual void askSensors( UniversalIO::UIOCommand cmd ) {}
116 virtual std::string
getTypeOfMessage(
int t )
const {
return uniset::strTypeOfMessage(t); }
118#ifndef DISABLE_REST_API
120 virtual Poco::JSON::Object::Ptr httpDumpIO();
121 virtual Poco::JSON::Object::Ptr httpRequestLog(
const Poco::URI::QueryParameters& p );
122 virtual Poco::JSON::Object::Ptr request_params_set(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
123 virtual Poco::JSON::Object::Ptr request_params_get(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
126 void preAskSensors( UniversalIO::UIOCommand cmd );
136 const std::string argprefix;
151 std::atomic_bool activated = {
false };
152 std::atomic_bool canceled = {
false };
159 std::shared_ptr<uniset::LogAgregator> loga;
160 std::shared_ptr<DebugStream> mylog;
161 std::shared_ptr<uniset::LogServer> logserv;
162 std::string logserv_host = {
""};
163 int logserv_port = {0};
182 return std::hash<long>()(
key);
186 std::unordered_map<const uniset::ObjectId,size_t, StatHashFn> smStat;
187 size_t processingMessageCatchCount = { 0 };
189 std::unordered_map<long,size_t> msgTypeStat;
191 std::string ostate = {
"" };
Definition UObject_SK.h:30
virtual void processingMessage(const uniset::VoidMessage *msg) override
virtual void httpGetUserData(Poco::JSON::Object::Ptr &jdata)
Definition UObject_SK.h:119
int askPause
Definition UObject_SK.h:155
uniset::timeout_t smReadyTimeout
Definition UObject_SK.h:150
virtual void callback() noexcept override
virtual bool deactivateObject() override
Деактивация объекта (переопределяется для необходимых действий при завершении работы)
xmlNode * confnode
Definition UObject_SK.h:144
virtual std::string getTypeOfMessage(int t) const
Definition UObject_SK.h:116
int getIntProp(const std::string &name)
Definition UObject_SK.h:146
uniset::timeout_t activateTimeout
Definition UObject_SK.h:153
const std::string getProp(const std::string &name)
Definition UObject_SK.h:148
uniset::PassiveTimer ptStartUpTimeout
Definition UObject_SK.h:154
virtual std::string getMonitInfo() const
Definition UObject_SK.h:115
std::string dumpVars()
Definition UObject_SK.h:93
long maxHeartBeat
Definition UObject_SK.h:142
uniset::ObjectId smTestID
Definition UObject_SK.h:137
uniset::ObjectId idHeartBeat
Definition UObject_SK.h:141
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации)
Пассивный таймер
Definition PassiveTimer.h:94
Definition MessageType.h:127
Definition MessageType.h:171
Definition MessageType.h:214
Definition UniSetObject.h:80
Definition VMonitor.h:117
std::string pretty_str(int namewidth=NameWidth, int colnum=ColCount) const
Definition VMonitor.cc:186
Definition Calibration.h:27
KeyType key(const uniset::ObjectId id, const uniset::ObjectId node)
Definition UniSetTypes.cc:980
const ObjectId DefaultObjectId
Definition UniSetTypes.h:71
std::shared_ptr< Configuration > uniset_conf() noexcept
Definition Configuration.cc:90
long ObjectId
Definition UniSetTypes_i.idl:30
Definition IOController_i.idl:58
Definition UniSetTypes_i.idl:65