UniSet  2.6.0
TestProc.h
00001 // -----------------------------------------------------------------------------
00002 #ifndef TestProc_H_
00003 #define TestProc_H_
00004 // -----------------------------------------------------------------------------
00005 #include <vector>
00006 #include "Debug.h"
00007 #include "TestProc_SK.h"
00008 #include "modbus/ModbusTCPServerSlot.h"
00009 // -----------------------------------------------------------------------------
00010 class TestProc:
00011     public TestProc_SK
00012 {
00013     public:
00014         TestProc( uniset::ObjectId id, xmlNode* confnode = uniset::uniset_conf()->getNode("TestProc") );
00015         virtual ~TestProc();
00016 
00017     protected:
00018         TestProc();
00019 
00020         enum Timers
00021         {
00022             tmChange,
00023             tmCheckWorking,
00024             tmCheck,
00025             tmLogControl
00026         };
00027 
00028         virtual void step();
00029         virtual void sensorInfo( const uniset::SensorMessage* sm );
00030         virtual void timerInfo( const uniset::TimerMessage* tm );
00031         virtual void sysCommand( const uniset::SystemMessage* sm );
00032 
00033         void test_depend();
00034         void test_undefined_state();
00035         void test_thresholds();
00036         void test_loglevel();
00037 
00038     private:
00039         bool state = { false };
00040         bool undef = { false };
00041 
00042         std::vector<Debug::type> loglevels;
00043         std::vector<Debug::type>::iterator lit;
00044 
00045         std::shared_ptr<uniset::ModbusTCPServerSlot> mbslave;
00047         uniset::ModbusRTU::mbErrCode writeOutputSingleRegister( uniset::ModbusRTU::WriteSingleOutputMessage& query,
00048                 uniset::ModbusRTU::WriteSingleOutputRetMessage& reply );
00049 
00050         std::shared_ptr< uniset::ThreadCreator<TestProc> > mbthr;
00051         void mbThread();
00052 };
00053 // -----------------------------------------------------------------------------
00054 #endif // TestProc_H_
00055 // -----------------------------------------------------------------------------