18#include <unordered_map>
20#include "UniSetObject.h"
23#include "DebugStream.h"
25#include "LogAgregator.h"
34 virtual ~JSProxy_SK();
46 inline std::shared_ptr<DebugStream> log()
noexcept {
return mylog; }
47 inline std::shared_ptr<uniset::LogAgregator> logAgregator()
noexcept {
return loga; }
49 void init_dlog( std::shared_ptr<DebugStream> d )
noexcept;
53 #define myinfo if( log()->debugging(Debug::INFO) ) log()->info()
56 #define mywarn if( log()->debugging(Debug::WARN) ) log()->warn()
59 #define mycrit if( log()->debugging(Debug::CRIT) ) log()->crit()
62 #define mylog1 if( log()->debugging(Debug::LEVEL1) ) log()->level1()
65 #define mylog2 if( log()->debugging(Debug::LEVEL2) ) log()->level2()
68 #define mylog3 if( log()->debugging(Debug::LEVEL3) ) log()->level3()
71 #define mylog4 if( log()->debugging(Debug::LEVEL4) ) log()->level4()
74 #define mylog5 if( log()->debugging(Debug::LEVEL5) ) log()->level5()
77 #define mylog6 if( log()->debugging(Debug::LEVEL6) ) log()->level6()
80 #define mylog7 if( log()->debugging(Debug::LEVEL7) ) log()->level7()
83 #define mylog8 if( log()->debugging(Debug::LEVEL8) ) log()->level8()
86 #define mylog9 if( log()->debugging(Debug::LEVEL9) ) log()->level9()
89 #define mylogany log()->any()
92 #define vmonit( var ) vmon.add( #var, var )
125 inline std::string
dumpVars(){
return vmon.pretty_str(); }
127 std::string help() const noexcept;
130#ifndef DISABLE_REST_API
133 virtual Poco::JSON::Object::Ptr httpHelp(
const Poco::URI::QueryParameters& p )
override;
154 const std::string file;
156 const int httpLoopCount;
157 const int httpMaxQueueSize;
158 const int httpResponseTimeout_msec;
159 const int httpQueueWaitTimeout_msec;
160 const int httpMaxThreads;
161 const int httpMaxRequestQueue;
162 const bool esmModuleMode;
168 virtual
void sysCommand( const
uniset::SystemMessage* sm )
override {}
169 virtual void askSensors( UniversalIO::UIOCommand cmd ) {}
170 virtual void sensorInfo(
const uniset::SensorMessage* sm )
override {}
171 virtual void timerInfo(
const uniset::TimerMessage* tm )
override {}
175 virtual std::string
getTypeOfMessage(
int t )
const {
return uniset::strTypeOfMessage(t); }
177#ifndef DISABLE_REST_API
179 virtual Poco::JSON::Object::Ptr httpDumpIO();
180 virtual Poco::JSON::Object::Ptr httpRequestLog(
const Poco::URI::QueryParameters& p );
181 virtual Poco::JSON::Object::Ptr request_params_set(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
182 virtual Poco::JSON::Object::Ptr request_params_get(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
185 void preAskSensors( UniversalIO::UIOCommand cmd );
193 virtual void step(){}
195 void updateOutputs(
bool force );
197 uniset::Trigger trResetMsg;
198 uniset::PassiveTimer ptResetMsg;
207 const std::string argprefix;
222 std::atomic_bool activated = {
false };
223 std::atomic_bool canceled = {
false };
230 std::shared_ptr<uniset::LogAgregator> loga;
231 std::shared_ptr<DebugStream> mylog;
232 std::shared_ptr<uniset::LogServer> logserv;
233 std::string logserv_host = {
""};
234 int logserv_port = {0};
236 uniset::VMonitor vmon;
255 void updatePreviousValues() noexcept;
259 void preSensorInfo( const uniset::SensorMessage* sm );
260 void preTimerInfo( const uniset::TimerMessage* tm );
268 return std::hash<long>()(
key);
272 std::unordered_map<const uniset::ObjectId,size_t, StatHashFn> smStat;
273 size_t processingMessageCatchCount = { 0 };
275 std::unordered_map<long,size_t> msgTypeStat;
277 std::string ostate = {
"" };
uniset::ObjectId smTestID
Определения JSProxy_SK.h:208
std::string strval(uniset::ObjectId id, bool showLinkName=true) const
int askPause
Определения JSProxy_SK.h:226
virtual bool deactivateObject() override
Деактивация объекта (переопределяется для необходимых действий при завершении работы).
virtual void httpGetUserData(Poco::JSON::Object::Ptr &jdata)
Определения JSProxy_SK.h:178
std::string dumpVars()
Определения JSProxy_SK.h:125
uniset::timeout_t smReadyTimeout
Определения JSProxy_SK.h:221
virtual std::string getMonitInfo() const
Определения JSProxy_SK.h:174
bool forceOut
Определения JSProxy_SK.h:202
virtual std::string getTypeOfMessage(int t) const
Определения JSProxy_SK.h:175
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации).
uniset::timeout_t activateTimeout
Определения JSProxy_SK.h:224
uniset::ObjectId idHeartBeat
Определения JSProxy_SK.h:212
const std::string getProp(const std::string &name)
Определения JSProxy_SK.h:219
int sleep_msec
Определения JSProxy_SK.h:201
int getIntProp(const std::string &name)
Определения JSProxy_SK.h:217
xmlNode * confnode
Определения JSProxy_SK.h:215
long maxHeartBeat
Определения JSProxy_SK.h:213
uniset::PassiveTimer ptStartUpTimeout
Определения JSProxy_SK.h:225
std::string str(uniset::ObjectId id, bool showLinkName=true) const
virtual void callback() noexcept override
virtual void processingMessage(const uniset::VoidMessage *msg) override
std::string msgstr(uniset::ObjectId id, bool showLinkName=true) const
Пассивный таймер
Определения PassiveTimer.h:94
Определения MessageType.h:171
Определения UniSetObject.h:80
Определения Calibration.h:27
KeyType key(const uniset::ObjectId id, const uniset::ObjectId node)
Определения UniSetTypes.cc:1048
const ObjectId DefaultObjectId
Определения UniSetTypes.h:71
std::shared_ptr< Configuration > uniset_conf() noexcept
Определения Configuration.cc:106
long ObjectId
Определения UniSetTypes_i.idl:30
Определения IOController_i.idl:64
Определения UniSetTypes_i.idl:65
Определения UHttpRequestHandler.h:87