RTXI  2.4
The Real-Time eXperiment Interface Documentation
connector.h
Go to the documentation of this file.
1 /*
2  The Real-Time eXperiment Interface (RTXI)
3  Copyright (C) 2011 Georgia Institute of Technology, University of Utah, Weill Cornell Medical College
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 */
19 
20 #ifndef CONNECTOR_H
21 #define CONNECTOR_H
22 
23 #include <QWidget>
24 #include <QtWidgets>
25 #include <QMdiArea>
26 
27 #include <event.h>
28 #include <fifo.h>
29 #include <io.h>
30 #include <plugin.h>
31 #include <vector>
32 
33 namespace Connector
34 {
35 class Panel : public QWidget, Event::Handler
36 {
37  Q_OBJECT
38 
39 public:
40  Panel(QWidget *);
41  ~Panel(void);
42  void receiveEvent(const Event::Object *);
43 
44 private slots:
45  void buildInputChannelList(void);
46  void buildOutputChannelList(void);
47  void highlightConnectionBox(QListWidgetItem *);
48  void toggleConnection(bool);
49  void updateConnectionButton(void);
50 
51 private:
52  static void buildConnectionList(IO::Block *,size_t,IO::Block *,size_t,void *);
53 
54  struct link_t
55  {
56  IO::Block *src;
57  size_t src_idx;
58  IO::Block *dest;
59  size_t dest_idx;
60  };
61 
62  QMdiSubWindow *subWindow;
63 
64  QGroupBox *connectionGroup;
65  QGroupBox *buttonGroup;
66  QGroupBox *outputGroup;
67  QGroupBox *inputGroup;
68  QComboBox *inputBlock;
69  QComboBox *inputChannel;
70  QComboBox *outputBlock;
71  QComboBox *outputChannel;
72  QListWidget *connectionBox;
73  QPushButton *connectionButton;
74  std::vector<IO::Block *> blocks;
75  std::vector<link_t> links;
76 }; // class Panel
77 
78 class Plugin : public QObject, public ::Plugin::Object
79 {
80  Q_OBJECT
81  friend class Panel;
82 
83 public:
84  static Plugin *getInstance(void);
85 
86 public slots:
87  void showConnectorPanel(void);
88 
89 private:
90  void removeConnectorPanel(Panel *);
91  Plugin(void);
92  ~Plugin(void);
93  Plugin(const Plugin &) : QObject() {};
94  Plugin &operator=(const Plugin &)
95  {
96  return *getInstance();
97  };
98  static Plugin *instance;
99  Panel *panel;
100 }; // class Plugin
101 }; // namespace Connector
102 #endif // CONNECTOR_H
Connector::Panel::~Panel
~Panel(void)
Definition: connector.cpp:160
Connector
Definition: connector.h:33
Connector::Plugin::showConnectorPanel
void showConnectorPanel(void)
Definition: connector.cpp:399
Plugin::Object
Definition: plugin.h:145
fifo.h
plugin.h
Connector::Panel::receiveEvent
void receiveEvent(const Event::Object *)
Definition: connector.cpp:165
IO::Block
Definition: io.h:188
event.h
Connector::Plugin::getInstance
static Plugin * getInstance(void)
Definition: connector.cpp:415
Event::Handler
Definition: event.h:256
Connector::Panel
Definition: connector.h:35
Plugin
Classes associated with the loading/unloading of binaries at run-time.
Definition: plugin.h:35
Connector::Panel::Panel
Panel(QWidget *)
Definition: connector.cpp:39
io.h
Connector::Plugin::Panel
friend class Panel
Definition: connector.h:81
Event::Object
Definition: event.h:128