ifw-fcf  5.0.0-pre2
Public Member Functions | List of all members
clib.devmgr_commands.DevMgrCommands Class Reference

Class managing the interface with a FCF DevMgr. More...

Inheritance diagram for clib.devmgr_commands.DevMgrCommands:

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...
 

Detailed Description

Class managing the interface with a FCF DevMgr.

Constructor & Destructor Documentation

◆ __init__()

def clib.devmgr_commands.DevMgrCommands.__init__ (   self,
  uri,
  timeout = 60000,
  setup_obj = None 
)

Class constructor.

Parameters
uriservice 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.

Member Function Documentation

◆ close()

def clib.devmgr_commands.DevMgrCommands.close (   self,
  devname 
)

Close a shutter device.

Parameters
nameDevice name (supported types: shutters)

◆ devconfig()

def clib.devmgr_commands.DevMgrCommands.devconfig (   self,
  device 
)

Returns server configuration of a particular device.

Parameters
nameDevice name.
Returns
Configuration of the device

◆ devinfo()

def clib.devmgr_commands.DevMgrCommands.devinfo (   self)

Execute DevInfo Command.

◆ devnames()

def clib.devmgr_commands.DevMgrCommands.devnames (   self)

Execute DevNames Command.

◆ devstatus()

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.

◆ devstatus_regex()

def clib.devmgr_commands.DevMgrCommands.devstatus_regex (   self,
  pattern = None 
)

Executes a DevStatus Command and match output with a pattern.

Parameters
patternPattern to match with regular expression
    The server will deliver the status for all devices.
    This method will filter the output according the pattern
Parameters
provided.

◆ devtype()

def clib.devmgr_commands.DevMgrCommands.devtype (   self,
  name 
)

Returns type of a particular device.

Parameters
nameDevice name.
Returns
Type of the device

◆ get_config()

def clib.devmgr_commands.DevMgrCommands.get_config (   self)

Execute GetConfig Command synchronously.

◆ help()

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.

◆ hw_disable()

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

◆ hw_enable()

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

◆ hw_init()

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

◆ hw_reset()

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

◆ ignore()

def clib.devmgr_commands.DevMgrCommands.ignore (   self,
argv 
)

Set one or more devices in ignored.

        argv (variable list):  List of devices

◆ move()

def clib.devmgr_commands.DevMgrCommands.move (   self,
  name,
  pos,
  type = "abs",
  unit = "uu",
  aux_motor = "" 
)

Move a motor to a target position.

Parameters
nameName of the device (supported types: motors, drots and ADCs)
posTarget 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.

◆ move_by_name()

def clib.devmgr_commands.DevMgrCommands.move_by_name (   self,
  name,
  namedpos 
)

Move a motor by named position.

Parameters
nameDevice name (supported types: motors and piezos)
namedposMotor named position.

◆ move_by_posangle()

def clib.devmgr_commands.DevMgrCommands.move_by_posangle (   self,
  name,
  angle 
)

Move a derotator device to a position angle.

Parameters
nameDevice name (supported types: drots)
anglePosition angle.
   @warning: Only for standard derotator devices

◆ move_by_speed()

def clib.devmgr_commands.DevMgrCommands.move_by_speed (   self,
  name,
  speed 
)

Move a motor by speed.

Parameters
nameDevice name (supported types: motors and drots)
speedMotor speed.

◆ move_piezo_in_bits()

def clib.devmgr_commands.DevMgrCommands.move_piezo_in_bits (   self,
  name,
  bit1,
  bit2,
  bit3 
)

Move a piezo device in user units.

Parameters
nameDevice name (supported types: piezos)
bit1Piezo position axis 1 in bits.
bit2Piezo position axis 2 in bits.
bit3Piezo position axis 3 in bits.
   @warning: Only for standard piezo devices

◆ move_piezo_in_user_units()

def clib.devmgr_commands.DevMgrCommands.move_piezo_in_user_units (   self,
  name,
  pos1,
  pos2,
  pos3 
)

Move a piezo device in user units.

Parameters
nameDevice name (supported types: piezos)
pos1Piezo position axis 1 in user units.
pos2Piezo position axis 2 in user units.
pos3Piezo position axis 3 in user units.
   @warning: Only for standard piezo devices

