Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 0e1ba50b authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Cleanup

parent b17536ea
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,6 @@ using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter;
using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
[assembly: InternalsVisibleTo("VectoCoreTest")]
......@@ -44,9 +43,6 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
{
public class EngineeringModeVectoRunDataFactory : LoggingObject, IVectoRunDataFactory
{
// todo mk-2016-10-11: field is never used. Delete?
protected DriverData Driver;
protected readonly IEngineeringInputDataProvider InputDataProvider;
internal EngineeringModeVectoRunDataFactory(IEngineeringInputDataProvider dataProvider)
......
......@@ -69,10 +69,6 @@ namespace TUGraz.VectoCore.Models.Simulation.Data
public AdvancedAuxData AdvancedAux { get; internal set; }
// todo mk 2016-08-30: property is never used. Delete?
[ValidateObject]
public string AccelerationLimitingFile { get; internal set; }
[ValidateObject]
public RetarderData Retarder { get; internal set; }
......@@ -173,7 +169,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Data
}
} catch (VectoException) {
return new ValidationResult(
string.Format("Interpolation of Angledrive-LossMap failed with torque={1} and angularSpeed={2}", gear.Key,
string.Format("Interpolation of Angledrive-LossMap failed with torque={0} and angularSpeed={1}",
angledriveTorque, (angularVelocity / gear.Value.Ratio).ConvertTo().Rounds.Per.Minute));
}
......
......@@ -214,10 +214,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
minAcceleration = VectoMath.Min(minAcceleration, DataBus.DriverAcceleration);
var minAccelerationReachable = reachableAcceleration.IsGreaterOrEqual(minAcceleration);
// todo mk-2016-12-19: check that accMin can be reached!
// todo l->l+1 LaccMin must be reachable
// todo C->l TCLaccMin must be reachable
// todo acc > min(driver-demand-acc, accMin)
if (isAboveUpShift && minAccelerationReachable) {
Upshift(absTime, gear);
return true;
......@@ -238,14 +234,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var engineSpeedOverMin = tcOperatingPoint.InAngularVelocity.IsGreater(minEngineSpeed);
// todo mk-2016-12-19: calculate accelerationReachable with param TCCaccMin: acc > min(driver-demand-acc, TCCaccMin)
var reachableAcceleration = EstimateAccelerationForGear(gear + 1, outAngularVelocity);
var minAcceleration = VectoMath.Min(ModelData.TorqueConverterData.CCUpshiftMinAcceleration,
DataBus.DriverAcceleration);
var minAccelerationReachable = reachableAcceleration.IsGreaterOrEqual(minAcceleration);
if (shiftTimeReached && engineSpeedOverMin && minAccelerationReachable) {
if (engineSpeedOverMin && minAccelerationReachable) {
Upshift(absTime, gear);
return true;
}
......@@ -296,10 +290,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
NewtonMeter inTorque, PerSecond inAngularVelocity, uint gear, Second lastShiftTime)
{
var shiftTimeReached = (absTime - lastShiftTime).IsGreaterOrEqual(ModelData.ShiftTime);
if (!shiftTimeReached)
return false;
if (IsBelowDownShiftCurve(gear, inTorque, inAngularVelocity)) {
if (shiftTimeReached && IsBelowDownShiftCurve(gear, inTorque, inAngularVelocity)) {
Downshift(absTime, gear);
return true;
}
......
......@@ -29,7 +29,6 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System.Collections.Generic;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.Connector.Ports.Impl;
......@@ -41,8 +40,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
public class EngineOnlyCombustionEngine : CombustionEngine
{
protected readonly List<Second> EnginePowerCorrections = new List<Second>();
public EngineOnlyCombustionEngine(IVehicleContainer container, CombustionEngineData modelData)
: base(container, modelData) {}
......@@ -88,39 +85,29 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
UpdateEngineState(CurrentState.EnginePower, avgEngineSpeed);
// = requestedEnginePower; //todo + _currentState.EnginePowerLoss;
CurrentState.EngineTorque = CurrentState.EnginePower / CurrentState.EngineSpeed;
return new ResponseSuccess() { Source = this };
return new ResponseSuccess { Source = this };
}
protected NewtonMeter LimitEnginePower(NewtonMeter requestedEngineTorque, PerSecond avgEngineSpeed, Second AbsTime)
protected NewtonMeter LimitEnginePower(NewtonMeter requestedEngineTorque, PerSecond avgEngineSpeed, Second absTime)
{
if (requestedEngineTorque > CurrentState.DynamicFullLoadTorque) {
if (requestedEngineTorque / CurrentState.DynamicFullLoadTorque > MaxTorqueExceededThreshold) {
EnginePowerCorrections.Add(AbsTime);
Log.Warn("t: {0} requested power > P_engine_full * 1.05 - corrected. P_request: {1} P_engine_full: {2}",
AbsTime, requestedEngineTorque * avgEngineSpeed, CurrentState.DynamicFullLoadTorque * avgEngineSpeed);
absTime, requestedEngineTorque * avgEngineSpeed, CurrentState.DynamicFullLoadTorque * avgEngineSpeed);
}
return CurrentState.DynamicFullLoadTorque;
}
if (requestedEngineTorque < CurrentState.FullDragTorque) {
if (requestedEngineTorque / CurrentState.FullDragTorque > MaxTorqueExceededThreshold &&
requestedEngineTorque > -99999) {
EnginePowerCorrections.Add(AbsTime);
Log.Warn("t: {0} requested power < P_engine_drag * 1.05 - corrected. P_request: {1} P_engine_drag: {2}",
AbsTime, requestedEngineTorque * avgEngineSpeed, CurrentState.FullDragTorque * avgEngineSpeed);
absTime, requestedEngineTorque * avgEngineSpeed, CurrentState.FullDragTorque * avgEngineSpeed);
}
return CurrentState.FullDragTorque;
}
return requestedEngineTorque;
}
public IList<string> Warnings()
{
IList<string> retVal = new List<string>();
retVal.Add(string.Format("Engine power corrected (>5%) in {0} time steps ", EnginePowerCorrections.Count));
return retVal;
}
}
}
\ No newline at end of file
......@@ -48,27 +48,6 @@ namespace TUGraz.VectoCore.OutputData
public interface IModalDataContainer
{
/// <summary>
/// Identify which run this modaldata container is for
/// </summary>
//todo mk 2016-10-11: Field is never used. Delete?
[Obsolete]
string RunName { get; }
/// <summary>
/// Identify which cycle is simulated
/// </summary>
//todo mk 2016-10-11: Field is never used. Delete?
[Obsolete]
string CycleName { get; }
/// <summary>
/// Custom suffix for this run, typically the loading type
/// </summary>
//todo mk 2016-10-11: Field is never used. Delete?
[Obsolete]
string RunSuffix { get; }
/// <summary>
/// Indexer for fields of the DataWriter. Accesses the data of the current step.
/// </summary>
......@@ -121,38 +100,12 @@ namespace TUGraz.VectoCore.OutputData
return data.GetValues<SI>(field).Min();
}
//todo mk 2016-10-11: Field is never used. Delete?
[Obsolete]
public static SI Average(this IModalDataContainer data, ModalResultField field, Func<SI, bool> filter = null)
{
return data.GetValues<SI>(field).Average(filter);
}
//todo mk 2016-10-11: Field is never used. Delete?
[Obsolete]
public static SI Sum(this IModalDataContainer data, ModalResultField field, Func<SI, bool> filter = null)
{
return data.GetValues<SI>(field).Where(filter ?? (x => x != null)).Sum();
}
//todo mk 2016-10-11: Field is never used. Delete?
[Obsolete]
public static SI Sum(this IModalDataContainer data, DataColumn col, Func<SI, bool> filter = null)
{
return data.GetValues<SI>(col).Where(filter ?? (x => x != null)).Sum();
}
public static SI Average(this IEnumerable<SI> self, Func<SI, bool> filter)
{
var values = self.Where(filter ?? (x => x != null && !double.IsNaN(x.Value()))).ToList();
return values.Any() ? values.Sum() / values.Count : null;
}
public static T DefaultIfNull<T>(this T self, T defaultValue) where T : class
{
return self ?? defaultValue;
}
/// <summary>
/// Returns a default value if the SI object is null.
/// </summary>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment