RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
gui.main_window.MainWindow Class Reference

The main GUI window class of the rtctkConfigTool. More...

Inheritance diagram for gui.main_window.MainWindow:

Public Member Functions

 __init__ (self, Operations operations, parent=None, *args, **kwargs)
 Initialise the main window object.
 
 persistent_repo_changed (self, start_index, end_index, roles)
 Qt slot that enables the commit button whenever the Persistent Configuration Repository model is changed.
 
 runtime_repo_changed (self, start_index, end_index, roles)
 Qt slot that enables the commit button whenever the Runtime Configuration Repository model is changed.
 
 on_actionReconnect_triggered (self)
 Closes the current connection to the Persistent and Runtime Configuration Repositories and connects to the repositories from scratch.
 
 on_actionExit_triggered (self)
 Method to handle menu exit from the application.
 
 on_actionValidate_triggered (self)
 Runs validation logic to check the structure and contents of the persistent configuration repository is correct.
 
 closeEvent (self, event)
 This method is called when a window is closed.
 
 __init__ (self, cfg, RtcDeploymentData deployment_data, RtcDeploymentControl deployment_control, OldbClient oldb, parent=None)
 Initializes the MainWindow object, and received the references to the required comms classes.
 
 on_rtcOverview_logs_requested (self, str comp_name)
 Slot the logs_requested signal from the RrtOverview widget.
 
 on_actionShowAllRTClogs_triggered (self)
 Slot that is executed from the menu entry Show All RTC Logs.
 
 closeEvent (self, event)
 We override the closeEvent.
 
 on_actionExit_triggered (self)
 Method to handle menu exit from the application.
 
 on_actionShowErrorDialogs_triggered (self, bool new_value)
 Matches the state of the QAction actionShowErrorDialogs that appears in the Menu of the application to the state of the global TaurusMessageBox.
 
 handle_protect_message_box_stateChanged (self, Qt.CheckState new_value)
 Matches the stateChanged signal from the global TaurusMessageBox to the QAction actionShowErrorDialogs that is part of the Menu of the application.
 
 setItemFactories (self, dict include=None, dict exclude=None)
 Sets and collects Item Factories plugins.
 
 handle_rtcOverview_uriChanged (self, str new_uri)
 Reacts to changes in the currently selected RTC Component.
 
 handle_rtcOverview_uri_removed (self, str uri)
 Reacts to removals from the RTC Component list.
 

Public Attributes

 ui = Ui_MainWindow()
 
 on_actionReconnect_triggered
 
 handle_rtcOverview_uriChanged
 
 handle_rtcOverview_uri_removed
 
 handle_protect_message_box_stateChanged = taurus.qt.qtgui.dialog.taurusmessagebox._PROTECT_MESSAGE_BOX
 

Protected Member Functions

 _setup_repositories (self)
 
 _init_gui (self)
 In some cases, widgets are not ready for modification until init is done.
 

Protected Attributes

 _runtime_repo_model = None
 
 _persistent_repo_model = None
 
 _operations = operations
 
 _logger = CiiLogManager.get_logger(__name__)
 
 _cfg = cfg
 
RtcDeploymentData _deployment_data = deployment_data
 
RtcDeploymentControl _deployment_control = deployment_control
 
OldbClient _oldb = oldb
 
dict _commands_uri_index_dict = {}
 
list _item_factories = []
 

Detailed Description

The main GUI window class of the rtctkConfigTool.

Implementation of the mainwindow.ui design.

It provides the logic for the widgets interactions, creates the comms objects, and forwards the calls to said comms classes.

Constructor & Destructor Documentation

◆ __init__() [1/2]

gui.main_window.MainWindow.__init__ ( self,
Operations operations,
parent = None,
* args,
** kwargs )

Initialise the main window object.

This will create the necessary user interface widgets, repository adapters and data model objects. The created data models are then attached to the view widgets and needed Qt signals connected.

