uniset-algorithms  0.2
Caller_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 Caller_SK_H_
00014 #define Caller_SK_H_
00015 // -----------------------------------------------------------------------------
00016 #include "UniSetObject.h"
00017 #include "LT_Object.h"
00018 #include "UniXML.h"
00019 #include "Trigger.h"
00020 // -----------------------------------------------------------------------------
00021 class Caller_SK:
00022     public UniSetObject,
00023     public LT_Object
00024 {
00025     public:
00026         Caller_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::conf->getNode("Caller") );
00027         Caller_SK();
00028         virtual ~Caller_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 Selected;       
00045         UniSetTypes::ObjectId node_Selected;
00046         const UniSetTypes::ObjectId Call;       
00047         UniSetTypes::ObjectId node_Call;
00048         const UniSetTypes::ObjectId lmpCall;        
00049         UniSetTypes::ObjectId node_lmpCall;
00050         const UniSetTypes::ObjectId MainConfirm;        
00051         UniSetTypes::ObjectId node_MainConfirm;
00052         const UniSetTypes::ObjectId Confirm1;       
00053         UniSetTypes::ObjectId node_Confirm1;
00054         const UniSetTypes::ObjectId Confirm2;       
00055         UniSetTypes::ObjectId node_Confirm2;
00056         const UniSetTypes::ObjectId Confirm3;       
00057         UniSetTypes::ObjectId node_Confirm3;
00058         const UniSetTypes::ObjectId Ring;       
00059         UniSetTypes::ObjectId node_Ring;
00060         const UniSetTypes::ObjectId Ring2;      
00061         UniSetTypes::ObjectId node_Ring2;
00062         const UniSetTypes::ObjectId Ring3;      
00063         UniSetTypes::ObjectId node_Ring3;
00064         const UniSetTypes::ObjectId Ring4;      
00065         UniSetTypes::ObjectId node_Ring4;
00066         const UniSetTypes::ObjectId aRing;      
00067         UniSetTypes::ObjectId node_aRing;
00068         const UniSetTypes::ObjectId aRing2;         
00069         UniSetTypes::ObjectId node_aRing2;
00070         const UniSetTypes::ObjectId aRing3;         
00071         UniSetTypes::ObjectId node_aRing3;
00072         const UniSetTypes::ObjectId aRing4;         
00073         UniSetTypes::ObjectId node_aRing4;
00074         
00075 
00076         // Используемые идентификаторы сообщений
00077         
00078         const UniSetTypes::ObjectId msg_NoConfirm;  
00079         UniSetTypes::ObjectId node_msg_NoConfirm;
00080         bool m_msg_NoConfirm;                           
00081         bool prev_m_msg_NoConfirm;                  
00083         const UniSetTypes::ObjectId msg_Call;   
00084         UniSetTypes::ObjectId node_msg_Call;
00085         bool m_msg_Call;                            
00086         bool prev_m_msg_Call;                   
00088         const UniSetTypes::ObjectId msg_Confirm;    
00089         UniSetTypes::ObjectId node_msg_Confirm;
00090         bool m_msg_Confirm;                             
00091         bool prev_m_msg_Confirm;                    
00093         const UniSetTypes::ObjectId msg_Confirm2;   
00094         UniSetTypes::ObjectId node_msg_Confirm2;
00095         bool m_msg_Confirm2;                            
00096         bool prev_m_msg_Confirm2;                   
00098         const UniSetTypes::ObjectId msg_Confirm3;   
00099         UniSetTypes::ObjectId node_msg_Confirm3;
00100         bool m_msg_Confirm3;                            
00101         bool prev_m_msg_Confirm3;                   
00104         // Текущее значение и предыдущее значение
00105         bool in_Selected;
00106         bool prev_in_Selected;
00107         bool in_Call;
00108         bool prev_in_Call;
00109         long out_lmpCall;
00110         long prev_out_lmpCall;
00111         bool in_MainConfirm;
00112         bool prev_in_MainConfirm;
00113         bool in_Confirm1;
00114         bool prev_in_Confirm1;
00115         bool in_Confirm2;
00116         bool prev_in_Confirm2;
00117         bool in_Confirm3;
00118         bool prev_in_Confirm3;
00119         bool out_Ring;
00120         bool prev_out_Ring;
00121         bool out_Ring2;
00122         bool prev_out_Ring2;
00123         bool out_Ring3;
00124         bool prev_out_Ring3;
00125         bool out_Ring4;
00126         bool prev_out_Ring4;
00127         long out_aRing;
00128         long prev_out_aRing;
00129         long out_aRing2;
00130         long prev_out_aRing2;
00131         long out_aRing3;
00132         long prev_out_aRing3;
00133         long out_aRing4;
00134         long prev_out_aRing4;
00135         
00136 
00137         // --- public variables ---
00138         
00139         
00140         // --- end of public variables ---
00141 
00142     protected:
00143         // --- protected variables ---
00144         
00145         
00146         // ---- end of protected variables ----
00147 
00148         
00149         virtual void callback();
00150         virtual void processingMessage( UniSetTypes::VoidMessage* msg );
00151         virtual void sysCommand( UniSetTypes::SystemMessage* sm );
00152         virtual void askSensors( UniversalIO::UIOCommand cmd ){}
00153         virtual void sensorInfo( UniSetTypes::SensorMessage* sm ){}
00154         virtual void timerInfo( UniSetTypes::TimerMessage* tm ){}
00155         virtual void sigterm( int signo );
00156         virtual bool activateObject();
00157         virtual void testMode( bool state );
00158         void updatePreviousValues();
00159         void checkSensors();
00160         void updateOutputs( bool force );
00161 
00162         void preAskSensors( UniversalIO::UIOCommand cmd );
00163         void preSensorInfo( UniSetTypes::SensorMessage* sm );
00164         void preTimerInfo( UniSetTypes::TimerMessage* tm );
00165         void waitSM( int wait_msec, UniSetTypes::ObjectId testID = UniSetTypes::DefaultObjectId );
00166 
00167         void resetMsg();
00168         Trigger trResetMsg;
00169         PassiveTimer ptResetMsg;
00170         int resetMsgTime;
00171 
00172         // Выполнение очередного шага программы
00173         virtual void step()=0;
00174 
00175         int sleep_msec; 
00176         bool active;
00177 
00178         UniSetTypes::ObjectId smTestID; 
00180         // управление датчиком "сердцебиения"
00181         PassiveTimer ptHeartBeat;               
00182         UniSetTypes::ObjectId idHeartBeat;      
00183         int maxHeartBeat;                       
00185         xmlNode* confnode;
00187         int getIntProp(const std::string name) { return UniSetTypes::conf->getIntProp(confnode, name); }
00189         inline const std::string getProp(const std::string name) { return UniSetTypes::conf->getProp(confnode, name); }
00190 
00191         int smReadyTimeout;     
00192         bool activated;
00193         int activateTimeout;    
00194         PassiveTimer ptStartUpTimeout;  
00195         int askPause; 
00197         IOController_i::SensorInfo si;
00198 
00199 
00200     private:
00201         
00202         // --- private variables ---
00203         // --- end of private variables ---
00204 
00205         
00206 
00207         bool end_private; // вспомогательное поле (для внутреннего использования при генерировании кода)
00208 };
00209 
00210 // -----------------------------------------------------------------------------
00211 #endif // Caller_SK_H_