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 e87bd059 authored by Stefanos Doumpoulakis's avatar Stefanos Doumpoulakis
Browse files

fix: monitoring report for dual fuel vehicles

parent 63cbbbe6
Branches
No related tags found
No related merge requests found
......@@ -3768,6 +3768,15 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to FuelType.
/// </summary>
public static string MonitoringFuelType {
get {
return ResourceManager.GetString("MonitoringFuelType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gearbox.
/// </summary>
......
......@@ -2196,4 +2196,7 @@
<data name="Component_FuelCell" xml:space="preserve">
<value>FuelCell</value>
</data>
<data name="MonitoringFuelType" xml:space="preserve">
<value>FuelType</value>
</data>
</root>
\ No newline at end of file
......@@ -471,20 +471,35 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.MonitoringReport
protected object[] GetEngineData()
{
return new object[] {
GetStandardFields(PlaceHolder.ENGINE.ToString()),
var elements = new List<object>() { GetStandardFields(PlaceHolder.ENGINE.ToString()) };
foreach (var fuel in _modelData.EngineData.Fuels)
{
elements.Add(
new XElement(
_tns + XMLNames.MonitoringWHTC,
new XElement(_tns + XMLNames.MonitoringFuelType, fuel.FuelData.FuelType.ToXMLFormat()),
new XElement(_tns + XMLNames.MonitoringCO2, double.NaN.ValueAsUnit(XMLNames.GramsPerKWattHour, 0)),
new XElement(_tns + XMLNames.MonitoringFuelConsumption, double.NaN.ValueAsUnit(XMLNames.GramsPerKWattHour, 0))
),
)
);
}
foreach (var fuel in _modelData.EngineData.Fuels)
{
elements.Add(
new XElement(
_tns + XMLNames.MonitoringWHSC,
new XElement(_tns + XMLNames.MonitoringFuelType, fuel.FuelData.FuelType.ToXMLFormat()),
new XElement(_tns + XMLNames.MonitoringCO2, double.NaN.ValueAsUnit(XMLNames.GramsPerKWattHour, 0)),
new XElement(_tns + XMLNames.MonitoringFuelConsumption, double.NaN.ValueAsUnit(XMLNames.GramsPerKWattHour, 0))
),
new XElement(_tns + XMLNames.MonitoringTypeApprovalNumber, GetPlaceholder(PlaceHolder.TYPE_APPROVAL_NUMBER))
};
)
);
}
elements.Add(new XElement(_tns + XMLNames.MonitoringTypeApprovalNumber, GetPlaceholder(PlaceHolder.TYPE_APPROVAL_NUMBER)));
return elements.ToArray();
}
protected object[] GetAxleData()
......
This diff is collapsed.
......@@ -3,12 +3,13 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:all_mon="urn:tugraz:ivt:VectoAPI:MonitoringOutput" xmlns:mon0.7="urn:tugraz:ivt:VectoAPI:MonitoringOutput:v0.7" targetNamespace="urn:tugraz:ivt:VectoAPI:MonitoringOutput" elementFormDefault="qualified" attributeFormDefault="unqualified" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:ParameterDocumentation ParameterDocumentation.xsd">
<!--
This is a convienience file that imports the schema for all supported versions of customer information file and all supported declaration definitions
This is a convienience file that imports the schema for all supported versions of monitoring report file and all supported declaration definitions
-->
<xs:import namespace="urn:tugraz:ivt:VectoAPI:MonitoringOutput:v0.7" schemaLocation="VectoMonitoring.0.7.xsd"/>
<xs:import namespace="urn:tugraz:ivt:VectoAPI:MonitoringOutput:v0.7.1" schemaLocation="VectoMonitoring.0.7.1.xsd"/>
<xs:import namespace="urn:tugraz:ivt:VectoAPI:MonitoringOutput:v0.8" schemaLocation="VectoMonitoring.0.8.xsd"/>
<xs:import namespace="urn:tugraz:ivt:VectoAPI:MonitoringOutput:v1.0" schemaLocation="VectoMonitoring.1.0.xsd"/>
<xs:import namespace="urn:tugraz:ivt:VectoAPI:MonitoringOutput:v1.1" schemaLocation="VectoMonitoring.1.1.xsd"/>
<xs:import namespace="urn:tugraz:ivt:VectoAPI:DeclarationOutput" schemaLocation="VectoOutputManufacturer.xsd"/>
</xs:schema>
......@@ -123,7 +123,7 @@ namespace TUGraz.VectoCore.Utils
public const string MONITORING_NAMESPACE = "urn:tugraz:ivt:VectoAPI:MonitoringOutput";
public const string MONITORING_SCHEMA_VERSION = "1.0";
public const string MONITORING_SCHEMA_VERSION = "1.1";
public const string MONITORING_NAMESPACE_URI = MONITORING_NAMESPACE + ":v" + MONITORING_SCHEMA_VERSION;
......
......@@ -109,13 +109,44 @@ namespace TUGraz.VectoCore.Tests.XML.Reports
: null
: null;
var engineData = (dataProvider is IMultistepBusInputDataProvider)
? null
: (dataProvider.JobInputData.Vehicle.Components != null)
? (dataProvider.JobInputData.Vehicle.Components.EngineInputData != null)
? new CombustionEngineData()
: null
: null;
if (engineData != null)
{
var fuelTypes = new List<FuelType>();
foreach (var mode in dataProvider.JobInputData.Vehicle.Components.EngineInputData.EngineModes)
{
var types = mode.Fuels.Select(x => x.FuelType);
foreach (var type in types)
{
if (!fuelTypes.Contains(type))
{
fuelTypes.Add(type);
}
}
}
engineData.Fuels = fuelTypes.Select(x => new CombustionEngineFuelData() {
FuelData = DeclarationData.FuelData.Lookup(x, dataProvider.JobInputData.Vehicle.TankSystem)
} ).ToList();
}
return new VectoRunData() {
InputData = dataProvider,
VehicleData = new VehicleData() {
OffVehicleCharging = false,
AxleData = axleData
},
AxleGearData = axleGearData
AxleGearData = axleGearData,
EngineData = engineData
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment