rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
trigger_simulator.h
Go to the documentation of this file.
1/*
2 * @file trigger_simulator.h
3 * @brief This class knows how to produce synthetic shaft signals based on triggerShape
4 *
5 * @date Sep 23, 2015
6 * @author Andrey Belomutskiy, (c) 2012-2020
7 */
8
9#pragma once
10
11#define SIMULATION_CYCLE_PERIOD 720000
12
13#include "trigger_decoder.h"
14
15int getSimulatedEventTime(const TriggerWaveform& shape, int i);
16
18public:
19
20 static expected<uint32_t> findTriggerSyncPoint(
21 TriggerWaveform& shape,
22 const TriggerConfiguration& triggerConfiguration,
24
25 static void assertSyncPosition(
26 const TriggerConfiguration& triggerConfiguration,
27 const uint32_t index,
29 TriggerWaveform& shape
30 );
31private:
32 // send next event so that we can see how state reacts
33 static void feedSimulatedEvent(
34 const TriggerConfiguration& triggerConfiguration,
36 const TriggerWaveform& shape,
37 int i);
38};
39
40bool isUsefulSignal(trigger_event_e signal, const TriggerWaveform& shape);
static expected< uint32_t > findTriggerSyncPoint(TriggerWaveform &shape, const TriggerConfiguration &triggerConfiguration, TriggerDecoderBase &state)
static void feedSimulatedEvent(const TriggerConfiguration &triggerConfiguration, TriggerDecoderBase &state, const TriggerWaveform &shape, int i)
static void assertSyncPosition(const TriggerConfiguration &triggerConfiguration, const uint32_t index, TriggerDecoderBase &state, TriggerWaveform &shape)
Trigger shape has all the fields needed to describe and decode trigger signal.
state("state", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1871, 1.0, -1.0, -1.0, "")
trigger_event_e
int getSimulatedEventTime(const TriggerWaveform &shape, int i)
bool isUsefulSignal(trigger_event_e signal, const TriggerWaveform &shape)