Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit f1ac192c authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

get correct cycle name and estimated driving time

parent 9a052e3b
No related branches found
No related tags found
No related merge requests found
using System;
using System.IO;
using System.Windows.Forms.VisualStyles;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Models.Simulation;
......@@ -29,57 +30,50 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var tmpAux = new AdvancedAuxiliaries();
// 'Set Statics
tmpAux.VectoInputs.Cycle = DetermineCycle(cycleName);
tmpAux.VectoInputs.Cycle = DetermineCycle(cycleName, tmpAux.Signals);
tmpAux.VectoInputs.VehicleWeightKG = (float)vehicleWeight.Value();
_fcMapAdapter = new FuelConsumptionAdapter() { FcMap = fcMap };
tmpAux.VectoInputs.FuelMap = _fcMapAdapter;
tmpAux.VectoInputs.FuelDensity = Physics.FuelDensity.Value();
//'Set Signals
tmpAux.Signals.TotalCycleTimeSeconds = 15000; // TODO MQ: get cycle time somehow!
tmpAux.Signals.EngineIdleSpeed = (float)(engineIdleSpeed.Value() / Constants.RPMToRad);
tmpAux.Initialise(Path.GetFileName(aauxFile), Path.GetDirectoryName(Path.GetFullPath(aauxFile)) + @"\");
Auxiliaries = tmpAux;
}
private static string DetermineCycle(string cycleName)
private static string DetermineCycle(string cycleName, ISignals aauxsignals)
{
return "Coach";
// Public Function DetermineCycleNameFromCurrentFile() As String
var cycle = cycleName.ToLower();
// 'Get DriveFile without path and without extension
// Dim driveFile As String = fFILE(CurrentCycleFile, False)
// Select Case (True)
// 'DJN - update to make contains test case insensitive
// Case driveFile.ToLower().Contains("heavy_urban") AndAlso driveFile.ToLower().Contains("bus")
// Return "Heavy urban"
// Case driveFile.ToLower().Contains("suburban") AndAlso driveFile.ToLower().Contains("bus")
// Return "Suburban"
// Case driveFile.ToLower().Contains("urban") AndAlso driveFile.ToLower().Contains("bus")
// Return "Urban"
// Case driveFile.ToLower().Contains("interurban") AndAlso driveFile.ToLower().Contains("bus")
// Return "Interurban"
// Case driveFile.ToLower().Contains("coach")
// Return "Coach"
// Case Else
// WorkerMsg(tMsgID.Warn,
// String.Format("UnServiced Cycle Name '{0}' in Pneumatics Actuations Map 0 Actuations returned", driveFile),
// "Advanced Auxiliaries")
// Return "UnknownCycleName"
// End Select
// Return "Urban"
//End Function
// cycle time is hard coded based on previous simulations
if (cycle.Contains("bus")) {
if (cycle.Contains("heavy_urban")) {
aauxsignals.TotalCycleTimeSeconds = 8912;
return "Heavy urban";
}
if (cycle.Contains("suburban")) {
aauxsignals.TotalCycleTimeSeconds = 3283;
return "Suburban";
}
if (cycle.Contains("urban")) {
aauxsignals.TotalCycleTimeSeconds = 8149;
return "Urban";
}
if (cycle.Contains("interurban")) {
aauxsignals.TotalCycleTimeSeconds = 12962;
return "Interurban";
}
}
if (cycle.Contains("coach")) {
aauxsignals.TotalCycleTimeSeconds = 15086;
return "Coach";
}
Logger<BusAuxiliariesAdapter>()
.Warn("UnServiced Cycle Name '{0}' in Pneumatics Actuations Map 0 Actuations returned", cycleName);
aauxsignals.TotalCycleTimeSeconds = 1;
return "UnknownCycleName";
}
public IEngineAuxPort Port()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment