Commit 0966926d authored by berge's avatar berge
Browse files

Merged similar CAM/DENM functions together in LibItsCommon_Functions.

Added new module LibItsCommon_Pixits
parent f3ac6701
Loading
Loading
Loading
Loading
+2 −78
Original line number Original line Diff line number Diff line
@@ -149,38 +149,6 @@ module LibItsCam_Functions {
    
    
    group externalFunctions {
    group externalFunctions {
        
        
        /**
         * @desc    Generate a timestamp of the cureent time to be used in a generationTime field
         * @return  TimeStamp<br>
         */
        external function fx_generateTime()
        return TimeStamp;
    
        /** 
         * @desc  Wrapper function for fx_generateTime
         *            
         * @see   xf_generateTime
         *
         */
        function f_generateTime()
        return TimeStamp {
            //Variables
            var TimeStamp v_generationTime:=0;
            
            v_generationTime := fx_generateTime();
            if (v_generationTime!=0)
            {
                log("*** f_generateTime: INFO: OK - generationTime = " & int2str(v_generationTime) & " ***");
                return v_generationTime ;            
            }
            else {
                log("*** f_generateTime: ERROR: timestamp could not be generated ***");
                setverdict( inconc ) ;
                return v_generationTime ;
            } 
        } // 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
@@ -198,23 +166,6 @@ module LibItsCam_Functions {
    
    
        } // end function f_getPtLineDescription
        } // end function f_getPtLineDescription


        /** 
         * @desc    function to get the stationID
         *          currently return the PIXIT value
         * @see     PX_TESTER_STATION_ID
         *
        */
        function f_getStationId()
        return StationID {
            //Variables
            var StationID v_stationId := 0;
            
            v_stationId :=  PX_TESTER_STATION_ID;   // PIXIT used!
            log("*** f_getStationId: INFO: OK - stationId = " & int2str(v_stationId) & " ***");
            return v_stationId ;
    
        } // end function fx_getStationId
        
        /**
        /**
        * @desc     get the stationCharacteristics of the tester
        * @desc     get the stationCharacteristics of the tester
        * @return   CoopAwareness.stationCharacteristics<br>
        * @return   CoopAwareness.stationCharacteristics<br>
@@ -239,33 +190,6 @@ module LibItsCam_Functions {
    
    
        } // end function f_getStationCharacteristics
        } // end function f_getStationCharacteristics


    
        /**
         * @desc    get the ReferencePosition of the tester
         * @return  ReferencePosition<br>
         */
        external function fx_getReferencePosition()
        return ReferencePosition;
    
        /** 
         * @desc    Wrapper function for fx_getReferencePosition
         *            
         * @see     fx_getReferencePosition
         *
         */
        function f_getReferencePosition()
        return ReferencePosition {
            //Variables
            var ReferencePosition v_referencePosition;
            
            v_referencePosition := fx_getReferencePosition();
            log("*** f_getReferencePosition: INFO: OK - referencePosition received ***");
            return v_referencePosition ;
    
        } // end function f_getReferencePosition
        
        
    
    } // end group externalFunctions
    } // end group externalFunctions


} // end LibItsCam_Functions
} // end LibItsCam_Functions
 No newline at end of file
+0 −6
Original line number Original line Diff line number Diff line
@@ -14,12 +14,6 @@ module LibItsCam_Pixits {
    
    
    group camPixits {
    group camPixits {


        /**
         * @desc Tester Station Id
         * 		 Station Id used in CAM messages sent by the tester (IRS)
         */
    	modulepar StationID PX_TESTER_STATION_ID := 111111;

        /**
        /**
         * @desc Tester Longitude reference position
         * @desc Tester Longitude reference position
         */
         */
+1 −1
Original line number Original line Diff line number Diff line
@@ -161,7 +161,7 @@ module LibItsCam_Templates {
             * @desc Check the receipt of a message at the LDM
             * @desc Check the receipt of a message at the LDM
             * @param p_message The message to check
             * @param p_message The message to check
             */
             */
            template (value) UtCamEvent m_checkLdmReceipt(CamReq p_message) := {
            template (value) UtCamEvent m_checkLdmReceipt(CamPdu p_message) := {
                checkLdmReceipt := p_message
                checkLdmReceipt := p_message
            }
            }
            
            
+1 −2
Original line number Original line Diff line number Diff line
@@ -10,7 +10,6 @@ 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;


@@ -96,7 +95,7 @@ module LibItsCam_TypesAndValues {
            ScheduleDeviation setScheduleDeviation,
            ScheduleDeviation setScheduleDeviation,
            PTLineDescription setPtLineDescription,
            PTLineDescription setPtLineDescription,
            ExteriorLights setExteriorLightsStatus,
            ExteriorLights setExteriorLightsStatus,
            CamReq checkLdmReceipt
            CamPdu checkLdmReceipt
        }
        }
        
        
    } // end utPrimitives
    } // end utPrimitives
+86 −18
Original line number Original line Diff line number Diff line
@@ -8,13 +8,18 @@
 
 
module LibItsCommon_Functions {
module LibItsCommon_Functions {


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


	/** @desc	function to generate integer random values
    group generalFunctions {
        
    	/** 
    	 * @desc	function to generate integer random values
    	 *			
    	 *			
    	 * @see		ttcn-3 - rnd()
    	 * @see		ttcn-3 - rnd()
	 *  @param 	p_lowerbound lowest number in range<br>
    	 * @param 	p_lowerbound lowest number in range
	 *  @param 	p_upperbound highest number in range<br>
    	 * @param 	p_upperbound highest number in range
	 *  @return 	integer<br>
    	 * @return 	random integer
    	 *
    	 *
    	*/
    	*/
    	function f_random(	in integer p_lowerbound,
    	function f_random(	in integer p_lowerbound,
@@ -23,10 +28,73 @@ module LibItsCommon_Functions {
    		//Variables
    		//Variables
    		var integer v_random := 0;
    		var integer v_random := 0;
            v_random := float2int(int2float(p_upperbound - p_lowerbound +1)*rnd()) + p_lowerbound;
            v_random := float2int(int2float(p_upperbound - p_lowerbound +1)*rnd()) + p_lowerbound;
		//  Here, upperbound and lowerbound denote highest and lowest number in range.
    
    		log("*** f_random: INFO: OK - random value = " & int2str(v_random) & " ***");
    		log("*** f_random: INFO: OK - random value = " & int2str(v_random) & " ***");
            return v_random;
            return v_random;
    
    
    	} // end function f_random
    	} // end function f_random
    
    
        /**
         * @desc    Gets the current time
         * @return  Timestamp - current time in Epoch format
         */
        function f_getCurrentTime() return TimeStamp {
            var TimeStamp v_timeStamp := 0;
            
            v_timeStamp := fx_getCurrentTime();
            
            return v_timeStamp;
        }
           
    } // end generalFunctions  
       
    group itsFunctions { 

        /** 
         * @desc    Gets the station identifier of test system
         * @return  Test system's station ID
         * @see     PX_TESTER_STATION_ID
         */
        function f_getTsStationId()
        return StationID {
            
            return PX_TESTER_STATION_ID;
                
        } // end f_getTsStationId
        
        /**
         * @desc    Gets the current position of test system
         * @return  Test system's position
         */
        function f_getTsCurrentPosition() return ReferencePosition {
            
            // TODO: correct values required
            var ReferencePosition v_referencePosition := {
                longitude := {hemisphere := east, degree := 0},
                latitude := {hemisphere := north, degree := 0},
                elevation := 0,
                heading := omit,
                streetName := omit,
                positionConfidence := omit,
                elevationConfidence := omit,
                roadSegmentID :=0
            }
            
            return v_referencePosition;
            
        } // end f_getTsCurrentPosition
                
    } // end itsFunctions       
  
    group externalFunctions {
        
        /**
         * @desc    Gets the current time    
         * @return  Timestamp - current time in Epoch format
         */
        external function fx_getCurrentTime() return TimeStamp;
        
    } // end externalFunctions


} // end of module
} // end of module
 No newline at end of file
Loading