private void TimerCallback(object state)
{
if (this.ended)
{
Pause();
ForceValue(1.0, 1.0, 1.0, ticks);
this.ended = false;
return;
}
UpdateOutput();
lock (lockObject)
{
if (++this.index1 >= this.positions)
this.index1 = 0;
if (++this.index2 >= this.positions)
this.index2 = 0;
if (++this.index3 >= this.positions)
this.index3 = 0;
this.ticks++;
if (++this.hitCounter >= this.positions)
{
// Next iteration
this.iterations++;
this.hitCounter = 0;
if (this.oneShot)
this.ended = true;
NewIterationAction?.Invoke(this.iterations);
}
}
}