From 2e1a0f62eee012d4fee7e0c0ce3c95d905900025 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 3 Aug 2016 10:18:32 +0000 Subject: [PATCH] RSUsimulator: Add PICS_GENERATE_xxx --- .../ItsRSUsSimulator_Functions.ttcn | 84 +++++++++---------- .../ItsRSUsSimulator_Pics.ttcn | 10 +++ .../ItsRSUsSimulator_TestCases.ttcn | 8 +- ttcn/AtsSremSsem/ItsSrem_TpFunctions.ttcn | 2 +- 4 files changed, 59 insertions(+), 45 deletions(-) diff --git a/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Functions.ttcn b/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Functions.ttcn index eafc20d5f..2b9819d4d 100644 --- a/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Functions.ttcn +++ b/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Functions.ttcn @@ -50,7 +50,11 @@ module ItsRSUsSimulator_Functions { // Local variables var template (value) DenmParmContainers v_denmParmContainers; - var DENMs v_denms := {}; + var template (omit) DENMs v_denms := omit; + var template (omit) CAM v_cam := omit; +// var template (omit) MAPEM v_mapem := omit; +// var template (omit) SPATEMs v_spatems := omit; +// var template (omit) SSEM v_ssem := omit; var integer v_counter; // Map @@ -72,37 +76,46 @@ module ItsRSUsSimulator_Functions { vc_longPosVectorRsu := PICS_RSU_PARAMS[PX_RSU_ID - 1].longPosVector; // TODO MAPEM // TODO IVIM - // Build the list of the DENM events - for (v_counter := 0; v_counter < lengthof(PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1]); v_counter := v_counter + 1) { - v_denmParmContainers := m_denmParmContainers( - PICS_RSU_PARAMS[PX_RSU_ID - 1].stationID, - f_getDenmSequenceNumber(), - PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].eventPosition, - PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].causeCodeType, - PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].eventHistory + if (PICS_GENERATE_DENM) { + // Build the list of the DENM events + for (v_counter := 0; v_counter < lengthof(PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1]); v_counter := v_counter + 1) { + v_denmParmContainers := m_denmParmContainers( + PICS_RSU_PARAMS[PX_RSU_ID - 1].stationID, + f_getDenmSequenceNumber(), + PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].eventPosition, + PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].causeCodeType, + PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].eventHistory + ); + v_denms[v_counter] := valueof( + m_denmPdu( + m_denm( + v_denmParmContainers.managementContainer, + v_denmParmContainers.situationContainer, + v_denmParmContainers.locationContainer + ))); + } // End of 'for' loop + } + if (PICS_GENERATE_CAM) { + // Build the list of the CAM events + v_cam := valueof( + m_camParm( + PICS_RSU_PARAMS[PX_RSU_ID - 1].stationID, + m_rsuPosition( + vc_longPosVectorRsu.latitude, + vc_longPosVectorRsu.longitude + ), + PICS_RSU_PARAMS[PX_RSU_ID - 1].pathHistory + ) ); - v_denms[v_counter] := valueof( - m_denmPdu( - m_denm( - v_denmParmContainers.managementContainer, - v_denmParmContainers.situationContainer, - v_denmParmContainers.locationContainer - ))); - } // End of 'for' loop + } // Build the messages value list for this RSU vc_rsuMessagesValueList[PX_RSU_ID - 1] := valueof( m_rsuProfile( - valueof( - m_camParm( - PICS_RSU_PARAMS[PX_RSU_ID - 1].stationID, - m_rsuPosition( - vc_longPosVectorRsu.latitude, - vc_longPosVectorRsu.longitude - ), - PICS_RSU_PARAMS[PX_RSU_ID - 1].pathHistory - ) - ), - v_denms + v_cam, + v_denms/*, + v_mapem, + v_spatems + v_ssem*/ )); if (PICS_RSU_PARAMS[PX_RSU_ID - 1].geoShape == e_geoCircle) { vc_geoArea := f_computeCircularArea(vc_longPosVectorRsu, PICS_RSU_PARAMS[PX_RSU_ID - 1].geoParms.radius); @@ -111,20 +124,6 @@ module ItsRSUsSimulator_Functions { setverdict(inconc); stop; } - // Sanity checks - if (not isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1])) { - log("*** " & testcasename() & ": INCONC: Wrong profiles initialisation ***"); - setverdict(inconc); - stop; - } else if (not isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].cam)) { - log("*** " & testcasename() & ": INCONC: Wrong CAM initialisation ***"); - setverdict(inconc); - stop; - } else if (not isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].denms)) { - log("*** " & testcasename() & ": INCONC: Wrong DENM initialisation ***"); - setverdict(inconc); - stop; - } } // End of function f_cf01Up @@ -282,6 +281,7 @@ module ItsRSUsSimulator_Functions { function f_processSrem( in GeoNetworkingPdu p_geoNetworkingPdu ) runs on ItsRSUsSimulator { + log("SREM=", p_geoNetworkingPdu) // TODO Process message, and send SSEM } diff --git a/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pics.ttcn b/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pics.ttcn index 113222329..74d192a6d 100644 --- a/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pics.ttcn +++ b/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_Pics.ttcn @@ -287,6 +287,16 @@ module ItsRSUsSimulator_Pics { group generationFrequencies { + modulepar boolean PICS_GENERATE_CAM := true; + + modulepar boolean PICS_GENERATE_DENM := true; + + modulepar boolean PICS_GENERATE_IVIM := true; + + modulepar boolean PICS_GENERATE_MAPEM_SPATEM := true; + + modulepar boolean PICS_GENERATE_SSEM := true; + /** * @desc CAM frequency timer */ diff --git a/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_TestCases.ttcn b/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_TestCases.ttcn index 19a1a770b..6a024a199 100644 --- a/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_TestCases.ttcn +++ b/ttcn/AtsRSUsSimulator/ItsRSUsSimulator_TestCases.ttcn @@ -38,8 +38,12 @@ module ItsRSUsSimulator_TestCases { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body - tc_cam.start; - tc_denm.start; + if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].cam)) { + tc_cam.start; + } + if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].denm)) { + tc_denm.start; + } if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].mapem)) { tc_mapem.start; } diff --git a/ttcn/AtsSremSsem/ItsSrem_TpFunctions.ttcn b/ttcn/AtsSremSsem/ItsSrem_TpFunctions.ttcn index 0c4f680fd..996661942 100644 --- a/ttcn/AtsSremSsem/ItsSrem_TpFunctions.ttcn +++ b/ttcn/AtsSremSsem/ItsSrem_TpFunctions.ttcn @@ -6,7 +6,7 @@ * */ -module ItsSrem_TpFunctions { +module ItsSrem_TpFunctions { // LibCommon import from LibCommon_BasicTypesAndValues all; -- GitLab