diff --git a/VectoCore/VectoCore/Models/GenericModelData/GenericBusEngineData.cs b/VectoCore/VectoCore/Models/GenericModelData/GenericBusEngineData.cs index 1f64039e29c162ad35a61aec94a82a09f2c04aff..e625cd2caa778b2d63ccd1d9de65712ba37ce8c1 100644 --- a/VectoCore/VectoCore/Models/GenericModelData/GenericBusEngineData.cs +++ b/VectoCore/VectoCore/Models/GenericModelData/GenericBusEngineData.cs @@ -145,13 +145,13 @@ namespace TUGraz.VectoCore.Models.Declaration foreach (var entry in clusterResult) { var dragTorque = fullLoadCurve.DragLoadStationaryTorque(entry.RPMtoRad()).Value(); var newRow = denormalizedData.NewRow(); - newRow[FuelConsumptionMapReader.Fields.EngineSpeed] = entry; - newRow[FuelConsumptionMapReader.Fields.Torque] = dragTorque; + newRow[FuelConsumptionMapReader.Fields.EngineSpeed] = Math.Round(entry, 2, MidpointRounding.AwayFromZero); + newRow[FuelConsumptionMapReader.Fields.Torque] = Math.Round(dragTorque, 2, MidpointRounding.AwayFromZero); newRow[FuelConsumptionMapReader.Fields.FuelConsumption] = 0; denormalizedData.Rows.Add(newRow); var newRow2 = denormalizedData.NewRow(); - newRow2[FuelConsumptionMapReader.Fields.EngineSpeed] = entry; - newRow2[FuelConsumptionMapReader.Fields.Torque] = dragTorque - 100; + newRow2[FuelConsumptionMapReader.Fields.EngineSpeed] = Math.Round(entry, 2, MidpointRounding.AwayFromZero); + newRow2[FuelConsumptionMapReader.Fields.Torque] = Math.Round(dragTorque - 100, 2, MidpointRounding.AwayFromZero); newRow2[FuelConsumptionMapReader.Fields.FuelConsumption] = 0; denormalizedData.Rows.Add(newRow2); } diff --git a/VectoCore/VectoCore/Models/GenericModelData/GenericTorqueConverterData.cs b/VectoCore/VectoCore/Models/GenericModelData/GenericTorqueConverterData.cs index 3ba997b51876846267cdaee832fb1bbfebdf2d45..c8c57899a54a1addee46b2585a3f37d35396d70f 100644 --- a/VectoCore/VectoCore/Models/GenericModelData/GenericTorqueConverterData.cs +++ b/VectoCore/VectoCore/Models/GenericModelData/GenericTorqueConverterData.cs @@ -63,30 +63,30 @@ namespace TUGraz.VectoCore.Models.Declaration // stall point var stallPt = retVal.NewRow(); - stallPt[colSpeedRatio] = speedRatioStallPt * ratio; - stallPt[colTqRatio] = torqueRatioStallPt / speedRAtioOverrunPt / ratio; - stallPt[colRefTq] = refTorqueStallPt; + stallPt[colSpeedRatio] = Math.Round(speedRatioStallPt * ratio, 4, MidpointRounding.AwayFromZero); + stallPt[colTqRatio] = Math.Round(torqueRatioStallPt / speedRAtioOverrunPt / ratio, 2, MidpointRounding.AwayFromZero); + stallPt[colRefTq] = Math.Round(refTorqueStallPt; retVal.Rows.Add(stallPt); // intermediate point var intermediatePt = retVal.NewRow(); - intermediatePt[colSpeedRatio] = speedRatioIntermediatePt * ratio; - intermediatePt[colTqRatio] = torqueRatioIntermediatePt / ratio; - intermediatePt[colRefTq] = refTorqueStallPt * refTorqueIntermediatePtFactor; + intermediatePt[colSpeedRatio] = Math.Round(speedRatioIntermediatePt * ratio, 4, MidpointRounding.AwayFromZero); + intermediatePt[colTqRatio] = Math.Round(torqueRatioIntermediatePt / ratio, 2, MidpointRounding.AwayFromZero); + intermediatePt[colRefTq] = Math.Round(refTorqueStallPt * refTorqueIntermediatePtFactor, 2, MidpointRounding.AwayFromZero); retVal.Rows.Add(intermediatePt); //coupling point var couplingPt = retVal.NewRow(); - couplingPt[colSpeedRatio] = speedRatioCouplingPt * speedRAtioOverrunPt * ratio; - couplingPt[colTqRatio] = torqueRatioCouplingPt / speedRAtioOverrunPt / ratio; - couplingPt[colRefTq] = refTorqueStallPt * refTorqueCouplingPtFactor; + couplingPt[colSpeedRatio] = Math.Round(speedRatioCouplingPt * speedRAtioOverrunPt * ratio, 4, MidpointRounding.AwayFromZero); + couplingPt[colTqRatio] = Math.Round(torqueRatioCouplingPt / speedRAtioOverrunPt / ratio, 2, MidpointRounding.AwayFromZero); + couplingPt[colRefTq] = Math.Round(refTorqueStallPt * refTorqueCouplingPtFactor, 2, MidpointRounding.AwayFromZero); retVal.Rows.Add(couplingPt); // overrun point var overrunPt = retVal.NewRow(); - overrunPt[colSpeedRatio] = speedRAtioOverrunPt * ratio; - overrunPt[colTqRatio] = torqueRatioOverrunPt / speedRAtioOverrunPt / ratio; - overrunPt[colRefTq] = refTorqueStallPt * refTorqueOverrunPtFactor; + overrunPt[colSpeedRatio] = Math.Round(speedRAtioOverrunPt * ratio, 4, MidpointRounding.AwayFromZero); + overrunPt[colTqRatio] = Math.Round(torqueRatioOverrunPt / speedRAtioOverrunPt / ratio, 2, MidpointRounding.AwayFromZero); + overrunPt[colRefTq] = Math.Round(refTorqueStallPt * refTorqueOverrunPtFactor, 2, MidpointRounding.AwayFromZero); retVal.Rows.Add(overrunPt); return retVal;