RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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  {
57  size_t src_idx;
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:
91  Plugin(void);
92  ~Plugin(void);
93  Plugin(const Plugin &) {};
95  {
96  return *getInstance();
97  };
98  static Plugin *instance;
100 }; // class Plugin
101 }; // namespace Connector
102 #endif // CONNECTOR_H
void removeConnectorPanel(Panel *)
Definition: connector.cpp:406
void showConnectorPanel(void)
Definition: connector.cpp:399
void buildOutputChannelList(void)
Definition: connector.cpp:257
QComboBox * outputChannel
Definition: connector.h:71
Definition: io.h:187
QGroupBox * inputGroup
Definition: connector.h:67
void highlightConnectionBox(QListWidgetItem *)
Definition: connector.cpp:273
void buildInputChannelList(void)
Definition: connector.cpp:241
QGroupBox * outputGroup
Definition: connector.h:66
Plugin & operator=(const Plugin &)
Definition: connector.h:94
void receiveEvent(const Event::Object *)
Definition: connector.cpp:165
QGroupBox * connectionGroup
Definition: connector.h:64
QComboBox * inputChannel
Definition: connector.h:69
QGroupBox * buttonGroup
Definition: connector.h:65
static Plugin * instance
Definition: connector.h:97
QListWidget * connectionBox
Definition: connector.h:72
Panel(QWidget *)
Definition: connector.cpp:39
QComboBox * inputBlock
Definition: connector.h:68
QMdiSubWindow * subWindow
Definition: connector.h:62
static void buildConnectionList(IO::Block *, size_t, IO::Block *, size_t, void *)
Definition: connector.cpp:367
static Plugin * getInstance(void)
Definition: connector.cpp:415
std::vector< IO::Block * > blocks
Definition: connector.h:74
QComboBox * outputBlock
Definition: connector.h:70
Plugin(const Plugin &)
Definition: connector.h:93
void toggleConnection(bool)
Definition: connector.cpp:332
void updateConnectionButton(void)
Definition: connector.cpp:348
std::vector< link_t > links
Definition: connector.h:75
Classes associated with the loading/unloading of binaries at run-time.
Definition: plugin.h:35
QPushButton * connectionButton
Definition: connector.h:73