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

Skip to content
Snippets Groups Projects
Commit 232b0f60 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

refactoring declaration data factory: move parts to abstract base class

refactoring writing manufacturer report: introduce abstract base class, derived class for exempted, primary bus, truck
started with primary information report
parent f53d982a
No related branches found
No related tags found
No related merge requests found
Showing
with 103 additions and 25 deletions
......@@ -266,9 +266,9 @@ Public Class Engine
End Get
End Property
Public ReadOnly Property [Date] As String Implements IComponentInputData.[Date]
Public ReadOnly Property [Date] As DateTime Implements IComponentInputData.[Date]
Get
Return Now.ToUniversalTime().ToString("o")
Return Now.ToUniversalTime()
End Get
End Property
......@@ -601,7 +601,7 @@ Public Class DummyVehicle
Public Property SavedInDeclarationMode As Boolean Implements IComponentInputData.SavedInDeclarationMode
Public Property Manufacturer As String Implements IComponentInputData.Manufacturer
Public Property Model As String Implements IComponentInputData.Model
Public Property [Date] As String Implements IComponentInputData.[Date]
Public Property [Date] As DateTime Implements IComponentInputData.[Date]
Public Property CertificationMethod As CertificationMethod Implements IComponentInputData.CertificationMethod
Public Property CertificationNumber As String Implements IComponentInputData.CertificationNumber
Public Property DigestValue As DigestData Implements IComponentInputData.DigestValue
......
......@@ -354,9 +354,9 @@ Public Class Gearbox
End Property
Public ReadOnly Property [Date] As String Implements IComponentInputData.[Date]
Public ReadOnly Property [Date] As DateTime Implements IComponentInputData.[Date]
Get
Return Now.ToUniversalTime().ToString("o")
Return Now.ToUniversalTime()
End Get
End Property
......@@ -783,7 +783,7 @@ Public Class MockEngineeringVehicle
Public Property SavedInDeclarationMode As Boolean Implements IComponentInputData.SavedInDeclarationMode
Public Property Manufacturer As String Implements IComponentInputData.Manufacturer
Public Property Model As String Implements IComponentInputData.Model
Public Property [Date] As String Implements IComponentInputData.[Date]
Public Property [Date] As DateTime Implements IComponentInputData.[Date]
Public Property CertificationMethod As CertificationMethod Implements IComponentInputData.CertificationMethod
Public Property CertificationNumber As String Implements IComponentInputData.CertificationNumber
Public Property DigestValue As DigestData Implements IComponentInputData.DigestValue
......
......@@ -10,7 +10,7 @@ Public Class MockVehicleInputData
Public Property SavedInDeclarationMode As Boolean Implements IComponentInputData.SavedInDeclarationMode
Public Property Manufacturer As String Implements IComponentInputData.Manufacturer
Public Property Model As String Implements IComponentInputData.Model
Public Property [Date] As String Implements IComponentInputData.[Date]
Public Property [Date] As DateTime Implements IComponentInputData.[Date]
Public Property CertificationMethod As CertificationMethod Implements IComponentInputData.CertificationMethod
Public Property CertificationNumber As String Implements IComponentInputData.CertificationNumber
Public Property DigestValue As DigestData Implements IComponentInputData.DigestValue
......
......@@ -14,6 +14,7 @@ Imports System.Collections.Generic
Imports System.ComponentModel.DataAnnotations
Imports System.IO
Imports System.Linq
Imports System.Xml
Imports TUGraz.VECTO.Input_Files
Imports TUGraz.VectoCommon.BusAuxiliaries
Imports TUGraz.VectoCommon.InputData
......@@ -285,9 +286,9 @@ Public Class Vehicle
End Property
Public ReadOnly Property [Date] As String Implements IComponentInputData.[Date]
Public ReadOnly Property [Date] As DateTime Implements IComponentInputData.[Date]
Get
Return Now.ToUniversalTime().ToString("o")
Return Now.ToUniversalTime()
End Get
End Property
......@@ -787,6 +788,8 @@ Public Class Vehicle
End Get
End Property
Public ReadOnly Property XMLSource As XmlNode Implements IAdvancedDriverAssistantSystemDeclarationInputData.XMLSource
Public ReadOnly Property IAdvancedDriverAssistantSystemsEngineering_DataSource As DataSource Implements IAdvancedDriverAssistantSystemsEngineering.DataSource
get
Return New DataSource() With {.SourceType = DataSourceType.JSONFile}
......
......@@ -9,11 +9,15 @@
//
// See the LICENSE.txt for the specific language governing permissions and limitations.
using System.Xml.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCore.Models.BusAuxiliaries;
namespace TUGraz.VectoCommon.BusAuxiliaries {
public interface IAuxiliaryConfig
{
IBusAuxiliariesDeclarationData InputData { get; }
// Electrical
IElectricsUserInputsConfig ElectricalUserInputsConfig { get; }
......
......@@ -12,7 +12,7 @@ namespace TUGraz.VectoCommon.BusAuxiliaries
bool SmartAirCompression { get; }
bool SmartRegeneration { get; }
//bool RetarderBrake { get; }
Meter KneelingHeightMillimeters { get; }
Meter KneelingHeight { get; }
ConsumerTechnology AirSuspensionControl { get; } // mechanical or electrical
ConsumerTechnology AdBlueDosing { get; } // pnmeumatic or electric
ConsumerTechnology Doors { get; } // pneumatic or electric
......
......@@ -46,7 +46,8 @@ namespace TUGraz.VectoCommon.Hashing
Tyre,
Vehicle,
VectoOutput,
VectoCustomerInformation
VectoCustomerInformation,
VectoPrimaryVehicleInformation
}
public static class VectoComponentsExtensionMethods
......@@ -76,6 +77,8 @@ namespace TUGraz.VectoCommon.Hashing
return "VectoOutput";
case VectoComponents.VectoCustomerInformation:
return "VectoCustomerInformation";
case VectoComponents.VectoPrimaryVehicleInformation:
return "VectoPrimaryVehicleInformation";
default:
throw new ArgumentOutOfRangeException("VectoComponents", component, null);
}
......@@ -104,6 +107,8 @@ namespace TUGraz.VectoCommon.Hashing
return "RESULT-";
case VectoComponents.VectoCustomerInformation:
return "COC-";
case VectoComponents.VectoPrimaryVehicleInformation:
return "PIF-";
default:
throw new ArgumentOutOfRangeException("VectoComponents", component, null);
}
......
......@@ -32,6 +32,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using TUGraz.VectoCommon.BusAuxiliaries;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Models;
......@@ -63,7 +65,7 @@ namespace TUGraz.VectoCommon.InputData
string Model { get; }
string Date { get; }
DateTime Date { get; }
CertificationMethod CertificationMethod { get; }
......@@ -229,6 +231,7 @@ namespace TUGraz.VectoCommon.InputData
PredictiveCruiseControlType PredictiveCruiseControl { get; }
bool? ATEcoRollReleaseLockupClutch { get; }
XmlNode XMLSource { get; }
}
public enum PredictiveCruiseControlType
......@@ -666,6 +669,8 @@ namespace TUGraz.VectoCommon.InputData
public interface IBusAuxiliariesDeclarationData
{
XmlNode XMLSource { get; }
string FanTechnology { get; }
IList<string> SteeringPumpTechnology { get; }
......
......@@ -1203,6 +1203,33 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to ElectricalOutput.
/// </summary>
public static string Engine_WHR_ElectricalOutput {
get {
return ResourceManager.GetString("Engine_WHR_ElectricalOutput", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to MechanicalOutputICE.
/// </summary>
public static string Engine_WHR_MechanicalOutputICE {
get {
return ResourceManager.GetString("Engine_WHR_MechanicalOutputICE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to MechanicalOutputDrivetrain.
/// </summary>
public static string Engine_WHR_MechanicalOutputIDrivetrain {
get {
return ResourceManager.GetString("Engine_WHR_MechanicalOutputIDrivetrain", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to WHRCorrection.
/// </summary>
......@@ -2553,6 +2580,15 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to VectoOutputPrimaryVehicle.
/// </summary>
public static string VectoPrimaryVehicleReport {
get {
return ResourceManager.GetString("VectoPrimaryVehicleReport", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to maxAcceleration.
/// </summary>
......
......@@ -1149,4 +1149,16 @@
<data name="Engine_FuelConsumptionMap_WHRMechPower_Attr" xml:space="preserve">
<value>mechanicalPower</value>
</data>
<data name="Engine_WHR_MechanicalOutputICE" xml:space="preserve">
<value>MechanicalOutputICE</value>
</data>
<data name="Engine_WHR_MechanicalOutputIDrivetrain" xml:space="preserve">
<value>MechanicalOutputDrivetrain</value>
</data>
<data name="Engine_WHR_ElectricalOutput" xml:space="preserve">
<value>ElectricalOutput</value>
</data>
<data name="VectoPrimaryVehicleReport" xml:space="preserve">
<value>VectoOutputPrimaryVehicle</value>
</data>
</root>
\ No newline at end of file
......@@ -302,6 +302,9 @@ namespace TUGraz.VectoHashing
if (Document.DocumentElement.LocalName.Equals("VectoCustomerInformation")) {
return VectoComponents.VectoCustomerInformation;
}
if (Document.DocumentElement.LocalName.Equals("VectoOutputPrimaryVehicle")) {
return VectoComponents.VectoPrimaryVehicleInformation;
}
throw new Exception("unknown document structure! neither input data nor output data format");
}
......
......@@ -157,7 +157,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
pneumaticUserInputsConfig.CompressorMap = CompressorMapReader.ReadFile(Path.Combine(baseDir, file));
}
pneumaticUserInputsConfig.Doors = puData.GetEx<string>("Doors").ParseEnum<ConsumerTechnology>();
pneumaticUserInputsConfig.KneelingHeightMillimeters =
pneumaticUserInputsConfig.KneelingHeight =
puData.GetEx<double>("KneelingHeightMillimeters").SI(Unit.SI.Milli.Meter).Cast<Meter>();
//pneumaticUserInputsConfig.RetarderBrake = puData.GetEx<bool>("RetarderBrake");
pneumaticUserInputsConfig.SmartAirCompression = puData.GetEx<bool>("SmartAirCompression");
......
......@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using TUGraz.VectoCommon.BusAuxiliaries;
using TUGraz.VectoCommon.InputData;
......@@ -143,7 +144,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public bool SavedInDeclarationMode { get; private set; }
public string Manufacturer { get; private set; }
public string Model { get; private set; }
public string Date { get; private set; }
public DateTime Date { get; private set; }
public CertificationMethod CertificationMethod { get; private set; }
public string CertificationNumber { get; private set; }
public DigestData DigestValue { get; private set; }
......@@ -241,6 +242,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
}
public bool? ATEcoRollReleaseLockupClutch { get { return VehicleData.ADAS.ATEcoRollReleaseLockupClutch; } }
public XmlNode XMLSource { get { return null; } }
public Meter Length { get { return VehicleData.Length; } }
public Meter Width { get { return VehicleData.Width; } }
......
......@@ -453,9 +453,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
}
public virtual string Date
public virtual DateTime Date
{
get { return Constants.NOT_AVailABLE; }
get { return DateTime.MinValue; }
}
public virtual CertificationMethod CertificationMethod
......
......@@ -522,9 +522,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get { return Body.GetEx<string>(JsonKeys.Gearbox_ModelName); }
}
public string Date
public DateTime Date
{
get { return Constants.NOT_AVailABLE; }
get { return DateTime.MinValue; }
}
public CertificationMethod CertificationMethod
......
......@@ -33,6 +33,8 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using Newtonsoft.Json.Linq;
using TUGraz.VectoCommon.BusAuxiliaries;
using TUGraz.VectoCommon.InputData;
......@@ -359,6 +361,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get { return null; }
}
public virtual XmlNode XMLSource { get { return null; } }
public virtual Meter Length
{
get { return null; }
......@@ -839,9 +843,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get { return Constants.NOT_AVailABLE; }
}
public virtual string Date
public virtual DateTime Date
{
get { return Constants.NOT_AVailABLE; }
get { return DateTime.MinValue; }
}
public CertificationMethod CertificationMethod
......
using System;
using System.Xml;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
......@@ -25,9 +26,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider {
get { return GetString(XMLNames.Component_Model); }
}
public virtual string Date
public virtual DateTime Date
{
get { return GetString(XMLNames.Component_Date); }
get { return XmlConvert.ToDateTime(GetString(XMLNames.Component_Date), XmlDateTimeSerializationMode.Utc); }
}
public virtual CertificationMethod CertificationMethod
......
......@@ -55,6 +55,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
}
public virtual bool? ATEcoRollReleaseLockupClutch { get { return null; } }
public virtual XmlNode XMLSource { get { return BaseNode; } }
#endregion
}
......
......@@ -22,6 +22,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider {
#region Implementation of IBusAuxiliariesDeclarationData
public XmlNode XMLSource { get { return BaseNode; } }
public string FanTechnology
{
get { return GetNode(new[] { "Fan", XMLNames.Auxiliaries_Auxiliary_Technology }).InnerText; }
......
......@@ -261,13 +261,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
{
get {
var retVal = WHRType.None;
if (XmlConvert.ToBoolean(GetString("MechanicalOutputICE"))) {
if (XmlConvert.ToBoolean(GetString(XMLNames.Engine_WHR_MechanicalOutputICE))) {
retVal |= WHRType.MechanicalOutputICE;
}
if (XmlConvert.ToBoolean(GetString("MechanicalOutputDrivetrain"))) {
if (XmlConvert.ToBoolean(GetString(XMLNames.Engine_WHR_MechanicalOutputIDrivetrain))) {
retVal |= WHRType.MechanicalOutputDrivetrain;
}
if (XmlConvert.ToBoolean(GetString("ElectricalOutput"))) {
if (XmlConvert.ToBoolean(GetString(XMLNames.Engine_WHR_ElectricalOutput))) {
retVal |= WHRType.ElectricalOutput;
}
......
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