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

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

higher range for loss map in 12t Truck for Declaration Mode

parent f17c5215
No related branches found
No related tags found
No related merge requests found
......@@ -122,25 +122,20 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
{
get
{
var i = 0;
return (from gear in Body.GetEx(JsonKeys.Gearbox_Gears)
where i++ != 0
let lossMap =
ReadTableData(gear.GetEx<string>(JsonKeys.Gearbox_Gear_LossMapFile), string.Format("Gear {0} LossMap", i))
let fullLoadCurve =
ReadTableData(gear.GetEx<string>(JsonKeys.Gearbox_Gear_FullLoadCurveFile),
string.Format("Gear {0} FLD", i), false)
let shiftPolygon =
ReadTableData(gear.GetEx<string>(JsonKeys.Gearbox_Gear_ShiftPolygonFile),
string.Format("Gear {0} shiftPolygon", i), false)
select new TransmissionInputData() {
Gear = i,
Ratio = gear.GetEx<double>(JsonKeys.Gearbox_Gear_Ratio),
FullLoadCurve = fullLoadCurve,
LossMap = lossMap,
ShiftPolygon = shiftPolygon,
TorqueConverterActive = gear.GetEx<bool>(JsonKeys.Gearbox_Gear_TCactive)
}).Cast<ITransmissionInputData>().ToList();
var resultGears = new List<ITransmissionInputData>();
var gears = Body.GetEx(JsonKeys.Gearbox_Gears);
for (var i = 1; i < gears.Count(); i++) {
var gear = gears[i];
var inputData = new TransmissionInputData {
Gear = i,
Ratio = gear.GetEx<double>(JsonKeys.Gearbox_Gear_Ratio),
FullLoadCurve = ReadTableData(gear.GetEx<string>(JsonKeys.Gearbox_Gear_FullLoadCurveFile), string.Format("Gear {0} FLD", i), false),
LossMap = ReadTableData(gear.GetEx<string>(JsonKeys.Gearbox_Gear_LossMapFile), string.Format("Gear {0} LossMap", i)),
ShiftPolygon = ReadTableData(gear.GetEx<string>(JsonKeys.Gearbox_Gear_ShiftPolygonFile), string.Format("Gear {0} shiftPolygon", i), false),
TorqueConverterActive = gear.GetEx<bool>(JsonKeys.Gearbox_Gear_TCactive)};
resultGears.Add(inputData);
}
return resultGears;
}
}
......
......@@ -91,14 +91,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
try {
return VectoCSVFile.Read(Path.Combine(BasePath, filename), true);
} catch (Exception e) {
if (required) {
throw new VectoException(string.Format("Invalid {0}: {1}", tableType, filename), e);
}
Log.Warn("Failed to read file {0} {1}", Path.Combine(BasePath, filename), tableType);
throw new VectoException(string.Format("Failed to read file for {0}: {1}", tableType, filename), e);
}
}
if (required) {
throw new VectoException("Invalid {0}: {1}", tableType, filename);
throw new VectoException("Invalid filename for {0}: {1}", tableType, filename);
}
return null;
}
......@@ -469,19 +467,18 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
if (acceleration == null || EmptyOrInvalidFileName(acceleration.Value<string>())) {
throw new VectoException("AccelerationCurve (VACC) required");
}
var accelerationData = ReadTableData(acceleration.Value<string>(), "DriverAccelerationCurve", false);
if (accelerationData != null) {
return accelerationData;
}
try {
var cycleDataRes =
RessourceHelper.ReadStream(RessourceHelper.Namespace + "VACC." + acceleration.Value<string>() +
Constants.FileExtensions.DriverAccelerationCurve);
accelerationData = VectoCSVFile.ReadStream(cycleDataRes);
} catch (Exception e) {
throw new VectoException("Failed to read Driver Acceleration Curve", e);
return ReadTableData(acceleration.Value<string>(), "DriverAccelerationCurve", false);
} catch (VectoException e) {
Log.Warn("Could not find file for acceleration curve. Trying lookup in declaration data.");
try {
var cycleDataRes = RessourceHelper.ReadStream(RessourceHelper.Namespace + "VACC." + acceleration.Value<string>() +
Constants.FileExtensions.DriverAccelerationCurve);
return VectoCSVFile.ReadStream(cycleDataRes);
} catch (Exception) {
throw new VectoException("Failed to read Driver Acceleration Curve: " + e.Message, e);
}
}
return accelerationData;
}
}
......
......@@ -129,3 +129,13 @@ Input Speed [rpm],Input Torque [Nm],Torque Loss [Nm],Eff [-]
2000,-1000,25.94,
2200,-1000,26.336,
2400,-1000,26.732,
2600,-1000,27.232,
2600,-350,14.232,
2600,-150,10.232,
2600,50,8.232,
2600,250,12.232,
2600,450,16.232,
2600,650,20.232,
2600,850,24.232,
2600,1050,28.232,
2600,1600,33.5,
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