Proper cam speed labels in triggers #4021

This commit is contained in:
rusefillc 2022-04-03 12:22:47 -04:00
parent 291d90ff48
commit e631988b22
7 changed files with 17 additions and 1 deletions

View File

@ -605,6 +605,7 @@ injection_mode_e Engine::getCurrentInjectionMode() {
}
// see also in TunerStudio project '[doesTriggerImplyOperationMode] tag
// this is related to 'knownOperationMode' flag
static bool doesTriggerImplyOperationMode(trigger_type_e type) {
return type != TT_TOOTHED_WHEEL
&& type != TT_ONE

View File

@ -85,7 +85,8 @@ void TriggerWaveform::initialize(operation_mode_e operationMode) {
#if EFI_UNIT_TEST
memset(&triggerSignalIndeces, 0, sizeof(triggerSignalIndeces));
memset(&triggerSignalStates, 0, sizeof(triggerSignalStates));
#endif
knownOperationMode = true;
#endif // EFI_UNIT_TEST
}
size_t TriggerWaveform::getSize() const {

View File

@ -185,6 +185,8 @@ public:
*/
int triggerSignalIndeces[PWM_PHASE_MAX_COUNT];
int triggerSignalStates[PWM_PHASE_MAX_COUNT];
// see also 'doesTriggerImplyOperationMode'
bool knownOperationMode = true;
#endif
/**

View File

@ -14,6 +14,11 @@
void initialize36_2_2_2(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CRANK_SENSOR);
#if EFI_UNIT_TEST
// placed on 'cam' on '2-stroke' rotary
s->knownOperationMode = false;
#endif // EFI_UNIT_TEST
float wide = 30 * 2;
float narrow = 10 * 2;

View File

@ -43,6 +43,9 @@ void initializeSkippedToothTriggerWaveformExt(TriggerWaveform *s, int totalTeeth
}
efiAssertVoid(CUSTOM_NULL_SHAPE, s != NULL, "TriggerWaveform is NULL");
s->initialize(operationMode);
#if EFI_UNIT_TEST
s->knownOperationMode = false;
#endif // EFI_UNIT_TEST
s->setTriggerSynchronizationGap(skippedCount + 1);
s->shapeWithoutTdc = (totalTeethCount > 1) && (skippedCount == 0);

View File

@ -10,6 +10,7 @@ import java.util.stream.Collectors;
import static com.rusefi.config.generated.Fields.TRIGGER_IS_CRANK_KEY;
import static com.rusefi.config.generated.Fields.TRIGGER_IS_SECOND_WHEEL_CAM;
import static com.rusefi.config.generated.Fields.TRIGGER_HAS_SECOND_CHANNEL;
import static com.rusefi.config.generated.Fields.TRIGGER_HARDCODED_OPERATION_MODE;
public class TriggerWheelInfo {
private final int id;
@ -60,6 +61,8 @@ public class TriggerWheelInfo {
case TRIGGER_HAS_SECOND_CHANNEL:
Boolean.parseBoolean(keyValue[1]);
break;
case TRIGGER_HARDCODED_OPERATION_MODE:
break;
default:
throw new IllegalStateException("Unexpected key/value: " + line);
}

View File

@ -71,6 +71,7 @@ TEST_P(AllTriggersFixture, TestTrigger) {
fprintf(fp, "%s=%s\n", TRIGGER_IS_CRANK_KEY, shape->getOperationMode() == FOUR_STROKE_CRANK_SENSOR ? "true" : "false");
fprintf(fp, "%s=%s\n", TRIGGER_IS_SECOND_WHEEL_CAM, shape->isSecondWheelCam ? "true" : "false");
fprintf(fp, "%s=%s\n", TRIGGER_HAS_SECOND_CHANNEL, shape->needSecondTriggerInput ? "true" : "false");
fprintf(fp, "%s=%s\n", TRIGGER_HARDCODED_OPERATION_MODE, shape->knownOperationMode ? "true" : "false");
fprintf(fp, "# duty %.2f %.2f\n", shape->expectedDutyCycle[0], shape->expectedDutyCycle[1]);
for (size_t i = 0; i < shape->getLength(); i++) {