RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
gui.rtc_overview.RtcOverview Class Reference

RtcOverview Widget presents a list of RTC Components, based on the current deployment. More...

Inheritance diagram for gui.rtc_overview.RtcOverview:

Public Member Functions

 __init__ (self, parent=None)
 Initialise method for the RtcOverview widget.
 
 set_components (self, list components)
 Uses the components contents to create a new RtcComponent widget and add it to the QListWidget.
 
 components (self)
 Getter for the list of components.
 
 set_dd_components (self, list dd_components)
 Uses the components contents to create a new RtcComponent widget and add it to the QListWidget.
 
RtcComponent get_component_widget (self, str component_name)
 Returns the RtcComponent widget that corresponds to the component_name.
 
int get_component_widget_index (self, str component_name)
 Returns component widget index Used for test purposes.
 
int component_count (self)
 Returns the number of components in the list widget.
 
 set_deployment_control (self, deployment_control)
 Sets deployment control.
 
 set_cfg (self, cfg)
 Sets configuration.
 
 on_componentsListWidget_itemSelectionChanged (self)
 Handles the selection changes in the componentListWidget.
 
 setup_global_status_widget (self, sup_oldb_uri, sup_rr_uri)
 Aside from oldb_uri sets also rr_uri for Global Status widget so that Global Status may be retireved via polling.
 
 on_deployPushButton_clicked (self)
 When the Deploy Button is clicked, this Slot is called.
 
 on_undeployPushButton_clicked (self)
 When the Undeploy Button is clicked, this Slot is called.
 
 handle_component_started (self, object tag)
 Slot that handles the notification from DeploymentControl that a component has been successfully started.
 
 handle_component_stopped (self, object tag)
 Slot that handles the notification from DeploymentControl that a component has been successfully stopped.
 
 handle_component_start_failed (self, str msg, object tag=None)
 Slot that handles the notification from DeploymentControl that a component has failed to start.
 
 handle_component_stop_failed (self, str msg, object tag=None)
 Slot that handles the notification from DeploymentControl that a component has failed to stop.
 
 handle_supervisor_detected (self, sup_oldb_uri, sup_rr_uri)
 Reacts to a supervisor being detected through their available interfaces.
 

Public Attributes

 ui = Ui_RtcOverview()
 
list workers = []
 
int active_deployment_set_index = -1
 
 setup_global_status_widget
 
 handle_supervisor_detected
 
 handle_component_started = deployment_control
 
 handle_component_stopped
 
 set_dd_components
 

Static Public Attributes

 logs_requested = Signal(str)
 Signal that indicates that the component is requesting logs to be shown.
 
 start_requested = Signal((str,), (str, object))
 Signal that indicates that the component is requesting its process to be started.
 
 stop_requested = Signal((str,), (str, object))
 Signal that indicates that the component is requesting its process to be stopped.
 
 rr_connection_changed = Signal(bool)
 Current Component's Reply Request connection state has changed.
 
 components_changed = Signal(list)
 Signal that indicates component list have changed.
 
 custom_commands_uri_changed = Signal(str)
 Signal that communicates to the Custom Command widget the new URI.
 
 custom_commands_uri_removed = Signal(str)
 Signal that communicates to the Custom Command widget the removal of an URI.
 
 components
 Qt Property that holds the list of components.
 

Protected Member Functions

 _init_gui (self)
 In some cases, widgets are not ready for modification until init is done.
 
 _add_or_update_component_to_list (self, str name, str oldb_uri, str rr_uri, on_tasks_finished=None)
 Creates the new RtcComponent widget, and adds it to the QListWidget.
 
 _create_component (self, worker_thread, str name, str oldb_uri, str rr_uri)
 Creates component that is shown in componentsListWidget.
 
 _populate_components_list_widget (self, component)
 Creates component-based QListWidgetItem and adds it to componentsListWidget.
 
 _remove_components_not_in_list (self, list components)
 Removes the RtcComponents not present in the list from the RtcOverview widget.
 
 _on_dd_state_changed (self, current_state)
 Invoked regularly after clicking 'Deploy' button to track deployment state.
 
 _deployment_sets_changed (self, list deployment_sets)
 Adds deployment sets to combo box.
 
 _active_deployment_set_changed (self, str deployment_set)
 Set or unset active deployment set in combo box and enable/disable buttons.
 
 _deployment_daemon_disconnected (self)
 

Protected Attributes

 _logger = CiiLogManager.get_logger(__name__)
 
list _components = []
 
list _dd_components = []
 
 _previous_selected_widget = None
 
 _deployment_control = None
 
 _cfg = None
 
 _oldb_client = None
 
int _workers_finished = 0
 
int _workers_started = 0
 
 _poll_deployment_state = QTimer()
 
bool _deployment_in_progress = False
 
 _deployment_sets_changed
 
 _on_dd_state_changed = True
 

Detailed Description

RtcOverview Widget presents a list of RTC Components, based on the current deployment.

It is a specialization of a QListWidget, and uses the set_components() method to populate the list of RTC components.

Constructor & Destructor Documentation

◆ __init__()

gui.rtc_overview.RtcOverview.__init__ ( self,
parent = None )

Initialise method for the RtcOverview widget.

Parameters
parentParent widget reference, important when creating UIs

Member Function Documentation

◆ _active_deployment_set_changed()

gui.rtc_overview.RtcOverview._active_deployment_set_changed ( self,
str deployment_set )
protected

Set or unset active deployment set in combo box and enable/disable buttons.

◆ _add_or_update_component_to_list()

gui.rtc_overview.RtcOverview._add_or_update_component_to_list ( self,
str name,
str oldb_uri,
str rr_uri,
on_tasks_finished = None )
protected

Creates the new RtcComponent widget, and adds it to the QListWidget.

Parameters
nameA String that identifies the component.
oldb_uriThe OLDB URI prefix of the component.
rr_uriThe Request-Reply URI of the component.
on_tasks_finishedOptional signal to trigger when the creation is finished.

◆ _create_component()

gui.rtc_overview.RtcOverview._create_component ( self,
worker_thread,
str name,
str oldb_uri,
str rr_uri )
protected

Creates component that is shown in componentsListWidget.

The method is processed in separate thread to avoid GUI blocking when componentsListWidget is rebuilt.

Parameters
worker_threadA thread in which the method is processed.
nameA String that identifies the component.
oldb_uriThe OLDB URI prefix of the component.
rr_uriThe Request-Reply URI of the component.

◆ _deployment_daemon_disconnected()

gui.rtc_overview.RtcOverview._deployment_daemon_disconnected ( self)
protected

◆ _deployment_sets_changed()

gui.rtc_overview.RtcOverview._deployment_sets_changed ( self,
list deployment_sets )
protected

Adds deployment sets to combo box.

◆ _init_gui()

gui.rtc_overview.RtcOverview._init_gui ( self)
protected

In some cases, widgets are not ready for modification until init is done.

This can be workaround by invoking another method at the end of init.

◆ _on_dd_state_changed()

gui.rtc_overview.RtcOverview._on_dd_state_changed ( self,
current_state )
protected

Invoked regularly after clicking 'Deploy' button to track deployment state.

(We cannot rely on 'deploy' command finish because CII raises timeout error when in fact deployment is still in progress)

◆ _populate_components_list_widget()

gui.rtc_overview.RtcOverview._populate_components_list_widget ( self,
component )
protected

Creates component-based QListWidgetItem and adds it to componentsListWidget.

Parameters
componentA RTC component to be added to componentsListWidget

◆ _remove_components_not_in_list()

gui.rtc_overview.RtcOverview._remove_components_not_in_list ( self,
list components )
protected

Removes the RtcComponents not present in the list from the RtcOverview widget.

Parameters
componentsList of dictionary with the component information.

◆ component_count()

int gui.rtc_overview.RtcOverview.component_count ( self)

Returns the number of components in the list widget.

Returns
Number of components in the list widget

◆ components()

gui.rtc_overview.RtcOverview.components ( self)

Getter for the list of components.

◆ get_component_widget()

RtcComponent gui.rtc_overview.RtcOverview.get_component_widget ( self,
str component_name )

