diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs index c4539df2e36bf015300fb0bf990bbdeed77bd48d..7c97f02e9c0be90199557b2ae06776b3b85e9505 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 6e2da668579e917d7b163eba6fcb4dc03103ad2f..5ffa57f7bb729ae233fee73fcf6cad847e7b1618 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 1319d7c684457f3e809edbc7884552c34d31edfe..90601b59d4604a8b4836e4569c56c401607945a3 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 d9ec305f2ce260a2315ad8be26d1a8eeff02934d..ee00eb678551d9cc4796eaa7f33031f73b79df83 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 d47c2d21e58d0d7299a7d672f120432f0be57599..851eff68b67ad650600a3d535efd4629293b631c 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 2d628d8d3e8c30b7207be37f38ec09846591689e..c6a73dc2ec3091d45b3f4ab7b33a3e82f9beb0ee 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 cfd08c4c2e6f933add7b332836a2b71430c84f35..1eb46333c138920babc1dae6717ff55b87abaf0a 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 84a9400174d98d17bf96920eed4df482af071c83..d4bcd9f7b9f67334c351ffee854aa80e2719ca8c 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 49be92b05ad11f740c2ae76d78472d498807399f..4bb0ef3a468bf75b0d913cf96a40b652484935d2 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 3e0d12e355a8088300dd5325c1ee74fee9a771f1..b42a9df5b2285f142209c4abc0dc13dd62553b3a 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 f4fc790a2153fe369f75c6baad86caae12f4cf3b..2e02f9d19f44560597876892a57684003ef28f3c 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 9eb37c7934be5e3cde817029bd55406df3e624ee..71ebac1f3be020d79dad8fbff0041eb16c70dfb2 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 f8bfff7cd58b5d448d1b9dd9901fd20610a5ea41..8220d9731d6fdf09cea324e94a5ae2060dafaa7e 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 16d0b98001654e259a86b676e42d350badeaafb6..0abcc5e95e3e1194683f34e9bba0f5fc1df81290 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 7a42e99a468de9ba05e78010e737b6e6c95010ed..556d4524fa614dc0a0b5b9b61b714bb73efbb985 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 3dc38204ca63f0b23e93b9893343ac66fb3abdf4..c1f94c0cc4b27a410811a728acddbaec2c9ab632 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 e899ddc1bdc60b7768311fb3f0e9959b7cda911a..bd968c9cb380c1db44c5f0f3f92d847ffa117f48 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 4ce4fe1ad153ca27f84177b7c044e91661bdd2ad..c95664d566e8009be2d9e57dfd56e22d2346e487 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 c03e24c1ca8a3b3c33140a60c74ca9da94061e4f..c63e4e3fca179a1c596710eab8b31532443277cb 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 d01da5ed023947f33afcd6895f9604a19bab3e50..e978f6f091a0bffa2638655db93e61a91bbabc52 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 a00df4971930282ae359b47b643678f65373c246..4534be8a1ea35b13f45917870354703b3b83c9ab 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 9e36e4a88041a853b149ed581e420646ca04f321..7d18e4f1948f64c47a08f266b6d01f95d83a59db 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 96478896ffa410e3fb4e0f024593f8ac956591e1..c3805b4f4ba256a0c44daa68f244d07a78721178 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 e8053c20ea6c8d0c1a0da6dc932904effb42e7be..ad52bffd2940dc50b46252ddd1edfd6397fdd9bb 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 68e96cfc5025a188041d0a1a0eba3e10cd5a37b5..2d1007314489659d49eb7a1e24e18893f6c5b83e 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 0c089b04af8c936f95e83a0aa172361735abb4e6..534657c750c0c374290ba99bc4724ad2d2a85a8b 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 b6627f1895eb89f309e66fd72c473218d9ac5900..cf8d3e0e6b0b13a562ccd3cf071687e803cbb07f 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 b11b4cd5e40c393432bb3acf4f5b5605432120e7..f9a3e5520b96d2902a66f455f5022bef254fc523 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 26d4774ea74d6dcf7b0d65292b24eea8b72a4b82..deb69b72f7a4cd8eca9d4751bb89616ad2ea1b19 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 e427d65f315ec4f607a1a561684bb4faa0b87d1d..21b5ae27b5dc6f20e1dbba193ca09ae1e7d213ef 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 557e3ef5116017fb1ab137f5eed05df8dfd60bd2..170b2f50f0ced831e85f893b8236d1a41e396c97 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 5c4160abecc0e3d3e9522a25f31fea8f6d1a49c5..83b07b0710f7aa3de8fba1fe9533e5b555e1016b 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 319f5b3e948dfd2a3ea7a7ca6160c50b65e102e1..fbad43ba46d92040bcfc4e4a3b5eaff12415300a 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 12f3ceaf702bd75c18e7693b14ab84d00c37e7a8..fb83f206e53c627dd1a40812a6cabcdd00272efd 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 9dec7cddfa6007f1fb89c02ef18bc0a902cb7b09..4c6e6caed13a61e94fef99c578f30eaa96ad9e02 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 7b38571e55eb7a9071b54282f76d050565e55855..0d9936cc9dbbec3154712a6b47929319c712a6e7 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 d4354a0d056ae3a117f5e7c9fdd4c57394b2b227..de59438ba3e12b4d503e137017b1f656ce60799b 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 2cb77d1e63c06d60e7da957ef2b7c2ee369b7649..f3de1d34b4e7eac28e218ad8142f132510fbc70e 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 76b97e56b9957f243473fd8a4915c57b215d63db..5ecbcdbea42130319c53e0d9611be7d22c799a1d 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 13e8e63da27126f0d49f5928e0f45f91bf7a1a09..acbcd043441957344cf991d000ca19b2e861c01d 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 de044761e86e2a76e1b04cc9ca7f93ba87922c48..43eada0b840117ad1ac86a061461526bc31c0e3e 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 3af177aabb8a955c1aad93a00002986feb9ebddb..18df85edb9788588482642d3782d058dcfc7ee44 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 36c30a9ffe5c6d98aaaca38447dcd0e83b665571..983ce5cf3fcfe1a50c5df6597d71cd7b1f98a09d 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 28ec611a54de1657a44231655f60751a17b63770..a0921ac24a12ad4fc3616d30b20969ae0ebe3384 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 b2b3f14f309ff09b2cd5858ce334fcd656c4267e..8359471720f383b0d84e1b233e0212be18dc8ba0 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 f216e777b9eb816ffc915a124f548a474b5b3f30..eb55061f4b0ff5a45491b03569ab34a248051473 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 e1cb4c676688a37c6c46e9174ea40ec693c1e4ef..4f6e12dbf501f6d282ab3082f613ef0553019dbe 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 7a659136b693c63c374af1911cced14e7c72439f..4c047df1fff591e52d1d0e3c034c3e48ff662061 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 7900f00107faf96d176838188c1427127a8247fe..2dc8dad844ee75a31fe97e05952ec3530681f8b3 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 a67cc3771a4d4a8ea818cdf61af9a3a63e6221fd..c2d195028f31115a2a14b4ff4f453c4f45cc1ac7 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 261a7d10273ebe206c6c92c730dcdffa6d48020b..4d25a7d51f23594ef048e7d02554bf336583e317 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 049b07ec2d7e7ad9b073b72bea71c8641b2d1078..6ed745e984d06975964a9daa521c10a640a1168f 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 39cf24c121e3aabd53a57eccc8c522c73f36c7fc..dd02c872da1a2752b13e31479fd7de99e5025d16 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 3e4dc0fb3ed93aaf13f8223e92e01b925e6dc537..5e67dcfb1528b25c98e34b75319fd4adff9f53ea 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 0d3b6e9723ccb04bfce22dbb2f31777d75b8e248..23338fa88a3c2370a75cd60b5e3f8e7295039b45 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 33722c85ce398ee0ff45910f8b1524d82b8559fd..b4c9b429c3493251ab308041a842b78a2282b9d1 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 bc4a4b808f05bba1ffa6041bad8903d66800b8cf..00c7e0db53a10b7a25c05972b1c121b1876f0fef 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 b832d2801c6e6cb1f76dc3b58d024b4519e42c42..64c1b97472aac76c35d528608011d180627ffe12 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 3baaded391ea484826385b6185dc0f7b589a6a8a..42ecc227c3fb369b5709dc0d496e1d06db6e197d 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 2eff2b8a78db57646d476f9506062348026a9ca2..58423bc151dc93968cd1c8f93c438f67e2d99f1d 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 83d65c1a60c0f76486f3e68145a1db42343d28c9..c9802f412b3ba5d4eb9a49547d4b16a3ca8fa052 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 89d2a3c987ac2ff9f0fcd669f3d15aff698f5e70..68efd7c76254a243cf5d0024cc5db522c0310be8 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 8d23f7038bc7b89b9ab78c73391511f22449f297..2846bea14641d849643f1bff9f4b1de2441b7b64 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 b076d54fe87bbe20574d66b3256f11ed6a2c8f45..e434ef9292a3af0170c2e8c034bb15927829f1a1 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 11b4389ef1c66a7112dcf36058e14dc16e9834ad..565b4313ef3970cede30bf4c9c311a2f540d756d 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 b8ad832394f5554711de0db6215a7bc8b832b3fc..8fcede0aed487fe85f923f6fcf318a51f8d626ad 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 43f559dc9c05bbd139155cd7c88f9e6cc417c29b..5635989fafd0da9def696e0552c731ece4e8e767 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 90ea43e51ccd6a4eabdaae12ea79acd3c3f2f530..64d71bcb4f8b1bfe2ff5f8d4bf2a8eb44f37db32 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 e05927a576d35002002ad32dfaf7f4c3ecc2377c..c04bc986b6ea80afbd29ae53ed6ce2250d23828c 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 cbb7c430a25dc70ccc1950c8c72bef7f4051bb06..7c672100e5d50a0591d8e36039ffd3ec827c28d7 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 e13422105359ab3efa6e5773f9d50f55fa68403d..25e65c5ef2001396fc2537f188d3224466506cb3 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 acef3487d4afd8ac6a2e2f40948c267771476796..b7d5740fb573b2eeac1c3e19654cd40329ae9c04 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;