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