Activity widget
Container widget for configuring the implementation widget.
ActivityContainerWidget
Bases: QWidget
, WidgetUi
Widget for configuring an activity.
Source code in src/cplus_plugin/gui/activity_widget.py
activities
Returns the user-defined activities in the activity view.
Returns:
Type | Description |
---|---|
list
|
User-defined activities for the current scenario. |
Source code in src/cplus_plugin/gui/activity_widget.py
is_activity_valid
Check if the user input is valid.
This checks if there is one activity defined with at least one NCS pathway under it.
Returns:
Type | Description |
---|---|
bool
|
True if the activity configuration is valid, else False at least until there is one implementation model defined with at least one NCS pathway under it. |
Source code in src/cplus_plugin/gui/activity_widget.py
is_ncs_valid
Checks whether the NCS pathways are valid against a given set of validation rules.
Returns:
Type | Description |
---|---|
bool
|
True if the NCS pathways are valid else False. |
Source code in src/cplus_plugin/gui/activity_widget.py
load
Load NCS pathways and activities to the views.
This function is idempotent as items will only be loaded once on initial call.
Source code in src/cplus_plugin/gui/activity_widget.py
ncs_pathways
Gets the NCS pathway objects in the NCS Pathways view.
Returns:
Type | Description |
---|---|
list
|
NCS pathway objects, both default and user-defined. |
Source code in src/cplus_plugin/gui/activity_widget.py
on_ncs_pathway_removed
Slot raised when an NCS pathway has been removed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ncs_pathway_uuid |
str
|
Unique identified of the removed NCS pathway item. |
required |
Source code in src/cplus_plugin/gui/activity_widget.py
on_ncs_pathway_updated
on_settings_changed
Slot raised when settings has been changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the setting that has changed. |
required |
value |
Any
|
New value for the given settings name. |
required |
Source code in src/cplus_plugin/gui/activity_widget.py
selected_activity_items
Returns the currently selected instances of activity items.
If an item is disabled then it will be excluded from the selection.
Returns:
Type | Description |
---|---|
list
|
Currently selected instances of ActivityItem or an empty list if there is no selection of activity items. |
Source code in src/cplus_plugin/gui/activity_widget.py
selected_items
Returns the selected model component item types which could be NCS pathway or activity items.
If an item is disabled then it will be excluded from the selection.
These are cloned objects so as not to interfere with the underlying data models when used for scenario analysis. Otherwise, one can also use the data models from the MVC item model.
Returns:
Type | Description |
---|---|
list
|
Selected model component items. |
Source code in src/cplus_plugin/gui/activity_widget.py
show_message
Shows message if message bar has been specified.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str
|
Text to display in the message bar. |
required |
level |
Qgis.MessageLevel
|
Message level type |
Warning
|