refactoring - explicit read method
This commit is contained in:
parent
71cbe6a3a6
commit
1003056f85
|
@ -391,9 +391,9 @@ void Engine::OnTriggerStateDecodingError() {
|
|||
triggerCentral.triggerState.currentCycle.eventCount[0],
|
||||
triggerCentral.triggerState.currentCycle.eventCount[1],
|
||||
triggerCentral.triggerState.currentCycle.eventCount[2],
|
||||
TRIGGER_WAVEFORM(expectedEventCount[0]),
|
||||
TRIGGER_WAVEFORM(expectedEventCount[1]),
|
||||
TRIGGER_WAVEFORM(expectedEventCount[2]));
|
||||
TRIGGER_WAVEFORM(getExpectedEventCount(0)),
|
||||
TRIGGER_WAVEFORM(getExpectedEventCount(1)),
|
||||
TRIGGER_WAVEFORM(getExpectedEventCount(2)));
|
||||
triggerCentral.triggerState.setTriggerErrorState();
|
||||
|
||||
|
||||
|
@ -402,9 +402,9 @@ void Engine::OnTriggerStateDecodingError() {
|
|||
#if EFI_PROD_CODE
|
||||
efiPrintf("error: synchronizationPoint @ index %d expected %d/%d/%d got %d/%d/%d",
|
||||
triggerCentral.triggerState.currentCycle.current_index,
|
||||
TRIGGER_WAVEFORM(expectedEventCount[0]),
|
||||
TRIGGER_WAVEFORM(expectedEventCount[1]),
|
||||
TRIGGER_WAVEFORM(expectedEventCount[2]),
|
||||
TRIGGER_WAVEFORM(getExpectedEventCount(0)),
|
||||
TRIGGER_WAVEFORM(getExpectedEventCount(1)),
|
||||
TRIGGER_WAVEFORM(getExpectedEventCount(2)),
|
||||
triggerCentral.triggerState.currentCycle.eventCount[0],
|
||||
triggerCentral.triggerState.currentCycle.eventCount[1],
|
||||
triggerCentral.triggerState.currentCycle.eventCount[2]);
|
||||
|
|
|
@ -183,6 +183,10 @@ operation_mode_e TriggerWaveform::getOperationMode() const {
|
|||
extern bool printTriggerDebug;
|
||||
#endif
|
||||
|
||||
int TriggerWaveform::getExpectedEventCount(int channelIndex) {
|
||||
return expectedEventCount[channelIndex];
|
||||
}
|
||||
|
||||
void TriggerWaveform::calculateExpectedEventCounts(bool useOnlyRisingEdgeForTrigger) {
|
||||
if (!useOnlyRisingEdgeForTrigger) {
|
||||
for (size_t i = 0; i < efi::size(expectedEventCount); i++) {
|
||||
|
|
|
@ -178,6 +178,8 @@ public:
|
|||
|
||||
void calculateExpectedEventCounts(bool useOnlyRisingEdgeForTrigger);
|
||||
|
||||
int getExpectedEventCount(int channelIndex);
|
||||
|
||||
/**
|
||||
* This is used for signal validation
|
||||
*/
|
||||
|
@ -321,6 +323,6 @@ void findTriggerPosition(
|
|||
|
||||
void setToothedWheelConfiguration(TriggerWaveform *s, int total, int skipped, operation_mode_e operationMode);
|
||||
|
||||
#define TRIGGER_WAVEFORM(x) ENGINE(triggerCentral.triggerShape.x)
|
||||
#define TRIGGER_WAVEFORM(x) ENGINE(triggerCentral.triggerShape).x
|
||||
|
||||
#define getTriggerSize() TRIGGER_WAVEFORM(privateTriggerDefinitionSize)
|
||||
|
|
|
@ -21,6 +21,7 @@ static char* trim(char *str) {
|
|||
}
|
||||
|
||||
void CsvReader::open(const char *fileName, int *columnIndeces) {
|
||||
printf("Reading from %s\r\n", fileName);
|
||||
fp = fopen(fileName, "r");
|
||||
this->columnIndeces = columnIndeces;
|
||||
ASSERT_TRUE(fp != nullptr);
|
||||
|
|
Loading…
Reference in New Issue