RTXI  3.0.0
The Real-Time eXperiment Interface Reference Manual
connector.hpp
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,
4  Weill Cornell Medical College
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 */
20 
21 #ifndef CONNECTOR_H
22 #define CONNECTOR_H
23 
24 #include <QComboBox>
25 #include <QListWidget>
26 #include <vector>
27 
28 #include "event.hpp"
29 #include "fifo.hpp"
30 #include "io.hpp"
31 #include "widgets.hpp"
32 
33 namespace Connector
34 {
35 constexpr std::string_view MODULE_NAME = "Connector";
36 
37 class Panel : public Widgets::Panel
38 {
39  Q_OBJECT
40 
41 public:
42  Panel(QMainWindow* mw, Event::Manager* ev_manager);
43 
44 signals:
47 
48 private slots:
49  void buildInputChannelList();
50  void buildOutputFlagList();
51  void buildOutputChannelList();
52  void highlightConnectionBox(const QString& /*unused*/);
53  void reverseHighlightConnectionBox(const QListWidgetItem* item);
54  void toggleConnection(bool down);
55  void updateConnectionButton();
56  void syncBlockInfo();
57 
58 private:
59  void buildConnectionList();
60  void buildBlockList();
61 
62  QGroupBox* connectionGroup;
63  QGroupBox* buttonGroup;
64  QGroupBox* outputGroup;
65  QGroupBox* inputGroup;
66  QComboBox* inputBlock;
67  QComboBox* inputChannel;
68  QComboBox* outputBlock;
69  QComboBox* outputFlag;
70  QComboBox* outputChannel;
71  QListWidget* connectionBox;
72  QPushButton* connectionButton;
73  std::vector<IO::Block*> blocks;
74  std::vector<RT::block_connection_t> links;
75 }; // class Panel
76 
77 class Plugin : public Widgets::Plugin
78 {
79 public:
80  explicit Plugin(Event::Manager* ev_manager);
81  void receiveEvent(Event::Object* event) override;
82 
83 private:
84  void updatePanelInfo();
85  // void receiveEvent(Event::Object* event) override;
86 
87 }; // class Plugin
88 
89 std::unique_ptr<Widgets::Plugin> createRTXIPlugin(Event::Manager* ev_manager);
90 
91 Widgets::Panel* createRTXIPanel(QMainWindow* main_window,
92  Event::Manager* ev_manager);
93 
94 std::unique_ptr<Widgets::Component> createRTXIComponent(
95  Widgets::Plugin* host_plugin);
96 
98 
99 } // namespace Connector
100 #endif // CONNECTOR_H
void updateBlockInfo()
void updateConnectionInfo()
Panel(QMainWindow *mw, Event::Manager *ev_manager)
Definition: connector.cpp:25
void receiveEvent(Event::Object *event) override
Definition: connector.cpp:228
Plugin(Event::Manager *ev_manager)
Definition: connector.cpp:467
std::unique_ptr< Widgets::Component > createRTXIComponent(Widgets::Plugin *host_plugin)
Definition: connector.cpp:485
constexpr std::string_view MODULE_NAME
Definition: connector.hpp:35
std::unique_ptr< Widgets::Plugin > createRTXIPlugin(Event::Manager *ev_manager)
Definition: connector.cpp:472
Widgets::Panel * createRTXIPanel(QMainWindow *main_window, Event::Manager *ev_manager)
Definition: connector.cpp:478
Widgets::FactoryMethods getFactories()
Definition: connector.cpp:491