Class FloatTriggerToGate

All Implemented Interfaces:
CompilableControlFlow, CompilableDataFlow, IntSignalSource, Realtime, SignalSource<Integer>, Runnable, IntSupplier, Supplier<Integer>

public class FloatTriggerToGate extends IntClockedSignalSource
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.
  • Field Details

    • freq

      protected final float freq
    • duration

      protected final FloatSignalSource duration
    • trigger

      protected final IntSignalSource trigger
    • gate

      protected final IntVariable gate
    • lastEvent

      protected int lastEvent
    • holding

      protected int holding
    • finished

      @Opt protected @Opt Runnable finished
  • Constructor Details

  • Method Details

    • setFinishedCallback

      public void setFinishedCallback(@Opt @Opt Runnable finished)
    • 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.