13 #ifndef TestProc_SK_H_
14 #define TestProc_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;
146 virtual
void callback() noexcept override;
148 virtual
void sysCommand( const
uniset::SystemMessage* sm ){};
149 virtual void askSensors( UniversalIO::UIOCommand cmd ){}
152 virtual void sigterm(
int signo )
override;
157 virtual void step(){}
159 void preAskSensors( UniversalIO::UIOCommand cmd );
162 virtual void testMode(
bool state );
163 void updateOutputs(
bool force );
176 const std::string argprefix;
191 std::atomic_bool activated;
199 std::shared_ptr<uniset::LogAgregator> loga;
200 std::shared_ptr<DebugStream> mylog;
201 std::shared_ptr<uniset::LogServer> logserv;
202 std::string logserv_host = {
""};
203 int logserv_port = {0};
223 void updatePreviousValues() noexcept;
224 void preSensorInfo( const
uniset::SensorMessage* sm );
225 void preTimerInfo( const
uniset::TimerMessage* tm );
235 return std::hash<long>()(key);
239 std::unordered_map<const uniset::ObjectId,size_t, StatHashFn> smStat;
240 size_t processingMessageCatchCount = { 0 };
242 std::string ostate = {
"" };
249 #endif // TestProc_SK_H_
Пассивный таймер
Definition: PassiveTimer.h:90
Definition: DebugStream.h:91
std::string dumpVars()
Definition: MQPerfTest/TestProc_SK.h:119
Definition: CallbackTimer.h:29
virtual void callback() noexceptoverride
uniset::ObjectId idHeartBeat
Definition: MBSlaveTest/TestProc_SK.h:240
Definition: MessageType.h:166
const std::string getProp(const std::string &name)
Definition: MQPerfTest/TestProc_SK.h:188
long maxHeartBeat
Definition: MBSlaveTest/TestProc_SK.h:241
std::string str(uniset::ObjectId id, bool showLinkName=true) const
uniset::PassiveTimer ptStartUpTimeout
Definition: MBSlaveTest/TestProc_SK.h:252
Definition: UniSetObject.h:73
Definition: VMonitor.h:116
std::string strval(uniset::ObjectId id, bool showLinkName=true) const
Definition: MBSlaveTest/TestProc_SK.h:28
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
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:56
virtual void processingMessage(const uniset::VoidMessage *msg) override
Definition: MessageType.h:122
virtual std::string getMonitInfo()
Definition: MQPerfTest/TestProc_SK.h:154
int sleep_msec
Definition: MBSlaveTest/TestProc_SK.h:232
Definition: MessageType.h:209
Definition: IOController_i.idl:56
xmlNode * confnode
Definition: MBSlaveTest/TestProc_SK.h:243
Definition: UniSetTypes_i.idl:64
int askPause
Definition: MBSlaveTest/TestProc_SK.h:253
virtual void sigterm(int signo) override
bool forceOut
Definition: MBSlaveTest/TestProc_SK.h:256
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации) ...
int getIntProp(const std::string &name)
Definition: MQPerfTest/TestProc_SK.h:186
uniset::timeout_t smReadyTimeout
Definition: MBSlaveTest/TestProc_SK.h:249
uniset::timeout_t activateTimeout
Definition: MBSlaveTest/TestProc_SK.h:251
long ObjectId
Definition: UniSetTypes_i.idl:30
uniset::ObjectId smTestID
Definition: MBSlaveTest/TestProc_SK.h:236