ScenarioListController Class Reference

Manages the signals and model of the ScenarioListView. All signals emitted by the ScenarioListView need to be connected to their corresponding slots in this controller. This controller periodically refreshes the status of the Applications and Scenarios displayed in the ScenarioListView. More...

#include <ArmarXGui/gui-plugins/ScenarioManager/controller/ScenarioListController.h>

+ Inheritance diagram for ScenarioListController:

Public Slots

void addApplicationsToScenario (QList< QPair< QString, ScenarioManager::Data_Structure::Application * > > applications, int row, const QModelIndex &parent)
 Adds applications to a scenario. More...
 
void createdScenario (std::string name, std::string package)
 Creates a new scenario in the package. More...
 
void createScenario ()
 Shows a view that allows the user to create a new Scenario. More...
 
void removeItem (QModelIndex item)
 Removes an item from the model. More...
 
void restart (int row, int column, QModelIndex parent)
 Restarts the object in the specified location. More...
 
void saveScenario (ScenarioManager::Data_Structure::ApplicationInstancePtr application)
 
void setIceAdmin (IceGrid::AdminPrx iceAdmin)
 Set an IceAdmin for the controller. More...
 
void showApplication (const QModelIndex &index)
 Calculates the object at the given index and signals to show it. More...
 
void start (int row, int column, QModelIndex parent, ScenarioStartModes mode)
 Starts or stops the object in the specified location. More...
 
void stop (int row, int column, QModelIndex parent)
 
void stopUpdateTask ()
 
void updateModel ()
 Updates the model by reloading all scenarios and applications. More...
 
void updateStati ()
 Updates the statuses of all Applications and Scenarios. More...
 
void updateStati (ApplicationInstanceStatusMap stati)
 

Signals

void applicationInstanceClicked (Data_Structure::ApplicationInstancePtr appInstance, ScenarioItem *item)
 Gets emitted after an ApplicationInstance has been clicked. More...
 
void modelUpdated (FilterableTreeModelSortFilterProxyModelPtr model)
 
void scenarioClicked (Data_Structure::ScenarioPtr scenario)
 Gets emitted after a Scenario has been clicked. More...
 
void statusFetched (ApplicationInstanceStatusMap stati)
 
void statusUpdated ()
 Gets emitted after changes have been made to the States of the Applications. More...
 
void updated ()
 Gets emitted after changes have been made to the data structure. More...
 

Public Member Functions

void fetchStati ()
 fetches application stati over their designated strategy. More...
 
FilterableTreeModelSortFilterProxyModelPtr getTreeModel ()
 Returns the model used by the ScenarioListView and managed by this controller. More...
 
 ScenarioListController (Data_Structure::PackageVectorPtr packages, Exec::ExecutorPtr executor, QObject *parent=0)
 Constructor which sets the data structure, the executor and optionally the parent object. More...
 
 ~ScenarioListController () override
 Destructor. More...
 
- Public Member Functions inherited from Logging
SpamFilterDataPtr deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
 disables the logging for the current line for the given amount of seconds. More...
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More...
 
void setTag (const LogTag &tag)
 
void setTag (const std::string &tagName)
 
virtual ~Logging ()
 

Static Public Member Functions

static bool StartScenario (ScenarioManager::Data_Structure::ScenarioPtr scenario, ScenarioStartModes mode, Exec::ExecutorPtr executor, IceGrid::AdminPrx iceAdmin)
 

Additional Inherited Members

- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtrgetLogSender () const
 Retrieve log sender. More...
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Detailed Description

Manages the signals and model of the ScenarioListView. All signals emitted by the ScenarioListView need to be connected to their corresponding slots in this controller. This controller periodically refreshes the status of the Applications and Scenarios displayed in the ScenarioListView.

Definition at line 57 of file ScenarioListController.h.

Constructor & Destructor Documentation

◆ ScenarioListController()

ScenarioListController ( Data_Structure::PackageVectorPtr  packages,
Exec::ExecutorPtr  executor,
QObject *  parent = 0 
)

Constructor which sets the data structure, the executor and optionally the parent object.

Parameters
packageslist of packages. Need to contain the Scenarios and Applications displayed in the ScenarioListView.
executorexecutor used to start, stop and update status of the Applications and Scenarios.
parentstandard QT option to specify a parent

Definition at line 55 of file ScenarioListController.cpp.

+ Here is the call graph for this function:

◆ ~ScenarioListController()

~ScenarioListController ( )
override

Destructor.

Definition at line 85 of file ScenarioListController.cpp.

Member Function Documentation

◆ addApplicationsToScenario

void addApplicationsToScenario ( QList< QPair< QString, ScenarioManager::Data_Structure::Application * > >  applications,
int  row,
const QModelIndex &  parent 
)
slot

Adds applications to a scenario.

Parameters
applicationslist of applications to be added
row
parentmodel-index of the scenario

Definition at line 283 of file ScenarioListController.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applicationInstanceClicked

