instrumentserver.server.application#
Functions
|
|
|
|
|
Opens a dialog displaying an exception. |
|
|
|
Create a server gui window. |
Classes
|
Dialog asking the user for instrument type, instrument name and any args and kwargs for its creation. |
|
A detached version of the server gui. |
|
A simple client we can use to communicate with the server object inside the server application. |
|
Widget that is able to instantiate new instruments in the instrumentserver. |
|
Items used in the PossibleInstrumentDisplay. |
|
Widget that lists pre-set (either in the config or that the user adds programmatically) instruments to instantiate in the server. |
|
Main window of the qcodes station server. |
|
A widget that shows the status of the instrument server. |
|
A widget that displays all objects in a qcodes station. |
|
- class instrumentserver.server.application.CreateInstrumentDialog(insType: str | None = None, insName: str | None = None, kwargsStr: str | None = None, parent=None, flags=<PyQt5.QtCore.Qt.WindowFlags object>)[source]#
Bases:
BaseDialogDialog asking the user for instrument type, instrument name and any args and kwargs for its creation. You can pass any of the 3 fields to it to have those filled before the dialog appears.
- Parameters:
insType – Optional, The path to the instrument
insName – Optional, The name of the instrument
kwargsStr – Optional, String with te args and kwargs separated by commas.
- createInstrument#
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class instrumentserver.server.application.DetachedServerGui(host: str = 'localhost', port: int = 5555)[source]#
Bases:
QMainWindowA detached version of the server gui.
- class instrumentserver.server.application.EmbeddedClient(parent=None, host='localhost', port=5555, connect=True, timeout=5, raise_exceptions=True)[source]#
Bases:
QtClientA simple client we can use to communicate with the server object inside the server application.
- class instrumentserver.server.application.InstrumentsCreator(cli: Client, guiConfig: dict, *args, **kwargs)[source]#
Bases:
QWidgetWidget that is able to instantiate new instruments in the instrumentserver.
- Parameters:
cli – client used to communicate with the server.
guiConfig – The initial config of the station. This is used to know what instruments to add as potential display and keep track of new instruments being created to store their args and kwargs in case the user want to instantiate them again. Note that even though we pass the gui config around, it is the same object, meaning that when the main window updates the config, all of the configs get updated too.
stationServer – The station server. We just need to connect to some of the signals that it sends
- newInstrumentCreated#
Signal()– emitted when the InstrumentCreator creates a new signal. Used to close the creation instrument widget.
- newInstrumentFailed#
Signal() – emitted when the creator tried to create a new instrument but failed. Arguments – The str message of the error/reason as to why it could not create the instrument
- class instrumentserver.server.application.PossibleInstrumentDisplayItem(text, fullInsType, configName=None, lineEdit=None, *args, **kwargs)[source]#
Bases:
QTreeWidgetItemItems used in the PossibleInstrumentDisplay. Need to have a custom one to store extra info.
- class instrumentserver.server.application.PossibleInstrumentsDisplay(guiConfig: dict | None = None, *args)[source]#
Bases:
QTreeWidgetWidget that lists pre-set (either in the config or that the user adds programmatically) instruments to instantiate in the server.
In it you can change the name of the new instances of instruments but the arguments are already pre-set either in the config or are the original args and kwargs passed when the instrument was created.
- addInstrumentToTree(fullInsType: str = 'InstrumentType', insName: str = 'MyInstrument', configName: str | None = None)[source]#
Each type is grouped together under a parent item of that type. If that parent item does not exist yet it creates it
- basedInstrumentRequested#
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- cols = ['Instrument Type & Preset', 'Instrument Name', 'Create Instrument']#
- createButtonPressed#
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class instrumentserver.server.application.ServerGui(startServer: bool | None = True, guiConfig: dict | None = None, **serverKwargs: Any)[source]#
Bases:
QMainWindowMain window of the qcodes station server.
- addInstrumentTab(item: QTreeWidgetItem, index: int)[source]#
- Gets called when the user double clicks and item of the instrument list.
Adds a new generic instrument GUI window to the tab bar. If the tab already exists switches to that one.
- addInstrumentToGui(instrumentBluePrint: InstrumentModuleBluePrint, insArgs, insKwargs)[source]#
Add an instrument to the station list.
If the guiConfig does not have an instrument with that name, it adds it.
- loadParamsFromFile()[source]#
Load the values of all parameters present in the server’s params json file to parameters registered in the station (incl those in instruments).
- refreshStationComponents()[source]#
Clear and re-populate the widget holding the station components, using the objects that are currently registered in the station.
- saveParamsToFile()[source]#
Save the values of all parameters registered in the station (incl those in instruments) to the server’s param json file.
- serverPortSet#
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class instrumentserver.server.application.ServerStatus(parent=None)[source]#
Bases:
QWidgetA widget that shows the status of the instrument server.
- class instrumentserver.server.application.StationList(parent=None)[source]#
Bases:
QTreeWidgetA widget that displays all objects in a qcodes station.
- addInstrument(bp: InstrumentModuleBluePrint)[source]#
- closeRequested#
Signal(str) – emitted when the user requested closing an instrument Argument is the name of the instrument that should be closed
- cols = ['Name', 'Type']#
- componentSelected#
Signal(str) – emitted when a parameter or Instrument is selected. Argument is the name of the selected instrument
- class instrumentserver.server.application.StationObjectInfo(parent=None)[source]#
Bases:
QTextEdit- setObject(bp: InstrumentModuleBluePrint)[source]#
- instrumentserver.server.application.bluePrintToHtml(bp: ParameterBluePrint | InstrumentModuleBluePrint)[source]#
- instrumentserver.server.application.instrumentToHtml(bp: InstrumentModuleBluePrint)[source]#
- instrumentserver.server.application.onExceptionDialog(exception: str)[source]#
Opens a dialog displaying an exception.
- Parameters:
exception – The text the dialog will show
- instrumentserver.server.application.parameterToHtml(bp: ParameterBluePrint, headerLevel=None)[source]#