diff --git a/VectoCore/FileIO/Reader/DataObjectAdaper/EngineeringDataAdapter.cs b/VectoCore/FileIO/Reader/DataObjectAdaper/EngineeringDataAdapter.cs index a2e388d0f31f81ffb6243ac8eb16d0a8105ef775..e8ef2f3ce6a1729d6ed74e09241081f3d6755c45 100644 --- a/VectoCore/FileIO/Reader/DataObjectAdaper/EngineeringDataAdapter.cs +++ b/VectoCore/FileIO/Reader/DataObjectAdaper/EngineeringDataAdapter.cs @@ -60,8 +60,11 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper internal DriverData CreateDriverData(VectoJobFileV2Engineering job) { var data = job.Body; + AccelerationCurveData accelerationData = null; + if (!string.IsNullOrWhiteSpace(data.AccelerationCurve) && data.AccelerationCurve != "<NOFILE>") { + accelerationData = AccelerationCurveData.ReadFromFile(Path.Combine(job.BasePath, data.AccelerationCurve)); + } - var accelerationData = AccelerationCurveData.ReadFromFile(Path.Combine(job.BasePath, data.AccelerationCurve)); var lookAheadData = new DriverData.LACData { Enabled = data.LookAheadCoasting.Enabled, Deceleration = data.LookAheadCoasting.Dec.SI<MeterPerSquareSecond>(), @@ -169,12 +172,14 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper var lossMapPath = Path.Combine(gearbox.BasePath, gearSettings.LossMap); var lossMap = TransmissionLossMap.ReadFromFile(lossMapPath, gearSettings.Ratio); - var shiftPolygon = string.IsNullOrEmpty(gearSettings.ShiftPolygon) - ? null - : ShiftPolygon.ReadFromFile(Path.Combine(gearbox.BasePath, gearSettings.ShiftPolygon)); - var fullLoad = string.IsNullOrEmpty(gearSettings.FullLoadCurve) || gearSettings.FullLoadCurve.Equals("<NOFILE>") - ? null - : FullLoadCurve.ReadFromFile(Path.Combine(gearbox.BasePath, gearSettings.FullLoadCurve)); + var shiftPolygon = !string.IsNullOrEmpty(gearSettings.ShiftPolygon) && gearSettings.ShiftPolygon != "-" && + gearSettings.ShiftPolygon != "<NOFILE>" + ? ShiftPolygon.ReadFromFile(Path.Combine(gearbox.BasePath, gearSettings.ShiftPolygon)) + : null; + var fullLoad = !string.IsNullOrEmpty(gearSettings.FullLoadCurve) && gearSettings.FullLoadCurve != "<NOFILE>" && + gearSettings.FullLoadCurve != "-" + ? FullLoadCurve.ReadFromFile(Path.Combine(gearbox.BasePath, gearSettings.FullLoadCurve)) + : null; var gear = new GearData { LossMap = lossMap, diff --git a/VectoCore/FileIO/Reader/Impl/EngineeringModeSimulationDataReader.cs b/VectoCore/FileIO/Reader/Impl/EngineeringModeSimulationDataReader.cs index c1143630825ffca0dfb0075b26ee198c29969aca..d7345be529efb8ec212e95e74b68d9634f2aec5e 100644 --- a/VectoCore/FileIO/Reader/Impl/EngineeringModeSimulationDataReader.cs +++ b/VectoCore/FileIO/Reader/Impl/EngineeringModeSimulationDataReader.cs @@ -62,7 +62,10 @@ namespace TUGraz.VectoCore.FileIO.Reader.Impl Technology = a.Technology, TechList = a.TechList.DefaultIfNull(Enumerable.Empty<string>()).ToArray(), DemandType = AuxiliaryDemandType.Mapping, - Data = AuxiliaryData.ReadFromFile(Path.Combine(basePath, a.Path)) + Data = + (!string.IsNullOrWhiteSpace(a.Path) && a.Path != "<NOFILE>") + ? AuxiliaryData.ReadFromFile(Path.Combine(basePath, a.Path)) + : null }).Concat(new VectoRunData.AuxData { ID = "", DemandType = AuxiliaryDemandType.Direct }.ToEnumerable()).ToList(); } diff --git a/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs b/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs index 26bca7212073d5b07740e8e0cfaa89858a680555..04cac44461331049ccb98876963241a13d68322f 100644 --- a/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs +++ b/VectoCore/Models/SimulationComponent/Impl/ShiftStrategy.cs @@ -129,6 +129,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public AMTShiftStrategy(GearboxData data, IDataBus dataBus) : base(data, dataBus) { PreviousGear = 1; + + // todo: move to settings + Data.EarlyShiftUp = true; + Data.SkipGears = true; } @@ -318,31 +322,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public uint NextGear { get; set; } } - //TODO Implement MTShiftStrategy - public class MTShiftStrategy : ShiftStrategy + public class MTShiftStrategy : AMTShiftStrategy { - public MTShiftStrategy(GearboxData data, IDataBus bus) : base(data, bus) {} - - public override uint Engage(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outEngineSpeed) + public MTShiftStrategy(GearboxData data, IDataBus bus) : base(data, bus) { - throw new NotImplementedException(); - } - - public override void Disengage(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outEngineSpeed) - { - throw new NotImplementedException(); - } - - public override bool ShiftRequired(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity, - NewtonMeter inTorque, - PerSecond inAngularSpeed, uint gear, Second lastShiftTime) - { - throw new NotImplementedException(); - } - - public override uint InitGear(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outEngineSpeed) - { - throw new NotImplementedException(); + // todo: move to settings + Data.EarlyShiftUp = false; + Data.SkipGears = true; } }