DetailedApplicationController.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#include <vector>
30
31#include <QObject>
32
39
42#include "../gui/scenarioitem.h"
44
46{
47 /**
48 * @class DetailedApplicationController
49 * @ingroup controller
50 * @brief This Controller manages the signals and model of the DetailedApplicationView.
51 * This controller gets notified by the ScenarioListController when a scenario or application
52 * gets selected and displays it. It also starts and stops applications and scenarios using the Executor.
53 */
54 class DetailedApplicationController : public QObject
55 {
56 Q_OBJECT
57 public:
58 /**
59 * Constructor that optionally sets the parent object.
60 * @parent standard QT option to specify a parent
61 */
62 DetailedApplicationController(Exec::ExecutorPtr executor, QObject* parent = 0);
63
64 /**
65 * Destructor.
66 */
68
69 /**
70 * Sets the view this controller manages.
71 */
73
74 public slots:
75 /**
76 * Shows an ApplicationInstance in the DetailedApplicationView.
77 * @param application ApplicationInstance to show
78 */
80 ScenarioItem* item);
81
82 /**
83 * Shows an Application in the DetailedApplicationView.
84 * @param application Application to show
85 */
87
88 /**
89 * Shows a Scenario in the DetailedApplicationView.
90 * @param scenario Scenario to show
91 */
93
94 /**
95 * Shows a Package in the DetailedApplicationView.
96 * @param package Package to show
97 */
99
100 /**
101 * Shows the configuration of the current ApplicationInstance in the standard editor.
102 */
104
105 /**
106 * Sets a property of the current ApplicationInstance.
107 * @param name key of the property
108 * @param value new value of the property
109 */
110 void setProperty(std::string name, std::string value);
111
112 /**
113 * Starts the current ApplicationInstance.
114 */
115 void start();
116
117 /**
118 * Stops the current ApplicationInstance.
119 */
120 void stop();
121
122 /**
123 * Saves the configuration of the current ApplicationInstance to the config file.
124 */
125 void save();
126
127 /**
128 * Deletes a property off the configuration file of the current ApplicationInstance.
129 * @param name name of the property to be deleted
130 */
131 void deleteProperty(std::string name);
132
133 void showPropertyAddView();
134
135
136 /**
137 * @brief Set an IceAdmin for the controller. Needet to start an application via ice
138 * @param IceGrid::AdminPrx
139 */
140 void setIceAdmin(IceGrid::AdminPrx iceAdmin);
141
142 private:
143 void startScenario(ScenarioManager::Data_Structure::ScenarioPtr scenarioItem);
144 void showWarningDialog(QString message);
145
146 private:
147 Exec::ExecutorPtr executor;
148
149 bool showingStartable;
151 Data_Structure::ScenarioPtr currentScenario;
153 CreatePropertyView propertyAdderView;
154 IceGrid::AdminPrx iceAdmin;
155 };
156} // namespace ScenarioManager::Controller
View that shows detailed information about a Scenario, Package or Application.
TreeItem representing data contained in a Scenario or an Application.
void showApplication(Data_Structure::ApplicationPtr application)
Shows an Application in the DetailedApplicationView.
void showPackage(Data_Structure::PackagePtr package)
Shows a Package in the DetailedApplicationView.
void deleteProperty(std::string name)
Deletes a property off the configuration file of the current ApplicationInstance.
void setDetailedApplicationView(DetailedApplicationView *ptr)
Sets the view this controller manages.
DetailedApplicationController(Exec::ExecutorPtr executor, QObject *parent=0)
Constructor that optionally sets the parent object.
void setIceAdmin(IceGrid::AdminPrx iceAdmin)
Set an IceAdmin for the controller.
void showScenario(Data_Structure::ScenarioPtr scenario)
Shows a Scenario in the DetailedApplicationView.
void save()
Saves the configuration of the current ApplicationInstance to the config file.
void showInStandardEditor()
Shows the configuration of the current ApplicationInstance in the standard editor.
void setProperty(std::string name, std::string value)
Sets a property of the current ApplicationInstance.
void showApplicationInstance(Data_Structure::ApplicationInstancePtr application, ScenarioItem *item)
Shows an ApplicationInstance in the DetailedApplicationView.
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
std::shared_ptr< Executor > ExecutorPtr
Definition Executor.h:175