2015-09-23 18:02:33 -07:00
|
|
|
/*
|
|
|
|
* @file trigger_simulator.h
|
|
|
|
* @brief This class knows how to produce synthetic shaft signals based on triggerShape
|
|
|
|
*
|
|
|
|
* @date Sep 23, 2015
|
2017-01-03 03:05:22 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2017
|
2015-09-23 18:02:33 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONTROLLERS_TRIGGER_TRIGGER_SIMULATOR_H_
|
|
|
|
#define CONTROLLERS_TRIGGER_TRIGGER_SIMULATOR_H_
|
|
|
|
|
|
|
|
#include "trigger_decoder.h"
|
|
|
|
|
|
|
|
class TriggerStimulatorHelper {
|
|
|
|
public:
|
|
|
|
TriggerStimulatorHelper();
|
|
|
|
|
2018-02-05 14:41:05 -08:00
|
|
|
uint32_t findTriggerSyncPoint(TriggerShape * shape,
|
|
|
|
TriggerState *state DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2015-09-23 18:02:33 -07:00
|
|
|
|
2018-02-05 14:44:10 -08:00
|
|
|
void assertSyncPositionAndSetDutyCycle(const uint32_t index, TriggerState *state, TriggerShape * shape
|
|
|
|
DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2018-02-05 14:41:05 -08:00
|
|
|
|
|
|
|
private:
|
|
|
|
// send next event so that we can see how state reacts
|
|
|
|
void feedSimulatedEvent(TriggerState *state, TriggerShape * shape, int i DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2015-09-23 18:02:33 -07:00
|
|
|
};
|
|
|
|
|
2019-11-07 08:28:49 -08:00
|
|
|
bool isUsefulSignal(trigger_event_e signal DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2015-09-23 18:02:33 -07:00
|
|
|
|
|
|
|
#endif /* CONTROLLERS_TRIGGER_TRIGGER_SIMULATOR_H_ */
|