detailedapplicationview.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 ArmarXCore::core
19 * @author Cedric Seehausen (usdnr at kit dot edu)
20 * @date 2016
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25
26#pragma once
27
28#include <memory>
29
30#include <QFileSystemWatcher>
31#include <QTimer>
32#include <QWidget>
33
35
37
39#include "scenarioitem.h"
40
41namespace Ui
42{
43 class DetailedApplicationView;
44}
45
46/**
47* @class DetailedApplicationView
48* @brief View that shows detailed information about a Scenario, Package or Application.
49* Shows status and parameters of the object.
50* Also allows starting, stopping and restarting of Scenarios and Applications.
51*/
52class DetailedApplicationView : public QWidget
53{
54 Q_OBJECT
55
56public:
57 /**
58 * Constructor that sets up the ui.
59 * @param parent parent widget
60 */
61 explicit DetailedApplicationView(QWidget* parent = 0);
62
63 /**
64 * Destructor.
65 */
66 ~DetailedApplicationView() override;
67
68public:
69 /**
70 * Show an Application.
71 * @param application Application to show
72 */
74
75 /**
76 * Show an ApplicationInstance.
77 * @param appInstance ApplicationInstance to show
78 */
79 void
81 ScenarioItem* item);
82
83 /**
84 * Show a Scenario.
85 * @param scenario Scenario to show
86 */
88
89 /**
90 * Show a Package.
91 * @param package Package to show
92 */
94
95
96signals:
104 void applicationEnabledChange(bool enabled);
105
106public slots:
107 /**
108 * Updates the status of the displayed item.
109 */
110 void updateStatus();
111
112private slots:
113 void on_searchBar_textEdited(const QString& text);
114
115 void on_showInactiveProperties_stateChanged(int state);
116
117 void on_startButton_clicked();
118
119 void on_stopButton_clicked();
120
121 void on_restartButton_clicked();
122
123 void on_addParameterButton_clicked();
124
125 void on_toolButton_clicked();
126
127 void itemChanged(QtProperty* property, const QVariant& value);
128 void itemAttributeChanged(QtProperty* property, const QString& attribute, const QVariant& val);
129
130 void on_reloadButton_clicked();
131
132 void on_fileUpdate();
133
134 void on_makeLocalButton_clicked();
135
136 void on_fileWatcherUpdate(const QString& path);
137
138private:
139 void init();
140 void show_or_hide_property(QtProperty*, bool);
141 bool show_or_hide_subproperties(QtProperty*, const QString&);
142
143private:
144 Ui::DetailedApplicationView* ui;
145
146 std::shared_ptr<QtVariantPropertyManager> variantManager;
147 std::shared_ptr<QtVariantEditorFactory> variantFactory;
148
149 bool statusUpdateRelevant;
152 ScenarioItem* lastScenarioItem;
153
154 bool neadsUpdate;
155 QTimer updateTimer;
156
157 QFileSystemWatcher fileSystemWatcher;
158 bool ignoreFileChanges = false;
159};
160
161using DetailedApplicationViewPtr = std::shared_ptr<DetailedApplicationView>;
void saveScenario(ScenarioManager::Data_Structure::ApplicationInstancePtr application)
void showApplicationInstance(ScenarioManager::Data_Structure::ApplicationInstancePtr appInstance, ScenarioItem *item)
Show an ApplicationInstance.
void showPackage(ScenarioManager::Data_Structure::PackagePtr package)
Show a Package.
void updateStatus()
Updates the status of the displayed item.
void showApplication(ScenarioManager::Data_Structure::ApplicationPtr application)
Show an Application.
void showScenario(ScenarioManager::Data_Structure::ScenarioPtr scenario)
Show a Scenario.
~DetailedApplicationView() override
Destructor.
DetailedApplicationView(QWidget *parent=0)
Constructor that sets up the ui.
void applicationEnabledChange(bool enabled)
The QtProperty class encapsulates an instance of a property.
TreeItem representing data contained in a Scenario or an Application.
std::shared_ptr< DetailedApplicationView > DetailedApplicationViewPtr
std::shared_ptr< Scenario > ScenarioPtr
Definition Scenario.h:35
std::shared_ptr< Application > ApplicationPtr
std::shared_ptr< Package > PackagePtr
Definition Package.h:122
std::shared_ptr< ApplicationInstance > ApplicationInstancePtr
ArmarX Headers.