◆ open()

def clib.devmgr_commands.DevMgrCommands.open (   self,
  devname 
)

Open a shutter device.

Parameters
nameDevice name (supported types: shutters)

◆ recover()

def clib.devmgr_commands.DevMgrCommands.recover (   self)

Executes a Recover Command.

◆ setup_json_file()

def clib.devmgr_commands.DevMgrCommands.setup_json_file (   self,
  json_file,
  keep = False 
)

Executes a Setup Command using a JSON fiile.

Parameters
json_fileJSON 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

Parameters
command.

◆ setup_json_string()

def clib.devmgr_commands.DevMgrCommands.setup_json_string (   self,
  json_str,
  keep = False 
)

Executes a Setup Command using a JSON string.

Parameters
json_strJSON string with the setup information, e.g.
'[{"id": "shutter1", "param": { "shutter": {"action": "OPEN"}}}]'
keep (bool, optional): Internal flag to keep buffer object.

It uses the JSON string to build the payload of the Setup

Parameters
command.
 remove quotes that may interfere with the parsing 

◆ simulate()

def clib.devmgr_commands.DevMgrCommands.simulate (   self,
argv 
)

Set one or more devices in simulation.

        argv(variable list):  List of devices

◆ start_track()

def clib.devmgr_commands.DevMgrCommands.start_track (   self,
  name,
  mode = "undef",
  angle = 0.0 
)

Start tracking.

Valid for Drot, Adc and Piezo

Parameters
nameName of the device (supported types: piezos, drots and ADCs) mode (str, optional): Tracking mode, e.g. sky or elev angle (float, optional): Initial position angle

◆ stop_ignore()

def clib.devmgr_commands.DevMgrCommands.stop_ignore (   self,
argv 
)

Stop one or more devices from being ignored.

        argv(variable list):  List of devices

◆ stop_simulate()

def clib.devmgr_commands.DevMgrCommands.stop_simulate (   self,
argv 
)

Stop one or more devices from being simulated.

        argv(variable list):  List of devices

◆ stop_track()

def clib.devmgr_commands.DevMgrCommands.stop_track (   self,
  name 
)

Stop tracking.

Valid for Drot, Adc and Piezo

Parameters
nameName of the device (supported types: piezos, drots and ADCs)

◆ switch_off()

def clib.devmgr_commands.DevMgrCommands.switch_off (   self,
  name 
)

Switch off a lamp or actuator device.

Parameters
nameDevice name (supported types: lamps and actuators)

◆ switch_on()

def clib.devmgr_commands.DevMgrCommands.switch_on (   self,
  name,
  intensity = 100.0,
  timer = 0 
)

Switch on a lamp or actuator device.

Parameters
nameDevice name (supported types: lamps and actuators) intensity (float, optional): Lamp intensity (only for lamps). timer (int, optional): Lamp time for being on (only for lamps).

◆ track_offset()

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.

Parameters
nameName of the device (supported types: drots)
offsetOffset to be applied to the actual position

◆ write_analog()

def clib.devmgr_commands.DevMgrCommands.write_analog (   self,
  name,
  channel,
  value 
)

Write a analog output signal handled by an IODev device.

Parameters
nameDevice name (supported types: iodev)
channelChannel name as defined in the iodev configuration.
valueSignal value.
    @warning: Only for standard iodev devices

◆ write_digital()

def clib.devmgr_commands.DevMgrCommands.write_digital (   self,
  name,
  channel,
  value 
)

Write a digital output signal handled by an IODev device.

Parameters
nameDevice name (supported types: iodev)
channelChannel name as defined in the iodev configuration.
valueSignal value.
    @warning: Only for standard iodev devices

◆ write_integer()

def clib.devmgr_commands.DevMgrCommands.write_integer (   self,
  name,
  channel,
  value 
)

Write a integer output value handled by an IODev device.

Parameters
nameDevice name (supported types: iodev)
channelChannel name as defined in the iodev configuration.
valueSignal value.
    @warning: Only for standard iodev devices

The documentation for this class was generated from the following file: