uniset-algorithms 0.2
APSPanel_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-01-24
00012 // -----------------------------------------------------------------------------
00013 #ifndef APSPanel_SK_H_
00014 #define APSPanel_SK_H_
00015 // -----------------------------------------------------------------------------
00016 #include "UniSetObject.h"
00017 #include "LT_Object.h"
00018 #include "UniXML.h"
00019 #include "Trigger.h"
00020 // -----------------------------------------------------------------------------
00021 class APSPanel_SK:
00022     public UniSetObject,
00023     public LT_Object
00024 {
00025     public:
00026         APSPanel_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::conf->getNode("APSPanel") );
00027         APSPanel_SK();
00028         virtual ~APSPanel_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 horn1;      
00045         UniSetTypes::ObjectId node_horn1;
00046         const UniSetTypes::ObjectId horn2;      
00047         UniSetTypes::ObjectId node_horn2;
00048         const UniSetTypes::ObjectId hornblink1;         
00049         UniSetTypes::ObjectId node_hornblink1;
00050         const UniSetTypes::ObjectId hornblink2;         
00051         UniSetTypes::ObjectId node_hornblink2;
00052         const UniSetTypes::ObjectId flamp;      
00053         UniSetTypes::ObjectId node_flamp;
00054         const UniSetTypes::ObjectId hornreset;      
00055         UniSetTypes::ObjectId node_hornreset;
00056         const UniSetTypes::ObjectId hornreset2;         
00057         UniSetTypes::ObjectId node_hornreset2;
00058         const UniSetTypes::ObjectId hornreset3;         
00059         UniSetTypes::ObjectId node_hornreset3;
00060         const UniSetTypes::ObjectId confirm;        
00061         UniSetTypes::ObjectId node_confirm;
00062         const UniSetTypes::ObjectId confirm2;       
00063         UniSetTypes::ObjectId node_confirm2;
00064         const UniSetTypes::ObjectId confirm3;       
00065         UniSetTypes::ObjectId node_confirm3;
00066         const UniSetTypes::ObjectId remoteconfirm;      
00067         UniSetTypes::ObjectId node_remoteconfirm;
00068         const UniSetTypes::ObjectId remoteconfirm2;         
00069         UniSetTypes::ObjectId node_remoteconfirm2;
00070         const UniSetTypes::ObjectId remoteconfirm3;         
00071         UniSetTypes::ObjectId node_remoteconfirm3;
00072         const UniSetTypes::ObjectId remote_bs;      
00073         UniSetTypes::ObjectId node_remote_bs;
00074         const UniSetTypes::ObjectId confirmlamp;        
00075         UniSetTypes::ObjectId node_confirmlamp;
00076         const UniSetTypes::ObjectId testlamp;       
00077         UniSetTypes::ObjectId node_testlamp;
00078         const UniSetTypes::ObjectId onControl;      
00079         UniSetTypes::ObjectId node_onControl;
00080         
00081 
00082         // Используемые идентификаторы сообщений
00083         
00084 
00085         // Текущее значение и предыдущее значение
00086         bool out_horn1;
00087         bool prev_out_horn1;
00088         bool out_horn2;
00089         bool prev_out_horn2;
00090         long out_hornblink1;
00091         long prev_out_hornblink1;
00092         long out_hornblink2;
00093         long prev_out_hornblink2;
00094         bool out_flamp;
00095         bool prev_out_flamp;
00096         bool in_hornreset;
00097         bool prev_in_hornreset;
00098         bool in_hornreset2;
00099         bool prev_in_hornreset2;
00100         bool in_hornreset3;
00101         bool prev_in_hornreset3;
00102         bool in_confirm;
00103         bool prev_in_confirm;
00104         bool in_confirm2;
00105         bool prev_in_confirm2;
00106         bool in_confirm3;
00107         bool prev_in_confirm3;
00108         bool in_remoteconfirm;
00109         bool prev_in_remoteconfirm;
00110         bool in_remoteconfirm2;
00111         bool prev_in_remoteconfirm2;
00112         bool in_remoteconfirm3;
00113         bool prev_in_remoteconfirm3;
00114         long in_remote_bs;
00115         long prev_in_remote_bs;
00116         long out_confirmlamp;
00117         long prev_out_confirmlamp;
00118         bool in_testlamp;
00119         bool prev_in_testlamp;
00120         bool in_onControl;
00121         bool prev_in_onControl;
00122         
00123 
00124         // --- public variables ---
00125         
00126         
00127         // --- end of public variables ---
00128 
00129     protected:
00130         // --- protected variables ---
00131         
00132         
00133         // ---- end of protected variables ----
00134 
00135         
00136         virtual void callback();
00137         virtual void processingMessage( UniSetTypes::VoidMessage* msg );
00138         virtual void sysCommand( UniSetTypes::SystemMessage* sm );
00139         virtual void askSensors( UniversalIO::UIOCommand cmd ){}
00140         virtual void sensorInfo( UniSetTypes::SensorMessage* sm ){}
00141         virtual void timerInfo( UniSetTypes::TimerMessage* tm ){}
00142         virtual void sigterm( int signo );
00143         virtual bool activateObject();
00144         virtual void testMode( bool state );
00145         void updatePreviousValues();
00146         void checkSensors();
00147         void updateOutputs( bool force );
00148 
00149         void preAskSensors( UniversalIO::UIOCommand cmd );
00150         void preSensorInfo( UniSetTypes::SensorMessage* sm );
00151         void preTimerInfo( UniSetTypes::TimerMessage* tm );
00152         void waitSM( int wait_msec, UniSetTypes::ObjectId testID = UniSetTypes::DefaultObjectId );
00153 
00154         void resetMsg();
00155         Trigger trResetMsg;
00156         PassiveTimer ptResetMsg;
00157         int resetMsgTime;
00158 
00159         // Выполнение очередного шага программы
00160         virtual void step()=0;
00161 
00162         int sleep_msec; 
00163         bool active;
00164 
00165         UniSetTypes::ObjectId smTestID; 
00167         // управление датчиком "сердцебиения"
00168         PassiveTimer ptHeartBeat;               
00169         UniSetTypes::ObjectId idHeartBeat;      
00170         int maxHeartBeat;                       
00172         xmlNode* confnode;
00174         int getIntProp(const std::string name) { return UniSetTypes::conf->getIntProp(confnode, name); }
00176         inline const std::string getProp(const std::string name) { return UniSetTypes::conf->getProp(confnode, name); }
00177 
00178         int smReadyTimeout;     
00179         bool activated;
00180         int activateTimeout;    
00181         PassiveTimer ptStartUpTimeout;  
00182         int askPause; 
00184         IOController_i::SensorInfo si;
00185 
00186 
00187     private:
00188         
00189         // --- private variables ---
00190         // --- end of private variables ---
00191 
00192         
00193 
00194         bool end_private; // вспомогательное поле (для внутреннего использования при генерировании кода)
00195 };
00196 
00197 // -----------------------------------------------------------------------------
00198 #endif // APSPanel_SK_H_