Commit c0cd9dbe authored by filatov's avatar filatov
Browse files

integrate STF507 changes into trunk

parents b9ccb54e 3fdc3ff5
Loading
Loading
Loading
Loading
+144 −5
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@ module LibItsCam_Functions {
    import from LibItsCam_TestSystem all;
    import from LibItsCam_TestSystem all;
    import from LibItsCam_Templates all;
    import from LibItsCam_Templates all;
    import from LibItsCam_TypesAndValues all;
    import from LibItsCam_TypesAndValues all;
    import from LibItsCommon_Pixits all;
    import from LibItsCommon_Templates all;
    import from LibItsCommon_Functions all;
    import from LibItsCommon_Functions all;
    import from LibItsCommon_TypesAndValues all;
    import from LibItsCommon_TypesAndValues all;
    import from ITS_Container language "ASN.1:1997" all;
    import from ITS_Container language "ASN.1:1997" all;
@@ -105,14 +107,121 @@ module LibItsCam_Functions {
                    
                    
    } // End of group utFunctions
    } // End of group utFunctions


    group adapterControl {
        
        /**
         * @desc    Triggers event in the test system adaptation.
         * @param   p_event The event to trigger
         * @return  FncRetCode
         */
        function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsCam return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            acPort.send(p_event);
            tc_ac.start;
            alt {
                [] acPort.receive(m_acGnssResponseSuccess) {
                    tc_ac.stop;
                }
                [] acPort.receive {
                    tc_ac.stop;
                    log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***");
                    f_selfOrClientSyncAndVerdict("error", e_error);
                }
                [] tc_ac.timeout {
                    log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***");
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
                }
            }
            
            return v_ret;
        }
        
        /**
         * @desc    Loads the given scenario
         * 
         * @param   p_scenario   The scenario to load.
         */
        function f_acLoadScenario(Scenario p_scenario) runs on ItsCam {
            
            if (PICS_GNSS_SCENARIO_SUPPORT==true) {
                f_acTriggerGnssEvent(m_loadScenario(p_scenario));
            }
        } // end f_acLoadScenario
        
        /**
         * @desc    Starts a loaded scenario
         */
        function f_acStartScenario() runs on ItsCam {
            
            if (PICS_GNSS_SCENARIO_SUPPORT==true) {
                f_acTriggerGnssEvent(m_startScenario);
                vc_scenarioStarted := true;
            }
        } // end f_acStartScenario
        
        /**
         * @desc    Stops a loaded scenario
         */
        function f_acStopScenario() runs on ItsCam {
            
            if (PICS_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) {
                f_acTriggerGnssEvent(m_stopScenario);
                vc_scenarioStarted := false;
            }
        } // end f_acStopScenario
        
        function f_acAwaitDistanceCovered(float p_distanceToCover) runs on ItsCam return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            if (PICS_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) {
                f_acTriggerGnssEvent(m_distanceToCover(p_distanceToCover));
                
                tc_ac.start;
                alt {
                    [] acPort.receive(m_acGnssDistanceCovered) {
                        tc_ac.stop;
                    }
                    [] acPort.receive {
                        tc_ac.stop;
                        log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***");
                        f_selfOrClientSyncAndVerdict("error", e_error);
                    }
                    [] tc_ac.timeout {
                        log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for covered distance indication ***");
                        f_selfOrClientSyncAndVerdict("error", e_timeout);
                    }
                }
                
            }
            return v_ret;
        } // end f_acAwaitDistanceCovered
        
        function f_acChangeSpeed(SpeedValue p_deltaSpeedValue) runs on ItsCam {
            
            if (PICS_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) {
                f_acTriggerGnssEvent(m_changeScenarioSpeed(p_deltaSpeedValue));
            }
        } // end f_acChangeSpeed
        
        function f_acChangeHeading(HeadingValue p_deltaHeadingValue) runs on ItsCam {
            
            if (PICS_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) {
                f_acTriggerGnssEvent(m_changeScenarioHeading(p_deltaHeadingValue));
            }
        } // end f_acChangeHeading
        
    } // End of group adapterControl

    group camConfigurationFunctions {
    group camConfigurationFunctions {
        
        
        /**
        /**
         * @desc    Setups default configuration   
         * @desc    Setups default configuration   
         */
         */
        function f_cfUp() runs on ItsCam {
        function f_cfUp() runs on ItsCam system ItsCamSystem {
            
            
            map(self:utPort, system:utPort);
            map(self:utPort, system:utPort);
            map(self:acPort, system:acPort);
            map(self:camPort, system:camPort);
            map(self:camPort, system:camPort);
            f_connect4SelfOrClientSync();
            f_connect4SelfOrClientSync();
            
            
@@ -121,9 +230,10 @@ module LibItsCam_Functions {
        /**
        /**
         * @desc    Deletes default configuration 
         * @desc    Deletes default configuration 
         */
         */
        function f_cfDown() runs on ItsCam {
        function f_cfDown() runs on ItsCam system ItsCamSystem {
            
            
            unmap(self:utPort, system:utPort);
            unmap(self:utPort, system:utPort);
            unmap(self:acPort, system:acPort);
            unmap(self:camPort, system:camPort);
            unmap(self:camPort, system:camPort);
            f_disconnect4SelfOrClientSync();
            f_disconnect4SelfOrClientSync();
            
            
@@ -191,16 +301,22 @@ module LibItsCam_Functions {
         * @desc    Initialize the IUT
         * @desc    Initialize the IUT
         * @remark  No specific actions specified in the base standard
         * @remark  No specific actions specified in the base standard
         */    
         */    
        function f_prInitialState() runs on ItsCam {
        function f_prInitialState(Scenario p_scenario := e_staticPosition, boolean p_awaitInitialCAM := true) runs on ItsCam {
            
            
            f_utInitializeIut(m_camInitialize);
            f_utInitializeIut(m_camInitialize);
            
            
            f_prDefault();
            f_prDefault();
            
            
            f_acLoadScenario(p_scenario);
            
            //Allow burst mode at the beginning
            //Allow burst mode at the beginning
            f_sleep(1.0);
            f_sleep(1.0);
            
            
            camPort.clear;
            camPort.clear;
            
            f_acStartScenario();
            
            if (p_awaitInitialCAM) {
            tc_ac.start;
            tc_ac.start;
            alt {
            alt {
                [] camPort.receive(mw_camInd ( mw_camMsg_any )){
                [] camPort.receive(mw_camInd ( mw_camMsg_any )){
@@ -212,6 +328,7 @@ module LibItsCam_Functions {
                    f_selfOrClientSyncAndVerdictPreamble("error", e_timeout);
                    f_selfOrClientSyncAndVerdictPreamble("error", e_timeout);
                }
                }
            }  
            }  
            }
        
        
        } // end f_prInitialState
        } // end f_prInitialState
    
    
@@ -223,7 +340,7 @@ module LibItsCam_Functions {
         * @desc The default postamble.
         * @desc The default postamble.
         */
         */
        function f_poDefault() runs on ItsCam {
        function f_poDefault() runs on ItsCam {
            //empty
            f_acStopScenario();
        }
        }
        
        
    } // end group postambles
    } // end group postambles
@@ -239,7 +356,7 @@ module LibItsCam_Functions {
         * 
         * 
         * @return The new reference position.
         * @return The new reference position.
         */
         */
        function f_computePositionUsingDistance(in ReferencePosition p_referencePosition, in integer p_offSet) return ReferencePosition {
        function f_computePositionUsingDistance(in ReferencePosition p_referencePosition, in float p_offSet) return ReferencePosition {
            var ReferencePosition v_referencePosition := p_referencePosition;
            var ReferencePosition v_referencePosition := p_referencePosition;
            
            
            log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***");
            log("*** f_computePositionUsingDistance: INFO: calling fx_computePositionUsingDistance() ***");
@@ -256,6 +373,28 @@ module LibItsCam_Functions {
        
        
    } // end group camPositionFunctions
    } // end group camPositionFunctions


    group camAuxilaryFunctions {
        
        function f_changeSpeed(SpeedValue p_deltaSpeedValue) runs on ItsCam {
            if (PICS_GNSS_SCENARIO_SUPPORT == false) {
                f_utTriggerEvent(m_changeSpeed(p_deltaSpeedValue));
            }
            else {
                f_acChangeSpeed(p_deltaSpeedValue);
            }
        }
        
        function f_changeHeading(HeadingValue p_deltaHeadingValue) runs on ItsCam {
            if (PICS_GNSS_SCENARIO_SUPPORT == false) {
                f_utTriggerEvent(m_changeHeading(p_deltaHeadingValue));
            }
            else {
                f_acChangeHeading(p_deltaHeadingValue);
            }
        }
        
    } // end group camAuxilaryFunctions
    
    group camGenerators {
    group camGenerators {
        function f_generateDefaultCam() 
        function f_generateDefaultCam() 
        return octetstring {
        return octetstring {
+14 −2
Original line number Original line Diff line number Diff line
@@ -25,14 +25,24 @@ module LibItsCam_TestSystem {
    
    
    group portDefinitions {
    group portDefinitions {
    
    
        /**
         * @desc Adapter control port
         */
        type port AdapterControlPort message {
            out
                AcGnssPrimitive;
            in
                AcGnssResponse, AcGnssDistanceCovered;
        } // end AdapterControlPort
        
        /**
        /**
         * @desc Upper Tester port
         * @desc Upper Tester port
         */
         */
        type port UpperTesterPort message {
        type port UpperTesterPort message {
            out 
            out 
                UtInitialize, UtCamTrigger, UtChangePosition;
                UtInitialize, UtCamTrigger, UtChangePosition, UtActivatePositionTime, UtDeactivatePositionTime;
            in 
            in 
                UtInitializeResult, UtCamTriggerResult, UtChangePositionResult, UtCamEventInd;
                UtInitializeResult, UtCamTriggerResult, UtChangePositionResult, UtActivatePositionTimeResult, UtDeactivatePositionTimeResult, UtCamEventInd;
        } // end UpperTesterPort
        } // end UpperTesterPort
        
        
    } // end portDefinitions
    } // end portDefinitions
@@ -65,6 +75,7 @@ module LibItsCam_TestSystem {
        type component ItsCamSystem {
        type component ItsCamSystem {
            
            
            port UpperTesterPort utPort;
            port UpperTesterPort utPort;
            port AdapterControlPort acPort;
            
            
            // FA1 ports
            // FA1 ports
            port CamPort camPort;
            port CamPort camPort;
@@ -79,6 +90,7 @@ module LibItsCam_TestSystem {
    type component ItsCam extends ItsBaseComponent {
    type component ItsCam extends ItsBaseComponent {


        port UpperTesterPort utPort;
        port UpperTesterPort utPort;
        port AdapterControlPort acPort;
        
        
        // FA1 ports
        // FA1 ports
        port CamPort camPort;
        port CamPort camPort;
+1 −1
Original line number Original line Diff line number Diff line
@@ -195,7 +195,7 @@ module LibItsCommon_Functions {
        external function fx_computePositionUsingDistance(
        external function fx_computePositionUsingDistance(
            in Int32 p_refLatitude, 
            in Int32 p_refLatitude, 
            in Int32 p_refLongitude, 
            in Int32 p_refLongitude, 
            in integer p_distance, 
            in float p_distance, 
            in integer p_orientation,
            in integer p_orientation,
            out Int32 p_latitude,
            out Int32 p_latitude,
            out Int32 p_longitude
            out Int32 p_longitude
+5 −0
Original line number Original line Diff line number Diff line
@@ -46,4 +46,9 @@ module LibItsCommon_Pixits {
     */
     */
    modulepar integer PX_TIME_DELTA := 1000;
    modulepar integer PX_TIME_DELTA := 1000;
    
    
    /**
     * @desc Support for GNSS scenario
     */
    modulepar boolean PICS_GNSS_SCENARIO_SUPPORT := true;
    
} // end LibItsCommon_Pixits
} // end LibItsCommon_Pixits
 No newline at end of file
+75 −0
Original line number Original line Diff line number Diff line
/**
 *  @author      ETSI / STF405 / STF449
 *  @version     $URL$
 *               $Id$
 *  @desc        Module containing base template definitions for DENM
 *
 */
module LibItsCommon_Templates {
    
    import from ITS_Container language "ASN.1:1997" all;

    // LibItsCommon
    import from LibItsCommon_TypesAndValues all;
    
    group taPrimitives {
        
        template AcGnssResponse m_acGnssResponseSuccess := true;
        
        template AcGnssDistanceCovered m_acGnssDistanceCovered := true;
        
        /**
         * @desc Testsystem will load GNSS scenario
         */
        template AcGnssPrimitive m_loadScenario(Scenario p_scenario) := {
            loadScenario := {
                scenario := p_scenario
            }
        }
        
        /**
         * @desc Testsystem will start GNSS scenario
         */
        template AcGnssPrimitive m_startScenario := {
            startScenario := {
            }
        }
        
        /**
         * @desc Testsystem will stop GNSS scenario
         */
        template AcGnssPrimitive m_stopScenario := {
            stopScenario := {
            }
        }
        
        /**
         * @desc Testsystem will request indication if distance was covered
         */
        template AcGnssPrimitive m_distanceToCover(float p_distance) := {
            distanceToCover := {
                distance := p_distance
            }
        }
        
        /**
         * @desc Testsystem will change the speed (delta value)
         */
        template AcGnssPrimitive m_changeScenarioSpeed(SpeedValue p_deltaSpeedValue) := {
            changeSpeed := {
                deltaSpeed := p_deltaSpeedValue
            }
        }
        
        /**
         * @desc Testsystem will change the heading (delta value)
         */
        template AcGnssPrimitive m_changeScenarioHeading(HeadingValue p_deltaHeadingValue) := {
            changeHeading := {
                deltaHeading := p_deltaHeadingValue
            }
        }
        
    } // end taPrimitives
    
}
Loading