uniset-algorithms  0.2
Diesel_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 Diesel_SK_H_
00014 #define Diesel_SK_H_
00015 // -----------------------------------------------------------------------------
00016 #include "UniSetObject.h"
00017 #include "LT_Object.h"
00018 #include "UniXML.h"
00019 #include "Trigger.h"
00020 // -----------------------------------------------------------------------------
00021 class Diesel_SK:
00022     public UniSetObject,
00023     public LT_Object
00024 {
00025     public:
00026         Diesel_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::conf->getNode("Diesel") );
00027         Diesel_SK();
00028         virtual ~Diesel_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         const UniSetTypes::ObjectId state_as;       
00045         UniSetTypes::ObjectId node_state_as;
00046         
00047 
00048         // Используемые идентификаторы сообщений
00049         
00050 
00051         // Текущее значение и предыдущее значение
00052         long in_state_as;
00053         long prev_in_state_as;
00054         
00055 
00056         // --- public variables ---
00057         
00058         
00059         // --- end of public variables ---
00060 
00061     protected:
00062         // --- protected variables ---
00063         
00064         
00065         // ---- end of protected variables ----
00066 
00067         
00068         virtual void callback();
00069         virtual void processingMessage( UniSetTypes::VoidMessage* msg );
00070         virtual void sysCommand( UniSetTypes::SystemMessage* sm );
00071         virtual void askSensors( UniversalIO::UIOCommand cmd ){}
00072         virtual void sensorInfo( UniSetTypes::SensorMessage* sm ){}
00073         virtual void timerInfo( UniSetTypes::TimerMessage* tm ){}
00074         virtual void sigterm( int signo );
00075         virtual bool activateObject();
00076         virtual void testMode( bool state );
00077         void updatePreviousValues();
00078         void checkSensors();
00079         void updateOutputs( bool force );
00080 
00081         void preAskSensors( UniversalIO::UIOCommand cmd );
00082         void preSensorInfo( UniSetTypes::SensorMessage* sm );
00083         void preTimerInfo( UniSetTypes::TimerMessage* tm );
00084         void waitSM( int wait_msec, UniSetTypes::ObjectId testID = UniSetTypes::DefaultObjectId );
00085 
00086         void resetMsg();
00087         Trigger trResetMsg;
00088         PassiveTimer ptResetMsg;
00089         int resetMsgTime;
00090 
00091         // Выполнение очередного шага программы
00092         virtual void step()=0;
00093 
00094         int sleep_msec; 
00095         bool active;
00096 
00097         UniSetTypes::ObjectId smTestID; 
00099         // управление датчиком "сердцебиения"
00100         PassiveTimer ptHeartBeat;               
00101         UniSetTypes::ObjectId idHeartBeat;      
00102         int maxHeartBeat;                       
00104         xmlNode* confnode;
00106         int getIntProp(const std::string name) { return UniSetTypes::conf->getIntProp(confnode, name); }
00108         inline const std::string getProp(const std::string name) { return UniSetTypes::conf->getProp(confnode, name); }
00109 
00110         int smReadyTimeout;     
00111         bool activated;
00112         int activateTimeout;    
00113         PassiveTimer ptStartUpTimeout;  
00114         int askPause; 
00116         IOController_i::SensorInfo si;
00117 
00118 
00119     private:
00120         
00121         // --- private variables ---
00122         // --- end of private variables ---
00123 
00124         
00125 
00126         bool end_private; // вспомогательное поле (для внутреннего использования при генерировании кода)
00127 };
00128 
00129 // -----------------------------------------------------------------------------
00130 #endif // Diesel_SK_H_