|
ifw-fcf
5.0.0-pre2
|
Class managing the interface with a FCF DevMgr. More...
Public Member Functions | |
| def | __init__ (self, uri, timeout=60000, setup_obj=None) |
| Class constructor. More... | |
| def | setup_json_string (self, json_str, keep=False) |
| Executes a Setup Command using a JSON string. More... | |
| def | setup_json_file (self, json_file, keep=False) |
| Executes a Setup Command using a JSON fiile. More... | |
| def | setup_spf (self, spf_str, keep=False) |
| Executes a Setup Command using a SPF string. More... | |
| def | devstatus (self, *argv) |
| Executes a DevStatus Command. More... | |
| def | recover (self) |
| Executes a Recover Command. More... | |
| def | devstatus_regex (self, pattern=None) |
| Executes a DevStatus Command and match output with a pattern. More... | |
| def | devnames (self) |
| Returns list of devices managed by the FCF Device Manager. More... | |
| def | devinfo (self) |
| Returns list of devices and type managed by the FCF Device Manager. More... | |
| def | devtype (self, name) |
| Returns type of a particular device. More... | |
| def | devconfig (self, name) |
| Returns server configuration of a particular device. More... | |
| def | ignore (self, *argv) |
| Set one or more devices in ignored. More... | |
| def | simulate (self, *argv) |
| Set one or more devices in simulation. More... | |
| def | stop_ignore (self, *argv) |
| Stop one or more devices from being ignored. More... | |
| def | stop_simulate (self, *argv) |
| Stop one or more devices from being simulated. More... | |
| def | hw_init (self, *argv) |
| Executes RPC Init in the PLC for the specified devices. More... | |
| def | hw_enable (self, *argv) |
| Executes RPC Enable in the PLC for the specified devices. More... | |
| def | hw_disable (self, *argv) |
| Executes RPC Disable in the PLC for the specified devices. More... | |
| def | hw_reset (self, *argv) |
| Executes RPC Reset in the PLC for the specified devices. More... | |
| def | get_config (self) |
| Returns server configuration. More... | |
| def | open (self, name) |
| Open a shutter device. More... | |
| def | close (self, name) |
| Close a shutter device. More... | |
| def | switch_on (self, name, intensity=100.0, timer=0) |
| Switch on a lamp or actuator device. More... | |
| def | switch_off (self, name) |
| Switch off a lamp or actuator device. More... | |
| def | move_by_name (self, name, namedpos) |
| Move a motor by named position. More... | |
| def | move_by_posangle (self, name, angle) |
| Move a derotator device to a position angle. More... | |
| def | move_piezo_in_user_units (self, name, pos1, pos2, pos3) |
| Move a piezo device in user units. More... | |
| def | move_piezo_in_bits (self, name, bit1, bit2, bit3) |
| Move a piezo device in user units. More... | |
| def | write_digital (self, name, channel, value) |
| Write a digital output signal handled by an IODev device. More... | |
| def | write_analog (self, name, channel, value) |
| Write a analog output signal handled by an IODev device. More... | |
| def | write_integer (self, name, channel, value) |
| Write a integer output value handled by an IODev device. More... | |
| def | move_by_speed (self, name, speed) |
| Move a motor by speed. More... | |
| def | move (self, name, pos, type="abs", unit="uu", aux_motor="") |
| Move a motor to a target position. More... | |
| def | start_track (self, name, mode="undef", angle=0.0) |
| Start tracking. More... | |
| def | track_offset (self, name, offset) |
| Offset position while tracking. More... | |
| def | stop_track (self, name) |
| Stop tracking. More... | |
| def | help (self, func=None) |
| Provides a text based help of the Command class functions. More... | |
Class managing the interface with a FCF DevMgr.
| def clib.devmgr_async_commands.DevmgrAsyncCommands.__init__ | ( | self, | |
| uri, | |||
timeout = 60000, |
|||
setup_obj = None |
|||
| ) |
Class constructor.
| uri | service URI (CII endpoint) in ms. timeout (bool, optional): CII communication timeout. setup_obj (object, optional): Setup object instance. |
If a setup object is not provided it will use an internal one. This setup object store all settings for the Setup command. It is not relevant for other commands.
| def clib.devmgr_async_commands.DevmgrAsyncCommands.close | ( | self, | |
| name | |||
| ) |
Close a shutter device.
| name | Device name (supported types: shutters) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.devconfig | ( | self, | |
| name | |||
| ) |
Returns server configuration of a particular device.
| name | Device name. |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.devinfo | ( | self | ) |
Returns list of devices and type managed by the FCF Device Manager.
| def clib.devmgr_async_commands.DevmgrAsyncCommands.devnames | ( | self | ) |
Returns list of devices managed by the FCF Device Manager.
| def clib.devmgr_async_commands.DevmgrAsyncCommands.devstatus | ( | self, | |
| * | argv | ||
| ) |
Executes a DevStatus Command.
argv(variable list): List of devices to inquire status.
It no devices are provided, the status will include all devices.
| def clib.devmgr_async_commands.DevmgrAsyncCommands.devstatus_regex | ( | self, | |
pattern = None |
|||
| ) |
Executes a DevStatus Command and match output with a pattern.
| pattern | Pattern to match with regular expression |
The server will deliver the status for all devices.
This method will filter the output according the pattern
| provided. |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.devtype | ( | self, | |
| name | |||
| ) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.get_config | ( | self | ) |
Returns server configuration.
| def clib.devmgr_async_commands.DevmgrAsyncCommands.help | ( | self, | |
func = None |
|||
| ) |
Provides a text based help of the Command class functions.
func (str, optional): Name of the function from where to get the help
This method is to be used for the implementation of CLIs.
Functions are methods of the class.
If the parameter <func> is not provided then the help provides a list of
functions. Functions started with '_' are skipped.
| def clib.devmgr_async_commands.DevmgrAsyncCommands.hw_disable | ( | self, | |
| * | argv | ||
| ) |
Executes RPC Disable in the PLC for the specified devices.
argv(variable list): List of devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.hw_enable | ( | self, | |
| * | argv | ||
| ) |
Executes RPC Enable in the PLC for the specified devices.
argv(variable list): List of devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.hw_init | ( | self, | |
| * | argv | ||
| ) |
Executes RPC Init in the PLC for the specified devices.
argv(variable list): List of devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.hw_reset | ( | self, | |
| * | argv | ||
| ) |
Executes RPC Reset in the PLC for the specified devices.
argv(variable list): List of devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.ignore | ( | self, | |
| * | argv | ||
| ) |
Set one or more devices in ignored.
argv (variable list): List of devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.move | ( | self, | |
| name, | |||
| pos, | |||
type = "abs", |
|||
unit = "uu", |
|||
aux_motor = "" |
|||
| ) |
Move a motor to a target position.
| name | Name of the device (supported types: motors, drots and ADCs) |
| pos | Target position where to move type (str, optional): Type of movement - absolute(abs) or relative(rel)) unit (str, optional): User units(uu) or encoders(enc) aux_motor (str, optional): Auxiliar motor name, only valid for ADCs |
For ADCs devices, the move will affect one of the ADC motors. This motor shall be specified by parameters aux_motor.
type and unit are lower insensitive, name is not.
| def clib.devmgr_async_commands.DevmgrAsyncCommands.move_by_name | ( | self, | |
| name, | |||
| namedpos | |||
| ) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.move_by_posangle | ( | self, | |
| name, | |||
| angle | |||
| ) |
Move a derotator device to a position angle.
| name | Device name (supported types: drots) |
| angle | Position angle. @warning: Only for standard derotator devices |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.move_by_speed | ( | self, | |
| name, | |||
| speed | |||
| ) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.move_piezo_in_bits | ( | self, | |
| name, | |||
| bit1, | |||
| bit2, | |||
| bit3 | |||
| ) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.move_piezo_in_user_units | ( | self, | |
| name, | |||
| pos1, | |||
| pos2, | |||
| pos3 | |||
| ) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.open | ( | self, | |
| name | |||
| ) |
Open a shutter device.
| name | Device name (supported types: shutters) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.recover | ( | self | ) |
Executes a Recover Command.
| def clib.devmgr_async_commands.DevmgrAsyncCommands.setup_json_file | ( | self, | |
| json_file, | |||
keep = False |
|||
| ) |
Executes a Setup Command using a JSON fiile.
| json_file | JSON filename with the setup information. keep (bool, optional): Internal flag to keep buffer object. |
It uses the JSON file to build the payload of the Setup
| command. |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.setup_json_string | ( | self, | |
| json_str, | |||
keep = False |
|||
| ) |
Executes a Setup Command using a JSON string.
| json_str | JSON string with the setup information, e.g. '[{"id": "shutter1", "param": { "shutter": {"action": "OPEN"}}}]'
|
It uses the JSON string to build the payload of the Setup
| command. |
remove quotes that may interfere with the parsing
| def clib.devmgr_async_commands.DevmgrAsyncCommands.setup_spf | ( | self, | |
| spf_str, | |||
keep = False |
|||
| ) |
Executes a Setup Command using a SPF string.
| spf_str | SPF string with the setup information, e.g. 'lamp1:action="ON",lamp1:intensity=70' keep (bool, optional): Internal flag to keep buffer object. |
It uses the SPF string to build the payload of the Setup
| command. |
remove quotes that may interfere with the parsing
| def clib.devmgr_async_commands.DevmgrAsyncCommands.simulate | ( | self, | |
| * | argv | ||
| ) |
Set one or more devices in simulation.
argv(variable list): List of devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.start_track | ( | self, | |
| name, | |||
mode = "undef", |
|||
angle = 0.0 |
|||
| ) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.stop_ignore | ( | self, | |
| * | argv | ||
| ) |
Stop one or more devices from being ignored.
argv(variable list): List of devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.stop_simulate | ( | self, | |
| * | argv | ||
| ) |
Stop one or more devices from being simulated.
argv(variable list): List of devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.stop_track | ( | self, | |
| name | |||
| ) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.switch_off | ( | self, | |
| name | |||
| ) |
Switch off a lamp or actuator device.
| name | Device name (supported types: lamps and actuators) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.switch_on | ( | self, | |
| name, | |||
intensity = 100.0, |
|||
timer = 0 |
|||
| ) |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.track_offset | ( | self, | |
| name, | |||
| offset | |||
| ) |
Offset position while tracking.
It the device is not tracking and error will be received.
| name | Name of the device (supported types: drots) |
| offset | Offset to be applied to the actual position |
| def clib.devmgr_async_commands.DevmgrAsyncCommands.write_analog | ( | self, | |
| name, | |||
| channel, | |||
| value | |||
| ) |
Write a analog output signal handled by an IODev device.
| name | Device name (supported types: iodev) |
| channel | Channel name as defined in the iodev configuration. |
| value | Signal value. |
@warning: Only for standard iodev devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.write_digital | ( | self, | |
| name, | |||
| channel, | |||
| value | |||
| ) |
Write a digital output signal handled by an IODev device.
| name | Device name (supported types: iodev) |
| channel | Channel name as defined in the iodev configuration. |
| value | Signal value. |
@warning: Only for standard iodev devices
| def clib.devmgr_async_commands.DevmgrAsyncCommands.write_integer | ( | self, | |
| name, | |||
| channel, | |||
| value | |||
| ) |
Write a integer output value handled by an IODev device.
| name | Device name (supported types: iodev) |
| channel | Channel name as defined in the iodev configuration. |
| value | Signal value. |
@warning: Only for standard iodev devices