Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 332f7242 authored by Stefanos Doumpoulakis's avatar Stefanos Doumpoulakis
Browse files

Merge branch 'amdm2/develop' into amdm2/main

parents e64bd479 95b4a962
Branches
Tags Release/4.3.2-RC
No related merge requests found
Showing
with 383 additions and 249 deletions
......@@ -2,6 +2,22 @@
**VECTO v4.3.2-RC (06-02-2025)**
- Features
* CodeEU #872: New battery and supercap readers (vecto/vecto!309)
- Bug Fixes
* CodeEU #861, #832, #880: ATShiftStrategyOptimized - No UpshiftFomL if not locked (vecto/vecto!301)
* CodeEU #883: Forbid downshift to locked gear in APT-S if it generates direct upshift condition (vecto/vecto!307)
* CodeEU #890: Add condition to write BusAuxiliaries output data in vsum (vecto/vecto!306)
* Allow old XMLs for battery and supercap in development only (vecto/vecto!311)
* Correct binding for supercap input data class; use correct xml data type in xml component reader for supercap (vecto/vecto!310)
**VECTO v4.2.7 Official Release (09-01-2025)**
......
......@@ -16,7 +16,7 @@
<Deterministic>true</Deterministic>
<!-- Set to true for VectoCore to fix Ninject version conflicts-->
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Version>4.2.7</Version>
<Version>4.3.2</Version>
<DefineTrace>false</DefineTrace>
<DisableDiagnosticTracing>true</DisableDiagnosticTracing>
<RemoveIntegerChecks>true</RemoveIntegerChecks>
......
No preview for this file type
......@@ -6,6 +6,26 @@
# VECTO v4.3.2-RC (06-02-2025)
## Features
- New battery and supercap readers (vecto/vecto!309)
## Bug Fixes
- ATShiftStrategyOptimized - No UpshiftFomL if not locked (vecto/vecto!301)
- Forbid downshift to locked gear in APT-S if it generates direct upshift condition (vecto/vecto!307)
- Add condition to write BusAuxiliaries output data in vsum (vecto/vecto!306)
- Allow old XMLs for battery and supercap in development only (vecto/vecto!311)
- Correct binding for supercap input data class; use correct xml data type in xml component reader for supercap (vecto/vecto!310)
# VECTO v4.2.7 Official Release (09-01-2025)
## Bug Fixes
......
## VECTO v4.2.7 Official Release (09-01-2025)
## VECTO v4.3.2-RC (06-02-2025)
### Features
- New battery and supercap readers (vecto/vecto!309)
### Bug Fixes
- Track release_notes.md for release
- CodeEU #858: Convert steering pump tech (vecto/vecto!303)
- Converter Tool: ngTankSystem for dual fuel (vecto/vecto!304)
- CodeEU #836: Restrictions on IEPC gear and MaxTorqueCurve XSD attributes (vecto/vecto!302)
\ No newline at end of file
- ATShiftStrategyOptimized - No UpshiftFomL if not locked (vecto/vecto!301)
- Forbid downshift to locked gear in APT-S if it generates direct upshift condition (vecto/vecto!307)
- Add condition to write BusAuxiliaries output data in vsum (vecto/vecto!306)
- Allow old XMLs for battery and supercap in development only (vecto/vecto!311)
- Correct binding for supercap input data class; use correct xml data type in xml component reader for supercap (vecto/vecto!310)
\ No newline at end of file
......@@ -2,6 +2,22 @@
**VECTO v4.3.2-RC (06-02-2025)**
- Features
* CodeEU #872: New battery and supercap readers (vecto/vecto!309)
- Bug Fixes
* CodeEU #861, #832, #880: ATShiftStrategyOptimized - No UpshiftFomL if not locked (vecto/vecto!301)
* CodeEU #883: Forbid downshift to locked gear in APT-S if it generates direct upshift condition (vecto/vecto!307)
* CodeEU #890: Add condition to write BusAuxiliaries output data in vsum (vecto/vecto!306)
* Allow old XMLs for battery and supercap in development only (vecto/vecto!311)
* Correct binding for supercap input data class; use correct xml data type in xml component reader for supercap (vecto/vecto!310)
**VECTO v4.2.7 Official Release (09-01-2025)**
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
<?xml version="1.0" encoding="UTF-8"?>
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="2.0" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0" xmlns:di="http://www.w3.org/2000/09/xmldsig#" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob V:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationJob.xsd" xmlns:v1.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:v2.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1" xmlns:v2.3="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.3" xmlns:v2.4="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4">
<tns:VectoInputDeclaration
xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
schemaVersion="2.0"
xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0"
xmlns:di="http://www.w3.org/2000/09/xmldsig#"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob V:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationJob.xsd"
xmlns:v1.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0"
xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"
xmlns:v2.3="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.3"
xmlns:v2.6="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.6">
<v2.0:Vehicle xsi:type="Vehicle_HEV-Px_HeavyLorryDeclarationType" id="Group5_HEV_P2_sc">
<Manufacturer>TU Graz</Manufacturer>
<ManufacturerAddress>Inffeldgasse 19</ManufacturerAddress>
......@@ -2219,19 +2229,19 @@
</ElectricMachine>
<ElectricEnergyStorage>
<Capacitor>
<Data xsi:type="v2.3:CapacitorSystemDataType" id="CAP-qwertz">
<v2.3:Manufacturer>SuperCAP Factory</v2.3:Manufacturer>
<v2.3:Model>Super cap 7000</v2.3:Model>
<v2.3:CertificationNumber>123456789</v2.3:CertificationNumber>
<v2.3:Date>2017-01-01T00:00:00Z</v2.3:Date>
<v2.3:AppVersion>aaaaa</v2.3:AppVersion>
<v2.3:CertificationMethod>Measured</v2.3:CertificationMethod>
<v2.3:Capacitance>37.00</v2.3:Capacitance>
<v2.3:InternalResistance>5.00</v2.3:InternalResistance>
<v2.3:MinVoltage>100.00</v2.3:MinVoltage>
<v2.3:MaxVoltage>900.00</v2.3:MaxVoltage>
<v2.3:MaxChargingCurrent>2200.00</v2.3:MaxChargingCurrent>
<v2.3:MaxDischargingCurrent>2200.00</v2.3:MaxDischargingCurrent>
<Data xsi:type="v2.6:CapacitorSystemDataType" id="CAP-qwertz">
<v2.6:Manufacturer>SuperCAP Factory</v2.6:Manufacturer>
<v2.6:Model>Super cap 7000</v2.6:Model>
<v2.6:CertificationNumber>123456789</v2.6:CertificationNumber>
<v2.6:Date>2017-01-01T00:00:00Z</v2.6:Date>
<v2.6:AppVersion>aaaaa</v2.6:AppVersion>
<v2.6:CertificationMethod>Measured</v2.6:CertificationMethod>
<v2.6:Capacitance>37.00</v2.6:Capacitance>
<v2.6:InternalResistance>5000.00</v2.6:InternalResistance>
<v2.6:MinVoltage>100.00</v2.6:MinVoltage>
<v2.6:MaxVoltage>900.00</v2.6:MaxVoltage>
<v2.6:MaxChargingCurrent>2200.00</v2.6:MaxChargingCurrent>
<v2.6:MaxDischargingCurrent>2200.00</v2.6:MaxDischargingCurrent>
</Data>
<Signature>
<di:Reference>
......
......@@ -1354,6 +1354,20 @@ namespace TUGraz.VectoCommon.Utils
public double AsMilliOhm => Val * 1000;
}
public class SpecificResistance : SIBase<SpecificResistance>
{
private static readonly int[] Units = { 1, 2, -3 + 1, -2 + 1, 0, 0, 0 };
private SpecificResistance(double val) : base(val, Units) { }
public override string UnitString => "ΩAs";
public static Ohm operator /(SpecificResistance spr, AmpereSecond amps)
{
return SIBase<Ohm>.Create(spr.Val / amps.Value());
}
}
public class Farad : SIBase<Farad>
{
private static readonly int[] Units = { -1, -2, 4, 2, 0, 0, 0 };
......
using System;
#if CERTIFICATION_RELEASE || RELEASE_CANDIDATE
#define PROHIBIT_OLD_XML
#endif
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
......@@ -211,7 +215,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
public const string XSD_TYPE = "BatterySystemStandardValuesDataType";
public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLBatteryPackDeclarationInputDataStandardV23(XmlNode componentNode, string sourceFile) : base(componentNode, sourceFile) { }
public XMLBatteryPackDeclarationInputDataStandardV23(XmlNode componentNode, string sourceFile) : base(componentNode, sourceFile)
{
#if PROHIBIT_OLD_XML
throw new VectoException($"{XSD_TYPE} v2.3 is no longer supported. Use newer version instead.");
#endif
}
#region Overrides of AbstractBatteryPackDeclarationInputDataProvider
......@@ -284,83 +293,77 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
#endregion
}
public class XMLBatteryPackDeclarationDeclarationInputDataV24 : AbstractCommonComponentType,
IXMLBatteryPackDeclarationInputData
public class XMLBatteryPackDeclarationInputDataStandardV26 : AbstractBatteryPackDeclarationInputDataProvider
{
public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24;
public const string XSD_TYPE = "REESSBatteryType";
public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V26;
public const string XSD_TYPE = "BatterySystemStandardValuesDataType";
public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
[Obsolete]
public XMLBatteryPackDeclarationDeclarationInputDataV24(XmlNode componentNode, string sourceFile)
: base(componentNode, sourceFile)
private SpecificResistances _specificResistances;
public XMLBatteryPackDeclarationInputDataStandardV26(XmlNode componentNode, string sourceFile) : base(componentNode, sourceFile)
{
throw new NotImplementedException("Replaced with v2.3 dataprovider");
//SourceType = DataSourceType.XMLEmbedded;
_specificResistances = new SpecificResistances();
}
#region Implementation of IREESSPackInputData
public REESSType StorageType => REESSType.Battery;
#endregion
#region Implementation of IBatteryPackDeclarationInputData
public virtual double? MinSOC =>
ElementExists(XMLNames.Battery_SOCmin) ? GetDouble(XMLNames.Battery_SOCmin) / 100 : (double?)null;
protected override XNamespace NamespaceURI => NAMESPACE_URI;
public virtual double? MaxSOC =>
ElementExists(XMLNames.Battery_SOCmax) ? GetDouble(XMLNames.Battery_SOCmax) / 100 : (double?)null;
protected override TableData GetMaxCurrentMap()
{
var entries = base.GetMaxCurrentMap();
public virtual BatteryType BatteryType => GetString(XMLNames.REESS_BatteryType).ParseEnum<BatteryType>();
public virtual AmpereSecond Capacity => GetDouble(XMLNames.REESS_RatedCapacity).SI(Unit.SI.Ampere.Hour).Cast<AmpereSecond>();
var requiredEntrySoCs = new List<int>() { 0, 30, 80, 100 };
public virtual bool? ConnectorsSubsystemsIncluded => CertificationMethod == CertificationMethod.StandardValues
? (bool?)null
: GetBool(XMLNames.REESS_ConnectorsSubsystemsIncluded);
foreach (var soc in requiredEntrySoCs)
{
if (!entries.AsEnumerable().Any(z => z.Field<string>(XMLNames.REESS_CurrentLimits_SoC).ToInt() == soc))
{
throw new VectoException($"Battery does not contain Current Limit entry for SoC: {soc}");
}
}
public virtual bool? JunctionboxIncluded => CertificationMethod == CertificationMethod.StandardValues
? (bool?)null
: GetBool(XMLNames.REESS_JunctionboxIncluded);
return entries;
}
public virtual Kelvin TestingTemperature => CertificationMethod != CertificationMethod.StandardValues
? GetDouble(XMLNames.REESS_TestingTemperature).DegCelsiusToKelvin()
: null;
protected override TableData GetInternalResistanceCurve()
{
const int SoC = 50;
public virtual TableData InternalResistanceCurve => ReadTableData(XMLNames.REESS_InternalResistanceCurve, XMLNames.REESS_MapEntry,
AttributeMappings.InternalResistanceMap);
var mapSoC = BatterySOCReader.Create(VoltageCurve);
if (!mapSoC.ContainsSoC(SoC / 100.0))
{
throw new VectoException($"Battery SoC map does not contain entry with SoC: {SoC}");
}
public virtual TableData VoltageCurve => ReadTableData(XMLNames.REESS_OCV, XMLNames.REESS_MapEntry,
AttributeMappings.VoltageMap);
var vNom = mapSoC.Lookup(SoC / 100.0);
var minCells = vNom / 4.0.SI<Volt>();
var maxCells = vNom / 3.0.SI<Volt>();
public virtual TableData MaxCurrentMap => ReadTableData(XMLNames.REESS_CurrentLimits, XMLNames.REESS_MapEntry,
AttributeMappings.MaxCurrentMap);
var resistances = base.GetInternalResistanceCurve();
var specificResistanceData = _specificResistances.Lookup(BatteryType);
#endregion
//var rowSoC = resistances.AsEnumerable().First();
foreach (DataRow rowSoC in resistances.AsEnumerable()) {
var soc = rowSoC.ParseDouble(0);
for (var i = 1; i < resistances.Columns.Count; i++) {
var resistance = rowSoC.ParseDouble(i).SI(Unit.SI.Milli.Ohm).Cast<Ohm>();
var resistanceName = resistances.Columns[i].ColumnName;
#region Overrides of AbstractXMLResource
var specificResistance = specificResistanceData.GetValue(resistanceName);
var cellResistance = specificResistance / Capacity;
protected override XNamespace SchemaNamespace => NAMESPACE_URI;
protected override DataSourceType SourceType => DataSourceType.XMLFile;
var minResistance = cellResistance * minCells.Value();
var maxResistance = cellResistance * maxCells.Value();
#endregion
if ((resistance < minResistance) || (resistance > maxResistance)) {
Log.Warn(
$@"Battery {resistanceName}: {resistance.AsMilliOhm}, for SoC: {soc}, out of range [{minResistance.AsMilliOhm.ToString("N2")}, {maxResistance.AsMilliOhm.ToString("N2")}]");
}
}
}
// ---------------------------------------------------------------------------------------
public class XMLBatteryPackDeclarationDeclarationInputDataV01 : XMLBatteryPackDeclarationDeclarationInputDataV24
{
public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1;
public const string XSD_TYPE = "REESSBatteryType";
public static readonly string QUALIFIED_XSD_TYPE =
XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLBatteryPackDeclarationDeclarationInputDataV01(XmlNode componentNode, string sourceFile) : base(componentNode, sourceFile) { }
return resistances;
}
}
public class XMLBatteryPackDeclarationInputDataMeasuredV01 : AbstractBatteryPackDeclarationInputDataProvider
......@@ -395,15 +398,20 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
// ---------------------------------------------------------------------------------------
public class XMLSuperCapDeclarationInputDataV24 : AbstractCommonComponentType, IXMLSuperCapDeclarationInputData
public class XMLSuperCapDeclarationInputDataV23 : AbstractCommonComponentType, IXMLSuperCapDeclarationInputData
{
public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24;
public const string XSD_TYPE = "REESSCapacitorType";
public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V23;
public const string XSD_TYPE = "CapacitorSystemDataType";
public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLSuperCapDeclarationInputDataV24(XmlNode componentNode, string sourceFile) : base(componentNode, sourceFile)
public XMLSuperCapDeclarationInputDataV23(XmlNode componentNode, string sourceFile, bool disallowed = true) : base(componentNode, sourceFile)
{
//SourceType = DataSourceType.XMLEmbedded;
#if PROHIBIT_OLD_XML
if (disallowed && CertificationMethod == CertificationMethod.StandardValues)
{
throw new VectoException($"Capacitor v2.3 is no longer supported. Use newer version instead.");
}
#endif
}
#region Implementation of IREESSPackInputData
......@@ -454,10 +462,23 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
#endregion
}
// ---------------------------------------------------------------------------------------
public class XMLSuperCapDeclarationInputDataV26 : XMLSuperCapDeclarationInputDataV23
{
public static new readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V26;
public const string XSD_TYPE = "CapacitorSystemDataType";
public static new readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLSuperCapDeclarationInputDataV26(XmlNode componentNode, string sourceFile) : base(componentNode, sourceFile, false)
{}
public override Ohm InternalResistance => GetDouble(XMLNames.Capacitor_InternalResistance).SI(Unit.SI.Milli.Ohm).Cast<Ohm>();
}
// ---------------------------------------------------------------------------------------
public class XMLSuperCapDeclarationInputDataV01 : XMLSuperCapDeclarationInputDataV24
public class XMLSuperCapDeclarationInputDataV01 : XMLSuperCapDeclarationInputDataV23
{
public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1;
public const string XSD_TYPE = "REESSCapacitorType";
......@@ -465,7 +486,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
public static readonly string QUALIFIED_XSD_TYPE =
XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLSuperCapDeclarationInputDataV01(XmlNode componentNode, string sourceFile) : base(componentNode, sourceFile) { }
public XMLSuperCapDeclarationInputDataV01(XmlNode componentNode, string sourceFile) : base(componentNode, sourceFile, false) { }
#region Overrides of XMLSuperCapDeclarationInputDataV24
......
......@@ -330,8 +330,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules
Bind<IXMLBatteryPackDeclarationInputData>().To<XMLBatteryPackDeclarationInputDataStandardV23>()
.Named(XMLBatteryPackDeclarationInputDataStandardV23.QUALIFIED_XSD_TYPE);
Bind<IXMLSuperCapDeclarationInputData>().To<XMLSuperCapDeclarationInputDataV24>()
.Named(XMLSuperCapDeclarationInputDataV24.QUALIFIED_XSD_TYPE);
Bind<IXMLSuperCapDeclarationInputData>().To<XMLSuperCapDeclarationInputDataV23>()
.Named(XMLSuperCapDeclarationInputDataV23.QUALIFIED_XSD_TYPE);
Bind<IXMLADCDeclarationInputData>().To<XMLADCDeclarationInputDataV23>()
.Named(XMLADCDeclarationInputDataV23.QUALIFIED_XSD_TYPE);
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ninject.Modules;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces;
namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules
{
public class XMLDeclarationInputDataV26InjectModule : NinjectModule
{
public override void Load()
{
Bind<IXMLBatteryPackDeclarationInputData>().To<XMLBatteryPackDeclarationInputDataStandardV26>()
.Named(XMLBatteryPackDeclarationInputDataStandardV26.QUALIFIED_XSD_TYPE);
Bind<IXMLSuperCapDeclarationInputData>().To<XMLSuperCapDeclarationInputDataV26>()
.Named(XMLSuperCapDeclarationInputDataV26.QUALIFIED_XSD_TYPE);
}
}
}
......@@ -54,6 +54,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration
new XMLDeclarationInputDataV23InjectModule(),
new XMLDeclarationInputDataV24InjectModule(),
new XMLDeclarationInputDataV25InjectModule(),
new XMLDeclarationInputDataV26InjectModule(),
new XMLDeclarationInputDataMultistageV01InjectModule(),
});
......
......@@ -651,6 +651,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl
protected virtual ISuperCapDeclarationInputData SuperCapCreator(string version,
XmlNode componentNode, string sourcefile)
{
var dataNode = GetNode(XMLNames.ComponentDataWrapper, componentNode);
version = XMLHelper.GetXsdType(dataNode.SchemaInfo.SchemaType);
return Factory.CreateSuperCapDeclarationInputData(version, componentNode, sourcefile);
}
......
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Declaration
{
public class SpecificResistances : LookupData<BatteryType, SpecificResistances.SpecificResistancesData>
{
protected override string ResourceId => DeclarationData.DeclarationDataResourcePrefix + ".SpecificResistances.csv";
protected override string ErrorMessage => "SpecificResistances Lookup Error: no value found. Key: '{0}'";
public struct SpecificResistancesData
{
public SpecificResistance Ri_2; // mOhm x Ah
public SpecificResistance Ri_10;
public SpecificResistance Ri_20;
public SpecificResistance Ri_120;
public SpecificResistance GetValue(string variable)
{
var modifiedVariable = variable.Replace('-', '_');
switch (modifiedVariable)
{
case nameof(Ri_2): return Ri_2;
case nameof(Ri_10): return Ri_10;
case nameof(Ri_20): return Ri_20;
case nameof(Ri_120): return Ri_120;
default: throw new ArgumentOutOfRangeException($"{variable} is not part of SpecificResistancesData");
}
}
}
public override SpecificResistancesData Lookup(BatteryType key)
{
return base.Lookup(key);
}
protected override void ParseData(DataTable table)
{
var ri120 = nameof(SpecificResistancesData.Ri_120).ToLower();
foreach (DataRow row in table.Rows)
{
var val = new SpecificResistancesData()
{
Ri_2 = row.ParseDouble(nameof(SpecificResistancesData.Ri_2).ToLower()).SI(Unit.SI.Milli.Ohm.Ampere.Hour).Cast<SpecificResistance>(),
Ri_10 = row.ParseDouble(nameof(SpecificResistancesData.Ri_10).ToLower()).SI(Unit.SI.Milli.Ohm.Ampere.Hour).Cast<SpecificResistance>(),
Ri_20 = row.ParseDouble(nameof(SpecificResistancesData.Ri_20).ToLower()).SI(Unit.SI.Milli.Ohm.Ampere.Hour).Cast<SpecificResistance>(),
Ri_120 = !row.IsNull(ri120) && !String.IsNullOrWhiteSpace(row[ri120].ToString()) ? row.ParseDouble(ri120).SI(Unit.SI.Milli.Ohm.Ampere.Hour).Cast<SpecificResistance>() : null
};
var type = (BatteryType)Enum.Parse(typeof(BatteryType), row["type"].ToString());
Data.Add(type, val);
}
}
}
}
......@@ -140,6 +140,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.ElectricComponents.Ba
Entries[idx].BatteryVolts, soc);
}
public bool ContainsSoC(double soc)
{
return Entries.Any(x => x.SOC.IsEqual(soc));
}
protected int FindIndex(double soc)
{
if (soc < Entries.First().SOC)
......
......@@ -448,9 +448,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl.Shiftstrategies
var shiftTimeReached = (absTime - lastShiftTime).IsGreaterOrEqual(GearshiftParams.TimeBetweenGearshifts);
if (shiftTimeReached && IsBelowDownShiftCurve(gear, inTorque, inAngularVelocity)) {
var next_gear = Gears.Predecessor(gear);
if (!(next_gear.TorqueConverterLocked.Equals(true)) || !(IsAboveUpShiftCurve(next_gear, outTorque / GearboxModelData.Gears[next_gear.Gear].Ratio, outAngularVelocity * GearboxModelData.Gears[next_gear.Gear].Ratio, true)))
{
Downshift(absTime, gear);
return true;
}
}
if (shiftTimeReached && DataBus.DriverInfo.DrivingAction == DrivingAction.Accelerate) {
if (DataBus.VehicleInfo.VehicleSpeed < DataBus.DrivingCycleInfo.CycleData.LeftSample.VehicleTargetSpeed - 10.KMPHtoMeterPerSecond() &&
......
......@@ -187,6 +187,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl.Shiftstrategies
response);
}
if (currentGear.TorqueConverterLocked==false) {
return false;
}
return CheckEarlyUpshiftFromLocked(
absTime, dt, outTorque, outAngularVelocity, origInTorque, origInAngularVelocity, currentGear, lastShiftTime,
response);
......
......@@ -526,7 +526,7 @@ namespace TUGraz.VectoCore.OutputData
{ E_PS_CompressorOn, SumFunc((r, m) => m.EnergyPneumaticCompressorOn().ConvertToKiloWattHour(), ModalResultField.Nl_busAux_PS_generated)},
{ E_BusAux_ES_generated, SumFunc((r, m) => m.EnergyBusAuxESGenerated().ConvertToKiloWattHour(), ModalResultField.P_busAux_ES_generated)},
{ E_BusAux_ES_consumed, SumFunc((r, m) => m.EnergyBusAuxESConsumed().ConvertToKiloWattHour(), ModalResultField.P_busAux_ES_consumer_sum)},
{ Delta_E_BusAux_Battery, SumFunc((r, m) => (r.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorType == AlternatorType.Smart
{ Delta_E_BusAux_Battery, SumFunc((r, m) => ((r.BusAuxiliaries != null && r.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorType == AlternatorType.Smart)
? m.DeltaSOCBusAuxBattery() * r.BusAuxiliaries.ElectricalUserInputsConfig.ElectricStorageCapacity
: 0.SI<WattSecond>())
.ConvertToKiloWattHour()) },
......
Type, Ri_2, Ri_10, Ri_20, Ri_120
HEBS, 210, 240, 270, 390
HPBS, 40, 45, 50,
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment