helping tests
This commit is contained in:
parent
cda5297c0a
commit
baaa64505e
|
@ -10,10 +10,12 @@
|
|||
#if EFI_DYNO_VIEW
|
||||
#include "dynoview.h"
|
||||
|
||||
static DynoView dynoInstance;
|
||||
|
||||
DynoView::DynoView()
|
||||
void DynoView::init()
|
||||
{
|
||||
if (isInitialized) {
|
||||
return;
|
||||
}
|
||||
isInitialized = true;
|
||||
wheelOverallDiameterMm = (uint16_t)(config->dynoCarWheelDiaInch * 25.4 + config->dynoCarWheelTireWidthMm * config->dynoCarWheelAspectRatio * 0.01 * 2);
|
||||
|
||||
saeVaporPressure = 6.1078 * pow(10.0, (7.5 * config->dynoSaeTemperatureC) / (237.3 + config->dynoSaeTemperatureC)) * .02953 * (config->dynoSaeRelativeHumidity / 100.0);
|
||||
|
@ -27,6 +29,7 @@ DynoView::DynoView()
|
|||
|
||||
void DynoView::update()
|
||||
{
|
||||
init();
|
||||
float rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||
rpm = efiRound(rpm, 1.0);
|
||||
int intRpm = (int)rpm;
|
||||
|
@ -133,18 +136,18 @@ bool DynoView::onRpm(int rpm, float time, float tps)
|
|||
}
|
||||
|
||||
int getDynoviewHP() {
|
||||
return dynoInstance.currentHP;
|
||||
return engine->dynoInstance.currentHP;
|
||||
}
|
||||
|
||||
int getDynoviewTorque() {
|
||||
return dynoInstance.currentTorque;
|
||||
return engine->dynoInstance.currentTorque;
|
||||
}
|
||||
|
||||
/**
|
||||
* Periodic update function called from SlowCallback.
|
||||
*/
|
||||
void updateDynoView() {
|
||||
dynoInstance.update();
|
||||
engine->dynoInstance.update();
|
||||
}
|
||||
|
||||
#endif /* EFI_DYNO_VIEW */
|
||||
|
|
|
@ -34,12 +34,13 @@ struct DynoPoint {
|
|||
class DynoView {
|
||||
public:
|
||||
|
||||
DynoView();
|
||||
void init();
|
||||
void update();
|
||||
bool onRpm(int rpm, float time, float tps);
|
||||
|
||||
float currentTorque;
|
||||
float currentHP;
|
||||
bool isInitialized = false;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -75,4 +76,4 @@ private:
|
|||
|
||||
float tail_hp[window_size];
|
||||
float tail_torque[window_size];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "local_version_holder.h"
|
||||
#include "buttonshift.h"
|
||||
#include "gear_controller.h"
|
||||
#include "dynoview.h"
|
||||
#include "high_pressure_fuel_pump.h"
|
||||
#include "limp_manager.h"
|
||||
#include "pin_repository.h"
|
||||
|
@ -119,6 +120,11 @@ public:
|
|||
IEtbController *etbControllers[ETB_COUNT] = {nullptr};
|
||||
#endif // EFI_ELECTRONIC_THROTTLE_BODY
|
||||
|
||||
|
||||
#if EFI_DYNO_VIEW
|
||||
DynoView dynoInstance;
|
||||
#endif
|
||||
|
||||
#if EFI_ENGINE_CONTROL
|
||||
FuelComputer fuelComputer;
|
||||
#endif // EFI_ENGINE_CONTROL
|
||||
|
|
Loading…
Reference in New Issue