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 | recover (self) |
Executes a Recover Command. More... | |
def | devstatus (self, *argv) |
Executes a DevStatus Command. More... | |
def | devstatus_regex (self, pattern=None) |
Executes a DevStatus Command and match output with a pattern. More... | |
def | devconfig (self, device) |
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 | devnames (self) |
Execute DevNames Command. More... | |
def | devinfo (self) |
Execute DevInfo Command. More... | |
def | devtype (self, name) |
Returns type of a particular device. More... | |
def | get_config (self) |
Execute GetConfig Command synchronously. More... | |
def | open (self, devname) |
Open a shutter device. More... | |
def | close (self, devname) |
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_commands.DevMgrCommands.__init__ | ( | self, | |
uri, | |||
timeout = 60000 , |
|||
setup_obj = None |
|||
) |
Class constructor.
uri | service URI (CII endpoint). timeout (bool, optional): CII communication timeout in ms. 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_commands.DevMgrCommands.close | ( | self, | |
devname | |||
) |
Close a shutter device.
name | Device name (supported types: shutters) |
def clib.devmgr_commands.DevMgrCommands.devconfig | ( | self, | |
device | |||
) |
Returns server configuration of a particular device.
name | Device name. |
def clib.devmgr_commands.DevMgrCommands.devinfo | ( | self | ) |
Execute DevInfo Command.
def clib.devmgr_commands.DevMgrCommands.devnames | ( | self | ) |
Execute DevNames Command.
def clib.devmgr_commands.DevMgrCommands.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_commands.DevMgrCommands.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_commands.DevMgrCommands.devtype | ( | self, | |
name | |||
) |
def clib.devmgr_commands.DevMgrCommands.get_config | ( | self | ) |
Execute GetConfig Command synchronously.
def clib.devmgr_commands.DevMgrCommands.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_commands.DevMgrCommands.hw_disable | ( | self, | |
* | argv | ||
) |
Executes RPC Disable in the PLC for the specified devices.
argv(variable list): List of devices
def clib.devmgr_commands.DevMgrCommands.hw_enable | ( | self, | |
* | argv | ||
) |
Executes RPC Enable in the PLC for the specified devices.
argv(variable list): List of devices
def clib.devmgr_commands.DevMgrCommands.hw_init | ( | self, | |
* | argv | ||
) |
Executes RPC Init in the PLC for the specified devices.
argv(variable list): List of devices
def clib.devmgr_commands.DevMgrCommands.hw_reset | ( | self, | |
* | argv | ||
) |
Executes RPC Reset in the PLC for the specified devices.
argv(variable list): List of devices
def clib.devmgr_commands.DevMgrCommands.ignore | ( | self, | |
* | argv | ||
) |
Set one or more devices in ignored.
argv (variable list): List of devices
def clib.devmgr_commands.DevMgrCommands.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_commands.DevMgrCommands.move_by_name | ( | self, | |
name, | |||
namedpos | |||
) |
def clib.devmgr_commands.DevMgrCommands.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_commands.DevMgrCommands.move_by_speed | ( | self, | |
name, | |||
speed | |||
) |
def clib.devmgr_commands.DevMgrCommands.move_piezo_in_bits | ( | self, | |
name, | |||
bit1, | |||
bit2, | |||
bit3 | |||
) |
def clib.devmgr_commands.DevMgrCommands.move_piezo_in_user_units | ( | self, | |
name, | |||
pos1, | |||
pos2, | |||
pos3 | |||
) |
def clib.devmgr_commands.DevMgrCommands.open | ( | self, | |
devname | |||
) |
Open a shutter device.
name | Device name (supported types: shutters) |
def clib.devmgr_commands.DevMgrCommands.recover | ( | self | ) |
Executes a Recover Command.
def clib.devmgr_commands.DevMgrCommands.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_commands.DevMgrCommands.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_commands.DevMgrCommands.simulate | ( | self, | |
* | argv | ||
) |
Set one or more devices in simulation.
argv(variable list): List of devices
def clib.devmgr_commands.DevMgrCommands.start_track | ( | self, | |
name, | |||
mode = "undef" , |
|||
angle = 0.0 |
|||
) |
def clib.devmgr_commands.DevMgrCommands.stop_ignore | ( | self, | |
* | argv | ||
) |
Stop one or more devices from being ignored.
argv(variable list): List of devices
def clib.devmgr_commands.DevMgrCommands.stop_simulate | ( | self, | |
* | argv | ||
) |
Stop one or more devices from being simulated.
argv(variable list): List of devices
def clib.devmgr_commands.DevMgrCommands.stop_track | ( | self, | |
name | |||
) |
def clib.devmgr_commands.DevMgrCommands.switch_off | ( | self, | |
name | |||
) |
Switch off a lamp or actuator device.
name | Device name (supported types: lamps and actuators) |
def clib.devmgr_commands.DevMgrCommands.switch_on | ( | self, | |
name, | |||
intensity = 100.0 , |
|||
timer = 0 |
|||
) |
def clib.devmgr_commands.DevMgrCommands.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_commands.DevMgrCommands.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_commands.DevMgrCommands.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_commands.DevMgrCommands.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