rusEFI
The most advanced open source ECU
|
#include <sensor.h>
Public Member Functions | |
bool | Register () |
virtual void | showInfo (const char *sensorName) const =0 |
const char * | getSensorName () const |
virtual SensorResult | get () const =0 |
virtual bool | hasSensor () const |
virtual float | getRaw () const |
virtual bool | isRedundant () const |
void | unregister () |
SensorType | type () const |
Static Public Member Functions | |
static void | showAllSensorInfo () |
static void | showInfo (SensorType type) |
static void | resetRegistry () |
static const Sensor * | getSensorOfType (SensorType type) |
static SensorResult | get (SensorType type) |
static float | getOrZero (SensorType type) |
static float | getRaw (SensorType type) |
static bool | isRedundant (SensorType type) |
static bool | hasSensor (SensorType type) |
static void | setMockValue (SensorType type, float value, bool mockRedundant=false) |
static void | setInvalidMockValue (SensorType type) |
static void | setMockValue (int type, float value) |
static void | resetMockValue (SensorType type) |
static void | resetAllMocks () |
static void | inhibitTimeouts (bool inhibit) |
static const char * | getSensorName (SensorType type) |
Protected Member Functions | |
Sensor (SensorType type) | |
Static Protected Attributes | |
static bool | s_inhibitSensorTimeouts = false |
Private Member Functions | |
constexpr size_t | getIndex () |
Static Private Member Functions | |
static constexpr size_t | getIndex (SensorType type) |
static SensorRegistryEntry * | getEntryForType (SensorType type) |
Private Attributes | |
const SensorType | m_type |
|
inlineexplicitprotected |
|
pure virtual |
Implemented in RedundantSensor, RedundantFordTps, ProxySensor, FallbackSensor, GearDetector, StoredValueSensor, LuaOverrideSensor, and FunctionPointerSensor.
Referenced by HpfpQuantity::calcPI(), canDashboardHaltech(), canMazdaRX8(), check(), EtbController::checkStatus(), WallFuelController::computeBeta(), WallFuelController::computeTau(), ThrottleModelBase::estimateThrottleFlow(), SensorReader< TSensorType >::get(), LuaOverrideSensor::get(), FallbackSensor::get(), ProxySensor::get(), RedundantFordTps::get(), RedundantSensor::get(), AcController::getAcState(), getAdvanceCorrections(), AlphaNAirmass::getAirmass(), getBaroCorrection(), getCltFuelCorrection(), getCltTimingCorrection(), getCrankingFuel3(), InjectorModelWithConfig::getDeadtime(), InjectorModelWithConfig::getFuelDifferentialPressure(), getIatFuelCorrection(), IdleController::getIdlePosition(), ClosedLoopFuelCellImpl::getLambdaError(), IFuelComputer::getLoadOverride(), MafAirmass::getMaf(), SpeedDensityAirmass::getMap(), BoostController::getOpenLoop(), getOrZero(), PrimeController::getPrimeDuration(), getRunningAdvance(), getSensor(), BoostController::getSetpoint(), EtbController::getSetpointEtb(), DfcoController::getState(), FanController::getState(), FuelComputer::getStoichiometricRatio(), IFuelComputer::getTCharge(), AirmassVeModelBase::getVe(), initMapDecoder(), LambdaMonitorBase::isCurrentlyGood(), Engine::isInShutdownMode(), LaunchControlBase::isInsideTpsCondition(), isPedalError(), TransmissionControllerBase::isShiftCompleted(), isTps1Error(), isTps2Error(), kLineThread(), AlternatorController::observePlant(), BoostController::observePlant(), EtbController::observePlant(), HpfpController::onFastCallback(), EngineState::periodicFastCallback(), Engine::periodicSlowCallback(), populateFrame(), TransmissionControllerBase::postState(), printMAPInfo(), printTPSInfo(), printTpsSenser(), readGppwmChannel(), recalculateAuxValveTiming(), TwoPinDcMotor::set(), Gm4l6xTransmissionController::set32State(), Generic4TransmissionController::setTccState(), shouldCorrect(), AutomaticGearController::update(), LimpManager::updateState(), updateTempSensors(), updateThrottles(), and updateTunerStudioState().
|
static |
Definition at line 166 of file sensor.cpp.
|
staticprivate |
Definition at line 148 of file sensor.cpp.
Referenced by get(), getRaw(), getSensorOfType(), hasSensor(), isRedundant(), resetMockValue(), setInvalidMockValue(), setMockValue(), and showInfo().
|
inlineconstexprprivate |
Definition at line 191 of file sensor.h.
Referenced by getEntryForType(), Register(), and unregister().
|
inlinestaticconstexprprivate |
|
inlinestatic |
Definition at line 92 of file sensor.h.
Referenced by adjustCrankPhase(), canDashboardBmwE46(), canDashboardBmwE90(), canDashboardFiat(), canDashboardGenesisCoupe(), canDashboardHaltech(), canDashboardNissanVQ(), canDashboardVAG(), canDashboardVagMqb(), canDashboardW202(), canMazdaRX8(), EtbController::checkStatus(), GearDetector::computeGearboxRatio(), configureRusefiLuaHooks(), TriggerCentral::decodeMapCam(), TriggerDecoderBase::decodeTriggerEvent(), fuelClosedLoopCorrection(), AcController::getAcState(), getBaroCorrection(), BoostController::getClosedLoopImpl(), GearDetector::getDriveshaftRpm(), getFuelALSCorrection(), IdleController::getIdlePosition(), KnockController::getKnockThreshold(), getLoad(), SpeedDensityAirmass::getMap(), getMaxAirflowAtMap(), KnockController::getMaximumRetard(), BoostController::getOpenLoop(), getRunningAdvance(), AlternatorController::getSetpoint(), BoostController::getSetpoint(), VvtController::getSetpoint(), EtbController::getSetpointEtb(), IgnitionState::getSparkDwell(), DfcoController::getState(), TpsAccelEnrichment::getTpsEnrichment(), getVeLoadAxis(), handleGetDataRequest(), hipThread(), initElectronicThrottle(), initNewSensors(), AntilagSystemBase::isALSMaxCLTCondition(), AntilagSystemBase::isALSMaxThrottleIntentCondition(), AntilagSystemBase::isALSMinCLTCondition(), LambdaMonitorBase::isCurrentlyGood(), isIgnVoltage(), LaunchControlBase::isInsideSpeedCondition(), LaunchControlBase::isLaunchRpmRetardCondition(), isPrimeInjectionPulseSkipped(), TriggerCentral::isToothExpectedNow(), lua_getAirmass(), mapAveragingTriggerCallback(), HpfpController::onFastCallback(), BoostController::onFastCallback(), WallFuelController::onFastCallback(), LimpManager::onFastCallback(), MainRelayController::onSlowCallback(), TripOdometer::onSlowCallback(), ThrottleModelBase::onSlowCallback(), onTdcCallback(), InjectionEvent::onTriggerTooth(), EngineState::periodicFastCallback(), Engine::periodicSlowCallback(), populateFrame(), printMAPInfo(), refreshMapAveragingPreCalc(), reportWave(), LambdaMonitorBase::restoreConditionsMet(), sendWidebandInfo(), StepperMotorBase::setInitialPosition(), shouldUpdateCorrection(), showAltInfo(), speedoUpdate(), startDwellByTurningSparkPinHigh(), tachUpdate(), tdcMarkCallback(), AntilagSystemBase::update(), LaunchControlBase::update(), GenericGearController::update(), DynoView::update(), updateEgtSensors(), updateFuelSensors(), DynoView::updateHP(), updateLambda(), updateMiscSensors(), updatePressures(), updateRawSensors(), LimpManager::updateRevLimit(), Engine::updateSlowSensors(), LimpManager::updateState(), updateThrottles(), updateTunerStudioState(), updateVehicleSpeed(), and updateVrThresholdPwm().
|
inlinevirtual |
Reimplemented in FunctionalSensor.
Definition at line 162 of file sensor.h.
Referenced by grabPedalIsUp(), grabPedalIsWideOpen(), grabTPSIsClosed(), grabTPSIsWideOpen(), lua_getSensorRaw(), Engine::periodicSlowCallback(), printTpsSenser(), sendQcBenchRawAnalogValues(), updateRawSensors(), and updateThrottles().
|
static |
|
inline |
Definition at line 144 of file sensor.h.
Referenced by check(), getSensorName(), HellaOilLevelSensor::init(), EtbController::init(), FrequencySensor::initIfValid(), AdcSubscription::PrintInfo(), FallbackSensor::showInfo(), ProxySensor::showInfo(), RedundantFordTps::showInfo(), RedundantSensor::showInfo(), and showInfo().
|
static |
|
static |
Definition at line 158 of file sensor.cpp.
Referenced by ProxySensor::isRedundant().
|
inlinevirtual |
Reimplemented in ProxySensor.
Definition at line 155 of file sensor.h.
Referenced by check(), WallFuelController::computeBeta(), GearDetector::computeGearboxRatio(), WallFuelController::computeTau(), doInitElectronicThrottle(), ThrottleModelBase::estimateThrottleFlow(), getBaroCorrection(), getCrankingFuel3(), InjectorModelWithConfig::getFuelDifferentialPressure(), MafAirmass::getMaf(), FuelComputer::getStoichiometricRatio(), ProxySensor::hasSensor(), EtbController::init(), initAuxValves(), initBaro(), isPedalError(), isTps2Error(), lua_hasSensor(), printMAPInfo(), and LimpManager::updateState().
|
static |
|
static |
Definition at line 241 of file sensor.cpp.
Referenced by writeToFlashIfPending().
|
inlinevirtual |
Reimplemented in SentTps, RedundantSensor, RedundantFordTps, and ProxySensor.
Definition at line 169 of file sensor.h.
Referenced by EtbController::init().
|
static |
Definition at line 183 of file sensor.cpp.
Referenced by ProxySensor::isRedundant().
bool Sensor::Register | ( | ) |
Definition at line 131 of file sensor.cpp.
Referenced by commonInitEngineController(), configureTempSensor(), enableTriggerStimulator(), HellaOilLevelSensor::init(), initAuxSensors(), initBaro(), initCanVssSupport(), initFlexSensor(), initFluidPressure(), initFuelLevel(), GearDetector::initGearDetector(), FrequencySensor::initIfValid(), initLambda(), initMaf(), initMap(), initOverrideSensors(), initRangeSensors(), initTps(), initVbatt(), onEcuStartDoSomethingTriggerInputPins(), and registerCanSensor().
|
static |
Definition at line 228 of file sensor.cpp.
Referenced by initSensorCli().
|
static |
|
static |
Definition at line 139 of file sensor.cpp.
|
static |
|
static |
Definition at line 211 of file sensor.cpp.
|
static |
Definition at line 203 of file sensor.cpp.
Referenced by initMapDecoder(), initNewSensors(), initSensorCli(), and setMockValue().
|
static |
Definition at line 246 of file sensor.cpp.
Referenced by initSensorCli(), and printSensorInfo().
|
pure virtual |
Implemented in RedundantSensor, RedundantFordTps, Lps25Sensor, FrequencySensor, StoredValueSensor, ProxySensor, FunctionalSensor, FallbackSensor, CanSensorBase, LuaOverrideSensor, RpmCalculator, MapAverager, GearDetector, and FunctionPointerSensor.
Referenced by initSensorCli().
|
static |
|
inline |
Definition at line 176 of file sensor.h.
Referenced by get(), getEntryForType(), getIndex(), getOrZero(), getRaw(), getSensorName(), getSensorOfType(), hasSensor(), isRedundant(), resetMockValue(), setInvalidMockValue(), setMockValue(), and showInfo().
void Sensor::unregister | ( | ) |
Definition at line 135 of file sensor.cpp.
Referenced by deinitAuxSensors(), deInitFlexSensor(), deinitTps(), onEcuStartDoSomethingTriggerInputPins(), and GearDetector::~GearDetector().
|
private |
Definition at line 188 of file sensor.h.
Referenced by getIndex(), getSensorName(), and type().
|
staticprotected |
Definition at line 185 of file sensor.h.
Referenced by StoredValueSensor::get(), and inhibitTimeouts().