UniSet  2.0.0
UObject_SK.h
00001 
00002 // --------------------------------------------------------------------------
00003 /*
00004  DO NOT EDIT THIS FILE. IT IS AUTOGENERATED FILE.
00005  ALL YOUR CHANGES WILL BE LOST.
00006  
00007  НЕ РЕДАКТИРУЙТЕ ЭТОТ ФАЙЛ. ЭТОТ ФАЙЛ СОЗДАН АВТОМАТИЧЕСКИ.
00008  ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
00009 */ 
00010 // --------------------------------------------------------------------------
00011 // generate timestamp: 2014-11-24+03:00
00012 // -----------------------------------------------------------------------------
00013 #ifndef UObject_SK_H_
00014 #define UObject_SK_H_
00015 // -----------------------------------------------------------------------------
00016 #include <string>
00017 #include "UniSetObject.h"
00018 #include "LT_Object.h"
00019 #include "UniXML.h"
00020 #include "Trigger.h"
00021 #include "DebugStream.h"
00022 // -----------------------------------------------------------------------------
00023 class UObject_SK:
00024     public UniSetObject,
00025     public LT_Object
00026 {
00027     public:
00028         UObject_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::uniset_conf()->getNode("UObject"), const std::string& argprefix="" );
00029         UObject_SK();
00030         virtual ~UObject_SK();
00031 
00032         
00033         bool alarm( UniSetTypes::ObjectId sid, bool state );
00034         long getValue( UniSetTypes::ObjectId sid );
00035         void setValue( UniSetTypes::ObjectId sid, long value );
00036         void askSensor( UniSetTypes::ObjectId sid, UniversalIO::UIOCommand, UniSetTypes::ObjectId node = UniSetTypes::uniset_conf()->getLocalNode() );
00037         void updateValues();
00038         void setMsg( UniSetTypes::ObjectId code, bool state );
00039 
00040         DebugStream mylog;
00041         void init_dlog( DebugStream& d );
00042 
00043         // "синтаксический сахар"..для логов
00044         #define myinfo if( mylog.debugging(Debug::INFO) ) mylog
00045         #define mywarn if( mylog.debugging(Debug::WARN) ) mylog
00046         #define mycrit if( mylog.debugging(Debug::CRIT) ) mylog
00047         #define mylog1 if( mylog.debugging(Debug::LEVEL1) ) mylog
00048         #define mylog2 if( mylog.debugging(Debug::LEVEL2) ) mylog
00049         #define mylog3 if( mylog.debugging(Debug::LEVEL3) ) mylog
00050         #define mylog4 if( mylog.debugging(Debug::LEVEL4) ) mylog
00051         #define mylog5 if( mylog.debugging(Debug::LEVEL5) ) mylog
00052         #define mylog6 if( mylog.debugging(Debug::LEVEL6) ) mylog
00053         #define mylog7 if( mylog.debugging(Debug::LEVEL7) ) mylog
00054         #define mylog8 if( mylog.debugging(Debug::LEVEL8) ) mylog
00055         #define mylog9 if( mylog.debugging(Debug::LEVEL9) ) mylog
00056 
00057 
00058         // Используемые идентификаторы
00059         
00060 
00061         // Используемые идентификаторы сообщений
00062         
00063 
00064         // Текущее значение и предыдущее значение
00065         
00066 
00067         // --- public variables ---
00068         
00069         
00070         // --- end of public variables ---
00071 
00072     protected:
00073         // --- protected variables ---
00074         
00075         
00076         // ---- end of protected variables ----
00077 
00078         
00079         virtual void callback() override;
00080         virtual void processingMessage( UniSetTypes::VoidMessage* msg ) override;
00081         virtual void sysCommand( const UniSetTypes::SystemMessage* sm ) override;
00082         virtual void askSensors( UniversalIO::UIOCommand cmd ){}
00083         virtual void sensorInfo( const UniSetTypes::SensorMessage* sm ) override{}
00084         virtual void timerInfo( const UniSetTypes::TimerMessage* tm ) override{}
00085         virtual void sigterm( int signo ) override;
00086         virtual bool activateObject() override;
00087         virtual void testMode( bool state );
00088         void updatePreviousValues();
00089         void checkSensors();
00090         void updateOutputs( bool force );
00091 
00092         void preAskSensors( UniversalIO::UIOCommand cmd );
00093         void preSensorInfo( const UniSetTypes::SensorMessage* sm );
00094         void preTimerInfo( const UniSetTypes::TimerMessage* tm );
00095         void waitSM( int wait_msec, UniSetTypes::ObjectId testID = UniSetTypes::DefaultObjectId );
00096 
00097         void resetMsg();
00098         Trigger trResetMsg;
00099         PassiveTimer ptResetMsg;
00100         int resetMsgTime;
00101 
00102         // Выполнение очередного шага программы
00103         virtual void step(){}
00104 
00105         int sleep_msec; 
00106         bool active;
00107 
00108         UniSetTypes::ObjectId smTestID; 
00110         // управление датчиком "сердцебиения"
00111         PassiveTimer ptHeartBeat;                
00112         UniSetTypes::ObjectId idHeartBeat;        
00113         int maxHeartBeat;                        
00115         xmlNode* confnode;
00117         int getIntProp(const std::string& name) { return UniSetTypes::uniset_conf()->getIntProp(confnode, name); }
00119         inline const std::string getProp(const std::string& name) { return UniSetTypes::uniset_conf()->getProp(confnode, name); }
00120 
00121         int smReadyTimeout;     
00122         std::atomic_bool activated;
00123         int activateTimeout;    
00124         PassiveTimer ptStartUpTimeout;    
00125         int askPause; 
00127         IOController_i::SensorInfo si;
00128 
00129 
00130     private:
00131         
00132         // --- private variables ---
00133         // --- end of private variables ---
00134 
00135         
00136 
00137         bool end_private; // вспомогательное поле (для внутреннего использования при генерировании кода)
00138 };
00139 
00140 // -----------------------------------------------------------------------------
00141 #endif // UObject_SK_H_