DS301Group.h
Go to the documentation of this file.
00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
00002 
00003 // -- BEGIN LICENSE BLOCK ----------------------------------------------
00004 // This file is part of the SCHUNK Canopen Driver suite.
00005 //
00006 // This program is free software licensed under the LGPL
00007 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
00008 // You can find a copy of this license in LICENSE folder in the top
00009 // directory of the source code.
00010 //
00011 // © Copyright 2016 SCHUNK GmbH, Lauffen/Neckar Germany
00012 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
00013 // -- END LICENSE BLOCK ------------------------------------------------
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   // the add-node method should be callable from the controller
00165   friend class CanOpenController;
00166 
00168   boost::shared_ptr<icl_comm::websocket::WsBroadcaster> m_ws_broadcaster;
00169 };
00170 
00171 
00172 }} // end of NS
00173 
00174 // include template implementations
00175 #include "DS301Group.hpp"
00176 
00177 #endif // DS301GROUP_H


schunk_canopen_driver
Author(s): Felix Mauch , Georg Heppner
autogenerated on Thu Jun 6 2019 20:17:24