Package eu.bandm.sig.adlib2.lib
Class FloatPost
java.lang.Object
eu.bandm.sig.adlib2.lib.FloatPost
- All Implemented Interfaces:
AbstractSignalSource
,CompilableDataFlow
,FloatSignalSource
,FloatSupplier
Central class to realize control values which can come from different sources
and flow to different consumers.
In practice, the following situations must be freely combinable:
- programmatic, spurious setting by imperative code
- clocked read of some signal source
- irregular, but predictable setting by a kind of sequencer
- spontaneous GUI input by slider / checkbox / textinput
- Midi input (key, ctrl, etc.)
- other external sensors
- continuous output as a signal source
- programmatic/event like reaction in case of change
- GUI visualization of current value
- visualization plot of recent history
- protocol of changes, either discrete or continuously sampled
- some scalar domain like float or int
- boolean
- (seldom: text)
- some PRODUCT of these
- (seldom: a CO-product)
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(Consumer<FloatPost> pl) float
Returns the current value of this signal source.protected int
model2view
(float model) void
setValue
(float value) Called from outside.protected void
protected float
view2model
(int view) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.sig.adlib2.compile.CompilableDataFlow
compileDataFlowTo, hasDataFlowIO
Methods inherited from interface eu.bandm.sig.adlib2.FloatSignalSource
abs, add, asInt, compileDataFlow, compileMainSignalSource, DEBUG, defined, delayed, delayed, divide, equal, floor, getConstantAsFloat, getValueClass, glidingAverage, glidingStandardDeviation, glidingSum, glidingVariance, greaterOrEqual, greaterThan, guard, hasConstantAsFloat, invariant, lessOrEqual, lessThan, map, max, min, modulo, multiply, negate, negative, nonEqual, nonnegative, nonpositive, nonzero, notANumber, positive, power, probe, publishStoredValueVariable, relateWith, sampleAndHold, selectAffine, series, sqrt, stored, subtract, zero, zeroCrossing, zipWith
-
Field Details
-
name
-
value
protected float value -
lastSource
-
min
protected final float min -
max
protected final float max -
epsilon
protected final float epsilon -
unit
-
listeners
-
APPEARANCE_HORIZONTAL
public static final int APPEARANCE_HORIZONTAL- See Also:
-
APPEARANCE_VERTICAL
public static final int APPEARANCE_VERTICAL- See Also:
-
SLIDER_MAX
public static final int SLIDER_MAXGet GUI representation.APPEARANCE_VERTICAL APPEARANCE_HORIZONTAL +-----+ +-----------------------------------------+ |name | | name [...] unit | | = | | |----------[XXX]---------------------| | | |300| | -120 300 | | | | +-----------------------------------------+ | | | |[XX] | | | | | | | | | | | | | | | | | | | | | | | |-120 | = | | | |[.]Hz| +-----+
- See Also:
-
-
Constructor Details
-
FloatPost
-
FloatPost
-
-
Method Details
-
getAsFloat
public float getAsFloat()Description copied from interface:FloatSignalSource
Returns the current value of this signal source.The value may be either computed on demand, or retrieved from storage.
Implementations of this method should have no side effect.
- Specified by:
getAsFloat
in interfaceFloatSignalSource
- Specified by:
getAsFloat
in interfaceFloatSupplier
- Returns:
- the current value of this signal source
-
write
-
setValue
public void setValue(float value) Called from outside. -
setValue
- Parameters:
source
- the agent which initiates this particular change of the value. It is excluded from the listeners which are notified aboth this particular change.
-
addListener
-
view2model
protected float view2model(int view) -
model2view
protected int model2view(float model)
-