Transfer Functions

Transfer Functions

by Patrick Ruoff in 2012

class transfer.CTransfer[source]

Base class for data transfers between a control value and a data item, i.e. a two way function, implements right shift operator for function concatenation >> hereby symbolizes the flow of the data from the control value to the data item

parent = None
FromWindow(data, key, val)[source]

Transfer data from window value val to data item data*[*key] never set impossible value! if there is an error, try to perform closest possible change and return False otherwise return True

ToWindow(data, key)[source]
class transfer.CMinMaxTrans(v_min, v_max)[source]

Transfer that implements minimum and maximum limits for the data item

FromWindow(data, key, val)[source]
class transfer.CAffineTrans(a, b)[source]

Affine transfer function

Construct affine transfer function with factor a and offset b or from range a = (a_from, a_to) to range b = (b_from, b_to) given by tuples

FromWindow(data, key, val)[source]
ToWindow(data, key)[source]
class transfer.CExpTrans(c=1, e=10)[source]

Exponential / Logarithmic transfer function

Construct exponential transfer function with factor c and exponent e

FromWindow(data, key, val)[source]
ToWindow(data, key)[source]
class transfer.CListIndexTrans(sorted_list)[source]

Maps number to index of closest number in sorted list

FromWindow(data, key, val)[source]
ToWindow(data, key)[source]

Previous topic

Validators

Next topic

Validator Mixins

This Page