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 <ArmarXGui/gui-plugins/ConditionViewerPlugin/ui_ConditionViewerWidget.h>
28 
29 #include "ConditionItemModel.h"
30 #include "TermTreeGraphicsScene.h"
31 #include "../TreeNode.h"
32 #include "../TermNode.h"
33 
36 
37 #include <QMainWindow>
38 #include <QWidget>
39 
40 #include <string>
41 #include <mutex>
42 #include <map>
43 
44 
45 namespace armarx
46 {
47  class ConditionViewerWidgetController;
48 
49  class ConditionViewerWidget : public QWidget
50  {
51  Q_OBJECT
52 
53  public:
55  ~ConditionViewerWidget() override;
56 
57  public slots:
58  void onDisconnect();
59  void onConnect();
60  void activeConditionItemSelected(const QItemSelection&, const QItemSelection&);
61  void pastConditionItemSelected(const QItemSelection&, const QItemSelection&);
62 
63  signals:
64  void clearScene();
65 
66  private:
67  ConditionRootPtr conditionFromItem(QStandardItem* selectedItem, const ConditionRegistry& registry);
68  void updateCondition(int conditionId, ConditionRootPtr& condition);
69  void updateLiterals();
70  Ui::ConditionViewerWidget ui;
72  TermNodePtr root;
73  TermTreeGraphicsScene* scene;
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 }
88 
armarx::TermNodePtr
std::shared_ptr< TermNode > TermNodePtr
Definition: TermNode.h:42
PeriodicTask.h
armarx::ConditionViewerWidget::ConditionViewerWidget
ConditionViewerWidget(ConditionViewerWidgetController *controller)
Definition: ConditionViewerWidget.cpp:37
armarx::ConditionViewerWidget::clearScene
void clearScene()
ConditionItemModel.h
armarx::ConditionViewerWidget::~ConditionViewerWidget
~ConditionViewerWidget() override
Definition: ConditionViewerWidget.cpp:72
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::ConditionItemModel
Definition: ConditionItemModel.h:36
armarx::ConditionViewerWidget::onConnect
void onConnect()
Definition: ConditionViewerWidget.cpp:80
controller
Definition: AddOperation.h:39
armarx::ConditionViewerWidget::activeConditionItemSelected
void activeConditionItemSelected(const QItemSelection &, const QItemSelection &)
Definition: ConditionViewerWidget.cpp:121
armarx::TermTreeGraphicsScene
Definition: TermTreeGraphicsScene.h:32
armarx::ConditionViewerWidget
Definition: ConditionViewerWidget.h:49
armarx::ConditionViewerWidget::onDisconnect
void onDisconnect()
Definition: ConditionViewerWidget.cpp:106
armarx::ConditionViewerWidget::timerEvent
void timerEvent(QTimerEvent *event) override
Definition: ConditionViewerWidget.cpp:246
IceUtil::Handle
Definition: forward_declarations.h:29
TermTreeGraphicsScene.h
armarx::ConditionViewerWidgetController
With this widget conditions can be visualized.
Definition: ConditionViewerWidgetController.h:54
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::ConditionViewerWidget::pastConditionItemSelected
void pastConditionItemSelected(const QItemSelection &, const QItemSelection &)
Definition: ConditionViewerWidget.cpp:142
Application.h