psychos.triggers.StepTrigger#

class psychos.triggers.StepTrigger(port: BasePort, mapping: Dict[str, int | bytes] | None = None)[source]#

Bases: BaseTrigger

Trigger that sends a value without resetting the port.

This trigger sends a value via the communication port and leaves the port in the state of the last sent value.

__init__(port: BasePort, mapping: Dict[str, int | bytes] | None = None)#

Initialize a BaseTrigger instance.

Parameters:
  • port (BasePort) – The communication port instance used for sending triggers.

  • mapping (Dict[str, Union[int, bytes]], optional) – A dictionary mapping trigger names (as strings) to their corresponding values (as integers or bytes). Defaults to None.

Methods

__init__(port[, mapping])

Initialize a BaseTrigger instance.

close()

Close the trigger by closing the associated communication port.

resolve_value(value)

Resolve the trigger value using the provided mapping.

send(value)

Send a trigger value without resetting the port.

send(value: str | int | bytes)[source]#

Send a trigger value without resetting the port.

Parameters:

value – The trigger value to send. This can be a string (which will be resolved using the mapping), an integer, or bytes.