Commit fdf74dd3 authored by tepelmann's avatar tepelmann
Browse files

Re-engineered upper tester functions for CAM.

Minor adaption for DENM.
parent 2be01182
Loading
Loading
Loading
Loading
+221 −500
Original line number Original line Diff line number Diff line
@@ -52,7 +52,6 @@ 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
     * @param	none
         */    
         */    
        function f_initialState() runs on ItsFa {
        function f_initialState() runs on ItsFa {
            
            
@@ -103,331 +102,48 @@ group otherFunctions {


    group upperTester {
    group upperTester {
    
    
	/** @desc	upper tester function to change current heading (absolute)
	*
	* @param 	p_heading<br>
	* @return 	FncRetCode<br>
	*/
	function f_changeHeading( Direction p_heading ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_changeHeading: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_changeHeading
    
	/** @desc	upper tester function to change current position (meter)
	*
	* @param 	p_position<br>
	* @return 	FncRetCode<br>
	*/
	function f_changePosition( integer p_position ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_changePosition: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_changePosition
    
	/** @desc	upper tester function to change speed (m/S)
	*
	* @param 	p_speed<br>
	* @return 	FncRetCode<br>
	*/
	function f_changeSpeed( Speed p_speed ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_changeSpeed: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_changeSpeed
    
	/** @desc	upper tester function to set the crash signal (activated/deactivated)
	*
	* @param 	p_crashStatus<br>
	* @return 	FncRetCode<br>
	*/
	function f_setCrashSignal( CrashStatus p_crashStatus ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setCrashSignal: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setCrashSignal
    
	/** @desc	upper tester function to set the dangerous goods status (Good type)
	*			p_goodType = 0 if no dangerous goods are transported
	* @param 	p_goodType<br>
	* @return 	FncRetCode<br>
	*/
	function f_setDangerousGoodsStatus( DangerousGoods p_goodType ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setDangerousGoodsStatus: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setDangerousGoodsStatus
    
	/** 
	* @desc	upper tester function to set if the Length/Width is precisely determined
	*			p_precision = true if the Length/Width is precisely determined
	* @param 	p_precision<br>
	* @return 	FncRetCode<br>
	*/
	function f_setLengthWidthPrecision( boolean p_precision ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setLengthWidthPrecision: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setLengthWidthPrecision
    
        /**
        /**
	*	@desc	upper tester function to set the doors status			
         * @desc    Triggers event from the application layer
	* 	@param 	p_doorStatus<br>
         * @param   p_event The event to trigger.
	* 	@return 	FncRetCode<br>
         * @return 
         */
         */
	function f_setDoorStatus( DoorOpen p_doorStatus ) runs on ItsFa return FncRetCode {
        function f_utTriggerEvent(template (value) UtCamEvent p_event) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setDoorStatus: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setDoorStatus
    
	/** @desc	upper tester function to set the distance to stop line
	*			
	* @param 	p_distance<br>
	* @return 	FncRetCode<br>
	*/
	function f_setDistanceToStopLine( Distance p_distance ) runs on ItsFa return FncRetCode {

		//Variables
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
            var template (value) UtCamTrigger v_utMsg := { p_event };
            
            
        //TODO define external function
            utPort.send(v_utMsg);
		log("*** f_setDistanceToStopLine: INFO: OK  ***");
            
            
            return v_ret;
            return v_ret;
        
        }
    } // end function f_setDistanceToStopLine
    
	/** @desc	upper tester function to set the turn advice
	*			
	* @param 	p_turnAdvice<br>
	* @return 	FncRetCode<br>
	*/
	function f_setTurnAdvice( TurnAdvice p_turnAdvice ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setTurnAdvice: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setTurnAdvice
    
	/** @desc	upper tester function to set the curvature change
	*			
	* @param 	p_curvature<br>
	* @return 	FncRetCode<br>
	*/
	function f_setCurvatureChange( Curvature p_curvature ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setCurvatureChange: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setCurvatureChange
    
	/** @desc	upper tester function to set the Occupancy
	*			
	* @param 	p_occupancy<br>
	* @return 	FncRetCode<br>
	*/
	function f_setOccupancy( Occupancy p_occupancy ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setOccupancy: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setOccupancy
    
	/** @desc	upper tester function to set the light bar status
	*			
	* @param 	p_status<br>
	* @return 	FncRetCode<br>
	*/
	function f_setLightBarStatus( SimpleSystemState p_status ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setLightBarStatus: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setLightBarStatus
    
	/** @desc	upper tester function to set the sirene status
	*			
	* @param 	p_status<br>
	* @return 	FncRetCode<br>
	*/
	function f_setSireneStatus( SimpleSystemState p_status ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setSireneStatus: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setSireneStatus
    
	/** @desc	upper tester function to set the traffic light priority
	*			
	* @param 	p_priority<br>
	* @return 	FncRetCode<br>
	*/
	function f_setTrafficLightPriority( Priority p_priority ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setTrafficLightPriority: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setTrafficLightPriority
    
    
	/** 
	*	@desc	upper tester function to set the Schedule Deviation			
	* 	@param 	p_scheduleDeviation<br>
	* 	@return 	FncRetCode<br>
	*/
	function f_setScheduleDeviation( ScheduleDeviation p_scheduleDeviation ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setScheduleDeviation: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setScheduleDeviation
    
	/** 
	*	@desc	upper tester function to set the PT Line Description			
	* 	@param 	p_ptLineDescription<br>
	* 	@return 	FncRetCode<br>
	*/
	function f_setPtLineDescription( PTLineDescription p_ptLineDescription ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setPtLineDescription: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setPtLineDescription
    
	/** 
	*	@desc	upper tester function to set the exterior lights status			
	* 	@param 	p_exteriorLightsStatus<br>
	* 	@return 	FncRetCode<br>
	*/
	function f_setExteriorLightsStatus( ExteriorLights p_exteriorLightsStatus ) runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_setExteriorLightsStatus: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_setExteriorLightsStatus
    
	/** 
	*	@desc	upper tester function to change the reference position (moving)			
	* 	@param 	none<br>
	* 	@return 	FncRetCode<br>
	*/
	function f_changeReferencePosition() runs on ItsFa return FncRetCode {

		//Variables
        var FncRetCode v_ret := e_success;
            
        //TODO define external function
		log("*** f_changeReferencePosition: INFO: OK  ***");
            
        return v_ret;
        
    } // end function f_changeReferencePosition
        
        
        /**
        /**
	*	@desc	upper tester function to check that the CAM was received on LDM			
         * @desc Checks that the event was indicated at the application layer
	* 	@param 	p_camMsg<br>
         * @param p_event The event to check.
	* 			p_received<br>
         * @return 
	* 	@return FncRetCode<br>
         */
         */
	function f_checkLdmReceipt( in CamReq p_camMsg, out boolean p_received) runs on ItsFa return FncRetCode {
        function f_utCheckEvent(template (value) UtCamEvent p_event) runs on ItsFa return FncRetCode {

		//Variables
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
            
            var template (value) UtCamCheck v_utMsg := { p_event };
        //TODO define external function
            
		log("*** f_checkLdmReceipt: INFO: OK  ***");
            utPort.send(v_utMsg);
            tc_ac.start;
            alt {
                [] utPort.receive(UtCamResult:true) {
                    setverdict (pass, "Event correctly indicated at application layer");
                    v_ret := e_success;
                }
                [] utPort.receive {
                    setverdict (fail, "Event not correctly indicated at application layer");
                    v_ret := e_error;
                }
                [] tc_ac.timeout {
                    setverdict (inconc, "Timeout while waiting for event check result");
                    v_ret := e_timeout;
                }
            }
            
            
            return v_ret;
            return v_ret;
        
        }
    } // end function f_checkLdmReceipt
        
        
    } // end group upperTester
    } // end group upperTester
    
    
@@ -440,7 +156,8 @@ group externalFunctions {
        external function fx_generateTime()
        external function fx_generateTime()
        return TimeStamp;
        return TimeStamp;
    
    
	/** @desc	Wrapper function for fx_generateTime
        /** 
         * @desc  Wrapper function for fx_generateTime
         *            
         *            
         * @see   xf_generateTime
         * @see   xf_generateTime
         *
         *
@@ -464,7 +181,8 @@ group externalFunctions {
        } // end function f_generateTime
        } // end function f_generateTime
        
        
    
    
	/** @desc	function to get the PT Line Description
        /** 
         * @desc    function to get the PT Line Description
         *          currently return the PIXIT value
         *          currently return the PIXIT value
         * @see     PX_PTLINE_COURSE, PX_PTLINE_REF, PX_PTLINE_ROUTE
         * @see     PX_PTLINE_COURSE, PX_PTLINE_REF, PX_PTLINE_ROUTE
         *
         *
@@ -480,7 +198,8 @@ group externalFunctions {
    
    
        } // end function f_getPtLineDescription
        } // end function f_getPtLineDescription
        
        
	/** @desc	function to get the stationID
        /** 
         * @desc    function to get the stationID
         *          currently return the PIXIT value
         *          currently return the PIXIT value
         * @see     PX_TESTER_STATION_ID
         * @see     PX_TESTER_STATION_ID
         *
         *
@@ -503,7 +222,8 @@ group externalFunctions {
        external function fx_getStationCharacteristics()
        external function fx_getStationCharacteristics()
        return CoopAwareness.stationCharacteristics;
        return CoopAwareness.stationCharacteristics;
    
    
	/** @desc	Wrapper function for fx_getStationCharacteristics
        /** 
         * @desc    Wrapper function for fx_getStationCharacteristics
         *            
         *            
         * @see     fx_getStationCharacteristics
         * @see     fx_getStationCharacteristics
         *
         *
@@ -527,7 +247,8 @@ group externalFunctions {
        external function fx_getReferencePosition()
        external function fx_getReferencePosition()
        return ReferencePosition;
        return ReferencePosition;
    
    
	/** @desc	Wrapper function for fx_getReferencePosition
        /** 
         * @desc    Wrapper function for fx_getReferencePosition
         *            
         *            
         * @see     fx_getReferencePosition
         * @see     fx_getReferencePosition
         *
         *
+311 −158
Original line number Original line Diff line number Diff line
@@ -7,16 +7,168 @@
 */
 */
module LibItsCam_Templates {
module LibItsCam_Templates {


    import from LibItsCam_TypesAndValues all;
    import from LibIts_Interface all;
    import from LibIts_Interface all;
    import from LibItsCam_Pixits all;
    import from LibItsCam_Pixits all;
    import from CAM_PDU_Descriptions language "ASN.1:1997" all;
    import from CAM_PDU_Descriptions language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    
    

    group Primitives {
        template CamInd mw_camInd (in template (present) CamPdu p_camMsg) := { msgIn := p_camMsg };
        template CamInd mw_camInd (in template (present) CamPdu p_camMsg) := { msgIn := p_camMsg };
    
    
        template CamReq m_camReq (in template (value) CamPdu p_camMsg) := { msgOut := p_camMsg };
        template CamReq m_camReq (in template (value) CamPdu p_camMsg) := { msgOut := p_camMsg };
        
        
        group utPrimitives {
            
            /**
             * @desc Change the heading
             * @param p_offset Offset to the current heading
             */
            template (value) UtCamEvent m_changeHeading(Direction p_offset) := {
                changeHeading := p_offset
            }
            
            /**
             * @desc Change the position
             * @param p_offset Offset to the current position
             */
            template (value) UtCamEvent m_changePosition(integer p_offset) := {
                changePosition := p_offset
            }
            
            /**
             * @desc Change the speed
             * @param p_offset Offset to the current position
             */
            template (value) UtCamEvent m_changeSpeed(Speed p_offset) := {
                changeSpeed := p_offset
            }
            
            /**
             * @desc Set the crash status
             * @param p_status The status to set
             */
            template (value) UtCamEvent m_setCrashSignal(CrashStatus p_status) := {
                setCrashSignal := p_status
            }
            
            /**
             * @desc Set the dangerous goods status
             * @param p_status The status to set
             */
            template (value) UtCamEvent m_setDangerousGoodsStatus(DangerousGoods p_status) := {
                setDangerousGoodsStatus := p_status
            }
            
            //TODO not clear which parameter type to use
            /**
             * @desc Set the length and width precision
             * @param p_precision The precision to set
             */
            template (value) UtCamEvent m_setLengthWidthPrecision(boolean p_precision) := {
                setLengthWidthPrecision := p_precision
            }
            
            /**
             * @desc Set the distance to the stop line
             * @param p_distance The distance to set
             */
            template (value) UtCamEvent m_setDistanceToStopLine(Distance p_distance) := {
                setDistanceToStopLine := p_distance
            }
            
            /**
             * @desc Set the turn advice
             * @param p_turnAdvice The turn advice to set
             */
            template (value) UtCamEvent m_setTurnAdvice(TurnAdvice p_turnAdvice) := {
                setTurnAdvice := p_turnAdvice
            }
            
            /**
             * @desc Change the curvature
             * @param p_offset Offset to the current curvature
             */
            template (value) UtCamEvent m_changeCurvature(Curvature p_offset) := {
                changeCurvature := p_offset
            }
            
            /**
             * @desc Set the occupancy
             * @param p_occupancy The occupancy to set
             */
            template (value) UtCamEvent m_setOccupancy(Occupancy p_occupancy) := {
                setOccupancy := p_occupancy
            }
            
            /**
             * @desc Set the door status
             * @param p_status The status to set
             */
            template (value) UtCamEvent m_setDoorStatus(DoorOpen p_status) := {
                setDoorStatus := p_status
            }
            
            /**
             * @desc Set the light bar status
             * @param p_status The status to set
             */
            template (value) UtCamEvent m_setLightBarStatus(SimpleSystemState p_status) := {
                setLightBarStatus := p_status
            }
            
            /**
             * @desc Set the sirene status
             * @param p_status The status to set
             */
            template (value) UtCamEvent m_setSireneStatus(SimpleSystemState p_status) := {
                setSireneStatus := p_status
            }
            
            /**
             * @desc Set the traffic light priority
             * @param p_priority The priority to set
             */
            template (value) UtCamEvent m_setTrafficLightPriority(Priority p_priority) := {
                setTrafficLightPriority := p_priority
            }
            
            /**
             * @desc Set the schedule deviation
             * @param p_scheduleDeviation The schedule deviation to set
             */
            template (value) UtCamEvent m_setScheduleDeviation(ScheduleDeviation p_scheduleDeviation) := {
                setScheduleDeviation := p_scheduleDeviation
            }
            
            /**
             * @desc Set the PT line description
             * @param p_ptLineDescription The PT line description to set
             */
            template (value) UtCamEvent m_setPtLineDescription(PTLineDescription p_ptLineDescription) := {
                setPtLineDescription := p_ptLineDescription
            }
            
            /**
             * @desc Set the exterior lights status
             * @param p_status The status to set
             */
            template (value) UtCamEvent m_setExteriorLightsStatus(ExteriorLights p_status) := {
                setExteriorLightsStatus := p_status
            }
            
            /**
             * @desc Check the receipt of a message at the LDM
             * @param p_message The message to check
             */
            template (value) UtCamEvent m_checkLdmReceipt(CamReq p_message) := {
                checkLdmReceipt := p_message
            }
            
        } // end utPrimitives
        
    } // end group Primitives
    
    template CamPdu mw_camMsg_any := {
    template CamPdu mw_camMsg_any := {
        header := {
        header := {
            protocolVersion := 0, 
            protocolVersion := 0, 
@@ -82,7 +234,8 @@ module LibItsCam_Templates {
        }
        }
    }
    }


	template CamPdu m_camMsg_valid(	TimeStamp p_generationTime, 
    template CamPdu m_camMsg_valid(
        TimeStamp p_generationTime, 
        StationID p_stationID,
        StationID p_stationID,
        CoopAwareness.stationCharacteristics p_stationCharacteristics,
        CoopAwareness.stationCharacteristics p_stationCharacteristics,
        template (value) ReferencePosition p_referencePosition
        template (value) ReferencePosition p_referencePosition
+90 −53
Original line number Original line Diff line number Diff line
@@ -10,6 +10,7 @@ module LibItsCam_TypesAndValues {
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
    import from LibCommon_DataStrings all;


    import from LibIts_Interface all;
    import from CAM_PDU_Descriptions language "ASN.1:1997" all;
    import from CAM_PDU_Descriptions language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;


@@ -29,6 +30,8 @@ group camValues {
        const AccelerationControl c_throttlePedal := '010000'B; 
        const AccelerationControl c_throttlePedal := '010000'B; 
        const AccelerationControl c_brakePedal := '100000'B; 
        const AccelerationControl c_brakePedal := '100000'B; 
        
        
        const DangerousGoods c_noDangerousGoodsTransported := 0;  // trigger -- no dangerous goods transported (formal param = 0)
      
        const Direction c_south := 14400; 
        const Direction c_south := 14400; 
        const Direction c_north := 0; 
        const Direction c_north := 0; 
        const Direction c_east := 7200; 
        const Direction c_east := 7200; 
@@ -63,4 +66,38 @@ group camValues {
          
          
    } // end group camValues
    } // end group camValues


    group utPrimitives {
        
        type record UtCamTrigger {
            UtCamEvent utEvent
        }
        
        type record UtCamCheck {
            UtCamEvent utEvent
        }
        
        type boolean UtCamResult;
        
        type union UtCamEvent {
            Direction changeHeading,
            integer changePosition,
            Speed changeSpeed,
            CrashStatus setCrashSignal,
            DangerousGoods setDangerousGoodsStatus,
            boolean setLengthWidthPrecision,
            Distance setDistanceToStopLine,
            TurnAdvice setTurnAdvice,
            Curvature changeCurvature,
            Occupancy setOccupancy,
            DoorOpen setDoorStatus,
            SimpleSystemState setLightBarStatus,
            SimpleSystemState setSireneStatus,
            Priority setTrafficLightPriority,
            ScheduleDeviation setScheduleDeviation,
            PTLineDescription setPtLineDescription,
            ExteriorLights setExteriorLightsStatus,
            CamReq checkLdmReceipt
        }
        
    } // end utPrimitives
}
}
+5 −5
Original line number Original line Diff line number Diff line
@@ -156,9 +156,9 @@ module LibItsDenm_Functions {
         * @param p_event The event to trigger.
         * @param p_event The event to trigger.
         * @return 
         * @return 
         */
         */
        function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsFa return FncRetCode {
        function f_utTriggerEvent(template (value) UtDenmEvent p_event) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
            var template (value) UtTrigger v_utMsg := { p_event };
            var template (value) UtDenmTrigger v_utMsg := { p_event };
            
            
            utPort.send(v_utMsg);
            utPort.send(v_utMsg);
            
            
@@ -170,14 +170,14 @@ module LibItsDenm_Functions {
         * @param p_event The event to check.
         * @param p_event The event to check.
         * @return 
         * @return 
         */
         */
        function f_utCheckEvent(template (value) UtEvent p_event) runs on ItsFa return FncRetCode {
        function f_utCheckEvent(template (value) UtDenmEvent p_event) runs on ItsFa return FncRetCode {
            var FncRetCode v_ret := e_success;
            var FncRetCode v_ret := e_success;
            var template (value) UtCheck v_utMsg := { p_event };
            var template (value) UtDenmCheck v_utMsg := { p_event };
            
            
            utPort.send(v_utMsg);
            utPort.send(v_utMsg);
            tc_ac.start;
            tc_ac.start;
            alt {
            alt {
                [] utPort.receive(UtResult:true) {
                [] utPort.receive(UtDenmResult:true) {
                    setverdict (pass, "Event correctly indicated at application layer");
                    setverdict (pass, "Event correctly indicated at application layer");
                    v_ret := e_success;
                    v_ret := e_success;
                }
                }
+8 −8

File changed.

Preview size limit exceeded, changes collapsed.

Loading