OpenIndy-Core  0.2.0.43
tool.h
Go to the documentation of this file.
1 #ifndef TOOL_H
2 #define TOOL_H
3 
4 #include <QObject>
5 #include <QWidget>
6 #include <QCloseEvent>
7 
8 #include "types.h"
9 #include "oirequestresponse.h"
10 #include "pluginmetadata.h"
11 #include "oijob.h"
12 
13 namespace oi{
14 
15 class OI_CORE_EXPORT Tool : public QWidget
16 {
17  Q_OBJECT
18 
19 public:
20  explicit Tool(QWidget *parent = 0);
21 
22  virtual ~Tool();
23 
24  //##########################
25  //tool initialization method
26  //##########################
27 
28  virtual void init();
29 
30  //#########################################
31  //methods to get or set further information
32  //#########################################
33 
34  const PluginMetaData &getMetaData() const;
35 
36  const ToolTypes &getToolType() const;
37 
38  const QPointer<OiJob> &getJob() const;
39  void setJob(const QPointer<OiJob> &job);
40 
41  //#########################
42  //override QWidget methods
43  //#########################
44 
45  void closeEvent(QCloseEvent *event);
46 
47 public slots:
48 
49  //#####################################
50  //special events a tool could listen on
51  //#####################################
52 
53  virtual void customXmlRequest(const QPointer<OiRequestResponse> &request);
54  virtual void watchWindowKeyPressed(const Qt::Key &key);
55 
56 signals:
57 
58  //############################################
59  //signals to inform OpenIndy about tool issues
60  //############################################
61 
62  void sendMessage(const QString &msg, const MessageTypes &msgType, const MessageDestinations &msgDest = eConsoleMessage);
63  void customXmlResponse(const QPointer<OiRequestResponse> &response);
64 
65  //###############################
66  //signals to start sensor actions
67  //###############################
68 
69  void startConnect();
70  void startDisconnect();
71  void startMeasurement();
72  void startMove(const Reading &reading);
73  void startAim();
74  void startAimAndMeasure();
75  void startToggleSight();
76  void startInitialize();
77  void startHome();
78  void startCompensation();
79  void startChangeMotorState();
80  void startCustomAction(const QString &task);
81 
82 protected:
83 
84  //###########################
85  //input and output parameters
86  //###########################
87 
89 
91 
92  QPointer<OiJob> job; //the OpenIndy job that this tool works on
93 
94 };
95 
96 }
97 
98 #ifndef STR
99 #define STR(x) #x
100 #endif
101 #ifndef STR2
102 #define STR2(x) STR(x)
103 #endif
104 
105 #ifndef CONCAT
106 #define CONCAT(a, b) a ## b
107 #endif
108 #ifndef CONCAT2
109 #define CONCAT2(a, b) CONCAT(a, b)
110 #endif
111 
112 #define TOOL_PREFIX de.openIndy.plugin.tool.v
113 #define Tool_iidd STR2(CONCAT2(TOOL_PREFIX, PLUGIN_INTERFACE_VERSION))
114 
115 #endif // TOOL_H
Definition: pluginmetadata.h:10
PluginMetaData metaData
Definition: tool.h:88
void init()
Definition: util.cpp:53
ToolTypes toolType
Definition: tool.h:90
Definition: tool.h:15
Definition: coordinatesystem.h:15
Definition: types.h:38
MessageDestinations
used to specify where to print a message
Definition: types.h:37
MessageTypes
all types of messages
Definition: types.h:29
ToolTypes
Definition: types.h:428
QPointer< OiJob > job
Definition: tool.h:92
The Reading class.
Definition: reading.h:132
#define OI_CORE_EXPORT
Definition: types.h:11