public void Evaluate(int SpreadMax) { for (int i = 0; i < SpreadMax; i++) { if (!FTrig[i]) { continue; } var id = FId[i] < 0 ? Math.Max(autoid, FId.Max() + 1) : FId[i]; Pulses.Add(new Pulse { Duration = FTime[i], Id = id }); autoid = id; } FPulse.AssignFrom(from pulse in Pulses where pulse.Clock.Elapsed.TotalSeconds <= pulse.Duration select pulse); FOutput.SliceCount = FOutputInv.SliceCount = FIdOut.SliceCount = FPulse.SliceCount; for (int i = 0; i < FPulse.SliceCount; i++) { FOutput[i] = FPulse[i].Clock.Elapsed.TotalSeconds / FPulse[i].Duration; FOutputInv[i] = 1.0 - FOutput[i]; FIdOut[i] = FPulse[i].Id; } Pulses = FPulse.ToList(); }