18 #include <unordered_map> 20 #include "UniSetObject.h" 23 #include "DebugStream.h" 24 #include "LogServer.h" 25 #include "LogAgregator.h" 46 inline std::shared_ptr<DebugStream> log() noexcept
50 inline std::shared_ptr<uniset::LogAgregator> logAgregator() noexcept
55 void init_dlog( std::shared_ptr<DebugStream> d ) noexcept;
59 #define myinfo if( log()->debugging(Debug::INFO) ) log()->info() 62 #define mywarn if( log()->debugging(Debug::WARN) ) log()->warn() 65 #define mycrit if( log()->debugging(Debug::CRIT) ) log()->crit() 68 #define mylog1 if( log()->debugging(Debug::LEVEL1) ) log()->level1() 71 #define mylog2 if( log()->debugging(Debug::LEVEL2) ) log()->level2() 74 #define mylog3 if( log()->debugging(Debug::LEVEL3) ) log()->level3() 77 #define mylog4 if( log()->debugging(Debug::LEVEL4) ) log()->level4() 80 #define mylog5 if( log()->debugging(Debug::LEVEL5) ) log()->level5() 83 #define mylog6 if( log()->debugging(Debug::LEVEL6) ) log()->level6() 86 #define mylog7 if( log()->debugging(Debug::LEVEL7) ) log()->level7() 89 #define mylog8 if( log()->debugging(Debug::LEVEL8) ) log()->level8() 92 #define mylog9 if( log()->debugging(Debug::LEVEL9) ) log()->level9() 95 #define mylogany log()->any() 98 #define vmonit( var ) vmon.add( #var, var ) 137 std::string help() const noexcept;
140 #ifndef DISABLE_REST_API 142 virtual Poco::JSON::Object::Ptr httpGet(
const Poco::URI::QueryParameters& p )
override;
143 virtual Poco::JSON::Object::Ptr httpRequest(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
144 virtual Poco::JSON::Object::Ptr httpHelp(
const Poco::URI::QueryParameters& p )
override;
169 virtual void callback() noexcept override;
171 virtual
void sysCommand( const
uniset::SystemMessage* sm )
override {}
172 virtual void askSensors( UniversalIO::UIOCommand cmd ) {}
183 return uniset::strTypeOfMessage(t);
186 #ifndef DISABLE_REST_API 188 virtual Poco::JSON::Object::Ptr httpDumpIO();
189 virtual Poco::JSON::Object::Ptr httpRequestLog(
const Poco::URI::QueryParameters& p );
190 virtual Poco::JSON::Object::Ptr request_params_set(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
191 virtual Poco::JSON::Object::Ptr request_params_get(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
195 virtual void step() {}
197 void preAskSensors( UniversalIO::UIOCommand cmd );
200 virtual void testMode(
bool state );
201 void updateOutputs(
bool force );
214 const std::string argprefix;
229 inline const std::string
getProp(
const std::string& name)
235 std::atomic_bool activated = {
false };
236 std::atomic_bool cancelled = {
false };
244 std::shared_ptr<uniset::LogAgregator> loga;
245 std::shared_ptr<DebugStream> mylog;
246 std::shared_ptr<uniset::LogServer> logserv;
247 std::string logserv_host = {
""};
248 int logserv_port = {0};
268 void updatePreviousValues() noexcept;
269 void preSensorInfo( const
uniset::SensorMessage* sm );
270 void preTimerInfo( const
uniset::TimerMessage* tm );
280 return std::hash<long>()(
key);
284 std::unordered_map<const uniset::ObjectId, size_t, StatHashFn> smStat;
285 size_t processingMessageCatchCount = { 0 };
287 std::unordered_map<long, size_t> msgTypeStat;
289 std::string ostate = {
"" };
296 #endif // UObject_SK_H_ Пассивный таймер
Definition: PassiveTimer.h:92
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации)
virtual void callback() noexcept override
bool forceOut
Definition: UObject_SK.h:242
Definition: CommonEventLoop.h:14
const std::string getProp(const std::string &name)
Definition: UObject_SK.h:229
int askPause
Definition: UObject_SK.h:239
xmlNode * confnode
Definition: UObject_SK.h:222
int getIntProp(const std::string &name)
Definition: UObject_SK.h:224
Definition: MessageType.h:170
Definition: UniSetObject.h:73
std::string dumpVars()
Definition: UObject_SK.h:132
Definition: VMonitor.h:116
virtual std::string getTypeOfMessage(int t) const
Definition: UObject_SK.h:181
uniset::timeout_t smReadyTimeout
Definition: UObject_SK.h:234
uniset::ObjectId smTestID
Definition: UObject_SK.h:215
std::shared_ptr< Configuration > uniset_conf() noexcept
Definition: Configuration.cc:89
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:69
virtual std::string getMonitInfo() const
Definition: UObject_SK.h:177
std::string pretty_str(int namewidth=NameWidth, int colnum=ColCount) const
Definition: VMonitor.cc:186
std::string str(uniset::ObjectId id, bool showLinkName=true) const
KeyType key(const uniset::ObjectId id, const uniset::ObjectId node)
Definition: UniSetTypes.cc:733
uniset::timeout_t activateTimeout
Definition: UObject_SK.h:237
Definition: MessageType.h:126
uniset::PassiveTimer ptStartUpTimeout
Definition: UObject_SK.h:238
virtual void httpGetUserData(Poco::JSON::Object::Ptr &jdata)
Definition: UObject_SK.h:187
Definition: MessageType.h:213
uniset::ObjectId idHeartBeat
Definition: UObject_SK.h:219
Definition: IOController_i.idl:57
long maxHeartBeat
Definition: UObject_SK.h:220
Definition: UniSetTypes_i.idl:64
Definition: UObject_SK.h:28
std::string strval(uniset::ObjectId id, bool showLinkName=true) const
virtual bool deactivateObject() override
Деактивация объекта (переопределяется для необходимых действий при завершении работы)
long ObjectId
Definition: UniSetTypes_i.idl:30
int sleep_msec
Definition: UObject_SK.h:211
virtual void processingMessage(const uniset::VoidMessage *msg) override
std::string msgstr(uniset::ObjectId id, bool showLinkName=true) const