CSV reader progress

This commit is contained in:
Andrey 2023-12-06 23:00:13 -05:00 committed by rusefillc
parent 10198684f9
commit fb406525f5
2 changed files with 9 additions and 3 deletions

View File

@ -76,7 +76,11 @@ void CsvReader::processLine(EngineTestHelper *eth) {
for (size_t i = 0;i<m_vvtCount;i++) { for (size_t i = 0;i<m_vvtCount;i++) {
char *vvtToken = trim(strtok(nullptr, s)); char *vvtToken = trim(strtok(nullptr, s));
newVvtState[vvtColumnIndeces[i]] = vvtToken[0] == '1'; if (vvtToken == nullptr) {
criticalError("Null token in [%s]", buffer);
}
bool state = vvtToken[0] == '1';
newVvtState[vvtColumnIndeces[i]] = state;
} }
if (timeStampstr == nullptr) { if (timeStampstr == nullptr) {
@ -97,9 +101,9 @@ void CsvReader::processLine(EngineTestHelper *eth) {
efitick_t nowNt = getTimeNowNt(); efitick_t nowNt = getTimeNowNt();
bool state; bool state;
if (index == 0) { if (index == 0) {
state = newTriggerState[index] ^ engineConfiguration->invertPrimaryTriggerSignal; state = newTriggerState[index] ^ flipOnRead ^ engineConfiguration->invertPrimaryTriggerSignal;
} else { } else {
state = newTriggerState[index] ^ engineConfiguration->invertSecondaryTriggerSignal; state = newTriggerState[index] ^ flipOnRead ^ engineConfiguration->invertSecondaryTriggerSignal;
} }
hwHandleShaftSignal(index, state, nowNt); hwHandleShaftSignal(index, state, nowNt);

View File

@ -30,6 +30,8 @@ public:
void readLine(EngineTestHelper *eth); void readLine(EngineTestHelper *eth);
double readTimestampAndValues(double *v); double readTimestampAndValues(double *v);
bool flipOnRead = false;
int lineIndex() const { int lineIndex() const {
return m_lineIndex; return m_lineIndex;
} }