Returns the RtcComponent widget that corresponds to the component_name.

Parameters
component_nameString that identifies the component.
Returns
RtcComponent Widget of the component_name requested.

◆ get_component_widget_index()

int gui.rtc_overview.RtcOverview.get_component_widget_index ( self,
str component_name )

Returns component widget index Used for test purposes.

Parameters
component_nameString that identifies the component.
Returns
index Index value of requested component

◆ handle_component_start_failed()

gui.rtc_overview.RtcOverview.handle_component_start_failed ( self,
str msg,
object tag = None )

Slot that handles the notification from DeploymentControl that a component has failed to start.

Parameters
msgA String that gives a description of the problem.
tagA RtcComponent.TagRequest object. It carries the comp_name.

◆ handle_component_started()

gui.rtc_overview.RtcOverview.handle_component_started ( self,
object tag )

Slot that handles the notification from DeploymentControl that a component has been successfully started.

Parameters
tagA RtcComponent.TagRequest object. It carries the comp_name.

◆ handle_component_stop_failed()

gui.rtc_overview.RtcOverview.handle_component_stop_failed ( self,
str msg,
object tag = None )

Slot that handles the notification from DeploymentControl that a component has failed to stop.

Parameters
msgA String that gives a description of the problem.
tagA RtcComponent.TagRequest object. It carries the comp_name.

◆ handle_component_stopped()

gui.rtc_overview.RtcOverview.handle_component_stopped ( self,
object tag )

Slot that handles the notification from DeploymentControl that a component has been successfully stopped.

Parameters
tagA RtcComponent.TagRequest object. It carries the comp_name.

◆ handle_supervisor_detected()

gui.rtc_overview.RtcOverview.handle_supervisor_detected ( self,
sup_oldb_uri,
sup_rr_uri )

Reacts to a supervisor being detected through their available interfaces.

This method handles only moving the RTC Component widget in the RTC Overview to the top position.

Parameters
sup_oldb_uriRTC Supervisor OLDB Uri
sup_rr_uriRTC Supervisor RR Uri

◆ on_componentsListWidget_itemSelectionChanged()

gui.rtc_overview.RtcOverview.on_componentsListWidget_itemSelectionChanged ( self)

Handles the selection changes in the componentListWidget.

When the selection changes, the buttons for the RR methods need to be updated to indicate if they are available or not.

Also, since connection to the RTC Component MAL RR interface is async, we need to connect the current component state to the same groupbox, and disconnect all other components from it.

Note
This method uses auto-connection. The signal componentListWidget. itemSelectionChanged is automatically connected to this Slot during the init call to setupUi().

◆ on_deployPushButton_clicked()

gui.rtc_overview.RtcOverview.on_deployPushButton_clicked ( self)

When the Deploy Button is clicked, this Slot is called.

It determines which is the deployment set from the combo box that is currently selected, and requests the deployment daemon to be deployed.

Note
The clicked Signal from the deployPushButton is auto- connected to this Slot during the ui.setupUi() call in init

◆ on_undeployPushButton_clicked()

gui.rtc_overview.RtcOverview.on_undeployPushButton_clicked ( self)

When the Undeploy Button is clicked, this Slot is called.

It requests the deployment daemon to do undeploy of current deployment set.

Note
The clicked Signal from the deployPushButton is auto- connected to this Slot during the ui.setupUi() call in init

◆ set_cfg()

gui.rtc_overview.RtcOverview.set_cfg ( self,
cfg )

Sets configuration.

Parameters
cfgConfiguration to be set.

◆ set_components()

gui.rtc_overview.RtcOverview.set_components ( self,
list components )

Uses the components contents to create a new RtcComponent widget and add it to the QListWidget.

Parameters
componentsA python list that contains one dictionary per RTC Component.

◆ set_dd_components()

gui.rtc_overview.RtcOverview.set_dd_components ( self,
list dd_components )

Uses the components contents to create a new RtcComponent widget and add it to the QListWidget.

Parameters
dd_componentsA python list that contains one dictionary per RTC Component.

◆ set_deployment_control()

gui.rtc_overview.RtcOverview.set_deployment_control ( self,
deployment_control )

