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 d086a091 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Torque Converter Speedratio Validation: Better error message

parent ccb2064a
No related branches found
No related tags found
No related merge requests found
......@@ -243,7 +243,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox
return retVal;
}
private NewtonMeter ReferenceTorqueLookup(double speedRatio)
{
int index;
......@@ -256,11 +255,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox
public static ValidationResult ValidateData(TorqueConverterData data, ValidationContext validationContext)
{
if (data.TorqueConverterEntries.Min(e => e.SpeedRatio) > 0 ||
data.TorqueConverterEntries.Max(e => e.SpeedRatio) < 2.2) {
return
new ValidationResult(
"Torque Converter Data invalid - Speedratio range has to at least cover 0.0 to 2.2");
var min = data.TorqueConverterEntries.Min(e => e.SpeedRatio);
var max = data.TorqueConverterEntries.Max(e => e.SpeedRatio);
if (min > 0 || max < 2.2) {
return new ValidationResult(string.Format(
"Torque Converter Data invalid - Speedratio has to cover the range from 0.0 to 2.2: given data only goes from {0} to {1}",
min, max));
}
return ValidationResult.Success;
......
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