Package eu.bandm.sighkn
Class FloatTriggerToGate
java.lang.Object
eu.bandm.sig.adlib.IntClockedSignalSource
eu.bandm.sighkn.FloatTriggerToGate
- All Implemented Interfaces:
CompilableControlFlow
,CompilableDataFlow
,IntSignalSource
,Realtime
,SignalSource<Integer>
,Runnable
,IntSupplier
,Supplier<Integer>
A small device which derives a gate from a trigger, which holds the given duration.
A trigger is (as usual) recognized on a change of its int value.
The first trigger value must be != 0.
The duration signal source is sampled once, when the trigger is active.
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.bandm.sig.adlib.SignalSource
SignalSource.AddOperator, SignalSource.CompilableBinaryOperator, SignalSource.Constant<A>, SignalSource.DivOperator, SignalSource.MultOperator, SignalSource.SubOperator
-
Field Summary
Modifier and TypeFieldDescriptionprotected final FloatSignalSource
protected final float
protected final IntVariable
protected int
protected int
protected final IntSignalSource
Fields inherited from class eu.bandm.sig.adlib.IntClockedSignalSource
out
Fields inherited from interface eu.bandm.sig.adlib.Realtime
DEFAULT_AFAP_INTERRUPT_LATENCY, DEFAULT_SLEEP_TIME_MS
-
Constructor Summary
ConstructorDescriptionFloatTriggerToGate
(int freq, FloatSignalSource duration, IntSignalSource trigger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
run()
Processes an event.void
setFinishedCallback
(@Opt Runnable finished) Methods inherited from class eu.bandm.sig.adlib.IntClockedSignalSource
compileDataFlow, counter, counter, counter, get, getAsInt, logged, logged, suppliedBy, suppliedBy
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.adlib.IntSignalSource
logger, logger, zipWith
Methods inherited from interface eu.bandm.sig.adlib.Realtime
afap, afap, andThen, asAsynchronousSwingEvent, compileControlFlow, every, every, frequently, frequently, frequently, times, times
-
Field Details
-
freq
protected final float freq -
duration
-
trigger
-
gate
-
lastEvent
protected int lastEvent -
holding
protected int holding -
finished
-
-
Constructor Details
-
FloatTriggerToGate
-
-
Method Details
-
setFinishedCallback
-
run
public void run()Description copied from interface:Realtime
Processes an event.Any implementation of this method should complete promptly and normally. In particular it must not block indefinitely.
-