Commit 45ff4c90 authored by garciay's avatar garciay
Browse files

Add UC3 & UC5 support

parent 0ad847cc
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ module ItsRSUsSimulator_Functions {
            
            // Map
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            map(self:cfPort, system:cfPort);
            map(self:geoNetworkingPort, system:geoNetworkingPort);
            
@@ -94,7 +93,6 @@ module ItsRSUsSimulator_Functions {
            
            // Unmap
            unmap(self:acPort, system:acPort);
            unmap(self:utPort, system:utPort);
            unmap(self:cfPort, system:cfPort);
            unmap(self:geoNetworkingPort, system:geoNetworkingPort);
            
@@ -121,7 +119,7 @@ module ItsRSUsSimulator_Functions {
        
        vc_longPosVectorRsu := PICS_RSU_PARAMS[p_rsu_id].longPosVector;
        // MAPEM
        if (PICS_GENERATE_MAPEM) {
        if (PICS_GENERATE_MAPEM and ispresent(PICS_MAPEM_PARMS_RSUs[p_rsu_id].intersections)) {
            // Build the list of the MAPEM events
            v_mapem := 
                m_mapemParm(
@@ -136,8 +134,8 @@ module ItsRSUsSimulator_Functions {
            // TODO Add more?
        }
        // SPATEM
        if (PICS_GENERATE_SPATEM) {
            // Build the list of the DENM events
        if (PICS_GENERATE_SPATEM and (lengthof(PICS_SPATEM_PARMS_RSUs[p_rsu_id]) != 0)) {
            // Build the list of the SPATEM events
            for (v_counter := 0; v_counter < lengthof(PICS_SPATEM_PARMS_RSUs[p_rsu_id]); v_counter := v_counter + 1) {
                v_spatems[v_counter] := 
                    m_spatemParm(
@@ -154,8 +152,8 @@ module ItsRSUsSimulator_Functions {
            // TODO Build SPATEM with dynamic values
        }
        // IVIM
        if (PICS_GENERATE_IVIM) {
            // Build the list of the MAPEM events
        if (PICS_GENERATE_IVIM and ispresent(PICS_IVIM_PARMS_RSUs[p_rsu_id].provider)) {
            // Build the list of the IVIM events
            v_ivim := 
                m_ivimParm(
                    PICS_RSU_PARAMS[p_rsu_id].stationID,
@@ -165,7 +163,7 @@ module ItsRSUsSimulator_Functions {
                            PICS_IVIM_PARMS_RSUs[p_rsu_id].iviIdentificationNumber,
                            0//IviStatus_new_
                        ),
                        { PICS_IVIM_PARMS_RSUs[p_rsu_id].iviContainer }
                        PICS_IVIM_PARMS_RSUs[p_rsu_id].iviContainers
            ));
            // Update ivi status
            v_ivim.ivi.mandatory.validFrom := f_getCurrentTime();
@@ -321,6 +319,18 @@ module ItsRSUsSimulator_Functions {
    ) runs on ItsRSUsSimulator {
        var template (value) SPATEM v_spatem := p_spatem; // Make a copy
        
        
        
        
        
		vc_currentPhaseStartTime := f_getCurrentTime();
		vc_endPhaseStartTime := vc_currentPhaseStartTime + vc_repitition_duration[vc_spatemStatesId];
        
        
        
        
        
        
        // Rebuild SPATEM message
        for (var integer v_intersection := 0; v_intersection < lengthof(v_spatem.spat.intersections); v_intersection := v_intersection + 1) {
            var template (value) MovementList v_states := vc_states[PX_RSU_ID - 1][v_intersection];