Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __ethercat_fsm__
00034 #define __ethercat_fsm__
00035
00036
00037
00038
00039
00040
00041 class EtherCAT_AL;
00042 class EC_Logic;
00043 class EtherCAT_SlaveHandler;
00044 class EtherCAT_DataLinkLayer;
00045 class EtherCAT_Router;
00046 class EtherCAT_PD_Buffer;
00047
00048
00049
00050 #include "ros_ethercat_eml/ethercat_slave_memory.h"
00051
00053
00054 class EC_ESM_Ops
00055 {
00056 public:
00057 void setRouter(EtherCAT_Router *_router);
00058 EC_Logic * m_logic_instance;
00059 EtherCAT_Router * m_router_instance;
00060 protected:
00062 bool start_mbx_comm();
00064 bool stop_mbx_comm();
00066 bool start_input_update();
00068 bool stop_input_update();
00070 bool start_output_update();
00072 bool stop_output_update();
00073
00074 protected:
00076
00078 EC_ESM_Ops(EtherCAT_SlaveHandler * a_SH,
00079 EtherCAT_DataLinkLayer *_m_dll_instance,
00080 EC_Logic *_m_logic_instance,
00081 EtherCAT_PD_Buffer *_m_pdbuf_instance);
00082
00083 EtherCAT_DataLinkLayer * m_dll_instance;
00084 EtherCAT_SlaveHandler * m_SH;
00085
00086 EtherCAT_PD_Buffer * m_pdbuf_instance;
00087
00089
00093 bool set_state(EC_State a_state);
00094 };
00095
00096
00097 class EC_ESM;
00098 class EC_ESM_InitState;
00099 class EC_ESM_PreOpState;
00100 class EC_ESM_SafeOpState;
00101 class EC_ESM_OpState;
00102
00104
00107 class EC_ESM_State
00108 {
00109 friend class EC_ESM;
00110
00111 public:
00112 virtual ~EC_ESM_State()
00113 {
00114 }
00115
00117
00125 virtual bool to_state(EC_ESM * a_ESM, EC_State a_state) = 0;
00126 virtual EC_State get_state() const = 0;
00127 protected:
00128 static EC_ESM_InitState initState;
00129 static EC_ESM_PreOpState preopState;
00130 static EC_ESM_SafeOpState safeopState;
00131 static EC_ESM_OpState opState;
00132 };
00133
00135
00142 class EC_ESM : public EC_ESM_Ops
00143 {
00144 friend class EC_ESM_State;
00145 friend class EC_ESM_InitState;
00146 friend class EC_ESM_PreOpState;
00147 friend class EC_ESM_SafeOpState;
00148 friend class EC_ESM_OpState;
00149
00150 public:
00151 EC_ESM(EtherCAT_SlaveHandler * a_SH,
00152 EtherCAT_DataLinkLayer *_m_dll_instance,
00153 EC_Logic *_m_logic_instance,
00154 EtherCAT_PD_Buffer *_m_pdbuf_instance);
00155
00157
00164 bool to_state(EC_State a_state)
00165 {
00166 return (m_esm_state->to_state(this, a_state));
00167 }
00168 EC_State get_state()
00169 {
00170 return m_esm_state->get_state();
00171 }
00172
00173 protected:
00175 void setState(EC_ESM_State * a_esm_state)
00176 {
00177 m_esm_state = a_esm_state;
00178 }
00179
00180 private:
00181 EC_ESM_State * m_esm_state;
00182 };
00183
00184 class EC_ESM_InitState : public EC_ESM_State
00185 {
00186 public:
00187 virtual EC_State get_state() const;
00188 virtual bool to_state(EC_ESM * a_ESM, EC_State a_state);
00189 };
00190
00191 class EC_ESM_PreOpState : public EC_ESM_State
00192 {
00193 public:
00194 virtual EC_State get_state() const;
00195 virtual bool to_state(EC_ESM * a_ESM, EC_State a_state);
00196 };
00197
00198 class EC_ESM_SafeOpState : public EC_ESM_State
00199 {
00200 public:
00201 virtual EC_State get_state() const;
00202 virtual bool to_state(EC_ESM * a_ESM, EC_State a_state);
00203 };
00204
00205 class EC_ESM_OpState : public EC_ESM_State
00206 {
00207 public:
00208 virtual EC_State get_state() const;
00209 virtual bool to_state(EC_ESM * a_ESM, EC_State a_state);
00210 };
00211
00212 #endif // __ethercat_fsm__
ros_ethercat_eml
Author(s): Tom Panis, Klaas Gadeyne, Bob Koninckx, Austin Hendrix, Manos Nikolaidis
autogenerated on Thu Jul 4 2019 20:01:49