qtt.gui package

Created on Fri Sep 9 14:42:26 2016

@author: LocalAdmin

Submodules

qtt.gui.dataviewer module

class qtt.gui.dataviewer.DataViewer(data_directory=None, window_title='Data browser', default_parameter='amplitude', extensions=None, verbose=1)[source]

Bases: QMainWindow

clipboard_callback()[source]
combobox_callback(index)[source]
fill_item(item, value)[source]

recursive population of tree structure with a dict

static find_datafiles(datadir, extensions=None, show_progress=True)[source]

Find all datasets in a directory with a given extension

static get_data_info(metadata)[source]
get_plot_parameter()[source]

Return parameter to be plotted

static load_data(filename, tag)[source]
load_info()[source]
log_callback(index)[source]

Function called when. a log entry is selected

ppt_callback()[source]
reset_combo_items(data, keys)[source]
select_directory(index=0)[source]
selected_data_file()[source]

Return currently selected data file

set_data_directory(data_directory, index=0)[source]
show_help()[source]

Show help dialog

toggle_data_directory()[source]
update_logs(filter_str=None)[source]

Update the list of measurements

update_meta_tabs()[source]

Update metadata tree

update_plot(parameter)[source]

qtt.gui.live_plotting module

qtt.gui.live_plotting.LivePlotControl

alias of RdaControl

class qtt.gui.live_plotting.MeasurementControl(name='Measurement Control', rda_variable='qtt_abort_running_measurement', text_vars=[], **kwargs)[source]

Bases: QMainWindow

Simple control for running measurements

abort_measurements()[source]

Abort the current measurement

enable_measurements()[source]

Enable measurements

getAllValues()[source]

get all string values

getVal(tv)[source]

get text value

sendVal(tv)[source]

send text value

showHelpBox()[source]

Show help dialog

updateStatus()[source]
class qtt.gui.live_plotting.MockCallback_2d(*args: Any, **kwargs: Any)[source]

Bases: Instrument

class qtt.gui.live_plotting.RdaControl(name='LivePlot Control', boxes=['xrange', 'yrange', 'nx', 'ny'], **kwargs)[source]

Bases: QMainWindow

update_values()[source]
valueChanged(name, value)[source]
qtt.gui.live_plotting.getLivePlotWindow()[source]

Return handle to live plotting window

Returns:

handle to live plotting window

Return type:

None or object

class qtt.gui.live_plotting.livePlot(datafunction=None, sweepInstrument=None, sweepparams=None, sweepranges=None, alpha=0.3, verbose=1, show_controls=True, window_title='live view', plot_dimension=None, plot_title=None, is1dscan=None, **kwargs)[source]

Bases: QObject

Class to enable live plotting of data.

datafunction

the function to call for data acquisition

sweepInstrument

the instrument to which sweepparams belong

sweepparams

the parameter(s) being swept

sweepranges

the ranges over which sweepparams are being swept

Type:

list

verbose

output level of logging information

Type:

int

show_controls

show gui elements for control of the live plotting

Type:

bool

alpha

parameter (value between 0 and 1) which determines the weight given in averaging to the latest measurement result (alpha) and the previous measurement result (1-alpha), default value 0.3

Type:

float

close()[source]
crosshair(show=None, pos=None)[source]

Enable or disable crosshair

Parameters:
  • show (None, True or False) –

  • pos (None or position) –

enable_averaging(value)[source]

Enabling rolling average

enable_averaging_slot(*args, **kwargs)[source]

Update the averaging mode of the widget

sigMouseClicked
startreadout(callback=None, rate=30, maxidx=None)[source]
Parameters:
  • callback (None or method) – Method to call on update

  • rate (float) – sample rate in ms

  • maxidx (None or int) – Stop reading if the index is larger than the maxidx

stopreadout()[source]

Stop the readout loop

update(data=None, processevents=True)[source]
updatebg()[source]

Update function for the widget

Calls the datafunction() and update() function

class qtt.gui.live_plotting.rda_t(host: str = '127.0.0.1', port: int = 6379, password: str | None = None)[source]

Bases: object

get(key: str, default_value: Any | None = None) Any | None[source]

Get a value

Parameters:
  • key – value to be retrieved

  • default_value – value to return if the key is not present

Returns:

Value retrieved

get_float(key: str, default_value: float | None = None) float | None[source]

Get value by key and convert to a float

Parameters:
  • key – Key to retrieve

  • default_value – Value to return when the key is not present

Returns:

Value retrieved

get_int(key: str, default_value: int | None = None) int | None[source]