Note
This class relies on the Operations class to manage configuration with its internal ConfigurationManager and to setup the repository adapters. An instance of Operations must be created and passed to this widget.
Parameters
operationsShould be an instance of the Operations class.
parentThe optional parent Qt widget object.
argsAdditional arguments passed to QMainWindow.
kwargsAdditional keyword arguments passed to QMainWindow.

◆ __init__() [2/2]

gui.main_window.MainWindow.__init__ ( self,
cfg,
RtcDeploymentData deployment_data,
RtcDeploymentControl deployment_control,
OldbClient oldb,
parent = None )

Initializes the MainWindow object, and received the references to the required comms classes.

Parameters
[in]cfgIt is used to access the Persistent Configuration.
[in]deployment_dataAn RtcDeploymentData realized class. It is used to query the RTC of the available components and their URIs.
[in]deployment_controlAn RtcDeploymentControl realised class. Used to start and stop RTC processes.
[in]oldbOLDB client
[in]parentReference of the parent widget. Needed by Qt.

Member Function Documentation

◆ _init_gui()

gui.main_window.MainWindow._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.

◆ _setup_repositories()

gui.main_window.MainWindow._setup_repositories ( self)
protected

◆ closeEvent() [1/2]

gui.main_window.MainWindow.closeEvent ( self,
event )

This method is called when a window is closed.

Here we execute whatever is needed to properly shutdown the application. At the end, call the parent's closeEvent in order to propagate the event.

Parameters
eventQEvent generated by Qt that informs the widget of the request to close it.

◆ closeEvent() [2/2]

gui.main_window.MainWindow.closeEvent ( self,
event )

We override the closeEvent.

This method is called when a window is closed. Here we execute whatever we need to nicely shutdown the application. At the end we call the parents closeEvent, in order to propagate the event.

Parameters
[in]eventQEvent generated by Qt that informs the widget of the request to close the widget.

◆ handle_protect_message_box_stateChanged()

gui.main_window.MainWindow.handle_protect_message_box_stateChanged ( self,
Qt.CheckState new_value )

Matches the stateChanged signal from the global TaurusMessageBox to the QAction actionShowErrorDialogs that is part of the Menu of the application.

Parameters
[in]new_valueChecked state (Qt.CheckState) from the TaurusMessageBox.

◆ handle_rtcOverview_uri_removed()

gui.main_window.MainWindow.handle_rtcOverview_uri_removed ( self,
str uri )

Reacts to removals from the RTC Component list.

Parameters
uriThe RR URI of the removed component.

◆ handle_rtcOverview_uriChanged()

gui.main_window.MainWindow.handle_rtcOverview_uriChanged ( self,
str new_uri )

Reacts to changes in the currently selected RTC Component.

Parameters
[in]new_uriThe RR URI of the selected component.

◆ on_actionExit_triggered() [1/2]

gui.main_window.MainWindow.on_actionExit_triggered ( self)

Method to handle menu exit from the application.

Instructs the application to close all its windows. Each window should implement proper shutdown procedures. In the case, this results in a forwarded call to the closeEvent() method that is overridden below.

Note
This method is auto-connected during the init call to self.ui.setupUi(self)

◆ on_actionExit_triggered() [2/2]

gui.main_window.MainWindow.on_actionExit_triggered ( self)

Method to handle menu exit from the application.

We instruct the application to close all its windows. Each window should implement proper shutdown procedures. In the case of this class (TaurusMainAppWindow), this results in a forwarded call to the closeEvent() method overridden below.

Note
This method is auto-connected during the init call to self.ui.setupUi(self)

◆ on_actionReconnect_triggered()

gui.main_window.MainWindow.on_actionReconnect_triggered ( self)

Closes the current connection to the Persistent and Runtime Configuration Repositories and connects to the repositories from scratch.

Note
This method is auto-connected during the init call to self.ui.setupUi(self)

◆ on_actionShowAllRTClogs_triggered()

