minor trigger refactoring
This commit is contained in:
parent
e3fd84ed08
commit
36d5b1fbb6
|
@ -150,32 +150,32 @@ TEST(misc, testAngleResolver) {
|
|||
event_trigger_position_s injectionStart;
|
||||
|
||||
printf("*************************************************** testAngleResolver 0\r\n");
|
||||
findTriggerPosition(&engine->triggerCentral.triggerShape, &engine->triggerCentral.triggerFormDetails,&injectionStart, -122);
|
||||
injectionStart.setAngle(-122);
|
||||
ASSERT_EQ( 2, injectionStart.triggerEventIndex) << "eventIndex@0";
|
||||
ASSERT_NEAR(0.24, injectionStart.angleOffsetFromTriggerEvent, EPS5D);
|
||||
|
||||
printf("*************************************************** testAngleResolver 0.1\r\n");
|
||||
findTriggerPosition(&engine->triggerCentral.triggerShape, &engine->triggerCentral.triggerFormDetails,&injectionStart, -80);
|
||||
injectionStart.setAngle(-80);
|
||||
ASSERT_EQ( 2, injectionStart.triggerEventIndex) << "eventIndex@0";
|
||||
ASSERT_FLOAT_EQ(42.24, injectionStart.angleOffsetFromTriggerEvent);
|
||||
|
||||
printf("*************************************************** testAngleResolver 0.2\r\n");
|
||||
findTriggerPosition(&engine->triggerCentral.triggerShape, &engine->triggerCentral.triggerFormDetails,&injectionStart, -54);
|
||||
injectionStart.setAngle(-54);
|
||||
ASSERT_EQ( 2, injectionStart.triggerEventIndex) << "eventIndex@0";
|
||||
ASSERT_FLOAT_EQ(68.2400, injectionStart.angleOffsetFromTriggerEvent);
|
||||
|
||||
printf("*************************************************** testAngleResolver 0.3\r\n");
|
||||
findTriggerPosition(&engine->triggerCentral.triggerShape, &engine->triggerCentral.triggerFormDetails,&injectionStart, -53);
|
||||
injectionStart.setAngle(-53);
|
||||
ASSERT_EQ(2, injectionStart.triggerEventIndex);
|
||||
ASSERT_FLOAT_EQ(69.24, injectionStart.angleOffsetFromTriggerEvent);
|
||||
|
||||
printf("*************************************************** testAngleResolver 1\r\n");
|
||||
findTriggerPosition(&engine->triggerCentral.triggerShape, &engine->triggerCentral.triggerFormDetails,&injectionStart, 0);
|
||||
injectionStart.setAngle(0);
|
||||
ASSERT_EQ(2, injectionStart.triggerEventIndex);
|
||||
ASSERT_FLOAT_EQ(122.24, injectionStart.angleOffsetFromTriggerEvent);
|
||||
|
||||
printf("*************************************************** testAngleResolver 2\r\n");
|
||||
findTriggerPosition(&engine->triggerCentral.triggerShape, &engine->triggerCentral.triggerFormDetails,&injectionStart, 56);
|
||||
injectionStart.setAngle(56);
|
||||
ASSERT_EQ(2, injectionStart.triggerEventIndex);
|
||||
ASSERT_FLOAT_EQ(178.24, injectionStart.angleOffsetFromTriggerEvent);
|
||||
|
||||
|
|
|
@ -159,19 +159,13 @@ TEST(trigger, test1995FordInline6TriggerDecoder) {
|
|||
|
||||
event_trigger_position_s position;
|
||||
ASSERT_EQ( 0, engineConfiguration->globalTriggerAngleOffset) << "globalTriggerAngleOffset";
|
||||
findTriggerPosition(&engine->triggerCentral.triggerShape,
|
||||
&engine->triggerCentral.triggerFormDetails,
|
||||
&position, 0);
|
||||
position.setAngle(0);
|
||||
assertTriggerPosition(&position, 0, 0);
|
||||
|
||||
findTriggerPosition(&engine->triggerCentral.triggerShape,
|
||||
&engine->triggerCentral.triggerFormDetails,
|
||||
&position, 200);
|
||||
position.setAngle(200);
|
||||
assertTriggerPosition(&position, 3, 20);
|
||||
|
||||
findTriggerPosition(&engine->triggerCentral.triggerShape,
|
||||
&engine->triggerCentral.triggerFormDetails,
|
||||
&position, 360);
|
||||
position.setAngle(360);
|
||||
assertTriggerPosition(&position, 6, 0);
|
||||
|
||||
eth.applyTriggerWaveform();
|
||||
|
|
Loading…
Reference in New Issue