Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00023
00024
00025 #ifndef DS301GROUP_H
00026 #define DS301GROUP_H
00027
00028 #include "DS301Node.h"
00029
00030 namespace icl_hardware {
00031 namespace canopen_schunk {
00032
00041 class DS301Group
00042 {
00043 public:
00045 typedef boost::shared_ptr<DS301Group> Ptr;
00047 typedef boost::shared_ptr<const DS301Group> ConstPtr;
00048
00049 DS301Group(const std::string& name = "");
00050
00054 virtual std::vector<DS301Node::Ptr> getNodes() const {return m_nodes;}
00055
00063 virtual bool deleteNodeFromId (const uint8_t node_id);
00064
00070 virtual void deleteNodes(std::vector<uint8_t>& deleted_ids);
00071
00089 virtual void initPDOMappingSingle (const PDO::MappingConfigurationList& config,
00090 const uint16_t pdo_nr,
00091 const PDO::eTransmissionType& transmission_type,
00092 const DS301Node::ePDO_TYPE& pdo_type,
00093 const bool dummy_mapping = false,
00094 const uint8_t cyclic_timeout_cycles = 0,
00095 const int16_t node_id = -1);
00096
00097
00115 virtual void appendPDOMappingSingle (const PDO::MappingConfigurationList& config,
00116 const uint16_t pdo_nr,
00117 const PDO::eTransmissionType& transmission_type,
00118 const DS301Node::ePDO_TYPE& pdo_type,
00119 const bool dummy_mapping = false,
00120 const uint8_t cyclic_timeout_cycles = 0,
00121 const int16_t node_id = -1);
00122
00123 void uploadPDOs ();
00124
00125 void downloadPDOs ();
00126
00130 std::string getName() const {return m_name;}
00131
00139 void printPDOMapping (const uint8_t node_id = -1);
00140
00141
00145 void registerWSBroadcaster(boost::shared_ptr<icl_comm::websocket::WsBroadcaster> broadcaster);
00146
00147 protected:
00158 template <typename NodeT>
00159 DS301Node::Ptr addNode(const uint8_t node_id, const CanDevPtr can_device, HeartBeatMonitor::Ptr heartbeat_monitor);
00160
00161 std::vector<DS301Node::Ptr> m_nodes;
00162 std::string m_name;
00163
00164
00165 friend class CanOpenController;
00166
00168 boost::shared_ptr<icl_comm::websocket::WsBroadcaster> m_ws_broadcaster;
00169 };
00170
00171
00172 }}
00173
00174
00175 #include "DS301Group.hpp"
00176
00177 #endif // DS301GROUP_H