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

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

Renamed GetValueOrDefault to GetVECTOValueOrDefault

parent 28dfda38
No related branches found
No related tags found
No related merge requests found
......@@ -215,7 +215,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
fullLoadCurves[0].EngineData = retVal;
if (gbx != null) {
foreach (var gear in gbx.Gears) {
var maxTorque = VectoMath.Min(gear.MaxTorque, limits.GetValueOrDefault(gear.Gear)?.MaxTorque);
var maxTorque = VectoMath.Min(gear.MaxTorque, limits.GetVECTOValueOrDefault(gear.Gear)?.MaxTorque);
fullLoadCurves[(uint)gear.Gear] = IntersectFullLoadCurves(fullLoadCurves[0], maxTorque);
}
}
......
......@@ -118,7 +118,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
public virtual Second AbsTime { get; set; }
public IElectricMotorInfo ElectricMotorInfo(PowertrainPosition pos)
{
return ElectricMotors.GetValueOrDefault(pos);
return ElectricMotors.GetVECTOValueOrDefault(pos);
}
......
......@@ -127,7 +127,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
private NewtonMeter MechanicalAssistPower(PowertrainPosition pos, Second absTime, Second dt, NewtonMeter outTorque, PerSecond prevOutAngularVelocity, PerSecond currOutAngularVelocity, bool dryRun)
{
return _electricMotorTorque.GetValueOrDefault(pos)?.Item2;
return _electricMotorTorque.GetVECTOValueOrDefault(pos)?.Item2;
}
///=======================================================================================
......
......@@ -160,10 +160,10 @@ namespace TUGraz.VectoCore.OutputData.XML.Engineering {
public string FilenameTemplate { get; set; }
}
public static Type GetWriterType(Type inputType) => mapping.GetValueOrDefault(inputType)?.WriterType;
public static Type GetWriterType(Type inputType) => mapping.GetVECTOValueOrDefault(inputType)?.WriterType;
public static string GetXMLTag(Type inputType) => mapping.GetValueOrDefault(inputType)?.XMLTag;
public static string GetXMLTag(Type inputType) => mapping.GetVECTOValueOrDefault(inputType)?.XMLTag;
public static string GetFilenameTemplate(Type inputType) => mapping.GetValueOrDefault(inputType)?.FilenameTemplate ?? "{0}_{1}.xml";
public static string GetFilenameTemplate(Type inputType) => mapping.GetVECTOValueOrDefault(inputType)?.FilenameTemplate ?? "{0}_{1}.xml";
}
}
\ No newline at end of file
......@@ -62,7 +62,7 @@ namespace TUGraz.VectoCore.Utils
}
}
public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey key) =>
public static TValue GetVECTOValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey key) =>
self.TryGetValue(key, out var value) ? value : default;
public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey key, TValue defaultValue) =>
......
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