MIRA
CANOpenNodeInfoPlugin.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 MetraLabs GmbH (MLAB), GERMANY.
3  * All rights reserved.
4  * Contact: info@MetraLabs.com
5  *
6  * Commercial Usage:
7  * Licensees holding valid commercial licenses may use this file in
8  * accordance with the commercial license agreement provided with the
9  * software or, alternatively, in accordance with the terms contained in
10  * a written agreement between you and MetraLabs.
11  *
12  * GNU General Public License Usage:
13  * Alternatively, this file may be used under the terms of the GNU
14  * General Public License version 3.0 as published by the Free Software
15  * Foundation and appearing in the file LICENSE.GPL3 included in the
16  * packaging of this file. Please review the following information to
17  * ensure the GNU General Public License version 3.0 requirements will be
18  * met: http://www.gnu.org/copyleft/gpl.html.
19  * Alternatively you may (at your option) use any later version of the GNU
20  * General Public License if such license has been publicly approved by
21  * MetraLabs (or its successors, if any).
22  *
23  * IN NO EVENT SHALL "MLAB" BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
24  * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
25  * OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLABS" HAS BEEN
26  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * "MLAB" SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
29  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30  * A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
31  * "AS IS" BASIS, AND "MLAB" HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
32  * SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
33  */
34 
43 #ifndef _MLAB_CANOPENNODEINFOPLUGIN_H_
44 #define _MLAB_CANOPENNODEINFOPLUGIN_H_
45 
46 #ifndef Q_MOC_RUN
47 #include <boost/thread/mutex.hpp>
48 #endif
49 
50 #include <can/CANOpenDefs.h>
52 
53 class QTableWidget;
54 class QTextEdit;
55 
56 namespace mira { namespace can {
57 
59 
64 {
65  Q_OBJECT;
67  ("Name", "CAN SDO viewer")
68  ("Category", "CANOpen")
69  ("Description", "Information about CANOpen nodes")
70  ("Title", "CANOpen Nodes"))
71 
72 public:
73 
75 
76  bool start(uint8 node, can::CANOpenNodeInfo nodeInfo);
77  bool stop(uint8 node);
78 
79 protected:
80 
81  virtual void initialize();
82 
83  void onHeartbeat(uint8 node, can::CANOpenNodeStatus status);
84 
85  void readUserData(uint8 node);
86 
87 public slots:
88  void onCellClicked(int row, int column);
89  void updateWidget();
90 
91 signals:
92  void changeWidget();
93 
94 protected:
95 
96  QTableWidget* mList;
97  QTextEdit* mUserDataEdit;
98  uint8 mNode;
99  uint32 mHeartbeatID;
101  boost::mutex mUpdateMutex;
102 };
103 
105 
106 }} // namespaces
107 
108 #endif
QTableWidget * mList
Definition: CANOpenNodeInfoPlugin.h:96
QTextEdit * mUserDataEdit
Definition: CANOpenNodeInfoPlugin.h:97
Plugin for showing informations about a CANOpen node.
Definition: CANOpenNodeInfoPlugin.h:63
uint8 mNode
Definition: CANOpenNodeInfoPlugin.h:98
The base class for all CAN tools.
Definition: CANToolsViewPlugin.h:61
uint32 mHeartbeatID
Definition: CANOpenNodeInfoPlugin.h:99
Global definitions of the CANopen standard.
virtual void initialize()
This method must be implemented for each CAN tool.
#define MIRA_META_OBJECT(classIdentifier, MetaInfo)
CANOpenNodeStatus
The different CANopen node states.
Definition: CANOpenDefs.h:154
boost::mutex mUpdateMutex
Definition: CANOpenNodeInfoPlugin.h:101
can::CANOpenNodeStatus mNodeStatus
Definition: CANOpenNodeInfoPlugin.h:100
A struct, which contains standard information about a CANopen node.
Definition: CANOpenDefs.h:165
The base class for CAN tools.
void onCellClicked(int row, int column)
void onHeartbeat(uint8 node, can::CANOpenNodeStatus status)