MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / advance

Method advance

app/src/DSP.h:658–692  ·  view source on GitHub ↗

* @brief Steps the trigger state with one trigger-source sample; returns the * sweep time to append at, or a negative sentinel to skip this sample. */

Source from the content-addressed store, hash-verified

656 * sweep time to append at, or a negative sentinel to skip this sample.
657 */
658 double advance(double now, double trigValue)
659 {
660 double sweepTime = -1.0;
661
662 if (sweeping) {
663 const double st = now - t0;
664 if (st > activeWindow())
665 completeSweep();
666 else {
667 sweepTime = st < 0 ? 0.0 : st;
668 prevValue = trigValue;
669 prevTime = now;
670 prevValid = true;
671 return sweepTime;
672 }
673 }
674
675 if (!sweeping && shouldStart(now, trigValue)) {
676 t0 = triggerOrigin(now, trigValue);
677 lastSweepSec = now;
678 if (edgeDetected(trigValue))
679 lastTriggerSec = now;
680
681 for (auto& r : back)
682 r.clear();
683
684 sweeping = true;
685 sweepTime = (now - t0) < 0 ? 0.0 : (now - t0);
686 }
687
688 prevValue = trigValue;
689 prevTime = now;
690 prevValid = true;
691 return sweepTime;
692 }
693
694private:
695 /**

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected