mahos.inst.server.InstrumentServer#
- class mahos.inst.server.InstrumentServer(gconf: dict, name, context=None, include=None, exclude=None)#
Instrument RPC Server.
Provides RPC services for instruments. Communication is done by REQ/REP pattern. Multiple clients can use the resource. Each client can lock some instruments for exclusive procedure execution.
An
Instrument
config is defined underinstrument
dictionary in this node’s conf. The key of that is the instrument name, and value (dict) is instrument configuration. Following three keys are given in value (dict).module
: The module name holding the Instrument class. It must be an importable Python module, but leadingmahos.inst.
can be omitted if a submodule inmahos.inst
package is used.class
: The Instrument class name. The class must be an attribute of themodule
.conf
: The configuration dictionary for the Instrument (this is optional, but usually necessary).
An
InstrumentOverlay
config is defined underinstrument_overlay
dictionary in the conf. The key of that is the overlay name, and value (dict) is overlay configuration. Following three keys are given in value (dict).module
: The module name holding the InstrumentOverlay class. It must be an importable Python module, but leadingmahos.inst.overlay.
can be omitted if a submodule inmahos.inst.overlay
package is used.class
: The InstrumentOverlay class name. The class must be an attribute of themodule
.conf
: The configuration dictionary for the InstrumentOverlay. If a value in this dictionary is a string starting with$
, it is considered a reference to Instrument / InstrumentOverlay in this server. The overlay receives resolved value, i.e., an Instrument / InstrumentOverlay instance instead of a string.
- __init__(gconf: dict, name, context=None, include=None, exclude=None)#
Methods
__init__
(gconf, name[, context, include, ...])close_resources
()Close custom resources.
handle_req
(msg)main
()Main procedure that will be looped.
Attributes