EventSenderConfig.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * 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 * @package
19 * @author
20 * @date
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#pragma once
25
26/* ArmarX headers */
27
28#include "TreeBox.h"
29
30/* Qt headers */
31#include <QComboBox>
32#include <QDialog>
33#include <QList>
34#include <QSettings>
35#include <QTableWidget>
36#include <QWidget>
37
38/* ArmarX Headers */
40
41#include "StateItemModel.h"
42
43namespace Ui
44{
45 class EventSenderConfigDialog;
46}
47
48namespace armarx
49{
51
53 {
55 QString description;
59
60
62
64 {
65 eventSenderName = source.eventSenderName;
66 description = source.description;
67 componentName = source.componentName;
68 globalStateIdentifier = source.globalStateIdentifier;
69
70
71 if (source.event)
72 {
73 event = source.event->clone();
74 }
75 else
76 {
77 event = new Event(EVENTTOALL, "dummyEvent");
78 }
79 }
80
82
83 void saveSettings(QSettings* settings);
84 void loadSettings(QSettings* settings);
85 };
86
87 class EventSenderConfigDialog : public QDialog, virtual public Logging
88 // public Component
89
90 {
91 Q_OBJECT
92
93 public:
94 Ui::EventSenderConfigDialog* ui;
95
96 EventSenderConfigDialog(QWidget* parent = 0);
97 ~EventSenderConfigDialog() override;
98
99
100 void setEventSender(QString first, QString second);
101
102 QStringList getPossibleEvents(StateIceBasePtr state);
103
104 // data retrieval functions
105 QString getSelectedComponentName();
106 QString getSelectedState();
108 void setConfig(const EventSenderConfig& config);
109 const QModelIndex getRowOfItem(QStandardItemModel* model,
110 QString searchString,
111 int userDataRole = 0,
112 QVariant userData = QVariant()) const;
113 const QModelIndex getRowOfItem(QStandardItem* item,
114 QString searchString,
115 int userDataRole = 0,
116 QVariant userData = QVariant()) const;
117 void setIceManager(IceManagerPtr iceManager);
118 public slots:
119 void send();
120 void eventBox(int index);
121 void saveEventSender();
123 void stateSelected(int index);
124
125 protected:
126 void setupUi();
127
128
129 void getTopLevelStates(std::string componentName,
130 std::vector<StateIceBasePtr>& baseStateList,
131 std::vector<StateIceBasePtr>& instanceStateList);
132
133 private:
134 int mdiId;
135 TreeBox* treeBox;
136 StateItemModel* model;
137 IceManagerPtr iceManager;
138 // StateParameterEditor* paramEditor;
139 };
141
142} // namespace armarx
uint8_t index
#define EVENTTOALL
Definition StateBase.h:42
void setIceManager(IceManagerPtr iceManager)
Ui::EventSenderConfigDialog * ui
QStringList getPossibleEvents(StateIceBasePtr state)
void getTopLevelStates(std::string componentName, std::vector< StateIceBasePtr > &baseStateList, std::vector< StateIceBasePtr > &instanceStateList)
const QModelIndex getRowOfItem(QStandardItemModel *model, QString searchString, int userDataRole=0, QVariant userData=QVariant()) const
void setEventSender(QString first, QString second)
void setConfig(const EventSenderConfig &config)
An Event is used to communicate between e.g.
Definition Event.h:51
ArmarX Headers.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< EventSenderConfigDialog > EventSenderPtr
IceUtil::Handle< IceManager > IceManagerPtr
IceManager smart pointer.
Definition ArmarXFwd.h:39
IceInternal::Handle< Event > EventPtr
Typedef of EventPtr as IceInternal::Handle<Event> for convenience.
Definition Event.h:40
void saveSettings(QSettings *settings)
void loadSettings(QSettings *settings)
EventSenderConfig & operator=(const EventSenderConfig &)=default
EventSenderConfig(const EventSenderConfig &source)