gui.main_window.MainWindow.on_actionShowAllRTClogs_triggered ( self)

Slot that is executed from the menu entry Show All RTC Logs.

Note
This method is auto-connected during the init call to self.ui.setupUi(self)

◆ on_actionShowErrorDialogs_triggered()

gui.main_window.MainWindow.on_actionShowErrorDialogs_triggered ( self,
bool new_value )

Matches the state of the QAction actionShowErrorDialogs that appears in the Menu of the application to the state of the global TaurusMessageBox.

Parameters
[in]new_valueBoolean that indicates the new toggled state of the QAction.

◆ on_actionValidate_triggered()

gui.main_window.MainWindow.on_actionValidate_triggered ( self)

Runs validation logic to check the structure and contents of the persistent configuration repository is correct.

Note
This method is auto-connected during the init call to self.ui.setupUi(self)

◆ on_rtcOverview_logs_requested()

gui.main_window.MainWindow.on_rtcOverview_logs_requested ( self,
str comp_name )

Slot the logs_requested signal from the RrtOverview widget.

That signal is raised when a the LogsButton of a component is pressed. This slots will react by showing the logs associated to that component, raising the Logs Dock Widget, and changing the Logs Dock Widget title to show the name of the file.

If comp_name is empty, then it clears the logs widget.

Parameters
[in]comp_nameComponent name
Note
This method is auto-connected during the init call to self.ui.setupUi(self)

◆ persistent_repo_changed()

gui.main_window.MainWindow.persistent_repo_changed ( self,
start_index,
end_index,
roles )

Qt slot that enables the commit button whenever the Persistent Configuration Repository model is changed.

◆ runtime_repo_changed()

gui.main_window.MainWindow.runtime_repo_changed ( self,
start_index,
end_index,
roles )

Qt slot that enables the commit button whenever the Runtime Configuration Repository model is changed.

◆ setItemFactories()

gui.main_window.MainWindow.setItemFactories ( self,
dict include = None,
dict exclude = None )

Sets and collects Item Factories plugins.

Item Factories are plugins as defined in the Taurus Plugin documentation, for the taurus.form.item_factories python wheel entrypoint.

Parameters
[in]includeInclusion rules as defined in a dictionary.
[in]excludeExclusion rules as defined in a dictionary.

Member Data Documentation

◆ _cfg

gui.main_window.MainWindow._cfg = cfg
protected

◆ _commands_uri_index_dict

dict gui.main_window.MainWindow._commands_uri_index_dict = {}
protected

◆ _deployment_control

gui.main_window.MainWindow._deployment_control = deployment_control
protected

◆ _deployment_data

RtcDeploymentData gui.main_window.MainWindow._deployment_data = deployment_data
protected

◆ _item_factories

list gui.main_window.MainWindow._item_factories = []
protected

◆ _logger

gui.main_window.MainWindow._logger = CiiLogManager.get_logger(__name__)
protected

◆ _oldb

OldbClient gui.main_window.MainWindow._oldb = oldb
protected

◆ _operations

gui.main_window.MainWindow._operations = operations
protected

◆ _persistent_repo_model

gui.main_window.MainWindow._persistent_repo_model = None
protected

◆ _runtime_repo_model

gui.main_window.MainWindow._runtime_repo_model = None
protected

◆ handle_protect_message_box_stateChanged

gui.main_window.MainWindow.handle_protect_message_box_stateChanged = taurus.qt.qtgui.dialog.taurusmessagebox._PROTECT_MESSAGE_BOX

◆ handle_rtcOverview_uri_removed

gui.main_window.MainWindow.handle_rtcOverview_uri_removed

◆ handle_rtcOverview_uriChanged

gui.main_window.MainWindow.handle_rtcOverview_uriChanged

◆ on_actionReconnect_triggered

gui.main_window.MainWindow.on_actionReconnect_triggered

◆ ui

gui.main_window.MainWindow.ui = Ui_MainWindow()

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