rusEFI
The most advanced open source ECU
Public Member Functions | Private Attributes
FuelConsumptionState Class Reference

#include <engine_parts.h>

Collaboration diagram for FuelConsumptionState:
Collaboration graph
[legend]

Public Member Functions

void consumeFuel (float grams, efitick_t nowNt)
 
float getConsumedGrams () const
 
float getConsumptionGramPerSecond () const
 

Private Attributes

float m_consumedGrams = 0
 
float m_rate = 0
 
Timer m_timer
 

Detailed Description

Definition at line 27 of file engine_parts.h.

Member Function Documentation

◆ consumeFuel()

void FuelConsumptionState::consumeFuel ( float  grams,
efitick_t  nowNt 
)

Definition at line 84 of file engine2.cpp.

84  {
85  m_consumedGrams += grams;
86 
87  float elapsedSecond = m_timer.getElapsedSecondsAndReset(nowNt);
88 
89  // If it's been a long time since last injection, ignore this pulse
90  if (elapsedSecond > 0.2f) {
91  m_rate = 0;
92  } else {
93  m_rate = grams / elapsedSecond;
94  }
95 }

Referenced by InjectionEvent::onTriggerTooth().

Here is the caller graph for this function:

◆ getConsumedGrams()

float FuelConsumptionState::getConsumedGrams ( ) const

Definition at line 97 of file engine2.cpp.

97  {
98  return m_consumedGrams;
99 }

Referenced by populateFrame(), and updateFuelResults().

Here is the caller graph for this function:

◆ getConsumptionGramPerSecond()

float FuelConsumptionState::getConsumptionGramPerSecond ( ) const

Definition at line 101 of file engine2.cpp.

101  {
102  return m_rate;
103 }

Referenced by handleGetDataRequest(), populateFrame(), and updateFuelResults().

Here is the caller graph for this function:

Field Documentation

◆ m_consumedGrams

float FuelConsumptionState::m_consumedGrams = 0
private

Definition at line 35 of file engine_parts.h.

Referenced by consumeFuel(), and getConsumedGrams().

◆ m_rate

float FuelConsumptionState::m_rate = 0
private

Definition at line 36 of file engine_parts.h.

Referenced by consumeFuel(), and getConsumptionGramPerSecond().

◆ m_timer

Timer FuelConsumptionState::m_timer
private

Definition at line 38 of file engine_parts.h.

Referenced by consumeFuel().


The documentation for this class was generated from the following files: