uniset-algorithms  0.2
CommonLamp_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: 2013-02-14
00012 // -----------------------------------------------------------------------------
00013 #ifndef CommonLamp_SK_H_
00014 #define CommonLamp_SK_H_
00015 // -----------------------------------------------------------------------------
00016 #include "UniSetObject.h"
00017 #include "LT_Object.h"
00018 #include "UniXML.h"
00019 #include "Trigger.h"
00020 // -----------------------------------------------------------------------------
00021 class CommonLamp_SK:
00022     public UniSetObject,
00023     public LT_Object
00024 {
00025     public:
00026         CommonLamp_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::conf->getNode("CommonLamp") );
00027         CommonLamp_SK();
00028         virtual ~CommonLamp_SK();
00029 
00030         
00031 
00032         bool alarm( UniSetTypes::ObjectId sid, bool state );
00033         bool getState( UniSetTypes::ObjectId sid );
00034         bool getValue( UniSetTypes::ObjectId sid );
00035         void setValue( UniSetTypes::ObjectId sid, long value );
00036         void setState( UniSetTypes::ObjectId sid, bool state );
00037         void askState( UniSetTypes::ObjectId sid, UniversalIO::UIOCommand, UniSetTypes::ObjectId node = UniSetTypes::conf->getLocalNode() );
00038         void askValue( UniSetTypes::ObjectId sid, UniversalIO::UIOCommand, UniSetTypes::ObjectId node = UniSetTypes::conf->getLocalNode() );
00039         void updateValues();
00040         void setMsg( UniSetTypes::ObjectId code, bool state );
00041 
00042 
00043         // Используемые идентификаторы
00044         
00045 
00046         // Используемые идентификаторы сообщений
00047         
00048 
00049         // Текущее значение и предыдущее значение
00050         
00051 
00052         // --- public variables ---
00053         
00054         
00055         // --- end of public variables ---
00056 
00057     protected:
00058         // --- protected variables ---
00059         
00060         
00061         // ---- end of protected variables ----
00062 
00063         
00064         virtual void callback();
00065         virtual void processingMessage( UniSetTypes::VoidMessage* msg );
00066         virtual void sysCommand( UniSetTypes::SystemMessage* sm );
00067         virtual void askSensors( UniversalIO::UIOCommand cmd ){}
00068         virtual void sensorInfo( UniSetTypes::SensorMessage* sm ){}
00069         virtual void timerInfo( UniSetTypes::TimerMessage* tm ){}
00070         virtual void sigterm( int signo );
00071         virtual bool activateObject();
00072         virtual void testMode( bool state );
00073         void updatePreviousValues();
00074         void checkSensors();
00075         void updateOutputs( bool force );
00076 
00077         void preAskSensors( UniversalIO::UIOCommand cmd );
00078         void preSensorInfo( UniSetTypes::SensorMessage* sm );
00079         void preTimerInfo( UniSetTypes::TimerMessage* tm );
00080         void waitSM( int wait_msec, UniSetTypes::ObjectId testID = UniSetTypes::DefaultObjectId );
00081 
00082         void resetMsg();
00083         Trigger trResetMsg;
00084         PassiveTimer ptResetMsg;
00085         int resetMsgTime;
00086 
00087         // Выполнение очередного шага программы
00088         virtual void step()=0;
00089 
00090         int sleep_msec; 
00091         bool active;
00092 
00093         UniSetTypes::ObjectId smTestID; 
00095         // управление датчиком "сердцебиения"
00096         PassiveTimer ptHeartBeat;               
00097         UniSetTypes::ObjectId idHeartBeat;      
00098         int maxHeartBeat;                       
00100         xmlNode* confnode;
00102         int getIntProp(const std::string name) { return UniSetTypes::conf->getIntProp(confnode, name); }
00104         inline const std::string getProp(const std::string name) { return UniSetTypes::conf->getProp(confnode, name); }
00105 
00106         int smReadyTimeout;     
00107         bool activated;
00108         int activateTimeout;    
00109         PassiveTimer ptStartUpTimeout;  
00110         int askPause; 
00112         IOController_i::SensorInfo si;
00113 
00114 
00115     private:
00116         
00117         // --- private variables ---
00118         // --- end of private variables ---
00119 
00120         
00121 
00122         bool end_private; // вспомогательное поле (для внутреннего использования при генерировании кода)
00123 };
00124 
00125 // -----------------------------------------------------------------------------
00126 #endif // CommonLamp_SK_H_