Skip to content

calc

Affine

Bases: _CalcBase

A slope and offset, y = ax + b.

Butter2

Bases: _CalcBase

Single-input, single-output Butterworth low-pass filter.

Constant

Bases: _CalcBase

Simplest calc that does anything at all.

InverseAffine

Bases: _CalcBase

Derive input voltage from linear amplifier reading.

First subtracts the output offset, then divides by the slope.

Pid

Bases: _CalcBase

A PID controller with simple saturation for anti-windup.

Polynomial

Bases: _CalcBase

Polynomial calibration: y = c0 + c1x + c2x^2 + ...

with an attached note that should include traceability info like a sensor serial number. Coefficients ordered by increasing polynomial order.

RtdPt100

Bases: _CalcBase

Derive temperature from a Pt100 RTD resistance reading.

SequenceMachine

Bases: _CalcBase

A lookup-table sequence machine with transition criteria.

add_channel_thresh_transition(source_target, channel, op, threshold_channel)

Add a channel threshold transition for a sequence.

add_constant_thresh_transition(source_target, channel, op, threshold)

Add a constant threshold transition for a sequence.

add_lookup_thresh_transition(source_target, channel, op, threshold_lookup)

Add a lookup threshold transition for a sequence.

add_sequence(name, tables, timeout)

Add a sequence state to the machine.

get_entry()

The sequence that is the entrypoint for the machine.

The folder reloaded during init, relative to op_dir, if any.

get_timeout(sequence)

The state this sequence transitions to when it times out.

graphviz_dot()

Render this sequence machine's state graph as Graphviz DOT text.

load_folder(path) staticmethod

Read configuration JSON and sequence CSV files from a folder.

save_folder(path)

Save configuration JSON and sequence CSV files to a folder.

set_entry(entry)

Set the sequence that is the entrypoint for the machine.

Set the folder reloaded during init, relative to op_dir, if any.

set_timeout(sequence, target)

Set the state this sequence transitions to when it times out.

Sin

Bases: _CalcBase

Sin wave between low and high with a period and phase offset.

TcKtype

Bases: _CalcBase

Calculate a K-type thermocouple temperature from voltage.