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

#include <tcu.h>

Inheritance diagram for TransmissionControllerBase:
Inheritance graph
[legend]
Collaboration diagram for TransmissionControllerBase:
Collaboration graph
[legend]

Public Member Functions

virtual void update (gear_e)
 
virtual void init ()
 
virtual gear_e getCurrentGear () const
 
virtual TransmissionControllerMode getMode () const
 

Protected Member Functions

virtual gear_e setCurrentGear (gear_e)
 
void postState ()
 
void measureShiftTime (gear_e)
 
float isShiftCompleted ()
 

Protected Attributes

gear_e currentGear = NEUTRAL
 

Private Attributes

Timer m_shiftTimer
 
bool m_shiftTime
 
gear_e m_shiftTimeGear
 

Additional Inherited Members

- Data Fields inherited from tcu_controller_s
int8_t tcuCurrentGear = (int8_t)0
 
uint8_t alignmentFill_at_1 [1]
 
scaled_channel< uint16_t, 100, 1 > tcRatio = (uint16_t)0
 
float lastShiftTime = (float)0
 
uint8_t tcu_currentRange = (uint8_t)0
 
int8_t pressureControlDuty = (int8_t)0
 
int8_t torqueConverterDuty = (int8_t)0
 
uint8_t alignmentFill_at_11 [1]
 
bool isShifting: 1 {}
 
bool unusedBit_9_1: 1 {}
 
bool unusedBit_9_2: 1 {}
 
bool unusedBit_9_3: 1 {}
 
bool unusedBit_9_4: 1 {}
 
bool unusedBit_9_5: 1 {}
 
bool unusedBit_9_6: 1 {}
 
bool unusedBit_9_7: 1 {}
 
bool unusedBit_9_8: 1 {}
 
bool unusedBit_9_9: 1 {}
 
bool unusedBit_9_10: 1 {}
 
bool unusedBit_9_11: 1 {}
 
bool unusedBit_9_12: 1 {}
 
bool unusedBit_9_13: 1 {}
 
bool unusedBit_9_14: 1 {}
 
bool unusedBit_9_15: 1 {}
 
bool unusedBit_9_16: 1 {}
 
bool unusedBit_9_17: 1 {}
 
bool unusedBit_9_18: 1 {}
 
bool unusedBit_9_19: 1 {}
 
bool unusedBit_9_20: 1 {}
 
bool unusedBit_9_21: 1 {}
 
bool unusedBit_9_22: 1 {}
 
bool unusedBit_9_23: 1 {}
 
bool unusedBit_9_24: 1 {}
 
bool unusedBit_9_25: 1 {}
 
bool unusedBit_9_26: 1 {}
 
bool unusedBit_9_27: 1 {}
 
bool unusedBit_9_28: 1 {}
 
bool unusedBit_9_29: 1 {}
 
bool unusedBit_9_30: 1 {}
 
bool unusedBit_9_31: 1 {}
 

Detailed Description

Definition at line 18 of file tcu.h.

Member Function Documentation

◆ getCurrentGear()

gear_e TransmissionControllerBase::getCurrentGear ( ) const
virtual

Definition at line 26 of file tcu.cpp.

26  {
27  return currentGear;
28 }

Referenced by postState(), setCurrentGear(), and Generic4TransmissionController::update().

Here is the caller graph for this function:

◆ getMode()

virtual TransmissionControllerMode TransmissionControllerBase::getMode ( ) const
inlinevirtual

Reimplemented in Gm4l6xTransmissionController, Generic4TransmissionController, and SimpleTransmissionController.

Definition at line 27 of file tcu.h.

Referenced by GearControllerBase::update().

Here is the caller graph for this function:

◆ init()

void TransmissionControllerBase::init ( )
virtual

Reimplemented in Gm4l6xTransmissionController, Generic4TransmissionController, and SimpleTransmissionController.

Definition at line 14 of file tcu.cpp.

14  {
15 }

Referenced by GearControllerBase::initTransmissionController().

Here is the caller graph for this function:

◆ isShiftCompleted()

float TransmissionControllerBase::isShiftCompleted ( )
protected

Definition at line 47 of file tcu.cpp.

47  {
48  auto detected = Sensor::get(SensorType::DetectedGear);
50  if (detected.Valid && m_shiftTime && m_shiftTimeGear == detected.Value) {
51  m_shiftTime = false;
52  return m_shiftTimer.getElapsedSeconds();
53  } else if (!iss.Valid && m_shiftTime && m_shiftTimer.hasElapsedMs(config->tcu_shiftTime)) {
54  m_shiftTime = false;
55  return config->tcu_shiftTime * 0.001;
56  } else {
57  return 0;
58  }
59 }
virtual SensorResult get() const =0
gear_e m_shiftTimeGear
Definition: tcu.h:22
persistent_config_s * config

Referenced by Generic4TransmissionController::update().

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

◆ measureShiftTime()

void TransmissionControllerBase::measureShiftTime ( gear_e  gear)
protected

Definition at line 41 of file tcu.cpp.

41  {
42  m_shiftTime = true;
43  m_shiftTimer.reset();
44  m_shiftTimeGear = gear;
45 }

Referenced by Generic4TransmissionController::update().

Here is the caller graph for this function:

◆ postState()

void TransmissionControllerBase::postState ( )
protected

Definition at line 30 of file tcu.cpp.

30  {
31 #if EFI_TUNER_STUDIO
33  auto rpm = Sensor::get(SensorType::Rpm);
34  if (iss.Valid && rpm.Valid) {
35  tcRatio = rpm.Value / iss.Value;
36  }
38 #endif
39 }
virtual gear_e getCurrentGear() const
Definition: tcu.cpp:26
scaled_channel< uint16_t, 100, 1 > tcRatio

Referenced by update().

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

◆ setCurrentGear()

gear_e TransmissionControllerBase::setCurrentGear ( gear_e  gear)
protectedvirtual

Definition at line 21 of file tcu.cpp.

21  {
22  currentGear = gear;
23  return getCurrentGear();
24 }

Referenced by SimpleTransmissionController::update(), and Generic4TransmissionController::update().

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

◆ update()

void TransmissionControllerBase::update ( gear_e  )
virtual

Reimplemented in Gm4l6xTransmissionController, Generic4TransmissionController, and SimpleTransmissionController.

Definition at line 17 of file tcu.cpp.

17  {
18  postState();
19 }

Referenced by GearControllerBase::update(), and SimpleTransmissionController::update().

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

Field Documentation

◆ currentGear

gear_e TransmissionControllerBase::currentGear = NEUTRAL
protected

Definition at line 31 of file tcu.h.

Referenced by getCurrentGear(), and setCurrentGear().

◆ m_shiftTime

bool TransmissionControllerBase::m_shiftTime
private

Definition at line 21 of file tcu.h.

Referenced by isShiftCompleted(), and measureShiftTime().

◆ m_shiftTimeGear

gear_e TransmissionControllerBase::m_shiftTimeGear
private

Definition at line 22 of file tcu.h.

Referenced by isShiftCompleted(), and measureShiftTime().

◆ m_shiftTimer

Timer TransmissionControllerBase::m_shiftTimer
private

Definition at line 20 of file tcu.h.

Referenced by isShiftCompleted(), and measureShiftTime().


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