Sets deployment control.

Parameters
deployment_controlDeployment Control to be set.

◆ setup_global_status_widget()

gui.rtc_overview.RtcOverview.setup_global_status_widget ( self,
sup_oldb_uri,
sup_rr_uri )

Aside from oldb_uri sets also rr_uri for Global Status widget so that Global Status may be retireved via polling.

(The signal is emitted only when oldb_uri starts with 'file')

Parameters
sup_oldb_uriRTC Supervisor OLDB Uri
sup_rr_uriRTC Supervisor RR Uri

Member Data Documentation

◆ _cfg

gui.rtc_overview.RtcOverview._cfg = None
protected

◆ _components

list gui.rtc_overview.RtcOverview._components = []
protected

◆ _dd_components

list gui.rtc_overview.RtcOverview._dd_components = []
protected

◆ _deployment_control

gui.rtc_overview.RtcOverview._deployment_control = None
protected

◆ _deployment_in_progress

bool gui.rtc_overview.RtcOverview._deployment_in_progress = False
protected

◆ _deployment_sets_changed

gui.rtc_overview.RtcOverview._deployment_sets_changed
protected

◆ _logger

gui.rtc_overview.RtcOverview._logger = CiiLogManager.get_logger(__name__)
protected

◆ _oldb_client

gui.rtc_overview.RtcOverview._oldb_client = None
protected

◆ _on_dd_state_changed

gui.rtc_overview.RtcOverview._on_dd_state_changed = True
protected

◆ _poll_deployment_state

gui.rtc_overview.RtcOverview._poll_deployment_state = QTimer()
protected

◆ _previous_selected_widget

gui.rtc_overview.RtcOverview._previous_selected_widget = None
protected

◆ _workers_finished

int gui.rtc_overview.RtcOverview._workers_finished = 0
protected

◆ _workers_started

int gui.rtc_overview.RtcOverview._workers_started = 0
protected

◆ active_deployment_set_index

int gui.rtc_overview.RtcOverview.active_deployment_set_index = -1

◆ components

gui.rtc_overview.RtcOverview.components
static
Initial value:
= Property(
type=list,
fget=components,
fset=set_components,
notify=components_changed,
doc="List of components. Each component is a dictionary",
)

Qt Property that holds the list of components.

◆ components_changed

gui.rtc_overview.RtcOverview.components_changed = Signal(list)
static

Signal that indicates component list have changed.

◆ custom_commands_uri_changed

gui.rtc_overview.RtcOverview.custom_commands_uri_changed = Signal(str)
static

Signal that communicates to the Custom Command widget the new URI.

◆ custom_commands_uri_removed

gui.rtc_overview.RtcOverview.custom_commands_uri_removed = Signal(str)
static

Signal that communicates to the Custom Command widget the removal of an URI.

◆ handle_component_started

gui.rtc_overview.RtcOverview.handle_component_started = deployment_control

◆ handle_component_stopped

gui.rtc_overview.RtcOverview.handle_component_stopped

◆ handle_supervisor_detected

gui.rtc_overview.RtcOverview.handle_supervisor_detected

◆ logs_requested

gui.rtc_overview.RtcOverview.logs_requested = Signal(str)
static

Signal that indicates that the component is requesting logs to be shown.

◆ rr_connection_changed

gui.rtc_overview.RtcOverview.rr_connection_changed = Signal(bool)
static

Current Component's Reply Request connection state has changed.

◆ set_dd_components

gui.rtc_overview.RtcOverview.set_dd_components

◆ setup_global_status_widget

gui.rtc_overview.RtcOverview.setup_global_status_widget

◆ start_requested

gui.rtc_overview.RtcOverview.start_requested = Signal((str,), (str, object))
static

Signal that indicates that the component is requesting its process to be started.

◆ stop_requested

gui.rtc_overview.RtcOverview.stop_requested = Signal((str,), (str, object))
static

Signal that indicates that the component is requesting its process to be stopped.

◆ ui

gui.rtc_overview.RtcOverview.ui = Ui_RtcOverview()

◆ workers

list gui.rtc_overview.RtcOverview.workers = []

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