Code development platform for open source projects from the European Union institutions

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

CombustionEngineData: Added Warning when Inertia is 0

parent 4d911a84
No related branches found
No related tags found
No related merge requests found
......@@ -31,12 +31,14 @@
using System;
using System.ComponentModel.DataAnnotations;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine;
namespace TUGraz.VectoCore.Models.SimulationComponent.Data
{
[CustomValidation(typeof(CombustionEngineData), "ValidateData")]
public class CombustionEngineData : SimulationComponentData
{
[Required, SIRange(1000 * 1E-6, 20000 * 1E-6)]
......@@ -89,5 +91,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
WHTCCorrectionFactor = WHTCCorrectionFactor,
};
}
// ReSharper disable once UnusedMember.Global -- used in CustomValidation
public static ValidationResult ValidateData(CombustionEngineData data, ValidationContext context)
{
if (data.Inertia.IsEqual(0)) {
LogManager.GetLogger(typeof(CombustionEngineData).FullName).Error("Warning: Engine Inertia is 0!");
}
return ValidationResult.Success;
}
}
}
\ No newline at end of file
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