rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
CdmState Class Reference

#include <cdm_ion_sense.h>

Collaboration diagram for CdmState:
Collaboration graph
[legend]

Public Member Functions

 CdmState ()
 
void onNewSignal (int currentRevolution)
 
void applyAccumulatedData (int currentRevolution)
 
int getValue (int currentRevolution)
 

Data Fields

int totalCdmEvents = 0
 
int accumilatingAtRevolution = -1
 
int accumulatingCurrentValue
 
int currentValue = 0
 
int currentValueAtIndex = -1
 

Detailed Description

Definition at line 13 of file cdm_ion_sense.h.

Constructor & Destructor Documentation

◆ CdmState()

CdmState::CdmState ( )

Definition at line 16 of file cdm_ion_sense.cpp.

16 {
18 currentValue = 0;
20}
int currentValue
int accumulatingCurrentValue
int accumilatingAtRevolution

Member Function Documentation

◆ applyAccumulatedData()

void CdmState::applyAccumulatedData ( int  currentRevolution)

Definition at line 32 of file cdm_ion_sense.cpp.

Referenced by getValue(), and onNewSignal().

Here is the caller graph for this function:

◆ getValue()

int CdmState::getValue ( int  currentRevolution)

Definition at line 22 of file cdm_ion_sense.cpp.

22 {
23 applyAccumulatedData(currentRevolution);
24 if (currentRevolution == currentValueAtIndex + 1) {
25 // returning total result of previous engine cycle
26 return currentValue;
27 }
28 // we are here if previous engine cycle had no knock events
29 return 0;
30}
void applyAccumulatedData(int currentRevolution)

Referenced by getCurrentCdmValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onNewSignal()

void CdmState::onNewSignal ( int  currentRevolution)

Definition at line 39 of file cdm_ion_sense.cpp.

39 {
40 if (this->accumilatingAtRevolution == currentRevolution) {
42 } else {
43 applyAccumulatedData(currentRevolution);
44 // start new accumulation
45 accumilatingAtRevolution = currentRevolution;
47 }
48}

Referenced by extIonCallback().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ accumilatingAtRevolution

int CdmState::accumilatingAtRevolution = -1

Definition at line 18 of file cdm_ion_sense.h.

Referenced by applyAccumulatedData(), CdmState(), and onNewSignal().

◆ accumulatingCurrentValue

int CdmState::accumulatingCurrentValue

accumulated value for engine cycle which is not over yet

Definition at line 22 of file cdm_ion_sense.h.

Referenced by applyAccumulatedData(), CdmState(), and onNewSignal().

◆ currentValue

int CdmState::currentValue = 0

event counter for previous complete engine cycle

Definition at line 26 of file cdm_ion_sense.h.

Referenced by applyAccumulatedData(), CdmState(), and getValue().

◆ currentValueAtIndex

int CdmState::currentValueAtIndex = -1

Definition at line 27 of file cdm_ion_sense.h.

Referenced by applyAccumulatedData(), and getValue().

◆ totalCdmEvents

int CdmState::totalCdmEvents = 0

Definition at line 16 of file cdm_ion_sense.h.

Referenced by extIonCallback(), and ionPostState().


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