DS301Group.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of the SCHUNK Canopen Driver suite.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 SCHUNK GmbH, Lauffen/Neckar Germany
12 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
23 //----------------------------------------------------------------------
24 
25 #ifndef DS301GROUP_H
26 #define DS301GROUP_H
27 
28 #include "DS301Node.h"
29 
30 namespace icl_hardware {
31 namespace canopen_schunk {
32 
42 {
43 public:
48 
49  DS301Group(const std::string& name = "");
50 
54  virtual std::vector<DS301Node::Ptr> getNodes() const {return m_nodes;}
55 
63  virtual bool deleteNodeFromId (const uint8_t node_id);
64 
70  virtual void deleteNodes(std::vector<uint8_t>& deleted_ids);
71 
90  const uint16_t pdo_nr,
91  const PDO::eTransmissionType& transmission_type,
92  const DS301Node::ePDO_TYPE& pdo_type,
93  const bool dummy_mapping = false,
94  const uint8_t cyclic_timeout_cycles = 0,
95  const int16_t node_id = -1);
96 
97 
115  virtual void appendPDOMappingSingle (const PDO::MappingConfigurationList& config,
116  const uint16_t pdo_nr,
117  const PDO::eTransmissionType& transmission_type,
118  const DS301Node::ePDO_TYPE& pdo_type,
119  const bool dummy_mapping = false,
120  const uint8_t cyclic_timeout_cycles = 0,
121  const int16_t node_id = -1);
122 
123  void uploadPDOs ();
124 
125  void downloadPDOs ();
126 
130  std::string getName() const {return m_name;}
131 
139  void printPDOMapping (const uint8_t node_id = -1);
140 
141 
146 
147 protected:
158  template <typename NodeT>
159  DS301Node::Ptr addNode(const uint8_t node_id, const CanDevPtr can_device, HeartBeatMonitor::Ptr heartbeat_monitor);
160 
161  std::vector<DS301Node::Ptr> m_nodes;
162  std::string m_name;
163 
164  // the add-node method should be callable from the controller
165  friend class CanOpenController;
166 
169 };
170 
171 
172 }} // end of NS
173 
174 // include template implementations
175 #include "DS301Group.hpp"
176 
177 #endif // DS301GROUP_H
virtual bool deleteNodeFromId(const uint8_t node_id)
Deletes a node with a given node id from the node list, if it is present. If the node can&#39;t be found ...
Definition: DS301Group.cpp:45
virtual void appendPDOMappingSingle(const PDO::MappingConfigurationList &config, const uint16_t pdo_nr, const PDO::eTransmissionType &transmission_type, const DS301Node::ePDO_TYPE &pdo_type, const bool dummy_mapping=false, const uint8_t cyclic_timeout_cycles=0, const int16_t node_id=-1)
Appends one or more mapping parameters to the existing mapping. Note that the PDO will be disabled wh...
Definition: DS301Group.cpp:80
std::vector< MappingConfiguration > MappingConfigurationList
The MappingConfigurationList holds multiple Mapping configurations. The Mapping of a single PDO is de...
Definition: PDO.h:70
void registerWSBroadcaster(boost::shared_ptr< icl_comm::websocket::WsBroadcaster > broadcaster)
registerWSBroadcaster Adds a debug interface
Definition: DS301Group.cpp:129
config
The DS301Group class is the base Class for all canOpen device groups, providing basic interfaces to t...
Definition: DS301Group.h:41
The CanOpenController class is the main entry point for any calls to the canOpen System.
eTransmissionType
Transmission types of a PDO, needed when mapping PDOs.
Definition: PDO.h:122
boost::shared_ptr< DS301Group > Ptr
Shared pointer to a DS301Group.
Definition: DS301Group.h:45
unsigned char uint8_t
virtual void deleteNodes(std::vector< uint8_t > &deleted_ids)
Deletes all nodes assigned to the group.
Definition: DS301Group.cpp:35
boost::shared_ptr< icl_comm::websocket::WsBroadcaster > m_ws_broadcaster
Interface to send out diagnostics data. Only available if compiled with IC_BUILDER_ICL_COMM_WEBSOCKET...
Definition: DS301Group.h:168
virtual std::vector< DS301Node::Ptr > getNodes() const
Returns the group&#39;s node vector.
Definition: DS301Group.h:54
boost::shared_ptr< const DS301Group > ConstPtr
Shared pointer to a const DS301Group.
Definition: DS301Group.h:47
std::vector< DS301Node::Ptr > m_nodes
Definition: DS301Group.h:161
void printPDOMapping(const uint8_t node_id=-1)
Will query the PDO mapping from the device and print that to the output.
Definition: DS301Group.cpp:118
signed short int16_t
virtual void initPDOMappingSingle(const PDO::MappingConfigurationList &config, const uint16_t pdo_nr, const PDO::eTransmissionType &transmission_type, const DS301Node::ePDO_TYPE &pdo_type, const bool dummy_mapping=false, const uint8_t cyclic_timeout_cycles=0, const int16_t node_id=-1)
Init PDO mapping with a given mapping configuration for a given pdo nr.
Definition: DS301Group.cpp:58
DS301Node::Ptr addNode(const uint8_t node_id, const CanDevPtr can_device, HeartBeatMonitor::Ptr heartbeat_monitor)
Creates a new DS301Node and adds it to the group-.
Definition: DS301Group.hpp:31
std::string getName() const
Returns the group&#39;s identifier string.
Definition: DS301Group.h:130
DS301Group(const std::string &name="")
Definition: DS301Group.cpp:30
ePDO_TYPE
Type of a PDO. RECEIVE_PDOs carry data from the host to the device, TRANSMIT_PDOs from the device to ...
Definition: DS301Node.h:88
unsigned short uint16_t


schunk_canopen_driver
Author(s): Felix Mauch , Georg Heppner
autogenerated on Mon Jun 10 2019 15:07:49