Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

torque converter fields in mod file

parent 3ef01a51
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Data
/// <returns></returns>
object this[ModalResultField key] { get; set; }
bool HasTorqueConverter { get; set; }
/// <summary>
/// Commits the data of the current simulation step.
/// </summary>
......
......@@ -15,12 +15,15 @@ namespace TUGraz.VectoCore.Models.Simulation.Data
public ModalDataWriter(string modFileName, bool engineOnly)
{
HasTorqueConverter = false;
ModFileName = modFileName;
Data = new ModalResults();
CurrentRow = Data.NewRow();
_engineOnly = engineOnly;
}
public bool HasTorqueConverter { get; set; }
public void CommitSimulationStep()
{
Data.Rows.Add(CurrentRow);
......@@ -71,13 +74,14 @@ namespace TUGraz.VectoCore.Models.Simulation.Data
ModalResultField.Pbrake
});
//todo only add if (GBX.TCon)
dataColumns.AddRange(new[] {
ModalResultField.TCν,
ModalResultField.TCmu,
ModalResultField.TC_M_Out,
ModalResultField.TC_n_Out
});
if (HasTorqueConverter) {
dataColumns.AddRange(new[] {
ModalResultField.TCν,
ModalResultField.TCmu,
ModalResultField.TC_M_Out,
ModalResultField.TC_n_Out
});
}
//todo: auxiliaries
}
......
......@@ -105,10 +105,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
public IVectoSimulator Build(string cycleFile)
{
if (_engineOnly) {
return BuildEngineOnly(cycleFile);
}
return BuildFullPowertrain(cycleFile);
return _engineOnly ? BuildEngineOnly(cycleFile) : BuildFullPowertrain(cycleFile);
}
private IVectoSimulator BuildFullPowertrain(string cycleFile)
......@@ -189,6 +186,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
public void AddGearbox(string gearboxFile)
{
var gearboxData = GearboxData.ReadFromFile(gearboxFile);
_axleGear = new AxleGear(gearboxData.AxleGearData);
_dataWriter.HasTorqueConverter = gearboxData.HasTorqueConverter;
//todo init gearbox with gearbox data
_gearBox = new Gearbox(_container);
}
......
......@@ -96,7 +96,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
gearboxData._data = d;
for (uint i = 0; i < d.Body.Gears.Count; i++) {
var gearSettings = d.Body.Gears[(int) i];
var gearSettings = d.Body.Gears[(int)i];
var lossMapPath = Path.Combine(basePath, gearSettings.LossMap);
TransmissionLossMap lossMap = TransmissionLossMap.ReadFromFile(lossMapPath, gearSettings.Ratio);
......@@ -206,7 +206,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
public SI Inertia
{
get { return _data.Body.Inertia.SI().Kilo.Gramm.Square.Meter; }
protected set { _data.Body.Inertia = (double) value.ConvertTo().Kilo.Gramm.Square.Meter; }
protected set { _data.Body.Inertia = (double)value.ConvertTo().Kilo.Gramm.Square.Meter; }
}
/// <summary>
......@@ -263,6 +263,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
protected set { _data.Body.StartAcceleration = value; }
}
public bool HasTorqueConverter
{
get { return _data.Body.TorqueConverter != null; }
}
/// <summary>
/// A class which represents the json data format for serializing and deseralizing the GearboxData files
......
......@@ -18,7 +18,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
[TestMethod]
public void AxleGearTest()
{
VehicleContainer vehicle = new VehicleContainer();
var vehicle = new VehicleContainer();
var gbxData = GearboxData.ReadFromFile(GearboxDataFile);
//GearData gearData = new GearData();
var axleGear = new AxleGear(gbxData.AxleGearData);
......
......@@ -20,6 +20,8 @@ namespace TUGraz.VectoCore.Tests.Utils
public ModalResults Data { get; set; }
public DataRow CurrentRow { get; set; }
public bool HasTorqueConverter { get; set; }
public void CommitSimulationStep()
{
Data.Rows.Add(CurrentRow);
......
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