restore testQuadCam #2911

This commit is contained in:
Andrey 2021-07-05 20:56:24 -04:00
parent de63a5cd17
commit 7cd5ea855c
1 changed files with 5 additions and 2 deletions

View File

@ -41,15 +41,18 @@ TEST(trigger, testQuadCam) {
float d = 4;
int firstCam = 0;
int secondCam = 1;
// this would be ignored since we only consume the other kind of fronts here
hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX);
eth.moveTimeForwardUs(MS2US(20 / d));
hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCam PASS_ENGINE_PARAMETER_SUFFIX);
// this would be be first VVT signal - gap duration would be calculated against 'DEEP_IN_THE_PAST_SECONDS' initial value
hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX);
eth.moveTimeForwardUs(MS2US(20 / d));
hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX);
// this second important front would give us first real VVT gap duration
hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX);
@ -60,7 +63,7 @@ TEST(trigger, testQuadCam) {
// this third important front would give us first comparison between two real gaps
hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX);
ASSERT_NEAR(-67.6 - 720 - 720 + 160.2, engine->triggerCentral.getVVTPosition(0, 1), EPS3D);
ASSERT_NEAR(0, engine->triggerCentral.getVVTPosition(0, 1), EPS3D);
// actually position based on VVT!
ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getTotalRevolutionCounter());
@ -85,7 +88,7 @@ TEST(trigger, testQuadCam) {
// this third important front would give us first comparison between two real gaps
hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCamSecondBank PASS_ENGINE_PARAMETER_SUFFIX);
ASSERT_NEAR(-2571.4, engine->triggerCentral.getVVTPosition(secondBank, secondCam), EPS3D);
ASSERT_NEAR(0, engine->triggerCentral.getVVTPosition(secondBank, secondCam), EPS3D);
// actually position based on VVT!
ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getTotalRevolutionCounter());