ConditionViewerWidget.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// Qt
27#include <map>
28#include <mutex>
29#include <string>
30
31#include <QMainWindow>
32#include <QWidget>
33
36
37#include <ArmarXGui/gui-plugins/ConditionViewerPlugin/ui_ConditionViewerWidget.h>
38
39#include "../TermNode.h"
40#include "../TreeNode.h"
41#include "ConditionItemModel.h"
43
44namespace armarx
45{
47
48 class ConditionViewerWidget : public QWidget
49 {
50 Q_OBJECT
51
52 public:
54 ~ConditionViewerWidget() override;
55
56 public slots:
57 void onDisconnect();
58 void onConnect();
59 void activeConditionItemSelected(const QItemSelection&, const QItemSelection&);
60 void pastConditionItemSelected(const QItemSelection&, const QItemSelection&);
61
62 signals:
63 void clearScene();
64
65 private:
66 ConditionRootPtr conditionFromItem(QStandardItem* selectedItem,
67 const ConditionRegistry& registry);
68 void updateCondition(int conditionId, ConditionRootPtr& condition);
69 void updateLiterals();
70 Ui::ConditionViewerWidget ui;
72 TermNodePtr root;
74 ConditionItemModel* activeConditionsModel;
75 ConditionItemModel* pastConditionsModel;
76 ConditionRegistry activeConditions;
77 ConditionRegistry pastConditions;
78 std::recursive_mutex dataMutex;
79
81 int timerId;
82
83 // QObject interface
84 protected:
85 void timerEvent(QTimerEvent* event) override;
86 };
87} // namespace armarx
With this widget conditions can be visualized.
void pastConditionItemSelected(const QItemSelection &, const QItemSelection &)
void timerEvent(QTimerEvent *event) override
ConditionViewerWidget(ConditionViewerWidgetController *controller)
void activeConditionItemSelected(const QItemSelection &, const QItemSelection &)
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< TermNode > TermNodePtr
Definition TermNode.h:42
IceInternal::Handle< ConditionRoot > ConditionRootPtr
Typedef of ConditionRootPtr as IceInternal::Handle<ConditionRoot> for convenience.