slacm.timer module

Created on Sep 18, 2020

@author: esdev

class slacm.timer.TimerPort(parent, name, spec)[source]

Bases: Port

Timer port

activate()[source]

Activate the timer port

cancel()[source]

Cancel the sporadic timer

deactivate()[source]

Deactivate the timer port

finalize(_disco)[source]
fire()[source]

Force a timer firing

getDelay()[source]

Get the current delay (for sporadic timer)

getPeriod()[source]

Read the period of the periodic timer

getSocket()[source]
halt()[source]

Halt the timer

inSocket()[source]
launch()[source]

Launch (start) the sporadic timer

recv()[source]

Receive a bytearray via the port.

recv_pyobj()[source]

Receive a Python object via the port.

reset()[source]
running()[source]

Returns True if the timer is running

send(msg)[source]

Send a bytearray via the port.

send_pyobj(msg)[source]

Send a Python object via the port.

setDelay(_delay)[source]

Set the current delay (for sporadic timer)

setPeriod(_period)[source]

Set the period - will be changed after the next firing. Period must be positive

setup(owner, _disco)[source]
terminate()[source]

Terminate the timer

class slacm.timer.TimerThread(parent)[source]

Bases: Thread

Thread for a timer port.

class Command(value)[source]

Bases: Enum

ACTIVATE = 2
CANCEL = 5
DEACTIVATE = 3
HALT = 6
START = 4
TERMINATE = 1
cmdError(where, cmd)[source]
fire()[source]

Fire timer from the ‘outside’

getDelay()[source]

Get the current delay (for sporadic timer)

getPeriod()[source]

Read out the period

ready()[source]
run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

running()[source]

Returns True if the timer is running

setDelay(_delay)[source]

Set the current delay (for sporadic timer)

setPeriod(_period)[source]

Set the period - will be changed after the next firing. Period must be positive

waitFor(timeout=None)[source]