void applicationInstanceClicked ( Data_Structure::ApplicationInstancePtr  appInstance,
ScenarioItem item 
)
signal

Gets emitted after an ApplicationInstance has been clicked.

Parameters
scenarioclicked ApplicationInstance
+ Here is the caller graph for this function:

◆ createdScenario

void createdScenario ( std::string  name,
std::string  package 
)
slot

Creates a new scenario in the package.

Parameters
namename of the new scenario
packagename of the package

Definition at line 557 of file ScenarioListController.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createScenario

void createScenario ( )
slot

Shows a view that allows the user to create a new Scenario.

This scenario will then be added to the data structure and models.

Definition at line 533 of file ScenarioListController.cpp.

+ Here is the call graph for this function:

◆ fetchStati()

void fetchStati ( )

fetches application stati over their designated strategy.

This is potentially slow and should not be done in the GUI thread.

Definition at line 834 of file ScenarioListController.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTreeModel()

Returns the model used by the ScenarioListView and managed by this controller.

Returns
managed model

Definition at line 90 of file ScenarioListController.cpp.

◆ modelUpdated

void modelUpdated ( FilterableTreeModelSortFilterProxyModelPtr  model)
signal

◆ removeItem

void removeItem ( QModelIndex  item)
slot

Removes an item from the model.

Can either be an ApplicationInstance or an Scenario

Parameters
indexof the model to be removed

Definition at line 456 of file ScenarioListController.cpp.

+ Here is the call graph for this function:

◆ restart

void restart ( int  row,
int  column,
QModelIndex  parent 
)
slot

Restarts the object in the specified location.

Parameters
rowrow the object is in
columncolumn the object is in
parentparent of the object. Needed to differentiate between scenarios and applications.
See also
start_stop(int row, int column, QModelIndex parent);

Definition at line 245 of file ScenarioListController.cpp.

+ Here is the call graph for this function:

◆ saveScenario

void saveScenario ( ScenarioManager::Data_Structure::ApplicationInstancePtr  application)
slot

Definition at line 1010 of file ScenarioListController.cpp.

+ Here is the call graph for this function:

◆ scenarioClicked

void scenarioClicked ( Data_Structure::ScenarioPtr  scenario)
signal

Gets emitted after a Scenario has been clicked.

Parameters
scenarioclicked Scenario
+ Here is the caller graph for this function:

◆ setIceAdmin

void setIceAdmin ( IceGrid::AdminPrx  iceAdmin)
slot

Set an IceAdmin for the controller.

Needet to start an application via ice

Parameters
IceGrid::AdminPrx

Definition at line 1029 of file ScenarioListController.cpp.

◆ showApplication

void showApplication ( const QModelIndex &  index)
slot

Calculates the object at the given index and signals to show it.

Parameters
indexindex of the object

Definition at line 613 of file ScenarioListController.cpp.

+ Here is the call graph for this function:

◆ start

void start ( int  row,
int  column,
QModelIndex  parent,
ScenarioStartModes  mode 
)
slot

Starts or stops the object in the specified location.

Parameters
rowrow the object is in
columncolumn the object is in
parentparent of the object. Needed to differentiate between scenarios and applications.

Definition at line 146 of file ScenarioListController.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartScenario()

bool StartScenario ( ScenarioManager::Data_Structure::ScenarioPtr  scenario,
ScenarioStartModes  mode,
Exec::ExecutorPtr  executor,
IceGrid::AdminPrx  iceAdmin 
)
static

Definition at line 858 of file ScenarioListController.cpp.

+ Here is the call graph for this function:

◆ statusFetched

void statusFetched ( ApplicationInstanceStatusMap  stati)
signal
+ Here is the caller graph for this function:

◆ statusUpdated

void statusUpdated ( )
signal

Gets emitted after changes have been made to the States of the Applications.

The DetailedApplicationView should update.

+ Here is the caller graph for this function:

◆ stop

void stop ( int  row,
int  column,
QModelIndex  parent 
)
slot

Definition at line 95 of file ScenarioListController.cpp.

+ Here is the call graph for this function:

◆ stopUpdateTask

void stopUpdateTask ( )
slot

Definition at line 141 of file ScenarioListController.cpp.

+ Here is the caller graph for this function:

◆ updated

void updated ( )
signal

Gets emitted after changes have been made to the data structure.

Other controllers should update their models.

+ Here is the caller graph for this function:

◆ updateModel

void updateModel ( )
slot

Updates the model by reloading all scenarios and applications.

Definition at line 654 of file ScenarioListController.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStati [1/2]

void updateStati ( )
slot

Updates the statuses of all Applications and Scenarios.

Definition at line 965 of file ScenarioListController.cpp.

+ Here is the caller graph for this function:

◆ updateStati [2/2]

void updateStati ( ApplicationInstanceStatusMap  stati)
slot

Definition at line 990 of file ScenarioListController.cpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: