From c8e8d804fc8c4c55b85725600b21ed5cd34b5b5e Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Tue, 30 Aug 2016 09:02:39 +0200 Subject: [PATCH] performed some cleanup as suggested by resharper --- .../InputData/FileIO/JSON/JSONGearboxData.cs | 12 +++------- .../InputData/FileIO/JSON/JSONVehicleData.cs | 1 - .../ComponentData/AccelerationCurveReader.cs | 5 ++-- .../CrossWindCorrectionCurveReader.cs | 2 +- .../ComponentData/RetarderLossMapReader.cs | 7 +++--- .../TorqueConverterDataReader.cs | 6 ++--- .../TransmissionLossMapReader.cs | 9 +++---- .../AbstractSimulationDataAdapter.cs | 1 + .../DeclarationDataAdapter.cs | 1 + .../EngineeringDataAdapter.cs | 1 - .../Reader/DrivingCycleDataReader.cs | 2 +- .../InputData/Reader/FullLoadCurveReader.cs | 4 ++-- .../DeclarationModeVectoRunDataFactory.cs | 1 + .../InputData/Reader/ShiftPolygonReader.cs | 5 ++-- .../Models/Connector/Ports/Impl/Response.cs | 1 - .../Models/Declaration/AuxiliaryTypeHelper.cs | 3 +-- .../Models/Declaration/DeclarationData.cs | 7 ++++-- .../VectoCore/Models/Declaration/Segments.cs | 2 +- .../Models/Simulation/DataBus/IGearboxInfo.cs | 1 - .../VectoCore/Models/Simulation/IVectoRun.cs | 3 --- .../Models/Simulation/IVehicleContainer.cs | 1 - .../Models/Simulation/Impl/JobContainer.cs | 1 + .../Simulation/Impl/SimulatorFactory.cs | 1 - .../Data/AccelerationCurve.cs | 6 +---- .../Data/CombustionEngineData.cs | 9 ++++--- .../Data/CrosswindCorrectionCdxALookup.cs | 1 + .../Data/CrosswindCorrectionVAirBeta.cs | 1 + .../Data/Engine/EngineFullLoadCurve.cs | 2 +- .../SimulationComponent/Data/FullLoadCurve.cs | 5 +--- .../Data/Gearbox/ShiftPolygon.cs | 3 --- .../Data/Gearbox/TorqueConverterData.cs | 2 +- .../SimulationComponent/Data/GearboxData.cs | 1 - .../Data/RetarderLossMap.cs | 4 ---- .../Data/SimulationComponentData.cs | 1 - .../SimulationComponent/Data/VehicleData.cs | 2 +- .../Models/SimulationComponent/IClutch.cs | 2 -- .../SimulationComponent/IDriverStrategy.cs | 1 - .../SimulationComponent/IShiftStrategy.cs | 1 - .../Impl/AMTShiftStrategy.cs | 2 +- .../SimulationComponent/Impl/ATGearbox.cs | 21 ++++++++-------- .../Impl/BusAuxiliariesAdapter.cs | 4 +--- .../Models/SimulationComponent/Impl/Clutch.cs | 2 +- .../Impl/CombustionEngine.cs | 4 +--- .../SimulationComponent/Impl/CycleGearbox.cs | 7 ++---- .../Impl/DefaultDriverStrategy.cs | 10 ++++---- .../Impl/DistanceBasedDrivingCycle.cs | 2 +- .../Models/SimulationComponent/Impl/Driver.cs | 1 - .../SimulationComponent/Impl/Gearbox.cs | 15 +++++------- .../Impl/MTShiftStrategy.cs | 1 - .../Impl/PowertrainDrivingCycle.cs | 3 ++- .../SimulationComponent/Impl/ShiftStrategy.cs | 3 --- .../Impl/TorqueConverter.cs | 6 ++--- .../OutputData/ModalDataContainer.cs | 24 +++++++++---------- .../VectoCore/Utils/ProviderExtensions.cs | 1 - VectoCore/VectoCore/Utils/SearchAlgorithm.cs | 1 - VectoCore/VectoCore/Utils/VectoCSVFile.cs | 4 ++-- .../Integration/CoachAdvancedAuxPowertrain.cs | 1 + .../Integration/CoachPowerTrain.cs | 1 + .../SimulationRuns/FullPowertrain.cs | 1 + .../SimulationRuns/MinimalPowertrain.cs | 1 + .../Integration/Truck40tPowerTrain.cs | 1 + .../Models/Declaration/DeclarationDataTest.cs | 1 + .../Simulation/LossMapRangeValidationTest.cs | 1 + .../Simulation/MeasuredSpeedModeTest.cs | 1 + .../Models/SimulationComponent/DriverTest.cs | 1 + .../Models/SimulationComponent/GearboxTest.cs | 1 + .../SimulationComponent/RetarderTest.cs | 1 + .../Models/SimulationComponent/VehicleTest.cs | 1 + .../AccelerationCurveTest.cs | 1 + .../FullLoadCurveTest.cs | 1 + .../GearboxDataTest.cs | 1 + .../SimulationComponentData/ValidationTest.cs | 1 + 72 files changed, 107 insertions(+), 138 deletions(-) diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs index c4539df2e3..7c97f02e9c 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs @@ -29,20 +29,16 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; using System.Collections.Generic; using System.Data; using System.Linq; using Newtonsoft.Json.Linq; -using Org.BouncyCastle.Asn1.Mozilla; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Impl; using TUGraz.VectoCore.Models.Declaration; -using TUGraz.VectoCore.Models.Simulation.Data; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.InputData.FileIO.JSON { @@ -210,11 +206,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON var torqueConverter = gear.GetEx<bool>(JsonKeys.Gearbox_Gear_TCactive); if (torqueConverter) { - if (gears[i + 1].GetEx<bool>(JsonKeys.Gearbox_Gear_TCactive)) { - resultGears.Add(CreateGear(gearNr, gear)); - } else { - resultGears.Add(CreateTorqueConverterGear(gearNr, gear, gears[++i])); - } + resultGears.Add(gears[i + 1].GetEx<bool>(JsonKeys.Gearbox_Gear_TCactive) + ? CreateGear(gearNr, gear) + : CreateTorqueConverterGear(gearNr, gear, gears[++i])); } else { resultGears.Add(CreateGear(gearNr, gear)); } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs index 6e2da66857..5ffa57f7bb 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs @@ -34,7 +34,6 @@ using System.Collections.Generic; using System.Data; using System.Linq; using Newtonsoft.Json.Linq; -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/AccelerationCurveReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/AccelerationCurveReader.cs index 1319d7c684..90601b59d4 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/AccelerationCurveReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/AccelerationCurveReader.cs @@ -6,9 +6,10 @@ using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Utils; -namespace TUGraz.VectoCore.Models.SimulationComponent.Data +namespace TUGraz.VectoCore.InputData.Reader.ComponentData { public class AccelerationCurveReader { @@ -43,7 +44,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data } LoggingObject.Logger<AccelerationCurveData>() .Warn("Acceleration Curve: Header Line is not valid. Expected: '{0}, {1}, {2}', Got: {3}", - Fields.Velocity, AccelerationCurveReader.Fields.Acceleration, + Fields.Velocity, Fields.Acceleration, Fields.Deceleration, ", ".Join(data.Columns.Cast<DataColumn>().Select(c => c.ColumnName))); return CreateFromColumnIndizes(data); diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/CrossWindCorrectionCurveReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/CrossWindCorrectionCurveReader.cs index d9ec305f2c..ee00eb6785 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/CrossWindCorrectionCurveReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/CrossWindCorrectionCurveReader.cs @@ -38,7 +38,7 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Utils; -namespace TUGraz.VectoCore.Models.SimulationComponent.Data +namespace TUGraz.VectoCore.InputData.Reader.ComponentData { public class CrossWindCorrectionCurveReader : LoggingObject { diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/RetarderLossMapReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/RetarderLossMapReader.cs index d47c2d21e5..851eff68b6 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/RetarderLossMapReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/RetarderLossMapReader.cs @@ -5,9 +5,10 @@ using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Utils; -namespace TUGraz.VectoCore.Models.SimulationComponent.Data +namespace TUGraz.VectoCore.InputData.Reader.ComponentData { public class RetarderLossMapReader { @@ -59,8 +60,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data { return data.Rows.Cast<DataRow>() .Select(row => new RetarderLossMap.RetarderLossEntry { - RetarderSpeed = DataTableExtensionMethods.ParseDouble(row, (string)Fields.RetarderSpeed).RPMtoRad(), - TorqueLoss = DataTableExtensionMethods.ParseDouble(row, (string)Fields.TorqueLoss).SI<NewtonMeter>() + RetarderSpeed = row.ParseDouble(Fields.RetarderSpeed).RPMtoRad(), + TorqueLoss = row.ParseDouble(Fields.TorqueLoss).SI<NewtonMeter>() }).ToList(); } diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/TorqueConverterDataReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/TorqueConverterDataReader.cs index 2d628d8d3e..c6a73dc2ec 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/TorqueConverterDataReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/TorqueConverterDataReader.cs @@ -35,9 +35,9 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData characteristicTorque = (from DataRow row in data.Rows select new TorqueConverterEntry() { - SpeedRatio = row.ParseDouble((string)Fields.SpeedRatio), - Torque = row.ParseDouble((string)Fields.CharacteristicTorque).SI<NewtonMeter>(), - TorqueRatio = row.ParseDouble((string)Fields.TorqueRatio) + SpeedRatio = row.ParseDouble(Fields.SpeedRatio), + Torque = row.ParseDouble(Fields.CharacteristicTorque).SI<NewtonMeter>(), + TorqueRatio = row.ParseDouble(Fields.TorqueRatio) }).ToList(); } else { characteristicTorque = (from DataRow row in data.Rows diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/TransmissionLossMapReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/TransmissionLossMapReader.cs index cfd08c4c2e..1eb46333c1 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/TransmissionLossMapReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/TransmissionLossMapReader.cs @@ -5,9 +5,10 @@ using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; using TUGraz.VectoCore.Utils; -namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox +namespace TUGraz.VectoCore.InputData.Reader.ComponentData { public sealed class TransmissionLossMapReader { @@ -80,9 +81,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox private static bool HeaderIsValid(DataColumnCollection columns) { - return columns.Contains(TransmissionLossMapReader.Fields.InputSpeed) && - columns.Contains(TransmissionLossMapReader.Fields.InputTorque) && - columns.Contains(TransmissionLossMapReader.Fields.TorqeLoss); + return columns.Contains(Fields.InputSpeed) && + columns.Contains(Fields.InputTorque) && + columns.Contains(Fields.TorqeLoss); } private static List<TransmissionLossMap.GearLossMapEntry> CreateFromColumnNames(DataTable data) diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs index 84a9400174..d4bcd9f7b9 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/AbstractSimulationDataAdapter.cs @@ -36,6 +36,7 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index 49be92b05a..4bb0ef3a46 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -37,6 +37,7 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data; diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 3e0d12e355..b42a9df5b2 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -36,7 +36,6 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; diff --git a/VectoCore/VectoCore/InputData/Reader/DrivingCycleDataReader.cs b/VectoCore/VectoCore/InputData/Reader/DrivingCycleDataReader.cs index f4fc790a21..2e02f9d19f 100644 --- a/VectoCore/VectoCore/InputData/Reader/DrivingCycleDataReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/DrivingCycleDataReader.cs @@ -182,7 +182,7 @@ namespace TUGraz.VectoCore.InputData.Reader var altitude = current.Altitude; var lastTime = entries.First().Time; foreach (var drivingCycleEntry in entries) { - altitude += (drivingCycleEntry.VehicleTargetSpeed * (drivingCycleEntry.Time - lastTime)) * + altitude += drivingCycleEntry.VehicleTargetSpeed * (drivingCycleEntry.Time - lastTime) * drivingCycleEntry.RoadGradient; drivingCycleEntry.Altitude = altitude; lastTime = drivingCycleEntry.Time; diff --git a/VectoCore/VectoCore/InputData/Reader/FullLoadCurveReader.cs b/VectoCore/VectoCore/InputData/Reader/FullLoadCurveReader.cs index 9eb37c7934..71ebac1f3b 100644 --- a/VectoCore/VectoCore/InputData/Reader/FullLoadCurveReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/FullLoadCurveReader.cs @@ -112,7 +112,7 @@ namespace TUGraz.VectoCore.InputData.Reader select new FullLoadCurve.FullLoadCurveEntry { EngineSpeed = row.ParseDouble(Fields.EngineSpeed).RPMtoRad(), TorqueFullLoad = row.ParseDouble(Fields.TorqueFullLoad).SI<NewtonMeter>(), - TorqueDrag = (engineFld ? row.ParseDouble(Fields.TorqueDrag).SI<NewtonMeter>() : null) + TorqueDrag = engineFld ? row.ParseDouble(Fields.TorqueDrag).SI<NewtonMeter>() : null }).ToList(); } @@ -122,7 +122,7 @@ namespace TUGraz.VectoCore.InputData.Reader select new FullLoadCurve.FullLoadCurveEntry { EngineSpeed = row.ParseDouble(0).RPMtoRad(), TorqueFullLoad = row.ParseDouble(1).SI<NewtonMeter>(), - TorqueDrag = (engineFld ? row.ParseDouble(2).SI<NewtonMeter>() : null) + TorqueDrag = engineFld ? row.ParseDouble(2).SI<NewtonMeter>() : null }).ToList(); } diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs index f8bfff7cd5..8220d9731d 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs @@ -34,6 +34,7 @@ using System.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; diff --git a/VectoCore/VectoCore/InputData/Reader/ShiftPolygonReader.cs b/VectoCore/VectoCore/InputData/Reader/ShiftPolygonReader.cs index 16d0b98001..0abcc5e95e 100644 --- a/VectoCore/VectoCore/InputData/Reader/ShiftPolygonReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ShiftPolygonReader.cs @@ -36,7 +36,6 @@ using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; using TUGraz.VectoCore.Utils; @@ -84,14 +83,14 @@ namespace TUGraz.VectoCore.InputData.Reader private static bool HeaderIsValid(DataColumnCollection columns) { return columns.Contains(Fields.Torque) && columns.Contains(Fields.AngularSpeedUp) && - columns.Contains((Fields.AngularSpeedDown)); + columns.Contains(Fields.AngularSpeedDown); } private static List<ShiftPolygon.ShiftPolygonEntry> CreateFromColumnNames(DataTable data, string columnName) { return (from DataRow row in data.Rows select new ShiftPolygon.ShiftPolygonEntry { - Torque = DataTableExtensionMethods.ParseDouble(row, (string)Fields.Torque).SI<NewtonMeter>(), + Torque = row.ParseDouble(Fields.Torque).SI<NewtonMeter>(), AngularSpeed = row.ParseDouble(columnName).RPMtoRad(), }).ToList(); } diff --git a/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs b/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs index 7a42e99a46..556d4524fa 100644 --- a/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs +++ b/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs @@ -33,7 +33,6 @@ using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; -using TUGraz.VectoCore.Models.SimulationComponent.Impl; namespace TUGraz.VectoCore.Models.Connector.Ports.Impl { diff --git a/VectoCore/VectoCore/Models/Declaration/AuxiliaryTypeHelper.cs b/VectoCore/VectoCore/Models/Declaration/AuxiliaryTypeHelper.cs index 3dc38204ca..c1f94c0cc4 100644 --- a/VectoCore/VectoCore/Models/Declaration/AuxiliaryTypeHelper.cs +++ b/VectoCore/VectoCore/Models/Declaration/AuxiliaryTypeHelper.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCore.Configuration; diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index e899ddc1bd..bd968c9cb3 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -243,8 +243,9 @@ namespace TUGraz.VectoCore.Models.Declaration public static ShiftPolygon ComputeShiftPolygon(int gear, FullLoadCurve fullLoadCurve, IList<ITransmissionInputData> gears, CombustionEngineData engine, double axlegearRatio, Meter dynamicTyreRadius) { - if (gears.Count < 2) + if (gears.Count < 2) { throw new VectoException("ComputeShiftPolygon needs at least 2 gears. {0} gears given.", gears.Count); + } // ReSharper disable once InconsistentNaming var engineSpeed85kmhLastGear = ComputeEngineSpeed85kmh(gears[gears.Count - 1], axlegearRatio, dynamicTyreRadius); @@ -286,7 +287,7 @@ namespace TUGraz.VectoCore.Models.Declaration return new ShiftPolygon(downShift, upShift); } - var gearRatio = gears[(int)gear].Ratio / gears[(int)(gear + 1)].Ratio; + var gearRatio = gears[gear].Ratio / gears[gear + 1].Ratio; var rpmMarginFactor = 1 + ShiftPolygonRPMMargin / 100.0; // ReSharper disable InconsistentNaming @@ -353,7 +354,9 @@ namespace TUGraz.VectoCore.Models.Declaration { var intersections = new List<Point>(); // compute all intersection points between both line segments + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var origLine in orig.Pairwise(Edge.Create)) { + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var transformedLine in transformedDownshift.Pairwise(Edge.Create)) { var isect = VectoMath.Intersect(origLine, transformedLine); if (isect != null) { diff --git a/VectoCore/VectoCore/Models/Declaration/Segments.cs b/VectoCore/VectoCore/Models/Declaration/Segments.cs index 4ce4fe1ad1..c95664d566 100644 --- a/VectoCore/VectoCore/Models/Declaration/Segments.cs +++ b/VectoCore/VectoCore/Models/Declaration/Segments.cs @@ -196,7 +196,7 @@ namespace TUGraz.VectoCore.Models.Declaration private static string GetMissionSuffix(MissionType missionType) { - return (missionType == MissionType.LongHaul ? "-longhaul" : "-other"); + return missionType == MissionType.LongHaul ? "-longhaul" : "-other"; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs index c03e24c1ca..c63e4e3fca 100644 --- a/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs +++ b/VectoCore/VectoCore/Models/Simulation/DataBus/IGearboxInfo.cs @@ -31,7 +31,6 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.SimulationComponent.Data; namespace TUGraz.VectoCore.Models.Simulation.DataBus { diff --git a/VectoCore/VectoCore/Models/Simulation/IVectoRun.cs b/VectoCore/VectoCore/Models/Simulation/IVectoRun.cs index d01da5ed02..e978f6f091 100644 --- a/VectoCore/VectoCore/Models/Simulation/IVectoRun.cs +++ b/VectoCore/VectoCore/Models/Simulation/IVectoRun.cs @@ -29,9 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; -using System.ComponentModel; - namespace TUGraz.VectoCore.Models.Simulation { /// <summary> diff --git a/VectoCore/VectoCore/Models/Simulation/IVehicleContainer.cs b/VectoCore/VectoCore/Models/Simulation/IVehicleContainer.cs index a00df49719..4534be8a1e 100644 --- a/VectoCore/VectoCore/Models/Simulation/IVehicleContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/IVehicleContainer.cs @@ -37,7 +37,6 @@ using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.SimulationComponent; using TUGraz.VectoCore.OutputData; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.Simulation { diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs b/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs index 9e36e4a880..7d18e4f194 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs @@ -110,6 +110,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl } else { var first = new Task(() => { }); var task = first; + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var run in Runs) { var r = run; task = task.ContinueWith(t => r.RunWorkerAsync().Wait(), TaskContinuationOptions.OnlyOnRanToCompletion); diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory.cs b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory.cs index 96478896ff..c3805b4f4b 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory.cs @@ -45,7 +45,6 @@ using TUGraz.VectoCore.InputData.Reader.Impl; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData.PDF; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.Simulation.Impl { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/AccelerationCurve.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/AccelerationCurve.cs index e8053c20ea..ad52bffd29 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/AccelerationCurve.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/AccelerationCurve.cs @@ -31,13 +31,9 @@ using System; using System.Collections.Generic; -using System.Data; using System.Diagnostics; -using System.IO; using System.Linq; -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { @@ -54,7 +50,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data { var index = FindIndex(key); - return new AccelerationCurveData.AccelerationEntry { + return new AccelerationEntry { Acceleration = VectoMath.Interpolate(_entries[index - 1].Key, _entries[index].Key, _entries[index - 1].Value.Acceleration, diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs index 68e96cfc50..2d10073144 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/CombustionEngineData.cs @@ -33,7 +33,6 @@ using System.ComponentModel.DataAnnotations; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { @@ -105,7 +104,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data if (ReferenceEquals(this, obj)) { return true; } - if (obj.GetType() != this.GetType()) { + if (obj.GetType() != GetType()) { return false; } return Equals((CombustionEngineData)obj); @@ -119,9 +118,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data hashCode = (hashCode * 397) ^ (Displacement != null ? Displacement.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (IdleSpeed != null ? IdleSpeed.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Inertia != null ? Inertia.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (WHTCUrban.GetHashCode()); - hashCode = (hashCode * 397) ^ (WHTCRural.GetHashCode()); - hashCode = (hashCode * 397) ^ (WHTCMotorway.GetHashCode()); + hashCode = (hashCode * 397) ^ WHTCUrban.GetHashCode(); + hashCode = (hashCode * 397) ^ WHTCRural.GetHashCode(); + hashCode = (hashCode * 397) ^ WHTCMotorway.GetHashCode(); hashCode = (hashCode * 397) ^ (ConsumptionMap != null ? ConsumptionMap.GetHashCode() : 0); return hashCode; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionCdxALookup.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionCdxALookup.cs index 0c089b04af..534657c750 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionCdxALookup.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionCdxALookup.cs @@ -33,6 +33,7 @@ using System.Collections.Generic; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Utils; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionVAirBeta.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionVAirBeta.cs index b6627f1895..cf8d3e0e6b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionVAirBeta.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/CrosswindCorrectionVAirBeta.cs @@ -35,6 +35,7 @@ using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Utils; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/EngineFullLoadCurve.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/EngineFullLoadCurve.cs index b11b4cd5e4..f9a3e5520b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/EngineFullLoadCurve.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/EngineFullLoadCurve.cs @@ -234,7 +234,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Engine if (ReferenceEquals(this, obj)) { return true; } - if (obj.GetType() != this.GetType()) { + if (obj.GetType() != GetType()) { return false; } return Equals((EngineFullLoadCurve)obj); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/FullLoadCurve.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/FullLoadCurve.cs index 26d4774ea7..deb69b72f7 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/FullLoadCurve.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/FullLoadCurve.cs @@ -32,15 +32,12 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Data; using System.Diagnostics; using System.Linq; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Declaration; -using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { @@ -223,7 +220,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data public override int GetHashCode() { unchecked { - var hashCode = (EngineSpeed != null ? EngineSpeed.GetHashCode() : 0); + var hashCode = EngineSpeed != null ? EngineSpeed.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (TorqueFullLoad != null ? TorqueFullLoad.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TorqueDrag != null ? TorqueDrag.GetHashCode() : 0); return hashCode; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/ShiftPolygon.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/ShiftPolygon.cs index e427d65f31..21b5ae27b5 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/ShiftPolygon.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/ShiftPolygon.cs @@ -33,12 +33,9 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; -using System.Data; using System.Diagnostics; using System.Linq; -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs index 557e3ef511..170b2f50f0 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TorqueConverterData.cs @@ -32,7 +32,6 @@ using System; using System.Collections.Generic; using System.Linq; -using iTextSharp.text.pdf.parser.clipper; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; @@ -161,6 +160,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox } var solutions = new List<double>(); + // ReSharper disable once LoopCanBeConvertedToQuery foreach (var edge in TorqueConverterEntries.Pairwise( (p1, p2) => Edge.Create(new Point(p1.SpeedRatio, p1.Torque.Value()), new Point(p2.SpeedRatio, p2.Torque.Value())))) { var x = (referenceTorque - edge.OffsetXY) / edge.SlopeXY; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs index 5c4160abec..83b07b0710 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/GearboxData.cs @@ -32,7 +32,6 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -using Newtonsoft.Json; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/RetarderLossMap.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/RetarderLossMap.cs index 319f5b3e94..fbad43ba46 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/RetarderLossMap.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/RetarderLossMap.cs @@ -29,14 +29,10 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Data; using System.Linq; -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/SimulationComponentData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/SimulationComponentData.cs index 12f3ceaf70..fb83f206e5 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/SimulationComponentData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/SimulationComponentData.cs @@ -33,7 +33,6 @@ using System.ComponentModel.DataAnnotations; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/VehicleData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/VehicleData.cs index 9dec7cddfa..4c6e6caed1 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/VehicleData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/VehicleData.cs @@ -170,7 +170,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data public static ValidationResult ValidateVehicleData(VehicleData vehicleData, ValidationContext validationContext) { - var mode = SimulationComponentData.GetExecutionMode(validationContext); + var mode = GetExecutionMode(validationContext); var weightShareSum = vehicleData.AxleData.Sum(axle => axle.AxleWeightShare); if (!weightShareSum.IsEqual(1.0, 1E-10)) { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IClutch.cs b/VectoCore/VectoCore/Models/SimulationComponent/IClutch.cs index 7b38571e55..0d9936cc9d 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IClutch.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IClutch.cs @@ -29,8 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using TUGraz.VectoCore.Models.Connector.Ports; - namespace TUGraz.VectoCore.Models.SimulationComponent { public enum ClutchState diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/IDriverStrategy.cs index d4354a0d05..de59438ba3 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IDriverStrategy.cs @@ -31,7 +31,6 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.Simulation.DataBus; namespace TUGraz.VectoCore.Models.SimulationComponent { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs index 2cb77d1e63..f3de1d34b4 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/IShiftStrategy.cs @@ -30,7 +30,6 @@ */ using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.SimulationComponent.Impl; namespace TUGraz.VectoCore.Models.SimulationComponent { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs index 76b97e56b9..5ecbcdbea4 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs @@ -180,7 +180,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl NextGear--; } - return (NextGear != gear); + return NextGear != gear; } protected virtual uint CheckUpshift(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs index 13e8e63da2..acbcd04344 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ATGearbox.cs @@ -1,5 +1,4 @@ -using System.CodeDom; -using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; @@ -14,12 +13,12 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { - public class ATGearbox : AbstractGearbox<ATGearbox.ATGearboxState>, IGearbox, ITnOutPort, ITnInPort, + public class ATGearbox : AbstractGearbox<ATGearbox.ATGearboxState>, IGearbox, ITnInPort, IClutchInfo { protected internal bool Disengaged = true; - protected internal readonly IShiftStrategy _strategy; + protected internal readonly IShiftStrategy Strategy; protected TorqueConverter TorqueConverter; @@ -28,10 +27,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public ATGearbox(IVehicleContainer container, GearboxData gearboxModelData, IShiftStrategy strategy) : base(container, gearboxModelData) { - _strategy = strategy; - _strategy.Gearbox = this; + Strategy = strategy; + Strategy.Gearbox = this; LastShift = -double.MaxValue.SI<Second>(); - TorqueConverter = new TorqueConverter(this, _strategy, container, gearboxModelData.TorqueConverterData); + TorqueConverter = new TorqueConverter(this, Strategy, container, gearboxModelData.TorqueConverterData); } @@ -58,7 +57,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public override IResponse Initialize(NewtonMeter outTorque, PerSecond outAngularVelocity) { if (Disengaged) { - Gear = _strategy.InitGear(0.SI<Second>(), Constants.SimulationSettings.TargetTimeInterval, outTorque, + Gear = Strategy.InitGear(0.SI<Second>(), Constants.SimulationSettings.TargetTimeInterval, outTorque, outAngularVelocity); } var inAngularVelocity = 0.SI<PerSecond>(); @@ -136,7 +135,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Log.Debug("AT-Gearbox Power Request: torque: {0}, angularVelocity: {1}", outTorque, outAngularVelocity); if (DataBus.VehicleStopped && outAngularVelocity > 0) { - Gear = _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity); + Gear = Strategy.InitGear(absTime, dt, outTorque, outAngularVelocity); LastShift = absTime; Disengaged = false; } @@ -156,7 +155,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl retVal.Switch() .Case<ResponseGearShift>(r => { loop = true; - Gear = _strategy.Engage(absTime, dt, outTorque, outAngularVelocity); + Gear = Strategy.Engage(absTime, dt, outTorque, outAngularVelocity); LastShift = absTime; }); } while (loop && ++count < 2); @@ -202,7 +201,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return TorqueConverter.Request(absTime, dt, inTorque, inAngularVelocity, dryRun); } if (!dryRun && - _strategy.ShiftRequired(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, Gear, LastShift)) { + Strategy.ShiftRequired(absTime, dt, outTorque, outAngularVelocity, inTorque, inAngularVelocity, Gear, LastShift)) { return new ResponseGearShift() { Source = this }; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs index de044761e8..43eada0b84 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs @@ -31,10 +31,8 @@ using System; using System.IO; -using System.Windows.Forms.VisualStyles; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; @@ -255,7 +253,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Auxiliaries.Signals.PreExistingAuxPower = AdditionalAux != null ? AdditionalAux.PowerDemand(absTime, dt, torquePowerTrain, torqueEngine, angularSpeed, dryRun) * avgAngularSpeed : 0.SI<Watt>(); - ; //mAAUX_Global.PreExistingAuxPower; + //mAAUX_Global.PreExistingAuxPower; Auxiliaries.Signals.Idle = DataBus.VehicleStopped; Auxiliaries.Signals.InNeutral = DataBus.Gear == 0; Auxiliaries.Signals.RunningCalc = true; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs index 3af177aabb..18df85edb9 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Clutch.cs @@ -159,7 +159,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var engineSpeed = VectoMath.Max(_idleSpeed, angularVelocity); angularVelocityIn = _clutchSpeedSlippingFactor * engineSpeed + _idleSpeed; - torqueIn = torque * effectiveAngularVelocity / ClutchEff / ((angularVelocityIn)); + torqueIn = torque * effectiveAngularVelocity / ClutchEff / angularVelocityIn; } else { _clutchState = ClutchState.ClutchClosed; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 36c30a9ffe..983ce5cf3f 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -30,7 +30,6 @@ */ using System; -using System.Collections.Generic; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; @@ -39,7 +38,6 @@ using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; -using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.Utils; @@ -239,7 +237,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl maxTorque = VectoMath.Min(maxTorque, gearboxFullLoad); } - CurrentState.EngineTorque = VectoMath.Limit(totalTorqueDemand, minTorque, maxTorque); + CurrentState.EngineTorque = totalTorqueDemand.Limit(minTorque, maxTorque); CurrentState.EnginePower = CurrentState.EngineTorque * avgEngineSpeed; if (totalTorqueDemand.IsGreater(0) && diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs index 28ec611a54..a0921ac24a 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs @@ -29,12 +29,10 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System.Diagnostics; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; -using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; @@ -45,8 +43,7 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { - public class CycleGearbox : AbstractGearbox<GearboxState>, IGearbox, ITnOutPort, ITnInPort, - IClutchInfo + public class CycleGearbox : AbstractGearbox<GearboxState>, IGearbox, IClutchInfo { public CycleGearbox(IVehicleContainer container, GearboxData gearboxModelData) : base(container, gearboxModelData) {} @@ -100,7 +97,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var inTorque = outTorque / ModelData.Gears[Gear].Ratio - inTorqueLossResult.Value; if (!inAngularVelocity.IsEqual(0)) { - var alpha = (ModelData.Inertia.IsEqual(0)) + var alpha = ModelData.Inertia.IsEqual(0) ? 0.SI<PerSquareSecond>() : outTorque / ModelData.Inertia; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index b2b3f14f30..8359471720 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -462,7 +462,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if ((Driver.DataBus.Distance + ds).IsSmaller(nextAction.TriggerDistance - newBrakingDistance)) { return response; } - newds = (nextAction.TriggerDistance - newBrakingDistance) - Driver.DataBus.Distance - + newds = nextAction.TriggerDistance - newBrakingDistance - Driver.DataBus.Distance - Constants.SimulationSettings.DriverActionDistanceTolerance / 2; break; default: @@ -583,11 +583,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl }). Case<ResponseOverload>(r => { // limiting deceleration while coast may result in an overload => issue brakes to decelerate with driver's max deceleration - if (DataBus.ClutchClosed(absTime)) { - response = Driver.DrivingActionAccelerate(absTime, ds, targetVelocity, gradient); - } else { - response = Driver.DrivingActionRoll(absTime, ds, targetVelocity, gradient); - } + response = DataBus.ClutchClosed(absTime) + ? Driver.DrivingActionAccelerate(absTime, ds, targetVelocity, gradient) + : Driver.DrivingActionRoll(absTime, ds, targetVelocity, gradient); //Phase = BrakingPhase.Brake; }). Case<ResponseDrivingCycleDistanceExceeded>(r => { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs index f216e777b9..eb55061f4b 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs @@ -257,7 +257,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl leftSamplePoint.Altitude, rightSamplePoint.Altitude, PreviousState.Distance + ds); var gradient = VectoMath.InclinationToAngle(((CurrentState.Altitude - PreviousState.Altitude) / - (ds)).Value()); + ds).Value()); //return 0.SI<Radian>(); return gradient; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index e1cb4c6766..4f6e12dbf5 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -30,7 +30,6 @@ */ using System; -using System.Windows.Forms.VisualStyles; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index 7a659136b6..4c047df1ff 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -29,12 +29,10 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System.Diagnostics; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; -using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; @@ -119,7 +117,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var inTorque = outTorque / ModelData.Gears[gear].Ratio + torqueLossResult.Value; if (!inAngularVelocity.IsEqual(0)) { - var alpha = (ModelData.Inertia.IsEqual(0)) + var alpha = ModelData.Inertia.IsEqual(0) ? 0.SI<PerSquareSecond>() : outTorque / ModelData.Inertia; @@ -224,7 +222,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } var shiftTimeExceeded = absTime.IsSmaller(_engageTime) && - _engageTime.IsSmaller(absTime + dt, Constants.SimulationSettings.LowerBoundTimeInterval); // allow 5% tolerance of shift time + _engageTime.IsSmaller(absTime + dt, Constants.SimulationSettings.LowerBoundTimeInterval); + // allow 5% tolerance of shift time if (shiftTimeExceeded) { return new ResponseFailTimeInterval { Source = this, @@ -278,11 +277,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (Disengaged && !outAngularVelocity.IsEqual(0)) { Disengaged = false; var lastGear = Gear; - if (DataBus.VehicleStopped) { - Gear = _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity); - } else { - Gear = _strategy.Engage(absTime, dt, outTorque, outAngularVelocity); - } + Gear = DataBus.VehicleStopped + ? _strategy.InitGear(absTime, dt, outTorque, outAngularVelocity) + : _strategy.Engage(absTime, dt, outTorque, outAngularVelocity); if (Gear > lastGear) { LastUpshift = absTime; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/MTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/MTShiftStrategy.cs index 7900f00107..2dc8dad844 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/MTShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/MTShiftStrategy.cs @@ -29,7 +29,6 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.SimulationComponent.Data; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs index a67cc3771a..c2d195028f 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/PowertrainDrivingCycle.cs @@ -438,13 +438,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl response.Switch() .Case<ResponseGearShift>(() => response = NextComponent.Request(absTime, dt, acceleration, gradient)) .Case<ResponseUnderload>(r => { + var acceleration1 = acceleration; DataBus.BrakePower = SearchAlgorithm.Search(DataBus.BrakePower, r.Delta, -r.Delta, getYValue: result => DataBus.ClutchClosed(absTime) ? ((ResponseDryRun)result).DeltaDragLoad : ((ResponseDryRun)result).GearboxPowerRequest, evaluateFunction: x => { DataBus.BrakePower = x; - return NextComponent.Request(absTime, dt, acceleration, gradient, true); + return NextComponent.Request(absTime, dt, acceleration1, gradient, true); }, criterion: y => DataBus.ClutchClosed(absTime) ? ((ResponseDryRun)y).DeltaDragLoad.Value() diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs index 261a7d1027..4d25a7d51f 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs @@ -29,14 +29,11 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using System; -using System.Drawing.Design; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.SimulationComponent.Data; -using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs index 049b07ec2d..6ed745e984 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs @@ -1,5 +1,4 @@ -using System; -using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; @@ -7,7 +6,6 @@ using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; -using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; using TUGraz.VectoCore.OutputData; @@ -108,7 +106,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } CurrentState.SetState(operatingPoint.InTorque, operatingPoint.InAngularVelocity, outTorque, outAngularVelocity); CurrentState.OperatingPoint = operatingPoint; - var retVal = NextComponent.Request(absTime, dt, operatingPoint.InTorque, operatingPoint.InAngularVelocity, dryRun); + var retVal = NextComponent.Request(absTime, dt, operatingPoint.InTorque, operatingPoint.InAngularVelocity); return retVal; } diff --git a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs index 39cf24c121..dd02c872da 100644 --- a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs @@ -310,7 +310,7 @@ namespace TUGraz.VectoCore.OutputData object[] remainingRow = null; var gearsList = new Dictionary<object, Second>(3); - var v_act = data.Rows.Cast<DataRow>().First().Field<MeterPerSecond>((int)ModalResultField.v_act); + var vAct = data.Rows.Cast<DataRow>().First().Field<MeterPerSecond>((int)ModalResultField.v_act); foreach (DataRow row in data.Rows) { var currentDt = row.Field<Second>((int)ModalResultField.simulationInterval); @@ -324,8 +324,8 @@ namespace TUGraz.VectoCore.OutputData var gear = row[(int)ModalResultField.Gear]; gearsList[gear] = gearsList.GetValueOrZero(gear) + diffDt; - distance += diffDt * v_act + diffDt * diffDt * (MeterPerSquareSecond)row[(int)ModalResultField.acc] / 2; - v_act += diffDt * (MeterPerSquareSecond)row[(int)ModalResultField.acc]; + distance += diffDt * vAct + diffDt * diffDt * (MeterPerSquareSecond)row[(int)ModalResultField.acc] / 2; + vAct += diffDt * (MeterPerSquareSecond)row[(int)ModalResultField.acc]; r.ItemArray = AddRow(remainingRow, MultiplyRow(row.ItemArray, diffDt)); absTime += diffDt; @@ -333,7 +333,7 @@ namespace TUGraz.VectoCore.OutputData r[(int)ModalResultField.simulationInterval] = 1.SI<Second>(); r[(int)ModalResultField.Gear] = gearsList.MaxBy(kv => kv.Value).Key; r[(int)ModalResultField.dist] = distance; - r[(int)ModalResultField.v_act] = v_act; + r[(int)ModalResultField.v_act] = vAct; gearsList.Clear(); results.Rows.Add(r); @@ -349,13 +349,13 @@ namespace TUGraz.VectoCore.OutputData var r = results.NewRow(); r.ItemArray = row.ItemArray; absTime += dt; - distance += dt * v_act + dt * dt * (MeterPerSquareSecond)row[(int)ModalResultField.acc] / 2; - v_act += dt * (MeterPerSquareSecond)row[(int)ModalResultField.acc]; + distance += dt * vAct + dt * dt * (MeterPerSquareSecond)row[(int)ModalResultField.acc] / 2; + vAct += dt * (MeterPerSquareSecond)row[(int)ModalResultField.acc]; r[(int)ModalResultField.time] = absTime; r[(int)ModalResultField.simulationInterval] = dt; r[(int)ModalResultField.dist] = distance; - r[(int)ModalResultField.v_act] = v_act; + r[(int)ModalResultField.v_act] = vAct; results.Rows.Add(r); } @@ -364,8 +364,8 @@ namespace TUGraz.VectoCore.OutputData var gear = row[(int)ModalResultField.Gear]; gearsList[gear] = gearsList.GetValueOrZero(gear) + currentDt; - distance += currentDt * v_act + currentDt * currentDt * (MeterPerSquareSecond)row[(int)ModalResultField.acc] / 2; - v_act += currentDt * (MeterPerSquareSecond)row[(int)ModalResultField.acc]; + distance += currentDt * vAct + currentDt * currentDt * (MeterPerSquareSecond)row[(int)ModalResultField.acc] / 2; + vAct += currentDt * (MeterPerSquareSecond)row[(int)ModalResultField.acc]; remainingRow = AddRow(remainingRow, MultiplyRow(row.ItemArray, currentDt)); remainingDt += currentDt; absTime += currentDt; @@ -383,15 +383,15 @@ namespace TUGraz.VectoCore.OutputData var r = results.NewRow(); r.ItemArray = MultiplyRow(remainingRow, 1 / remainingDt).ToArray(); - distance += remainingDt * v_act + + distance += remainingDt * vAct + remainingDt * remainingDt * (MeterPerSquareSecond)last[(int)ModalResultField.acc] / 2; - v_act += remainingDt * (MeterPerSquareSecond)last[(int)ModalResultField.acc]; + vAct += remainingDt * (MeterPerSquareSecond)last[(int)ModalResultField.acc]; r[(int)ModalResultField.time] = VectoMath.Ceiling(absTime); r[(int)ModalResultField.simulationInterval] = 1.SI<Second>(); r[(int)ModalResultField.Gear] = gearsList.MaxBy(kv => kv.Value).Key; r[(int)ModalResultField.dist] = distance; - r[(int)ModalResultField.v_act] = v_act; + r[(int)ModalResultField.v_act] = vAct; results.Rows.Add(r); } diff --git a/VectoCore/VectoCore/Utils/ProviderExtensions.cs b/VectoCore/VectoCore/Utils/ProviderExtensions.cs index 3e4dc0fb3e..5e67dcfb15 100644 --- a/VectoCore/VectoCore/Utils/ProviderExtensions.cs +++ b/VectoCore/VectoCore/Utils/ProviderExtensions.cs @@ -30,7 +30,6 @@ */ using System; -using System.Collections.Generic; using TUGraz.VectoCommon.Models; using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Simulation; diff --git a/VectoCore/VectoCore/Utils/SearchAlgorithm.cs b/VectoCore/VectoCore/Utils/SearchAlgorithm.cs index 0d3b6e9723..23338fa88a 100644 --- a/VectoCore/VectoCore/Utils/SearchAlgorithm.cs +++ b/VectoCore/VectoCore/Utils/SearchAlgorithm.cs @@ -35,7 +35,6 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; -using System.Windows.Forms; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; diff --git a/VectoCore/VectoCore/Utils/VectoCSVFile.cs b/VectoCore/VectoCore/Utils/VectoCSVFile.cs index 33722c85ce..b4c9b429c3 100644 --- a/VectoCore/VectoCore/Utils/VectoCSVFile.cs +++ b/VectoCore/VectoCore/Utils/VectoCSVFile.cs @@ -187,7 +187,7 @@ namespace TUGraz.VectoCore.Utils return; } var header = table.Columns.Cast<DataColumn>().Select(col => col.Caption ?? col.ColumnName); - writer.WriteLine(Delimiter.ToString().Join(header)); + writer.WriteLine(Delimiter.Join(header)); foreach (DataRow row in table.Rows) { var row1 = row; @@ -203,7 +203,7 @@ namespace TUGraz.VectoCore.Utils : string.Format(CultureInfo.InvariantCulture, "{0}", item); }); - writer.WriteLine(Delimiter.ToString().Join(formattedList)); + writer.WriteLine(Delimiter.Join(formattedList)); } } } diff --git a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs index bc4a4b808f..00c7e0db53 100644 --- a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs @@ -35,6 +35,7 @@ using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; diff --git a/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs b/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs index b832d2801c..64c1b97472 100644 --- a/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs +++ b/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs @@ -36,6 +36,7 @@ using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; diff --git a/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs b/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs index 3baaded391..42ecc227c3 100644 --- a/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/SimulationRuns/FullPowertrain.cs @@ -38,6 +38,7 @@ using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; diff --git a/VectoCore/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs b/VectoCore/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs index 2eff2b8a78..58423bc151 100644 --- a/VectoCore/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs @@ -35,6 +35,7 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; diff --git a/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs b/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs index 83d65c1a60..c9802f412b 100644 --- a/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs +++ b/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs @@ -36,6 +36,7 @@ using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index 89d2a3c987..68efd7c762 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -38,6 +38,7 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.JSON; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.InputData.Reader.Impl; using TUGraz.VectoCore.Models.Declaration; diff --git a/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs b/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs index 8d23f7038b..2846bea146 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/LossMapRangeValidationTest.cs @@ -39,6 +39,7 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; diff --git a/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs b/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs index b076d54fe8..e434ef9292 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs @@ -38,6 +38,7 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs index 11b4389ef1..565b4313ef 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/DriverTest.cs @@ -35,6 +35,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Declaration; diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs index b8ad832394..8fcede0aed 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/GearboxTest.cs @@ -37,6 +37,7 @@ using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.DataBus; diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/RetarderTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/RetarderTest.cs index 43f559dc9c..5635989faf 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/RetarderTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/RetarderTest.cs @@ -33,6 +33,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Simulation.Impl; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Impl; diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs index 90ea43e51c..64d71bcb4f 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponent/VehicleTest.cs @@ -34,6 +34,7 @@ using System.IO; using NUnit.Framework; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/AccelerationCurveTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/AccelerationCurveTest.cs index e05927a576..c04bc986b6 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/AccelerationCurveTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/AccelerationCurveTest.cs @@ -31,6 +31,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.SimulationComponent.Data; namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs index cbb7c430a2..7c672100e5 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs @@ -36,6 +36,7 @@ using NLog.Config; using NLog.Targets; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs index e134221053..25e65c5ef2 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs @@ -36,6 +36,7 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine; using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox; diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs index acef3487d4..b7d5740fb5 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/ValidationTest.cs @@ -38,6 +38,7 @@ using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader; +using TUGraz.VectoCore.InputData.Reader.ComponentData; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation.Data; -- GitLab