Commit 8a3e80ed authored by garciay's avatar garciay
Browse files

STF507 Week#11: Merge GNSS support from C2C branch

parent 7f8ae006
......@@ -14,11 +14,11 @@ module ItsCam_TpFunctions {
import from LibCommon_Time all;
import from LibCommon_BasicTypesAndValues all;
// LibItsCommon
import from LibItsCommon_Pixits all;
// LibIts
import from LibItsCommon_Functions all;
import from LibItsCommon_TypesAndValues {
type UtChangePosition
};
import from LibItsCommon_TypesAndValues all;
import from LibItsCam_TestSystem all;
import from LibItsCam_Functions all;
import from LibItsCam_Templates all;
......@@ -168,7 +168,7 @@ module ItsCam_TpFunctions {
// Test Body
for (v_cntSpeed:=0; v_cntSpeed<lengthof(v_speedValues); v_cntSpeed:=v_cntSpeed + 1) {
f_utTriggerEvent(m_changeSpeed(v_speedValues[v_cntSpeed]));
f_changeSpeed(v_speedValues[v_cntSpeed]);
v_cntTime := 0;
tc_ac.start;
alt {
......@@ -320,7 +320,7 @@ module ItsCam_TpFunctions {
// Test Body
for (v_cntSpeed:=0; v_cntSpeed<lengthof(v_speedValues); v_cntSpeed:=v_cntSpeed + 1) {
f_utTriggerEvent(m_changeSpeed(v_speedValues[v_cntSpeed]));
f_changeSpeed(v_speedValues[v_cntSpeed]);
v_cntTime := 0;
tc_ac.start;
alt {
......@@ -419,6 +419,7 @@ module ItsCam_TpFunctions {
/**
* @desc TP Function for TC_CAM_MSD_INA_BV_01_01
*/
// TODO yann/ifsttar: why 3601? 0 and 3600 indicates the north!!!!
function f_CAM_MSD_INA_BV_01_01() runs on ItsCam {
// Local variables
......@@ -466,7 +467,7 @@ module ItsCam_TpFunctions {
} else { // TODO Add negative value case
v_curVal := v_camInd.msgIn.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.curvature.curvatureValue - c_curValOffset;
if (valueof(v_curVal) < -30000) {
v_curVal := 0;
v_curVal := 0; // yann/ifsttar TODO It's not a true negative modulus operation
}
}
f_utTriggerEvent(m_changeCurvature(c_curValOffset));
......@@ -1597,7 +1598,7 @@ module ItsCam_TpFunctions {
log("*** " & testcasename() & ": Checking INFO==Heading value ***");
// change the heading value to retrieve the current value
f_utTriggerEvent(m_changeHeading(c_headingValOffset));
f_changeHeading(c_headingValOffset);
tc_ac.start;
alt {
......@@ -1612,7 +1613,7 @@ module ItsCam_TpFunctions {
v_initialReceived := true;
//change again the heading value and set the expectation to the measured value
v_headingVal := (v_camInd.msgIn.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.heading.headingValue+c_headingValOffset) mod 3601;
f_utTriggerEvent(m_changeHeading(c_headingValOffset));
f_changeHeading(c_headingValOffset);
tc_ac.start;
repeat;
}
......@@ -1660,7 +1661,7 @@ module ItsCam_TpFunctions {
log("*** " & testcasename() & ": Checking INFO==Speed value ***");
// change the speed value to retrieve the current value
f_utTriggerEvent(m_changeSpeed(c_speedValOffset));
f_changeSpeed(c_speedValOffset);
tc_ac.start;
alt {
......@@ -1675,7 +1676,7 @@ module ItsCam_TpFunctions {
v_initialReceived := true;
//change again the speed value and set the expectation to the measured value
v_speedVal := (v_camInd.msgIn.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.speed.speedValue+c_speedValOffset) mod 16384;
f_utTriggerEvent(m_changeSpeed(c_speedValOffset));
f_changeSpeed(c_speedValOffset);
tc_ac.start;
repeat;
}
......@@ -1798,7 +1799,8 @@ module ItsCam_TpFunctions {
v_initialReceived := true;
//change again the yaw rate value and set the expectation to the measured value
v_yawRateVal := v_camInd.msgIn.cam.camParameters.highFrequencyContainer.basicVehicleContainerHighFrequency.yawRate.yawRateValue;
if (valueof(v_yawRateVal)>=32767) {
if (valueof(v_yawRateVal)>=32767) { // FIXME Yann/ifsttar: quid if we receive -32768
// FIXME if current value is 32760 and offset applied, we shall not expect posiive value
v_yawRateVal := -32766;
}
else {
......@@ -2236,7 +2238,7 @@ module ItsCam_TpFunctions {
}
t_minTransInterval.start;
}
f_utTriggerEvent(m_changeSpeed(v_speedValues[v_cntSpeed]));
f_changeSpeed(v_speedValues[v_cntSpeed]);
}
t_minTransInterval.stop;
log("*** " & testcasename() & ": PASS: Generation of CAM messages was successful ***");
......@@ -2403,7 +2405,7 @@ module ItsCam_TpFunctions {
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
}
}
f_utTriggerEvent(m_changeSpeed(1000));
f_changeSpeed(1000);
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
......@@ -2513,7 +2515,7 @@ module ItsCam_TpFunctions {
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
f_utTriggerEvent(m_changeHeading(v_changeHeadingValue));
f_changeHeading(v_changeHeadingValue);
t_genCam_dcc.timeout;
t_genCam_min.start;
alt {
......@@ -2543,7 +2545,7 @@ module ItsCam_TpFunctions {
timer t_genCam_dcc := PICS_T_GENCAMDCC * 0.90;
var CamInd v_camPdu;
var ReferencePosition v_referencePosition, v_expectedReferencePosition;
var integer v_changePosValue := 8; // 8 >> 4m
var float v_changePosValue := 8.0; // 8 >> 4m
// Test control
if (not PICS_CAM_GENERATION) {
......@@ -2577,10 +2579,16 @@ module ItsCam_TpFunctions {
// Test Body
v_expectedReferencePosition := f_computePositionUsingDistance(v_referencePosition, v_changePosValue);
f_utChangePosition ( valueof ( UtChangePosition: {
latitude := v_expectedReferencePosition.latitude - v_referencePosition.latitude,
longitude := v_expectedReferencePosition.longitude - v_referencePosition.longitude,
elevation := 0 } ) );
if (PICS_GNSS_SCENARIO_SUPPORT == false) {
f_utChangePosition(
valueof(
UtChangePosition: {
latitude := v_expectedReferencePosition.latitude - v_referencePosition.latitude,
longitude := v_expectedReferencePosition.longitude - v_referencePosition.longitude,
elevation := 0
}
));
}
t_genCam_dcc.timeout;
t_genCam_dcc.start;
alt {
......@@ -2644,7 +2652,7 @@ module ItsCam_TpFunctions {
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
f_utTriggerEvent(m_changeSpeed(v_changeSpeedValue));
f_changeSpeed(v_changeSpeedValue);
t_genCam_dcc.timeout;
t_genCam_min.start;
alt {
......@@ -2706,7 +2714,7 @@ module ItsCam_TpFunctions {
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
}
}
f_utTriggerEvent(m_changeSpeed(1000));
f_changeSpeed(1000);
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment