13 #ifndef LostTestProc_SK_H_
14 #define LostTestProc_SK_H_
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 {
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 )
121 std::string help() noexcept;
147 virtual
void callback() noexcept override;
149 virtual
void sysCommand( const
uniset::SystemMessage* sm ){};
150 virtual void askSensors( UniversalIO::UIOCommand cmd ){}
153 virtual void sigterm(
int signo )
override;
158 virtual void step(){}
160 void preAskSensors( UniversalIO::UIOCommand cmd );
163 virtual void testMode(
bool state );
164 void updateOutputs(
bool force );
177 const std::string argprefix;
192 std::atomic_bool activated;
200 std::shared_ptr<uniset::LogAgregator> loga;
201 std::shared_ptr<DebugStream> mylog;
202 std::shared_ptr<uniset::LogServer> logserv;
203 std::string logserv_host = {
""};
204 int logserv_port = {0};
224 void updatePreviousValues() noexcept;
225 void preSensorInfo( const
uniset::SensorMessage* sm );
226 void preTimerInfo( const
uniset::TimerMessage* tm );
236 return std::hash<long>()(key);
240 std::unordered_map<const uniset::ObjectId,size_t, StatHashFn> smStat;
241 size_t processingMessageCatchCount = { 0 };
243 std::string ostate = {
"" };
250 #endif // LostTestProc_SK_H_
Пассивный таймер
Definition: PassiveTimer.h:90
virtual void callback() noexceptoverride
Definition: CallbackTimer.h:29
int askPause
Definition: LostTestProc_SK.h:195
uniset::timeout_t smReadyTimeout
Definition: LostTestProc_SK.h:191
long maxHeartBeat
Definition: LostTestProc_SK.h:183
Definition: MessageType.h:166
std::string dumpVars()
Definition: LostTestProc_SK.h:119
uniset::timeout_t activateTimeout
Definition: LostTestProc_SK.h:193
Definition: UniSetObject.h:73
Definition: VMonitor.h:116
std::shared_ptr< Configuration > uniset_conf() noexcept
Definition: Configuration.cc:89
std::string pretty_str(int namewidth=NameWidth, int colnum=ColCount)
Definition: VMonitor.cc:187
virtual void sigterm(int signo) override
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:56
bool forceOut
Definition: LostTestProc_SK.h:198
int getIntProp(const std::string &name)
Definition: LostTestProc_SK.h:187
virtual std::string getMonitInfo()
Definition: LostTestProc_SK.h:155
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации) ...
const int checkTime
Definition: LostTestProc_SK.h:136
xmlNode * confnode
Definition: LostTestProc_SK.h:185
Definition: MessageType.h:122
std::string strval(uniset::ObjectId id, bool showLinkName=true) const
Definition: LostTestProc_SK.h:28
int sleep_msec
Definition: LostTestProc_SK.h:174
uniset::ObjectId idHeartBeat
Definition: LostTestProc_SK.h:182
Definition: MessageType.h:209
virtual void processingMessage(const uniset::VoidMessage *msg) override
uniset::PassiveTimer ptStartUpTimeout
Definition: LostTestProc_SK.h:194
Definition: IOController_i.idl:56
const std::string getProp(const std::string &name)
Definition: LostTestProc_SK.h:189
Definition: UniSetTypes_i.idl:64
std::string str(uniset::ObjectId id, bool showLinkName=true) const
long ObjectId
Definition: UniSetTypes_i.idl:30
uniset::ObjectId smTestID
Definition: LostTestProc_SK.h:178