diff --git a/VECTO/Input Files/Vehicle.vb b/VECTO/Input Files/Vehicle.vb index 980d3f7f42c030a7458be5a164d9edfc46f1d97a..a60da3c75b80ccd14f5251135cba3a82c7333294 100644 --- a/VECTO/Input Files/Vehicle.vb +++ b/VECTO/Input Files/Vehicle.vb @@ -290,7 +290,7 @@ Public Class Vehicle Public ReadOnly Property CertificationNumber As String Implements IComponentInputData.CertificationNumber Get - Return "N.A." 'ToDo + Return "N.A." ' Todo: MQ 20160908 End Get End Property diff --git a/VECTOAux/VectoAuxiliaries/AdvancedAuxiliaries.vb b/VECTOAux/VectoAuxiliaries/AdvancedAuxiliaries.vb index 47d9a7596d401e65d163ec184bdabc5fc9a765f1..47ad622181dea7f5626b906e10ba9310a70acf07 100644 --- a/VECTOAux/VectoAuxiliaries/AdvancedAuxiliaries.vb +++ b/VECTOAux/VectoAuxiliaries/AdvancedAuxiliaries.vb @@ -476,7 +476,7 @@ Public Class AdvancedAuxiliaries End Property - 'TODO:REMOVE WHEN TESTING IS COMPLETE + 'TODO:REMOVE WHEN TESTING IS COMPLETE - MK2017-06-26: what should be removed? I can't see the "pure-diagnostics" 'PURE DIAGNOSTICS SHOULD ONLY BE USED IN MOD FOR ENGINEERING TESTS Public ReadOnly Property AA_D_M12_INTERP1 As Kilogram Implements IAdvancedAuxiliaries.AA_D_M12_INTERP1 diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/cMAP.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/cMAP.vb index b32e65b86b56326e8187d65922a56f3c90787e2d..7b8c13d27d42bff352cbea31fec97461f7564548 100644 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/cMAP.vb +++ b/VECTOAux/VectoAuxiliaries/DownstreamModules/cMAP.vb @@ -28,7 +28,7 @@ Public Class cMAP lFC = Nothing LTq = Nothing LnU = Nothing - iMapDim = -1 + iMapDim = - 1 FuelMap = New cDelaunayMap End Sub @@ -46,7 +46,6 @@ Public Class cMAP 'Stop if there's no file If sFilePath = "" OrElse Not IO.File.Exists(sFilePath) Then - 'If ShowMsg Then WorkerMsg(tMsgID.Err, "Map file not found! (" & sFilePath & ")", MsgSrc) Return False End If @@ -54,7 +53,6 @@ Public Class cMAP file = New cFile_V3 If Not file.OpenRead(sFilePath) Then file = Nothing - 'TODO:WORKERMESSAGE If ShowMsg Then WorkerMsg(tMsgID.Err, "Failed to open file (" & sFilePath & ") !", MsgSrc) Return False End If @@ -87,7 +85,7 @@ Public Class cMAP 'Check sign If CSng(line(2)) < 0 Then file.Close() - 'TODO:WORKERMESSAGEIf ShowMsg Then WorkerMsg(tMsgID.Err, "FC < 0 in map at " & nU & " [1/min], " & line(1) & " [Nm]", MsgSrc) + Return False End If @@ -97,7 +95,7 @@ Public Class cMAP Loop Catch ex As Exception - 'TODO:WORKERMESSAGE If ShowMsg Then WorkerMsg(tMsgID.Err, "Error during file read! Line number " & iMapDim + 1 & " (" & sFilePath & ")", MsgSrc, sFilePath) + GoTo lbEr End Try @@ -111,7 +109,7 @@ Public Class cMAP 'ERROR-label for clean Abort -lbEr: + lbEr: file.Close() file = Nothing @@ -140,8 +138,8 @@ lbEr: val = CType(FuelMap.Intpol(nU, Tq), Single) If FuelMap.ExtrapolError Then - 'TODO:WORKERMESSAGE WorkerMsg(tMsgID.Err, "Cannot extrapolate FC map! n= " & nU.ToString("0.0") & " [1/min], Me= " & Tq.ToString("0.0") & " [Nm]", "MAP/FC_Intp") - Return -10000 + + Return - 10000 Else Return val End If diff --git a/VectoCore/VectoCore/Configuration/Constants.cs b/VectoCore/VectoCore/Configuration/Constants.cs index 39866f24b040a941f7486b21034505e4851b898c..1bfde99ff9e9708a085b97eb99d6a62733e57ca8 100644 --- a/VectoCore/VectoCore/Configuration/Constants.cs +++ b/VectoCore/VectoCore/Configuration/Constants.cs @@ -36,6 +36,7 @@ namespace TUGraz.VectoCore.Configuration { public static class Constants { + public static Second DefaultPowerShiftTime = 0.8.SI<Second>(); public const double RPMToRad = 2 * Math.PI / 60; public const double Kilo = 1000; public const double MeterPerSecondToKMH = 3.6; diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs index 4a0aaca25f61f92a241022b8024e2d2114fac47f..192771cdbbaa19997e16ae51d2125542d8e565ca 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONGearboxData.cs @@ -389,7 +389,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON { get { return Body["PowershiftShiftTime"] == null - ? 0.8.SI<Second>() + ? Constants.DefaultPowerShiftTime : Body.GetEx<double>("PowershiftShiftTime").SI<Second>(); } } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 4321fb273c867e832cbabb552e6afae6bf8311d9..2e17f9602e86bcbc7916ad2014d5dc44e21f13f1 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -386,7 +386,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } var fc = result.Value; - //TODO mk-2015-11-11: calculate aux start stop correction var fcAux = fc; var fcWHTC = fcAux * ModelData.FuelConsumptionCorrectionFactor; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs index 8609584f951d3d9cdcdd94031ff90b85f557cc59..1b384fa2ae89ec89de42f3e24704ebded0ef4945 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CycleGearbox.cs @@ -206,15 +206,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var inAngularVelocity = outAngularVelocity * effectiveRatio; - // TODO: MQ 20170111 - disabled this check, caused more problems than it actually solved... -- re-think - //if (!dryRun && ModelData.Type.AutomaticTransmission() && torqueConverterLocked && - // inAngularVelocity.IsSmaller(DataBus.EngineIdleSpeed) && !dryRun) { - // Log.Error( - // "ERROR: EngineSpeed is lower than Idlespeed in Measuredspeed-Cycle with given Gear (Automatic Transmission). AbsTime: {0}, Gear: {1} TC-Active: {2}, EngineSpeed: {3}", - // absTime, Gear, !torqueConverterLocked, inAngularVelocity.AsRPM); - // return new ResponseEngineSpeedTooLow { Source = this, EngineSpeed = inAngularVelocity }; - //} - if (!inAngularVelocity.IsEqual(0)) { // MQ 19.2.2016: check! inertia is related to output side, torque loss accounts to input side CurrentState.InertiaTorqueLossOut = @@ -236,13 +227,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (TorqueConverter != null && !torqueConverterLocked) { return TorqueConverter.Request(absTime, dt, inTorque, inAngularVelocity, true); } - // mk 2016-12-13 - //if (outTorque.IsSmaller(0) && inAngularVelocity.IsSmaller(DataBus.EngineIdleSpeed)) { - // //Log.Warn("engine speed would fall below idle speed - disengage! gear from cycle: {0}, vehicle speed: {1}", Gear, - // // DataBus.VehicleSpeed); - // Gear = 0; - // return RequestDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun); - //} + var dryRunResponse = NextComponent.Request(absTime, dt, inTorque, inAngularVelocity, true); dryRunResponse.GearboxPowerRequest = outTorque * avgOutAngularVelocity; return dryRunResponse; @@ -250,7 +235,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState.TransmissionTorqueLoss = inTorque * effectiveRatio - outTorque; - CurrentState.SetState(inTorque, inAngularVelocity, outTorque, outAngularVelocity); CurrentState.Gear = Gear; // end critical section @@ -259,13 +243,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl CurrentState.TorqueConverterActive = true; return TorqueConverter.Request(absTime, dt, inTorque, inAngularVelocity); } - // mk 2016-12-13 - //if (outTorque.IsSmaller(0) && inAngularVelocity.IsSmaller(DataBus.EngineIdleSpeed)) { - // Log.Warn("engine speed would fall below idle speed - disengage! gear from cycle: {0}, vehicle speed: {1}", Gear, - // DataBus.VehicleSpeed); - // Gear = 0; - // return RequestDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun); - //} + if (TorqueConverter != null) { TorqueConverter.Locked(CurrentState.InTorque, CurrentState.InAngularVelocity, CurrentState.InTorque, CurrentState.InAngularVelocity); @@ -319,26 +297,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl }; } - - //var motoringSpeed = DataBus.EngineIdleSpeed; - //var disengagedResponse = NextComponent.Request(absTime, dt, 0.SI<NewtonMeter>(), DataBus.EngineIdleSpeed); - //if (!(disengagedResponse is ResponseSuccess)) { - // motoringSpeed = DataBus.EngineSpeed; - // if (motoringSpeed.IsGreater(DataBus.EngineIdleSpeed)) { - // var first = (ResponseDryRun)NextComponent.Request(absTime, dt, 0.SI<NewtonMeter>(), motoringSpeed, true); - // try { - // motoringSpeed = SearchAlgorithm.Search(motoringSpeed, first.DeltaDragLoad, - // Constants.SimulationSettings.EngineIdlingSearchInterval, - // getYValue: result => ((ResponseDryRun)result).DeltaDragLoad, - // evaluateFunction: n => NextComponent.Request(absTime, dt, 0.SI<NewtonMeter>(), n, true), - // criterion: result => ((ResponseDryRun)result).DeltaDragLoad.Value()); - // } catch (VectoException) { - // Log.Warn("CycleGearbox could not find motoring speed for disengaged state."); - // } - // motoringSpeed = motoringSpeed.LimitTo(DataBus.EngineIdleSpeed, DataBus.EngineSpeed); - // } - // disengagedResponse = NextComponent.Request(absTime, dt, 0.SI<NewtonMeter>(), motoringSpeed); - //} IResponse disengagedResponse; if (GearboxType.AutomaticTransmission()) { disengagedResponse = EngineIdleRequest(absTime, dt); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index 485e4be47eed6f39d59f07d33d94fb529f1ed29c..32e606de4d9a39e2d10891d0e5c05b75217a6c78 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -450,7 +450,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } else { if (DataBus.VehicleSpeed.IsSmallerOrEqual(0.SI<MeterPerSecond>())) { // the clutch is disengaged, and the vehicle stopped - we can't perform a roll action. wait for the clutch to be engaged - // todo mk 2016-08-23: is this still needed? var remainingShiftTime = Constants.SimulationSettings.TargetTimeInterval; while (!DataBus.ClutchClosed(absTime + remainingShiftTime)) { remainingShiftTime += Constants.SimulationSettings.TargetTimeInterval; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs index dbae9245a3542a478016f308e9015468cad9c090..5ef7c018e3e3a1d472b5b76b296da1fe215ec3f5 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs @@ -419,10 +419,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl // only use the one with min. speed if (cycleIterator.RightSample.VehicleTargetSpeed < lookaheadEntry.VehicleTargetSpeed) { retVal.Remove(lookaheadEntry); - retVal.Add(cycleIterator.RightSample); // TODO: MQ 2016-05-13: use clone of iterator here? + retVal.Add(cycleIterator.RightSample); } } else { - retVal.Add(cycleIterator.RightSample); // TODO: MQ 2016-05-13: use clone of iterator here? + retVal.Add(cycleIterator.RightSample); } velocity = cycleIterator.RightSample.VehicleTargetSpeed; if (velocity.IsEqual(0.KMPHtoMeterPerSecond())) { diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationWriter.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationWriter.cs index 87fb34848e02e6e620f8fc6ae3f8f5afe2c7bb26..bff1895e9200b99d2969ae2e6c21a796ffe6ce01 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationWriter.cs @@ -360,8 +360,8 @@ namespace TUGraz.VectoCore.OutputData.XML new XElement(tns + XMLNames.ComponentDataWrapper, new XAttribute(XMLNames.Component_ID_Attr, id), GetDefaultComponentElements(data.Model, "N.A."), - new XElement(tns + "CdxA_0", data.AirDragArea.Value().ToXMLFormat(2)), // TODO - new XElement(tns + "TransferredCdxA", data.AirDragArea.Value().ToXMLFormat(2)), // TODO + new XElement(tns + "CdxA_0", data.AirDragArea.Value().ToXMLFormat(2)), // TODO MQ + new XElement(tns + "TransferredCdxA", data.AirDragArea.Value().ToXMLFormat(2)), // TODO MQ new XElement(tns + XMLNames.AirDrag_DeclaredCdxA, data.AirDragArea.Value().ToXMLFormat(2))), AddSignatureDummy(id) ); diff --git a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs index b04558a032a19f417e6e7b5efd78f3bd41e4bc67..0d28bcb8b48511ede6cd2a63f058d931479ab878 100644 --- a/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs +++ b/VectoCore/VectoCoreTest/XML/XMLEngineeringInputSingleTest.cs @@ -436,13 +436,14 @@ namespace TUGraz.VectoCore.Tests.XML Assert.AreEqual(DeclarationData.Gearbox.StartAcceleration.Value(), shiftStrategy.StartAcceleration.Value(), 1e-6); Assert.AreEqual(DeclarationData.Gearbox.TorqueReserveStart, shiftStrategy.StartTorqueReserve, 1e-6); - // TODO: MQ 2017-01-16: introduce constants, use also in input data provider! - Assert.AreEqual(0.8, shiftStrategy.PowershiftShiftTime.Value(), 1e-6); + AssertHelper.AreRelativeEqual(Constants.DefaultPowerShiftTime, shiftStrategy.PowershiftShiftTime); var tcShiftStrategy = inputDataProvider.GearboxInputData.TorqueConverter; - Assert.AreEqual(0.1, tcShiftStrategy.CCUpshiftMinAcceleration.Value(), 1e-6); - Assert.AreEqual(0.1, tcShiftStrategy.CLUpshiftMinAcceleration.Value(), 1e-6); + AssertHelper.AreRelativeEqual(DeclarationData.TorqueConverter.CCUpshiftMinAcceleration, + tcShiftStrategy.CCUpshiftMinAcceleration); + AssertHelper.AreRelativeEqual(DeclarationData.TorqueConverter.CLUpshiftMinAcceleration, + tcShiftStrategy.CLUpshiftMinAcceleration); } [TestMethod]