iRiser API
Riser
This is the highest level of API for interacting with the iRiser.
- class Riser(slot)
iRiser object. Contains relevant attributes for understanding the current state of the riser.
- Parameters:
slot (int) – iRiser slot number. Valid values are 0 - 18 on a ‘RM’ and 0-4 on ‘DT’
Example
>>> from iRiser import Riser >>> slot = 1 >>> r = Riser(1)
- copy_action(num, dest)
Copy an action from an existing action number to a new action number
- edit_action(dest, dir, val, time, units, _next, log=True)
Edit an iRiser action
- get_action(raw=False, log=True)
The current action of the iRiser. If the device has just been initialized the action is None. Otherwise, valid actions are integers 0 to 127’
- Parameters:
raw (bool) – If set to True, returns an integer representing the current action. If set to false, returns the value in a status dictionary.
- Return type:
int or dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.get_action() iRiser -d 7 status -J {'status': 0, 'action': ...} >>> r.get_action(raw=True) iRiser -d 7 status -J
- get_actions(raw=False, log=True) [<class 'iRiser.action.Action'>]
Get the actions currently programed on the gpio
- Returns:
status actions
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.get_actions() iRiser ...
- get_bits(raw=False, log=True) Bits
Get info about the signals on the current iRiser
- Returns:
signal names with their values
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.get_bits() iRiser ...
- get_gpio(log=True) dict
Return all information from a gpio query
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.get_gpio() iRiser -d 7 show gpio -J {'status': 0, 'bits': ... 'gpio': '0'}
- get_power(log=True, raw=False)
Get power measured by iRiser
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.get_power() iRiser -d 7 show power {'status': 0, 'power': ..., 'units': 'Watts'}
- get_sequence(raw=False)
The current sequence of the iRiser. If the device has just been initialized the sequence is None. Otherwise, valid sequences are integers 0 to 127’
- Parameters:
raw (bool) – If set to True, returns an integer representing the current sequence. If set to false, returns the value in a status dictionary.
- Return type:
int or dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.get_sequence() iRiser -d ... status -J {'status': 0, 'sequence': ...} >>> r.get_sequence(raw=True) iRiser -d ... status -J >>>
- get_sequences(log=True, raw=False) [<class 'iRiser.sequence.Sequence'>]
Get the sequences currently programed on the gpio.
- Returns:
sequence objects
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.get_sequences() iRiser ...
- get_state(raw=False, log=True)
The current state of the iRiser. If the device has just been initialized the state is None. Otherwise, valid states are ‘stopped’, and ‘running’
- Parameters:
raw (bool) – If set to True, returns a string representing the state. If set to false, returns the value in a status dictionary.
log (bool)
- Return type:
str or dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.get_state() iRiser -d 7 status -J {'status': 0, 'state': 'stopped'} >>> r.get_state(raw=True) iRiser -d 7 status -J 'stopped' >>>
- get_status(log=True, raw=False)
The current status of the iRiser.
- Return type:
int or dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.get_status() iRiser -d 7 status -J {'status': 0, 'sequencer': 'stopped', 'sequence': ...
- init(log=True) dict
Reset GPIO to default values, stop the sequencer and clear memory sequence.
Sets module back to initialized state, PCIe switches will be Closed, all signals will be in operational state
- Returns:
dict
Example
>>> from iRiser import Riser >>> r = Riser(7) >>> r.init() iRiser -d ... init {'status': 0, 'result': 'INFO: iRiser -d ...
- start_sequence(num, log=True)
Start a sequence by sequence number
- Returns:
status
- Return type:
dict