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 5fc1abd1 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

Merge pull request #747 in VECTO/vecto-sim from...

Merge pull request #747 in VECTO/vecto-sim from ~EMQUARIMA/vecto-sim:feature/VECTO-932-consistency-in-na-values-in-the-vsum-file to develop

* commit '5e459bf8':
  adapt testcase to new 'not available' abbreviation
  use constant for different writings of 'not available' throughout the code
parents 0b0f0098 5e459bf8
Branches
Tags
No related merge requests found
Showing
with 48 additions and 41 deletions
......@@ -290,7 +290,7 @@ Public Class Engine
Public ReadOnly Property Manufacturer As String Implements IComponentInputData.Manufacturer
Get
' Just for the interface. Value is not available in GUI yet.
Return "N.A."
Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE
End Get
End Property
......@@ -309,7 +309,7 @@ Public Class Engine
Public ReadOnly Property CertificationNumber As String Implements IComponentInputData.CertificationNumber
Get
' Just for the interface. Value is not available in GUI yet.
Return "N.A."
Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE
End Get
End Property
......
......@@ -307,7 +307,7 @@ Public Class Gearbox
Public ReadOnly Property Manufacturer As String Implements IComponentInputData.Manufacturer
Get
' Just for the interface. Value is not available in GUI yet.
Return "N.A."
Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE
End Get
End Property
......@@ -327,7 +327,7 @@ Public Class Gearbox
Public ReadOnly Property CertificationNumber As String Implements IComponentInputData.CertificationNumber
Get
' Just for the interface. Value is not available in GUI yet.
Return "N.A."
Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE
End Get
End Property
......
......@@ -269,14 +269,14 @@ Public Class Vehicle
Public ReadOnly Property Manufacturer As String Implements IComponentInputData.Manufacturer
Get
' Just for the interface. Value is not available in GUI yet.
Return "N.A."
Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE
End Get
End Property
Public ReadOnly Property Model As String Implements IComponentInputData.Model
Get
' Just for the interface. Value is not available in GUI yet.
Return "N.A."
Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE
End Get
End Property
......@@ -296,7 +296,7 @@ Public Class Vehicle
Public ReadOnly Property CertificationNumber As String Implements IComponentInputData.CertificationNumber
Get
' Just for the interface. Value is not available in GUI yet.
Return "N.A."
Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE
End Get
End Property
......@@ -328,7 +328,7 @@ Public Class Vehicle
Public ReadOnly Property VIN As String Implements IVehicleDeclarationInputData.VIN
Get
Return "N.A."
Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE
End Get
End Property
......@@ -360,7 +360,7 @@ Public Class Vehicle
Public ReadOnly Property ManufacturerAddress As String Implements IVehicleDeclarationInputData.ManufacturerAddress
Get
Return "N.A."
Return TUGraz.VectoCore.Configuration.Constants.NOT_AVailABLE
End Get
End Property
......
......@@ -36,6 +36,8 @@ namespace TUGraz.VectoCore.Configuration
{
public static class Constants
{
public const string NOT_AVailABLE = "N/A";
public static Second DefaultPowerShiftTime = 0.8.SI<Second>();
public const double RPMToRad = 2 * Math.PI / 60;
public const double Kilo = 1000;
......
......@@ -35,6 +35,7 @@ using Newtonsoft.Json.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
namespace TUGraz.VectoCore.InputData.FileIO.JSON
{
......@@ -217,7 +218,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string Manufacturer
{
get { return "N/A"; }
get { return Constants.NOT_AVailABLE; }
}
public string Model
......@@ -228,7 +229,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string Date
{
get { return "N/A"; }
get { return Constants.NOT_AVailABLE; }
}
public CertificationMethod CertificationMethod
......@@ -238,7 +239,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string CertificationNumber
{
get { return "N/A"; }
get { return Constants.NOT_AVailABLE; }
}
public DigestData DigestValue
......
......@@ -477,7 +477,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string Manufacturer
{
get { return "N/A"; }
get { return Constants.NOT_AVailABLE; }
}
public string Model
......@@ -487,7 +487,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string Date
{
get { return "N/A"; }
get { return Constants.NOT_AVailABLE; }
}
public CertificationMethod CertificationMethod
......@@ -497,7 +497,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string CertificationNumber
{
get { return "N/A"; }
get { return Constants.NOT_AVailABLE; }
}
public DigestData DigestValue
......
......@@ -38,6 +38,7 @@ using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.InputData.Impl;
using TUGraz.VectoCore.Models.Declaration;
......@@ -60,7 +61,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string VIN
{
get { return "N.A."; }
get { return Constants.NOT_AVailABLE; }
}
public LegislativeClass LegislativeClass
......@@ -143,7 +144,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string ManufacturerAddress
{
get { return "N.A."; }
get { return Constants.NOT_AVailABLE; }
}
public PerSecond EngineIdleSpeed
......@@ -483,17 +484,17 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string Manufacturer
{
get { return "N/A"; }
get { return Constants.NOT_AVailABLE; }
}
public string Model
{
get { return "N.A."; }
get { return Constants.NOT_AVailABLE; }
}
public string Date
{
get { return "N/A"; }
get { return Constants.NOT_AVailABLE; }
}
public CertificationMethod CertificationMethod
......@@ -503,7 +504,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public string CertificationNumber
{
get { return "N.A."; }
get { return Constants.NOT_AVailABLE; }
}
public DigestData DigestValue
......
......@@ -36,6 +36,7 @@ using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration;
using TUGraz.VectoCore.Utils;
......@@ -96,7 +97,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering
public override string CertificationNumber
{
get { return "N.A."; }
get { return Constants.NOT_AVailABLE; }
}
public override CertificationMethod CertificationMethod
......
......@@ -169,7 +169,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering
public string ManufacturerAddress
{
get { return "N.A."; }
get { return Constants.NOT_AVailABLE; }
}
public PerSecond EngineIdleSpeed
......
......@@ -813,10 +813,11 @@ namespace TUGraz.VectoCore.OutputData
? ""
: data.CertificationNumber;
} else {
row[ANGLEDRIVE_MANUFACTURER] = "n.a.";
row[ANGLEDRIVE_MODEL] = "n.a.";
row[ANGLEDRIVE_RATIO] = "n.a.";
row[ANGLEDRIVE_MANUFACTURER] = Constants.NOT_AVailABLE;
row[ANGLEDRIVE_MODEL] = Constants.NOT_AVailABLE;
row[ANGLEDRIVE_RATIO] = Constants.NOT_AVailABLE;
row[ANGLEDRIVE_CERTIFICATION_METHOD] = "";
row[ANGLEDRIVE_CERTIFICATION_NUMBER] = "";
}
}
......@@ -831,8 +832,8 @@ namespace TUGraz.VectoCore.OutputData
? ""
: data.CertificationNumber;
} else {
row[RETARDER_MANUFACTURER] = "n.a.";
row[RETARDER_MODEL] = "n.a.";
row[RETARDER_MANUFACTURER] = Constants.NOT_AVailABLE;
row[RETARDER_MODEL] = Constants.NOT_AVailABLE;
row[RETARDER_CERTIFICATION_METHOD] = "";
row[RETARDER_CERTIFICATION_NUMBER] = "";
}
......@@ -870,8 +871,8 @@ namespace TUGraz.VectoCore.OutputData
row[GEAR_RATIO_LAST_GEAR] = data.Gears.Count > 0
? (ConvertedSI)data.Gears.Last().Value.Ratio.SI<Scalar>()
: (ConvertedSI)0.SI<Scalar>();
row[TORQUECONVERTER_MANUFACTURER] = "n.a.";
row[TORQUECONVERTER_MODEL] = "n.a.";
row[TORQUECONVERTER_MANUFACTURER] = Constants.NOT_AVailABLE;
row[TORQUECONVERTER_MODEL] = Constants.NOT_AVailABLE;
row[TORQUE_CONVERTER_CERTIFICATION_METHOD] = "";
row[TORQUE_CONVERTER_CERTIFICATION_NUMBER] = "";
}
......
......@@ -42,6 +42,7 @@ using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.InputData.Reader;
using TUGraz.VectoCore.InputData.Reader.ComponentData;
......@@ -128,7 +129,7 @@ namespace TUGraz.VectoCore.OutputData.XML
return new XElement(tns + XMLNames.Component_Vehicle,
new XAttribute(XMLNames.Component_ID_Attr, id),
GetDefaultComponentElements(vehicle.CertificationNumber, vehicle.Model, "N.A."),
GetDefaultComponentElements(vehicle.CertificationNumber, vehicle.Model, Constants.NOT_AVailABLE),
new XElement(tns + XMLNames.Vehicle_LegislativeClass, "N3"),
new XElement(tns + XMLNames.Vehicle_VehicleCategory, vehicle.VehicleCategory.ToXMLFormat()),
new XElement(tns + XMLNames.Vehicle_AxleConfiguration, vehicle.AxleConfiguration.GetName()),
......@@ -299,7 +300,7 @@ namespace TUGraz.VectoCore.OutputData.XML
return new XElement((ns ?? tns) + XMLNames.Component_Axlegear,
new XElement(tns + XMLNames.ComponentDataWrapper,
new XAttribute(XMLNames.Component_ID_Attr, typeId),
GetDefaultComponentElements(typeId, "N.A."),
GetDefaultComponentElements(typeId, Constants.NOT_AVailABLE),
new XElement(tns + "LineType", "Single portal axle"),
new XElement(tns + XMLNames.Axlegear_Ratio, data.Ratio.ToXMLFormat(3)),
new XElement(tns + XMLNames.Component_CertificationMethod, "Standard values"),
......@@ -374,7 +375,7 @@ namespace TUGraz.VectoCore.OutputData.XML
return new XElement((ns ?? tns) + XMLNames.Component_AirDrag,
new XElement(tns + XMLNames.ComponentDataWrapper,
new XAttribute(XMLNames.Component_ID_Attr, id),
GetDefaultComponentElements(data.Model, "N.A."),
GetDefaultComponentElements(data.Model, Constants.NOT_AVailABLE),
new XElement(tns + "CdxA_0", data.AirDragArea.Value().ToXMLFormat(2)),
new XElement(tns + "TransferredCdxA", data.AirDragArea.Value().ToXMLFormat(2)),
new XElement(tns + XMLNames.AirDrag_DeclaredCdxA, data.AirDragArea.Value().ToXMLFormat(2))),
......
......@@ -407,7 +407,7 @@ namespace TUGraz.VectoCore.OutputData.XML
var typeId = string.Format("AXLGEAR-{0:0.000}", data.Ratio);
var axl = new XElement(tns + XMLNames.Component_Axlegear,
new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, typeId),
GetDefaultComponentElements("N.A."),
GetDefaultComponentElements(Constants.NOT_AVailABLE),
new XElement(tns + XMLNames.Axlegear_Ratio, data.Ratio.ToXMLFormat(3)),
data.LossMap == null
? new XElement(tns + XMLNames.Axlegear_TorqueLossMap,
......@@ -540,7 +540,7 @@ namespace TUGraz.VectoCore.OutputData.XML
return new XElement(tns + XMLNames.Component_AirDrag,
new XElement(tns + XMLNames.ComponentDataWrapper,
new XAttribute(XMLNames.Component_ID_Attr, id),
GetDefaultComponentElements("N.A."),
GetDefaultComponentElements(Constants.NOT_AVailABLE),
new XElement(tns + XMLNames.Vehicle_CrossWindCorrectionMode, data.CrossWindCorrectionMode.ToXMLFormat()),
new XElement(tns + XMLNames.Vehicle_AirDragArea, data.AirDragArea.Value().ToXMLFormat(2))),
GetCrossWindCorrectionData(data)
......
......@@ -96,7 +96,7 @@ namespace TUGraz.VectoCore.Tests.XML
var xml = new XMLEngineeringInputDataProvider(outFile, true);
Assert.IsNotNull(xml);
Assert.AreEqual("VEH-N.A.", xml.JobInputData.JobName);
Assert.AreEqual("VEH-N/A", xml.JobInputData.JobName);
}
[Category("LongRunning")]
......@@ -113,7 +113,7 @@ namespace TUGraz.VectoCore.Tests.XML
var xml = new XMLEngineeringInputDataProvider(outFile, true);
Assert.IsNotNull(xml);
Assert.AreEqual("VEH-N.A.", xml.JobInputData.JobName);
Assert.AreEqual("VEH-N/A", xml.JobInputData.JobName);
}
[Category("LongRunning")]
......@@ -132,7 +132,7 @@ namespace TUGraz.VectoCore.Tests.XML
var xml = new XMLEngineeringInputDataProvider(Path.Combine(outDir, outFile), true);
Assert.IsNotNull(xml);
Assert.AreEqual("VEH-N.A.", xml.JobInputData.JobName);
Assert.AreEqual("VEH-N/A", xml.JobInputData.JobName);
}
[Category("LongRunning")]
......@@ -171,7 +171,7 @@ namespace TUGraz.VectoCore.Tests.XML
var xml = new XMLDeclarationInputDataProvider(reader, true);
Assert.IsNotNull(xml);
Assert.AreEqual("VEH-N.A.", xml.JobInputData.JobName);
Assert.AreEqual("VEH-NA", xml.JobInputData.JobName);
}
[TestCase]
......@@ -193,7 +193,7 @@ namespace TUGraz.VectoCore.Tests.XML
var xml = new XMLDeclarationInputDataProvider(reader, true);
Assert.IsNotNull(xml);
Assert.AreEqual("VEH-N.A.", xml.JobInputData.JobName);
Assert.AreEqual("VEH-NA", xml.JobInputData.JobName);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment