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
132 virtual Poco::JSON::Object::Ptr httpGet(
const Poco::URI::QueryParameters& p )
override;
133 virtual Poco::JSON::Object::Ptr httpRequest(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
134 virtual Poco::JSON::Object::Ptr httpHelp(
const Poco::URI::QueryParameters& p )
override;
155 const std::string file;
157 const int httpLoopCount;
158 const int httpMaxQueueSize;
159 const int httpResponseTimeout_msec;
160 const int httpQueueWaitTimeout_msec;
161 const int httpMaxThreads;
162 const int httpMaxRequestQueue;
163 const bool esmModuleMode;
169 virtual
void sysCommand( const
uniset::SystemMessage* sm )
override {}
170 virtual void askSensors( UniversalIO::UIOCommand cmd ) {}
171 virtual void sensorInfo(
const uniset::SensorMessage* sm )
override {}
172 virtual void timerInfo(
const uniset::TimerMessage* tm )
override {}
176 virtual std::string
getTypeOfMessage(
int t )
const {
return uniset::strTypeOfMessage(t); }
178#ifndef DISABLE_REST_API
180 virtual Poco::JSON::Object::Ptr httpDumpIO();
181 virtual Poco::JSON::Object::Ptr httpRequestLog(
const Poco::URI::QueryParameters& p );
182 virtual Poco::JSON::Object::Ptr request_params_set(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
183 virtual Poco::JSON::Object::Ptr request_params_get(
const std::string& req,
const Poco::URI::QueryParameters& p )
override;
186 void preAskSensors( UniversalIO::UIOCommand cmd );
194 virtual void step(){}
196 void updateOutputs(
bool force );
198 uniset::Trigger trResetMsg;
199 uniset::PassiveTimer ptResetMsg;
208 const std::string argprefix;
223 std::atomic_bool activated = {
false };
224 std::atomic_bool canceled = {
false };
231 std::shared_ptr<uniset::LogAgregator> loga;
232 std::shared_ptr<DebugStream> mylog;
233 std::shared_ptr<uniset::LogServer> logserv;
234 std::string logserv_host = {
""};
235 int logserv_port = {0};
237 uniset::VMonitor vmon;
256 void updatePreviousValues() noexcept;
260 void preSensorInfo( const uniset::SensorMessage* sm );
261 void preTimerInfo( const uniset::TimerMessage* tm );
269 return std::hash<long>()(
key);
273 std::unordered_map<const uniset::ObjectId,size_t, StatHashFn> smStat;
274 size_t processingMessageCatchCount = { 0 };
276 std::unordered_map<long,size_t> msgTypeStat;
278 std::string ostate = {
"" };
uniset::ObjectId smTestID
Определения JSProxy_SK.h:209
std::string strval(uniset::ObjectId id, bool showLinkName=true) const
int askPause
Определения JSProxy_SK.h:227
virtual bool deactivateObject() override
Деактивация объекта (переопределяется для необходимых действий при завершении работы).
virtual void httpGetUserData(Poco::JSON::Object::Ptr &jdata)
Определения JSProxy_SK.h:179
std::string dumpVars()
Определения JSProxy_SK.h:125
uniset::timeout_t smReadyTimeout
Определения JSProxy_SK.h:222
virtual std::string getMonitInfo() const
Определения JSProxy_SK.h:175
bool forceOut
Определения JSProxy_SK.h:203
virtual std::string getTypeOfMessage(int t) const
Определения JSProxy_SK.h:176
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации).
uniset::timeout_t activateTimeout
Определения JSProxy_SK.h:225
uniset::ObjectId idHeartBeat
Определения JSProxy_SK.h:213
const std::string getProp(const std::string &name)
Определения JSProxy_SK.h:220
int sleep_msec
Определения JSProxy_SK.h:202
int getIntProp(const std::string &name)
Определения JSProxy_SK.h:218
xmlNode * confnode
Определения JSProxy_SK.h:216
long maxHeartBeat
Определения JSProxy_SK.h:214
uniset::PassiveTimer ptStartUpTimeout
Определения JSProxy_SK.h:226
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:990
const ObjectId DefaultObjectId
Определения UniSetTypes.h:71
std::shared_ptr< Configuration > uniset_conf() noexcept
Определения Configuration.cc:90
long ObjectId
Определения UniSetTypes_i.idl:30
Определения IOController_i.idl:64
Определения UniSetTypes_i.idl:65