Commit 1df5d671 authored by garciay's avatar garciay
Browse files

Changes applied for UC3:

1)ETSI CTI Plugtests Guide V0.0.5
2)NodeXY X/Y inversion
parent ec7108c8
Loading
Loading
Loading
Loading
+34 −21
Original line number Diff line number Diff line
@@ -484,50 +484,63 @@ module ItsRSUsSimulator_Functions {
        var template (omit) SPATEM v_spatem := p_spatem; // Make a copy
        var TimeMark v_currentTimeMark := f_getCurrentTimeMark();
        
        if (vc_currentPhaseStartTime == 36001) {
        if (vc_currentPhaseStartTime == 36001) { // First call
            vc_currentPhaseStartTime := v_currentTimeMark;
            vc_endPhaseStartTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, vc_repitition_duration[vc_spatemStatesId]);
            select (vc_spatemStatesId) {
                case (0) {
                    vc_endPhaseStartTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
                }
                case (1) {
                    vc_endPhaseStartTime := f_computeEndPhaseStartTime(v_currentTimeMark, PICS_SPATEM_REPITITION_DURATION_STATE_30);
                }
                case (2) {
                    vc_endPhaseStartTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
                }
        if (v_currentTimeMark >= vc_endPhaseStartTime) {
            vc_spatemStatesId := (vc_spatemStatesId + 1) mod vc_spatemStatesNum; // Change state
            } // End of 'select' statement
        }
        if (v_currentTimeMark >= vc_endPhaseStartTime) { // Change state
            vc_spatemStatesId := (vc_spatemStatesId + 1) mod vc_spatemStatesNum;
            vc_currentPhaseStartTime := v_currentTimeMark;
            vc_endPhaseStartTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, vc_repitition_duration[vc_spatemStatesId]);
            vc_endPhaseStartTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
        }
        log("vc_currentPhaseStartTime = ", vc_currentPhaseStartTime);
        log("vc_endPhaseStartTime = ", vc_endPhaseStartTime);
        log("v_currentTimeMark = ", v_currentTimeMark);
        log("vc_endPhaseStartTime = ", vc_endPhaseStartTime);
        log("vc_spatemStatesId = ", vc_spatemStatesId);
        log("mintime#1 = ", vc_currentPhaseStartTime + vc_repitition_duration[(vc_spatemStatesId + 1) mod vc_spatemStatesNum]);
        log("mintime#2 = ", vc_currentPhaseStartTime + vc_repitition_duration[(vc_spatemStatesId + 2) mod vc_spatemStatesNum]);
        // Rebuild SPATEM message
        for (var integer v_intersection := 0; v_intersection < lengthof(v_spatem.spat.intersections); v_intersection := v_intersection + 1) {
            var template (omit) MovementList v_states := vc_states[vc_signalGroupParmId][v_intersection];
            v_spatem.spat.intersections[v_intersection].states[0] := v_states[vc_spatemStatesId];
            select (vc_spatemStatesId) {
                case (0) {
                    v_spatem.spat.intersections[v_intersection].states[0] := v_states[0];
                    v_spatem.spat.intersections[v_intersection].states[1] := v_states[1];
                    v_spatem.spat.intersections[v_intersection].states[2] := v_states[2];
                    //v_spatem.spat.intersections[v_intersection].states[2] := v_states[2];
                    // Update startTime & minEndTime
                    v_spatem.spat.intersections[v_intersection].states[0].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
                    v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.startTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
                    v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_40);
                }
                case (1) {
                    v_spatem.spat.intersections[v_intersection].states[0] := v_states[1];
                    v_spatem.spat.intersections[v_intersection].states[1] := v_states[2];
                    v_spatem.spat.intersections[v_intersection].states[2] := v_states[0];
                    //v_spatem.spat.intersections[v_intersection].states[2] := v_states[0];
                    // Update startTime & minEndTime
                    v_spatem.spat.intersections[v_intersection].states[0].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(v_currentTimeMark, PICS_SPATEM_REPITITION_DURATION_STATE_10);
                    v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.startTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_10);
                    v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
                }
                case (2) {
                    v_spatem.spat.intersections[v_intersection].states[0] := v_states[2];
                    v_spatem.spat.intersections[v_intersection].states[1] := v_states[0];
                    v_spatem.spat.intersections[v_intersection].states[2] := v_states[1];
                    //v_spatem.spat.intersections[v_intersection].states[2] := v_states[1];
                    // Update startTime & minEndTime
                    v_spatem.spat.intersections[v_intersection].states[0].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_20);
                    v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.startTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_20);
                    v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_50);
                }
                case else {
                }
            } // End of 'select' statement
            // Update 'minEndTime' field
            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
        log("v_spatem.spat.intersections = ", v_spatem.spat.intersections);
        
        p_payload := valueof(
            f_adaptPayload(
@@ -677,7 +690,7 @@ module ItsRSUsSimulator_Functions {
                    valueof(p_payload)
                ),
                m_defaultLifetime,
                c_defaultHopLimit
                c_hopLimit1
            ));
        } else {
            v_geoNetworkingPdu := valueof(m_geoNwPdu( // FIXME Use PIXIT parameter to get a fully configurable template
+22 −18
Original line number Diff line number Diff line
@@ -492,7 +492,7 @@ module ItsRSUsSimulator_Pics {
                typeOfAddress                               := e_manual,
                stationType                                 := e_bus,
                stationCountryCode                          := 39,
                mid                                         := '000ACCDDEEEE'O
                mid                                         := '001C6B0DEEEE'O
            } // End of PICS_UC7_GN_ADDRESS
            
            modulepar RsuParm PICS_UC7_LPV := {
@@ -519,8 +519,8 @@ module ItsRSUsSimulator_Pics {
                latitude                                    := 435582150,
                longitude                                   := 103065170,
                positionConfidenceEllipse                   := {
                    semiMajorConfidence   := SemiAxisLength_oneCentimeter_,
                    semiMinorConfidence   := SemiAxisLength_oneCentimeter_,
                    semiMajorConfidence   := 100,
                    semiMinorConfidence   := 100,
                    semiMajorOrientation  := HeadingValue_wgs84North_
                },
                altitude                                    := {
@@ -2722,7 +2722,7 @@ module ItsRSUsSimulator_Pics {
            modulepar MapemParm PICS_Z1_M1_SL := {
                intersections := {
                    { // Start of intersection #0
                        name                                := "PICS_Z1_M1_SL - RSU_11",
                        name                                := "PICS_Z1_M1_SL",
                        id                                  := PICS_Z1_M1_SL_IDX,
                        revision                            := 0,
                        refPoint                            := PICS_Z1_M1_SL_RP,
@@ -2878,7 +2878,7 @@ module ItsRSUsSimulator_Pics {
            modulepar MapemParm PICS_Z2_M1_SL := {
                intersections := {
                    { // Start of intersection #0
                        name                                := "PICS_Z2_M1_SL - RSU_3",
                        name                                := "PICS_Z2_M1_SL",
                        id                                  := PICS_Z2_M1_SL_IDX,
                        revision                            := 0,
                        refPoint                            := PICS_Z2_M1_SL_RP,
@@ -3034,7 +3034,7 @@ module ItsRSUsSimulator_Pics {
            modulepar MapemParm PICS_Z3_M1_SL := {
                intersections := {
                    { // Start of intersection #0
                        name                                := "PICS_Z3_M1_SL - RSU_12",
                        name                                := "PICS_Z3_M1_SL",
                        id                                  := PICS_Z3_M1_SL_IDX,
                        revision                            := 0,
                        refPoint                            := PICS_Z3_M1_SL_RP,
@@ -3190,7 +3190,7 @@ module ItsRSUsSimulator_Pics {
            modulepar MapemParm PICS_Z4_M1_SL := {
                intersections := {
                    { // Start of intersection #0
                        name                                := "PICS_Z4_M1_SL - RSU_5",
                        name                                := "PICS_Z4_M1_SL",
                        id                                  := PICS_Z4_M1_SL_IDX,
                        revision                            := 0,
                        refPoint                            := PICS_Z4_M1_SL_RP,
@@ -3346,7 +3346,7 @@ module ItsRSUsSimulator_Pics {
            modulepar MapemParm PICS_Z5_M1_SL := {
                intersections := {
                    { // Start of intersection #0
                        name                                := "PICS_Z5_M1_SL - RSU_4",
                        name                                := "PICS_Z5_M1_SL",
                        id                                  := PICS_Z5_M1_SL_IDX,
                        revision                            := 0,
                        refPoint                            := PICS_Z5_M1_SL_RP,
@@ -3502,7 +3502,7 @@ module ItsRSUsSimulator_Pics {
            modulepar MapemParm PICS_Z6_M1_SL := {
                intersections := {
                    { // Start of intersection #0
                        name                                := "PICS_Z6_M1_SL - RSU_7",
                        name                                := "PICS_Z6_M1_SL",
                        id                                  := PICS_Z6_M1_SL_IDX,
                        revision                            := 0,
                        refPoint                            := PICS_Z6_M1_SL_RP,
@@ -3597,11 +3597,15 @@ module ItsRSUsSimulator_Pics {
            
            modulepar UInt32 PICS_SPATEM_ITS_AID                        := 137;
            
            modulepar UInt32 PICS_SPATEM_REPITITION_DURATION_STATE_1    := 30*10; // In units of 1/10th second
            modulepar UInt32 PICS_SPATEM_REPITITION_DURATION_STATE_10    := 10*10; // In units of 1/10th second
            
            modulepar UInt32 PICS_SPATEM_REPITITION_DURATION_STATE_20    := 20*10; // In units of 1/10th second
            
            modulepar UInt32 PICS_SPATEM_REPITITION_DURATION_STATE_30    := 30*10; // In units of 1/10th second
            
            modulepar UInt32 PICS_SPATEM_REPITITION_DURATION_STATE_2    := 30*10; // In units of 1/10th second
            modulepar UInt32 PICS_SPATEM_REPITITION_DURATION_STATE_40    := 40*10; // In units of 1/10th second
            
            modulepar UInt32 PICS_SPATEM_REPITITION_DURATION_STATE_3    := 30*10; // In units of 1/10th second
            modulepar UInt32 PICS_SPATEM_REPITITION_DURATION_STATE_50    := 50*10; // In units of 1/10th second
            
        } // End of group spatemCommonParams
        
@@ -3611,7 +3615,7 @@ module ItsRSUsSimulator_Pics {
                signalGroupID                               := 1,
                intersections := {
                    {
                        name                                := "PICS_SPATEM_PARMS_SG_1 - RSU_11",
                        name                                := "PICS_SPATEM_PARMS_SG_50",
                        id                                  := PICS_Z1_M1_SL_IDX,
                        revision                            := 0,   
                        status                              := int2bit(0, 16),
@@ -3701,7 +3705,7 @@ module ItsRSUsSimulator_Pics {
                signalGroupID                               := 1,
                intersections := {
                    {
                        name                                := "PICS_SPATEM_PARMS_SG_1 - RSU_3",
                        name                                := "PICS_SPATEM_PARMS_SG_50",
                        id                                  := PICS_Z2_M1_SL_IDX,
                        revision                            := 0,   
                        status                              := int2bit(0, 16),
@@ -3791,7 +3795,7 @@ module ItsRSUsSimulator_Pics {
                signalGroupID                               := 1,
                intersections := {
                    {
                        name                                := "PICS_SPATEM_PARMS_SG_1 - RSU_12",
                        name                                := "PICS_SPATEM_PARMS_SG_50",
                        id                                  := PICS_Z3_M1_SL_IDX,
                        revision                            := 0,   
                        status                              := int2bit(0, 16),
@@ -3881,7 +3885,7 @@ module ItsRSUsSimulator_Pics {
                signalGroupID                               := 1,
                intersections := {
                    {
                        name                                := "PICS_SPATEM_PARMS_SG_1 - RSU_5",
                        name                                := "PICS_SPATEM_PARMS_SG_50",
                        id                                  := PICS_Z4_M1_SL_IDX,
                        revision                            := 0,   
                        status                              := int2bit(0, 16),
@@ -3971,7 +3975,7 @@ module ItsRSUsSimulator_Pics {
                signalGroupID                               := 1,
                intersections := {
                    {
                        name                                := "PICS_SPATEM_PARMS_SG_1 - RSU_4",
                        name                                := "PICS_SPATEM_PARMS_SG_50",
                        id                                  := PICS_Z5_M1_SL_IDX,
                        revision                            := 0,   
                        status                              := int2bit(0, 16),
@@ -4061,7 +4065,7 @@ module ItsRSUsSimulator_Pics {
                signalGroupID                               := 1,
                intersections := {
                    {
                        name                                := "PICS_SPATEM_PARMS_SG_1 - RSU_4",
                        name                                := "PICS_SPATEM_PARMS_SG_50",
                        id                                  := PICS_Z6_M1_SL_IDX,
                        revision                            := 0,   
                        status                              := int2bit(0, 16),
+3 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ module ItsRSUsSimulator_Pixits {
    /**
     * @desc Indicate which RSU to simulate
     */
    modulepar integer PX_RSU_ID := 2; 
    modulepar integer PX_RSU_ID := 1; 
    
    /**
     * @desc Indicate which Use Case to simulate
@@ -32,6 +32,7 @@ module ItsRSUsSimulator_Pixits {
     *         UC6 (CAM only):          PX_ETSI_USE_CASE_ID := 6 !! PX_RSU_ID 2
     *         UC7 (CAM only):          PX_ETSI_USE_CASE_ID := 7 !! PX_RSU_ID 2
     *         UC9 (CAM only):          PX_ETSI_USE_CASE_ID := 9 !! PX_RSU_ID 5
     * @remark LibItsGeoNetworking_Pixits.PX_GN_UPPER_LAYER := e_btpB
     */
    modulepar integer PX_ETSI_USE_CASE_ID := 3;
    
@@ -39,7 +40,7 @@ module ItsRSUsSimulator_Pixits {
     * @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;
    
    modulepar boolean PICS_GENERATE_BEACON   := false;
    
+1 −1
Original line number Diff line number Diff line
@@ -423,7 +423,7 @@ module ItsRSUsSimulator_Templates {
                termination                 := omit,
                eventPosition               := p_eventPosition,
                relevanceDistance           := p_relevanceDistance,
                relevanceTrafficDirection   := omit,
                relevanceTrafficDirection   := upstreamTraffic,
                validityDuration            := p_validityDuration,
                transmissionInterval        := p_repetitionInterval,
                stationType                 := StationType_roadSideUnit_
+4 −6
Original line number Diff line number Diff line
@@ -73,16 +73,14 @@ module ItsRSUsSimulator_TestSystem {
        /**
         * @desc Repetition duration times of SPATEM phases
         */
        var SpatemRepetionDuration vc_repitition_duration := { 
        /* TODO To be removed
         * var SpatemRepetionDuration vc_repitition_duration := { 
            PICS_SPATEM_REPITITION_DURATION_STATE_1, 
            PICS_SPATEM_REPITITION_DURATION_STATE_2, 
            PICS_SPATEM_REPITITION_DURATION_STATE_3 
        };
        /**
         * @desc Number of SPATEM phases
        */
        var integer vc_spatemStatesNum := lengthof(vc_repitition_duration);
        
        var integer vc_spatemStatesNum := 3; // Two states
        
        var boolean vc_beacon := PICS_GENERATE_BEACON;
        var boolean vc_cam    := PICS_GENERATE_CAM;