Commit 52c787f0 authored by garciay's avatar garciay
Browse files

Add external function f_getMinuteOfTheYear()

Editorial changes
Add UC6 support
parent 067603ec
......@@ -145,8 +145,8 @@ module ItsRSUsSimulator_Functions {
var integer v_counter;
vc_longPosVectorRsu := PICS_RSU_PARAMS[p_rsu_id].longPosVector;
// MAPEM
if (PICS_GENERATE_MAPEM and ispresent(PICS_MAPEM_PARMS_RSUs[p_rsu_id].intersections)) {
// MAPEM, only if PX_ETSI_USE_CASE_ID is set to 3
if ((vc_mapem == true) and (PX_ETSI_USE_CASE_ID == 3) and ispresent(PICS_MAPEM_PARMS_RSUs[p_rsu_id].intersections)) {
// Build the list of the MAPEM events
v_mapem :=
m_mapemParm(
......@@ -159,9 +159,11 @@ module ItsRSUsSimulator_Functions {
// Update revision fields
v_mapem.map_.intersections[0].revision := f_incMsgIssueRevision();
// TODO Add more?
} else {
vc_mapem := false;
}
// SPATEM
if (PICS_GENERATE_SPATEM and (lengthof(PICS_SPATEM_PARMS_RSUs[p_rsu_id]) != 0)) {
// SPATEM, only if PX_ETSI_USE_CASE_ID is set to 3
if ((vc_spatem == true) and (PX_ETSI_USE_CASE_ID == 3) and (lengthof(PICS_SPATEM_PARMS_RSUs[p_rsu_id]) != 0)) {
// Reset counter
vc_currentPhaseStartTime := 36001;
vc_endPhaseStartTime := 0;
......@@ -181,9 +183,11 @@ module ItsRSUsSimulator_Functions {
// TODO Build SPATEM with dynamic values
} // End of 'for' statement
// TODO Build SPATEM with dynamic values
} else {
vc_spatem := false;
}
// IVIM
if (PICS_GENERATE_IVIM and ispresent(PICS_IVIM_PARMS_RSUs[p_rsu_id].provider)) {
// IVIM, only if PX_ETSI_USE_CASE_ID is set to 5
if ((vc_ivim == true) and (PX_ETSI_USE_CASE_ID == 5) and ispresent(PICS_IVIM_PARMS_RSUs[p_rsu_id].provider)) {
// Build the list of the IVIM events
v_ivim :=
m_ivimParm(
......@@ -198,9 +202,11 @@ module ItsRSUsSimulator_Functions {
));
// Update ivi status
v_ivim.ivi.mandatory.validFrom := f_getCurrentTime();
} else {
vc_ivim := false;
}
// DENM
if (PICS_GENERATE_DENM) {
// DENM, only if PX_ETSI_USE_CASE_ID is set to 1
if ((vc_denm == true) and (PX_ETSI_USE_CASE_ID == 1)) {
// Build the list of the DENM events for the specified RSU (PX_RSU_ID) and the given zone (PX_ETSI_ZONE_ID)
for (v_counter := 0; v_counter < lengthof(PICS_DENM_EVENTS_RSU[p_rsu_id][PX_ETSI_ZONE_ID - 1]); v_counter := v_counter + 1) {
var DenmEventsParmsPerZone v_denmEventsParmsPerZone := PICS_DENM_EVENTS_RSU[p_rsu_id][PX_ETSI_ZONE_ID - 1];
......@@ -229,9 +235,11 @@ module ItsRSUsSimulator_Functions {
v_denms[v_counter].denm.alacarte := m_alacarte(v_denmEventsParmsPerZone[v_counter].roadWorksContainerExtended);
}
} // End of 'for' statement
} else {
vc_denm := false;
}
// CAM
if (PICS_GENERATE_CAM) {
if (vc_cam == true) {
// Build the list of the CAM events
v_cam :=
m_camParm(
......@@ -243,7 +251,7 @@ module ItsRSUsSimulator_Functions {
PICS_RSU_PARAMS[p_rsu_id].pathHistory
);
}
if (PICS_GENERATE_BEACON) {
if (vc_beacon == true) {
// Build the list of the BeACON events
v_beacon := 'AAAAAAAA'O; // TODO Use a PICS
}
......@@ -424,6 +432,8 @@ module ItsRSUsSimulator_Functions {
v_spatem.spat.intersections[v_intersection].states[0].state_time_speed[0].timing.minEndTime := vc_currentPhaseStartTime;
v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.minEndTime := vc_currentPhaseStartTime + vc_repitition_duration[(vc_spatemStatesId + 1) mod vc_spatemStatesNum];
v_spatem.spat.intersections[v_intersection].states[2].state_time_speed[0].timing.minEndTime := vc_currentPhaseStartTime + vc_repitition_duration[(vc_spatemStatesId + 2) mod vc_spatemStatesNum];
v_spatem.spat.intersections[v_intersection].timeStamp := f_getCurrentTime() mod 65536;
v_spatem.spat.intersections[v_intersection].moy := f_getMinuteOfTheYear();
} // End of 'for' statement
p_payload := valueof(
......
......@@ -22,18 +22,21 @@ module ItsRSUsSimulator_Pixits {
/**
* @desc Indicate which RSU to simulate
*/
modulepar integer PX_RSU_ID := 3;
modulepar integer PX_RSU_ID := 1;
/**
* @desc Indicate which Use Case to simulate
* @remark Used only for DENM
* @remark UC1 (DENM): PX_ETSI_USE_CASE_ID := 1
* UC3 (TLM): PX_ETSI_USE_CASE_ID := 3
* UC5 (IVIM): PX_ETSI_USE_CASE_ID := 5
* UC6 (CAM): PX_ETSI_USE_CASE_ID := 6
*/
modulepar integer PX_ETSI_USE_CASE_ID := 6;
modulepar integer PX_ETSI_USE_CASE_ID := 5;
/**
* @desc Indicate which zone to simulate
* @remark Used only for DENM
*/
modulepar integer PX_ETSI_ZONE_ID := 2;
modulepar integer PX_ETSI_ZONE_ID := 1;
} // End of module ItsRSUsSimulator_Pixits
......@@ -103,21 +103,21 @@ module ItsRSUsSimulator_TestCases {
repeat;
}
}
[PICS_GENERATE_BEACON] tc_beacon.timeout {
[vc_beacon == true] tc_beacon.timeout {
log("*** " & testcasename() & ": DEBUG: Processing BEACON ***");
f_prepare_beacon(v_payload);
f_send(v_payload, PICS_CAM_ITS_AID);
tc_beacon.start;
repeat;
}
[PICS_GENERATE_CAM] tc_cam.timeout {
[vc_cam == true] tc_cam.timeout {
log("*** " & testcasename() & ": DEBUG: Processing CAM ***");
f_prepare_cam(v_payload);
f_send(v_payload, PICS_CAM_ITS_AID);
tc_cam.start;
repeat;
}
[PICS_GENERATE_DENM] tc_denm.timeout {
[vc_denm == true] tc_denm.timeout {
log("*** " & testcasename() & ": DEBUG: Processing DENM ***");
for (var integer v_i := 0; v_i < lengthof(vc_rsuMessagesValueList[vc_rsu_id].denms); v_i := v_i + 1) {
f_prepare_denm(v_payload);
......@@ -126,14 +126,14 @@ module ItsRSUsSimulator_TestCases {
tc_denm.start;
repeat;
}
[PICS_GENERATE_MAPEM] tc_mapem.timeout {
[vc_mapem == true] tc_mapem.timeout {
log("*** " & testcasename() & ": DEBUG: Processing MAPEM ***");
f_prepare_mapem(v_payload);
f_send(v_payload, PICS_MAPEM_ITS_AID);
tc_mapem.start;
repeat;
}
[PICS_GENERATE_SPATEM] tc_spatem.timeout {
[vc_spatem == true] tc_spatem.timeout {
log("*** " & testcasename() & ": DEBUG: Processing SPATEM ***");
for (var integer v_counter := 0; v_counter < lengthof(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems); v_counter := v_counter + 1) {
f_prepare_spatem(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems[v_counter], v_payload);
......@@ -142,7 +142,7 @@ module ItsRSUsSimulator_TestCases {
tc_spatem.start;
repeat;
}
[PICS_GENERATE_IVIM] tc_ivim.timeout {
[vc_ivim == true] tc_ivim.timeout {
log("*** " & testcasename() & ": DEBUG: Processing IVIM ***");
f_prepare_ivim(v_payload);
f_send(v_payload, PICS_IVIM_ITS_AID);
......@@ -188,7 +188,7 @@ module ItsRSUsSimulator_TestCases {
mw_geoNwPdu(
mw_geoNwShbPacketWithNextHeader_cam(
mw_longPosVectorPosition_vendors(
PICS_UC6_VEHICLE_POSITION
PICS_UC6_VEHICLE_POSITION // Ignore RSUsimultor CAM messages
),
?,
e_btpB
......@@ -256,14 +256,14 @@ module ItsRSUsSimulator_TestCases {
f_initialiseVehicleSimulatorComponent(p_component, v_cam);
tc_cam.start;
tc_ca_uc6.start;
alt {
[] tc_cam.timeout {
log("*** " & testcasename() & ": DEBUG: Processing CAM ***");
f_send_vehicle_cam(v_cam, v_idx);
v_idx := v_idx + 1;
if (v_idx < lengthof(PICS_USECASE6_VEHICLE_POSITIONS)) {
tc_cam.start;
tc_ca_uc6.start;
repeat;
} // else, terminate
}
......
......@@ -83,8 +83,16 @@ module ItsRSUsSimulator_TestSystem {
*/
var integer vc_spatemStatesNum := lengthof(vc_repitition_duration);
var boolean vc_beacon := PICS_GENERATE_BEACON;
var boolean vc_cam := PICS_GENERATE_CAM;
var boolean vc_denm := PICS_GENERATE_DENM;
var boolean vc_ivim := PICS_GENERATE_IVIM;
var boolean vc_mapem := PICS_GENERATE_MAPEM;
var boolean vc_spatem := PICS_GENERATE_SPATEM;
timer tc_beacon := PICS_BEACON_FREQUENCY;
timer tc_cam := PICS_CAM_FREQUENCY;
timer tc_ca_uc6 := PICS_CAM_FREQUENCY_UC6;
timer tc_denm := PICS_DENM_FREQUENCY;
timer tc_mapem := PICS_MAPEM_FREQUENCY;
timer tc_spatem := PICS_SPATEM_FREQUENCY;
......
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