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