Refactoring, technical debt: export more of trigger attributes into triggers.txt file #2077

This commit is contained in:
rusefillc 2022-04-02 19:08:22 -04:00
parent 5bdda75fbc
commit 086739d20a
3 changed files with 3 additions and 2 deletions

View File

@ -118,7 +118,6 @@ public:
/**
* this variable is incremented after each trigger shape redefinition
* See also
*/
int version = 0;

View File

@ -194,6 +194,7 @@ struct_no_prefix engine_configuration_s
#define TRIGGER_IS_CRANK_KEY "crankBased"
#define TRIGGER_IS_SECOND_WHEEL_CAM "isSecondWheelCam"
#define TRIGGER_HAS_SECOND_CHANNEL "hasSecondChannel"
#define TRIGGER_HARDCODED_OPERATION_MODE "knownOperationMode"
!
! all the xxx_PACKING_xxx constants are about persisting tables in compact for, for example packing RPM with 50 increment in a byte

View File

@ -67,9 +67,10 @@ TEST_P(AllTriggersFixture, TestTrigger) {
ASSERT_FALSE(shape->shapeDefinitionError) << "Trigger shapeDefinitionError";
fprintf(fp, "TRIGGERTYPE %d %d %s %.2f\n", tt, shape->getLength(), getTrigger_type_e(tt), shape->tdcPosition);
// todo: use getCrankDivider insread to support symmetrical crank wheels?
// todo: use getCrankDivider instead to support symmetrical crank wheels?
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, "# duty %.2f %.2f\n", shape->expectedDutyCycle[0], shape->expectedDutyCycle[1]);
for (size_t i = 0; i < shape->getLength(); i++) {