srsgui.ui package

srsgui.ui.taskmain module

class srsgui.ui.taskmain.TaskMain(parent=None)

Bases: QMainWindow, Ui_TaskMain

The main window of the SRSGUI application

DefaultConfigFile = '/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/srsgui/examples/oscilloscope example/oscilloscope example project.taskconfig'
OrganizationName = 'srsinst'
ApplicationName = 'srsgui'
LogoImageFile = 'srslogo.jpg'
LogoFile = '/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/srsgui/ui/srslogo.jpg'
DocsSuffix = ' documentation'
TextAbout = 'About'
load_tasks()
Load configuration info from a .taskconfig file specified from
  1. Command line argument

  2. Settings saved in the registry

  3. Application default .taskconfig file

print_redirect(text)

Handles text output for stdout, stderr and various text output from srsgui.task.task.Task

onTaskStarted()
onTaskFinished()
is_task_running()

Check if a task is running

update_figure(figure)

Handle figure update request from a task

onTaskSelect(action)
onRun()
onStop()
onOpen()
onInstrumentSelect(inst_action)
onConnect(inst_name)
onDisconnect(inst_name)
display_question(question, return_type=<class 'bool'>)

Slot to handle a question from the Task.ask_question

okToContinue()

Check if ok to quit the application.

closeEvent(event)

Override the default closeEvent handler

get_logo_file()
handle_initial_image(task_class)
onHelp(help_action)
onAbout()
load_settings()

Load settings from the registry

save_settings()

Save settings to the registry

staticMetaObject = <PySide2.QtCore.QMetaObject object>

srsgui.ui.connectdlg module

class srsgui.ui.connectdlg.ConnectDlg(inst, parent=None)

Bases: QDialog

  • To build the connection dialog box based on available_interface of subclasses of srsgui.inst.instrument.Instrument class listed in the current .taskconfig file.

  • To connect to the selected interface of the instrument.

create_tab(parameters)
create_input_widget(input_item)
accept(self) None
save_settings()
load_setting()
staticMetaObject = <PySide2.QtCore.QMetaObject object>

srsgui.ui.commandterminal module

class srsgui.ui.commandterminal.CommandTerminal(parent)

Bases: QFrame

Terminal to control instruments defined in the .taskconfig file

Type a command in one of the following ways:

  • inst_name:remote_command

    ‘inst_name’ is the first item after the prefix “inst:” in a line in the .taskconfig file. ‘Remote_command’ after the colon is a raw remote command of the instrument. Terminals send the ‘remote_command’ directly to the instrument ‘inst_name’, and display a reply if the instrument sends one back.

    dut:*idn?

    dut:mi10 - This is a RGA100 command to set scan initial mass to 10

  • inst_name.instrument_command

    When you use .before a command, the command is interpreted as a Python instrument command or a method defined in the Instrument subclass, which is the third item in the line starting with ‘inst:’ used in .taskconfig file.

    inst_name.(components.)dir - it shows all available components, commands, and methods in the instrument or its component as a Python dictionary.

    rga.dir

    rga.status.dir

    rga.status.id_string - this returns the id string. It is a Python instrument command defined in the rga.status component. rga.scan.initial_mass = 10 - this changes the scan initial mass to 10. rga.scan.get_analog_scan() - this is a method defined in the rga.scan component.

    With the prefix of ‘inst_name:’ or ‘inst_name.’, you can specify which instrument receive the following command, as either a raw remote command or a instrument command defined in a Instrument subclass.

  • command

    if you type a command without ‘inst_name.’ or ‘inst_name:’, the command goes to the first instrument in the .taskconfig file. A command with dot(s) is interpreted as a Python instrument command or a method. A command without any dot will be sent directly to the first instrument in the .taskconfig file as a raw remote command.

command_requested
setup_widget()

Set up the terminal widget

on_clear()

When ‘Clear’ button is pressed, the terminal display and command input line is cleared.

on_up_pressed()

When the keyboard UP arrow key is pressed, the previous command in the history is displayed in the command input line.

on_down_pressed()

When the keyboard DOWN arrow key is pressed, the next command in the history is displayed in the command input line.

on_send()

When the Send button is pressed, send the command in the command input line to the instrument.

