migrating to SensorType::Rpm API
This commit is contained in:
parent
8361b6d1f6
commit
3183a123cd
|
@ -95,8 +95,8 @@ void DynoView::updateHP() {
|
|||
engineForce = engineConfiguration->vehicleWeight * acceleration;
|
||||
enginePower = engineForce * (vss / 3.6);
|
||||
engineHP = enginePower / 746;
|
||||
if (isValidRpm(GET_RPM())) {
|
||||
engineTorque = ((engineHP * 5252) / GET_RPM());
|
||||
if (Sensor::getOrZero(SensorType::Rpm) > 0) {
|
||||
engineTorque = ((engineHP * 5252) / Sensor::getOrZero(SensorType::Rpm));
|
||||
}
|
||||
} else {
|
||||
//we should calculate static power
|
||||
|
|
|
@ -66,7 +66,7 @@ TEST(DynoView, VSS_fast) {
|
|||
|
||||
// Test Speed threshold
|
||||
engineConfiguration->vehicleWeight = 900; //kg
|
||||
engine->rpmCalculator.mockRpm = 2200;
|
||||
Sensor::setMockValue(SensorType::Rpm, 2200);
|
||||
eth.moveTimeForwardMs(50);
|
||||
|
||||
Sensor::setMockValue(SensorType::VehicleSpeed, 50.0);
|
||||
|
@ -89,7 +89,7 @@ TEST(DynoView, VSS_Torque) {
|
|||
|
||||
// Test Speed threshold
|
||||
engineConfiguration->vehicleWeight = 900; //kg
|
||||
engine->rpmCalculator.mockRpm = 2200;
|
||||
Sensor::setMockValue(SensorType::Rpm, 2200);
|
||||
eth.moveTimeForwardMs(50);
|
||||
|
||||
Sensor::setMockValue(SensorType::VehicleSpeed, 80.0);
|
||||
|
|
Loading…
Reference in New Issue