instrumentserver.gui.instruments#

Classes

AddParameterWidget([parent, typeInput])

A widget that allows parameter creation.

GenericInstrument(ins[, parent])

Widget that allows the display of real time parameters and changing their values.

InstrumentMethods(instrument, **kwargs)

InstrumentParameters(instrument, parent, ...)

ItemParameters([unit])

MethodDisplay(fun[, fullName])

MethodsDelegate([parent])

MethodsModel(*args, **kwargs)

MethodsTreeView(model, *args, **kwargs)

ModelParameters(*args, **kwargs)

ParameterDelegate([parent])

The delegate for the InstrumentParameters widget.

ParameterDeleteDelegate([parent])

ParameterManagerGui(instrument[, parent])

ParameterManagerTreeView(model, *args, **kwargs)

ParametersTreeView(model, *args, **kwargs)

ProfilesManager(*args, **kwargs)

class instrumentserver.gui.instruments.AddParameterWidget(parent: QWidget | None = None, typeInput: bool = False)[source]#

Bases: QWidget

A widget that allows parameter creation.

Parameters:
  • parent – parent widget

  • typeInput – if True, add input fields for creating a value validator.

clear() None[source]#
clearError() None[source]#
invalidParamRequested#

Signal(str)

newParamRequested#

Signal(str, str, str, ParameterTypes, str)

requestNewParameter(_: bool) None[source]#
setError(message: str) None[source]#
class instrumentserver.gui.instruments.GenericInstrument(ins: ProxyInstrumentModule | Instrument, parent: QWidget | None = None, **modelKwargs: Any)[source]#

Bases: QWidget

Widget that allows the display of real time parameters and changing their values.

closeEvent(event: QCloseEvent) None[source]#

Stop the parameter subscriber thread before destruction.

class instrumentserver.gui.instruments.InstrumentMethods(instrument: Any, **kwargs: Any)[source]#

Bases: InstrumentDisplayBase

connectSignals() None[source]#

Connects all the signals to slots of different classes. Override to add more signals

class instrumentserver.gui.instruments.InstrumentParameters(instrument: Any, parent: QWidget | None = None, viewType: type = <class 'instrumentserver.gui.instruments.ParametersTreeView'>, callSignals: bool = True, **kwargs: Any)[source]#

Bases: InstrumentDisplayBase

connectSignals() None[source]#

Connects all the signals to slots of different classes. Override to add more signals

class instrumentserver.gui.instruments.ItemParameters(unit: str = '', **kwargs: Any)[source]#

Bases: ItemBase

class instrumentserver.gui.instruments.MethodDisplay(fun: Callable, fullName: str | None = None, *args: Any, **kwargs: Any)[source]#

Bases: QWidget

classmethod getTooltipFromFun(fun: Callable) str[source]#

Returns the signature of the function with its documentation underneath.

runFailed#

Signal(str) emitted when the widget runs a function and fails. Emits the exception as a string.

runFun() None[source]#
runSuccessful#

Signal(str) emitted when the widget runs a function and is successful. Emits the return value as a string.

class instrumentserver.gui.instruments.MethodsDelegate(parent: QObject | None = None)[source]#

Bases: DelegateBase

createEditor(self, parent: QWidget | None, option: QStyleOptionViewItem, index: QModelIndex) QWidget | None[source]#
methods: Dict[str, MethodDisplay]#
class instrumentserver.gui.instruments.MethodsModel(*args: Any, **kwargs: Any)[source]#

Bases: InstrumentModelBase

insertItemTo(parent: QStandardItem, item: QStandardItem) None[source]#

This is the only function that actually inserts items into the model. Overload for models that utilize more columns. Don’t call directly

If you are using delegates, this function should emit the newItem signal

class instrumentserver.gui.instruments.MethodsTreeView(model: QAbstractItemModel, *args: Any, **kwargs: Any)[source]#

Bases: InstrumentTreeViewBase

class instrumentserver.gui.instruments.ModelParameters(*args: Any, **kwargs: Any)[source]#

Bases: InstrumentModelBase

insertItemTo(parent: QStandardItem, item: QStandardItem) None[source]#

This is the only function that actually inserts items into the model. Overload for models that utilize more columns. Don’t call directly

If you are using delegates, this function should emit the newItem signal

itemNewValue#

Emitted when an item in the model has received a new value, first object is the item’s name, second object is its new value

Type:

Signal(item, object)

stopListener() None[source]#

Stop the background listener thread and wait for it to exit.

updateParameter(bp: ParameterBroadcastBluePrint) None[source]#
class instrumentserver.gui.instruments.ParameterDelegate(parent: QObject | None = None)[source]#

Bases: DelegateBase

The delegate for the InstrumentParameters widget.

createEditor(widget: QWidget, option: QStyleOptionViewItem, index: QModelIndex) QWidget[source]#

This is the function that is supposed to create the widget. It should return it.

parameters: Dict[str, QWidget]#
class instrumentserver.gui.instruments.ParameterDeleteDelegate(parent: QObject | None = None)[source]#

Bases: ParameterDelegate

createEditor(widget: QWidget, option: QStyleOptionViewItem, index: QModelIndex) QWidget[source]#

This is the function that is supposed to create the widget. It should return it.

makeRemoveWidget(fullName: str, widget: QWidget) QPushButton[source]#
removeParameter#

Signal(str) Emits the name of the parameter to be deleted when the user presses the delete button.

class instrumentserver.gui.instruments.ParameterManagerGui(instrument: ProxyInstrumentModule | ParameterManager, parent: QWidget | None = None, **kwargs: Any)[source]#

Bases: InstrumentParameters

addParameter(fullName: str, value: Any, unit: str) None[source]#
connectSignals() None[source]#

Connects all the signals to slots of different classes. Override to add more signals

loadFromFile(loadFile: str | None = None) None[source]#
loadProfile() None[source]#
makeToolbar() QToolBar[source]#

Creates the toolbar, override to add more buttons to the toolbar.

parameterCreated#

Signal() – emitted when a parameter was created successfully

parameterCreationError#

Signal(str) – emitted when there’s an error during parameter creation.

refreshAll() None[source]#
removeParameter(fullName: str) None[source]#
saveToFile() None[source]#
class instrumentserver.gui.instruments.ParameterManagerTreeView(model: QAbstractItemModel, *args: Any, **kwargs: Any)[source]#

Bases: InstrumentTreeViewBase

onItemNewValue(itemName: str, value: Any) None[source]#
class instrumentserver.gui.instruments.ParametersTreeView(model: QAbstractItemModel, *args: Any, **kwargs: Any)[source]#

Bases: InstrumentTreeViewBase

onItemNewValue(itemName: str, value: Any) None[source]#
class instrumentserver.gui.instruments.ProfilesManager(*args: Any, **kwargs: Any)[source]#

Bases: QComboBox

indexChanged#

Signal() Emitted when the selected index changed.

onCurrentIndexChanged(index: int) None[source]#
refresh() None[source]#