handle_command(cmd, reply)

Display the processed command to the terminal display

staticMetaObject = <PySide2.QtCore.QMetaObject object>

srsgui.ui.deviceinfohandler module

class srsgui.ui.deviceinfohandler.DeviceInfoHandler(parent)

Bases: object

To handle the instrument info tab widget

select_browser(inst_name)

Set parent.deviceInfo browser to the tab associated with the name

update_info(inst_name)
update_tabs()

Update tabs in sync with inst_dict

add_tab(name)

Add a new tab at the end

remove_tab()

Remove the last tab

srsgui.ui.dockhandler module

class srsgui.ui.dockhandler.DockHandler(parent)

Bases: object

To handle all the QDockWidget instances used for the console, terminal, matplotlib figure windows, along with the Docks menu in the main application.

DefaultConsoleName = 'Console'
DefaultTerminalName = 'Terminal'
DefaultFigureName = 'plot'
MenuDocksName = 'menu_Docks'
MenuPlotName = 'menu_Plot'
TitleFormat = '{} - Capture'
init_plot_menu()
onTightLayout()
onToolbar()
init_console()
init_terminal()
init_inst_dock(name)
static setup_figure_canvas(widget: QDockWidget)
init_figure_dock(name)
display_image(image_file, figure=None)
get_terminal()
get_figure(name=None) Figure
set_figure_update_period(period)
get_figure_update_period()
update_figure(figure: Figure)
get_dock(name=None) QDockWidget
onMenuDocksSelected(action)
reset_inst_docks()
reset_figures(name_list)
update_menu()
get_figure_dict()
clear_figures(name=None)
show_toolbar(state=True)
stop_command_handlers()

srsgui.ui.inputpanel module

class srsgui.ui.inputpanel.InputPanel(task_class: Task, parent)

Bases: QScrollArea

To build the input panel in an instance of TaskMain class based on input_parameters in a subclass of Task class

FirstColumn = 0
SecondColumn = 1
update(self) None
update(self, arg__1: PySide2.QtCore.QRect) None
update(self, arg__1: PySide2.QtGui.QRegion) None
update(self, x: int, y: int, w: int, h: int) None
on_default()
on_apply()
handle_reply(cmd, reply)
get_cmd_instance(cmd_input)

Find the command instance in CommandInput from cmd_name

staticMetaObject = <PySide2.QtCore.QMetaObject object>

srsgui.ui.qtloghandler module

class srsgui.ui.qtloghandler.QtLogHandler(text_browser)

Bases: Handler

Subclass logging.Handler to be used with QTextBrowser widget.

class SignalObject

Bases: QObject

new_message
staticMetaObject = <PySide2.QtCore.QMetaObject object>
emit(record)

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

append(message)

srsgui.ui.signalhandler module

class srsgui.ui.signalhandler.SignalHandler(parent)

Bases: QObject, Callbacks

Subclass to override srsgui.task.callbacks.Callbacks class. It implements Callbacks base methods to utilize I/O methods provided in srsgui.ui.taskmain.

sig_started
sig_finished
sig_text_available
sig_parameter_changed
sig_figure_update_requested
sig_data_available
sig_new_question
signals = [<PySide2.QtCore.Signal object>, <PySide2.QtCore.Signal object>, <PySide2.QtCore.Signal object>, <PySide2.QtCore.Signal object>, <PySide2.QtCore.Signal object>, <PySide2.QtCore.Signal object>, <PySide2.QtCore.Signal object>]
started()
finished()
text_available(text: str)
parameter_changed()

Override to do something when a parameter in input_parameters is changed

figure_update_requested(fig: Figure)
data_available(data: dict)
new_question(question: str, return_type: object)
disconnect_all()
staticMetaObject = <PySide2.QtCore.QMetaObject object>

srsgui.ui.stdout module

class srsgui.ui.stdout.StdOut(output_function, parent=None)

Bases: QObject

Redirect the system standard output and standard error output to the output_function in __init__(). It is instantiated with srsgui.ui.taskmain.TaskMain.print_redirect() for the main application.

textWritten
write(text)
flush()
staticMetaObject = <PySide2.QtCore.QMetaObject object>