Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 14246bfc authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Acceleration Curve: Check for small values (dismiss small values)

parent d086a091
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
protected internal AccelerationCurveData(List<KeyValuePair<MeterPerSecond, AccelerationEntry>> entries)
{
_entries = entries;
var smallValues = _entries.Where(e => e.Key < 5.KMPHtoMeterPerSecond()).OrderBy(e => e.Key).ToList();
if (smallValues.Count >= 2) {
Log.Error("Found small velocity entries in Driver-Acceleration/Deceleration file. Values dismissed:" +
string.Join(", ", smallValues.Skip(1).Select(e => e.Key.AsKmph.ToString("F1"))));
foreach (var kv in smallValues.Skip(1)) {
_entries.Remove(kv);
}
}
}
public AccelerationEntry Lookup(MeterPerSecond key)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment