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 013d4709 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

new gear rating for output in case no gear rating has been calculated (Z),...

new gear rating for output in case no gear rating has been calculated (Z), make linear output range of gear rating wider
parent 62bea7b2
No related branches found
No related tags found
No related merge requests found
......@@ -576,7 +576,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
string.Format("Gear{0}-Rating", gear),
GearRatings.ContainsKey(gear)
? GearRatings[gear].NumericValue
: new GearRating(GearRatingCase.E, 0, null).NumericValue);
: new GearRating(GearRatingCase.Z, 0, null).NumericValue);
}
container.SetDataValue("acc_rsv", accRsv?.Value() ?? 0);
......
......@@ -8,12 +8,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
B, // inside engine speed limits, torque demand too high
C, // valid gear, gear residience time below threshold
D, // inside engine speed limits, outside preferred speed range
E // outside engine speed limits
E, // outside engine speed limits
Z = 10 // no rating calculated
}
internal struct GearRating
{
private const double CaseSeparationInterval = 1e6;
public GearRating(GearRatingCase ratingCase, double rating, PerSecond maxEngineSpeed)
{
RatingCase = ratingCase;
......@@ -24,11 +27,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
public double Rating { get; }
public GearRatingCase RatingCase { get; }
public PerSecond MaxEngineSpeed { get; set; }
public PerSecond MaxEngineSpeed { get; }
public double NumericValue
{
get { return ((int)RatingCase - 1) * 1e3 + (Rating * 100).LimitTo(0, 1e3-10); }
get { return ((int)RatingCase - 1) * CaseSeparationInterval + (Rating * 100).LimitTo(0, CaseSeparationInterval-10); }
}
public static bool operator <(GearRating first, GearRating second)
......
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