yaq/traits/is-discrete


The is-discrete trait is used for hardware that has a countable number of discrete positions, each with a unique identifier. This trait requires the has-position trait, and discrete hardware must support all of the 'normal' methods such as set_position and get_destination. Hardware with this trait simply offer an additional identifier mapping on top of the existing position and destination behavior. A convinience method 'set_identifier' allows clients to provide identifiers instead of raw positions, if desired.

requires

has-position

configuration

Daemons with the is-discrete trait expect the following configuration:

identifiers ({'type': 'map', 'values': 'double'}) default: {}
Position identifiers

state

Daemons with the is-discrete trait will provide the following state information:

destination (double)
from has-position

position (double)
from has-position

position_identifier (['null', 'string'])
Current position identifier.

messages

Daemons with the is-discrete trait expose the following public messages:

get_destination ➜ double
Get current daemon destination.
from has-position

get_identifier ➜ ['null', 'string']
Get current identifier string. Current identifier may be None.

get_position ➜ double
Get current daemon position.
from has-position

get_position_identifiers ➜ {'type': 'map', 'values': 'double'}
Get position identifiers. Identifiers may not change at runtime.

get_units ➜ ['null', 'string']
Get units of daemon. These units apply to the position and destination fields.
from has-position

set_identifier ➜ double
Set using an identifier. Returns new destination.
parameters:

identifier (string)

set_position
Give the daemon a new destination, and begin motion towards that destination.
from has-position
parameters:

position (double)

set_relative ➜ double
Give the daemon a new destination relative to its current position. Daemon will immediately begin motion towards new destination. Returns new destination.
from has-position
parameters:

distance (double)

daemons

The following daemons implement the is-discrete trait:

fake-discrete-hardware
gpio-digital-output
lightcon-topas4-shutter
wright-filter-wheel


built 2020-10-27 13:47:08                                      CC0: no copyright