Get value by key and convert to an int

Parameters:
  • key – Key to retrieve

  • default_value – Value to return when the key is not present

Returns:

Value retrieved

set(key: str, value: Any)[source]

Set a value

Parameters:
  • key – key

  • value – the value to be set

qtt.gui.live_plotting.setupMeasurementWindows(station=None, create_parameter_widget=True, ilist=None, qtplot_remote=True)[source]

Create liveplot window and parameter widget (optional)

Parameters:
  • station (QCoDeS station) – station with instruments

  • create_parameter_widget (bool) – if True create ParameterWidget

  • ilist (None or list) – list of instruments to add to ParameterWidget

  • qtplot_remote (bool) – If True, then use remote plotting

Returns:

created gui objects

Return type:

dict

qtt.gui.live_plotting.start_measurement_control(doexec=False)[source]

Start measurement control GUI

Parameters:

doexec (bool) – if True run the event loop

qtt.gui.loggingGUI module

A GUI for multi-processing logging using ZMQ

Code is adapted from https://github.com/zeromq/pyzmq/blob/master/examples/logger/zmqlogger.py

Pieter Eendebak <pieter.eendebak@tno.nl>

qtt.gui.loggingGUI.installZMQlogger(port=5800, name=None, clear=True, level=None, logger=None)[source]

Add ZMQ logging handler to a Python logger

qtt.gui.loggingGUI.qt_logger(port, dlg, level=20, verbose=1)[source]
qtt.gui.loggingGUI.removeZMQlogger(name=None, verbose=0)[source]

Remove ZMQ logger from handlers

Parameters:
  • name (str or logger) –

  • verbose (int) –

qtt.gui.loggingGUI.start_logging_gui()[source]

Start logging GUI in the background

qtt.gui.loggingGUI.static_var(varname, value)[source]

Helper function to create a static variable

qtt.gui.loggingGUI.tprint(string, dt=1, output=False)[source]

Print progress of a loop every dt seconds

class qtt.gui.loggingGUI.zmqLoggingGUI(parent=None, extra_controls=False)[source]

Bases: QDialog

LOG_LEVELS = {10: 'debug', 20: 'info', 30: 'warning', 40: 'error', 50: 'critical'}
addMessage(msg, level=None)[source]

Add a message to the GUI list

addMessageSignal
clearMessages()[source]

Clear the messages in the logging window

close(self) bool[source]
closeEvent(self, a0: QCloseEvent)[source]
killPID()[source]

Clear the messages in the logging window

setLevel(boxidx)[source]
setup_monitor(port=5800)[source]

qtt.gui.parameterviewer module

Contains code for viewing Parameters in a gui window

class qtt.gui.parameterviewer.ParameterViewer(instruments: list, name: str = 'QuTech Parameter Viewer', fields: Sequence[str] = ('Value', 'unit'), **kwargs)[source]

Bases: QTreeWidget

Simple class to show qcodes parameters

close(self) bool[source]
initialize_viewer(instruments)[source]
is_running()[source]
setParamSingleStep(instr: str, param: str, value: Any)[source]

Set the default step size for a parameter in the viewer

Parameters:
  • instr (str) – instrument

  • param (str) – parameter of the instrument

  • value (float) – step size

setSingleStep(value: float, instrument_name: str | None = None)[source]

Set the default step size for all parameters in the viewer

Parameters:

value (float) – step size

set_column_sizehints(size_hints)[source]
set_parameter_properties(minimum_value=None, maximum_value=None, step_size=None)[source]

Set properties of the parameter viewer widget elements

set_window_name(name)[source]
stop()[source]

Stop readout of the parameters in the widget

update_field_signal
updatecallback(start: bool = True, dt: float = 3)[source]

Update the data and restarts timer

updatedata(force_update=False)[source]

Update data in viewer using station.snapshow

class qtt.gui.parameterviewer.QCodesTimer(callback_function, dt=2, **kwargs)[source]

Bases: Thread

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

stop()[source]
qtt.gui.parameterviewer.createParameterWidget(instruments, doexec=False, remote=False)[source]

Create a parameter widget

Parameters:
  • instruments (list) –

  • doexec (bool) – if True execute as a standalone Qt app

  • remote (bool) – if True, then start in a remote process. Note: this can only be used if all the Instruments are remote instruments.

qtt.gui.parameterviewer.createParameterWidgetRemote(instruments, doexec=True)[source]

Create a parameter widget in a remote process.

Note: this can only be used if all the Instruments are remote instruments.

qtt.gui.parameterviewer.isfloat(value)[source]