Commit b6255bc6 authored by Yann Garcia's avatar Yann Garcia
Browse files

Merge branch 'TTF0002' of https://forge.etsi.org/gitlab/LIBS/LibIts into TTF0002

parents 77630300 2760db00
Loading
Loading
Loading
Loading
+100 −0
Original line number Original line Diff line number Diff line
@@ -170,6 +170,17 @@ module LibItsMapemSpatem_Functions {
            }
            }
        }
        }
        
        
        /**
         * @desc Default handling cf02 de-initialisation.
         */
            altstep a_cf02Down() runs on ItsMtc {
          [] a_shutdown() {
            f_cf02Down();
            log("*** a_cf02Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
            stop;
          }
        }
        
        /**
        /**
         * @desc The base default.
         * @desc The base default.
         */
         */
@@ -264,6 +275,66 @@ module LibItsMapemSpatem_Functions {
            f_disconnect4SelfOrClientSync();
            f_disconnect4SelfOrClientSync();
        } // End of f_cfDown
        } // End of f_cfDown
        
        
        /**
         * @desc    Setups default configuration   
         * @param   p_certificateId The certificate identifier the TA shall use in case of secured IUT
         */
        function f_cf02Up(in charstring p_certificateId := PX_CERT_FOR_TS
        )  runs on ItsMtc mtc ItsMtc system ItsMapemSpatemSystem {
            
            // Variables
            var integer i;
            
            // Select components
            vc_componentTable := {{c_compMap, omit}, {c_compSpat, omit}};
            
            // Create components
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
              vc_componentTable[i].msComponent := ItsMapemSpatem.create(vc_componentTable[i].componentName) alive;
            }
            
            // Map & Connect
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            connect(self:syncPort, mtc:syncPort);
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) {
              map(vc_componentTable[i].msComponent:acPort, system:acPort);
              map(vc_componentTable[i].msComponent:utPort, system:utPort);
              map(vc_componentTable[i].msComponent:mapemSpatemPort, system:mapemSpatemPort);
              connect(vc_componentTable[i].msComponent:syncPort, self:syncPort);
            }
            
            activate(a_cf02Down());
            
            // Initialise secured mode
            f_initialiseSecuredMode(p_certificateId); 
            
        } // End of f_cf02Up
        
        /**
         * @desc    Deletes default configuration 
         */
        function f_cf02Down() runs on ItsMtc mtc ItsMtc system ItsMapemSpatemSystem {
            
            // Local variables
            var integer i;
            
            f_uninitialiseSecuredMode();
            
            // Unmap & Disconnect
            for(i:=0; i < lengthof(vc_componentTable); i:=i+1) { 
              unmap(vc_componentTable[i].msComponent:utPort, system:utPort);
              unmap(vc_componentTable[i].msComponent:acPort, system:acPort);
              unmap(vc_componentTable[i].msComponent:mapemSpatemPort, system:mapemSpatemPort);
              disconnect(vc_componentTable[i].msComponent:syncPort, self:syncPort);
            }
            unmap(self:acPort, system:acPort);
            unmap(self:utPort, system:utPort);
            disconnect(self:syncPort, mtc:syncPort);
            
            
        } // End of f_cf02Down
        
    } // End of of mapSpatConfigurationFunctions
    } // End of of mapSpatConfigurationFunctions
    
    
    group preambles {
    group preambles {
@@ -358,4 +429,33 @@ module LibItsMapemSpatem_Functions {
        
        
    } // End of group receiveFunctions
    } // End of group receiveFunctions
    
    
    group componentFunctions {
      /**
       * @desc    Get the component  corresponding to a key
       * @param   p_componentName   Name searched component
       * @return  ItsGeoNetworking - The searched position vector
       */
      function f_getComponent(
                              in charstring p_componentName
                              ) runs on ItsMtc
      return ItsMapemSpatem {
            
        var ItsMapemSpatem v_return := null;
        var integer i := 0;
            
        for (i:=0; i<lengthof(vc_componentTable); i:=i+1) {
          if (vc_componentTable[i].componentName == p_componentName) {
            if (isvalue(vc_componentTable[i].msComponent)) {
            v_return := valueof(vc_componentTable[i].msComponent);
            }
            else {
              testcase.stop(__SCOPE__ & " can not handle omitted MS components");
            }
          }
        }
            
        return v_return;
      }
    }
    
} // End of module LibItsMapemSpatem_Functions
} // End of module LibItsMapemSpatem_Functions
+4 −0
Original line number Original line Diff line number Diff line
@@ -138,4 +138,8 @@ module LibItsMapemSpatem_Pics {
     */
     */
    modulepar boolean PICS_SPATEM_TRANSMISSION_RATE := false;
    modulepar boolean PICS_SPATEM_TRANSMISSION_RATE := false;
    
    
    modulepar float PICS_T_GEN_SPATEM_MIN := 0.1;
    
    modulepar float PICS_T_GEN_SPATEM_MAX := 2.0;
    
} // end LibItsSremSsem_Pics
} // end LibItsSremSsem_Pics
+118 −1
Original line number Original line Diff line number Diff line
@@ -668,6 +668,40 @@ module LibItsMapemSpatem_Templates {
                    regional            := omit
                    regional            := omit
                }
                }
                
                
                template (value) IntersectionState m_intersection_regional (
                                          in template (omit) IntersectionState.regional p_regional := omit
                ) modifies m_intersection := {
                    name                := omit,                                                // Human readable name for intersection to be used only in debug mode
                    id                  := m_intersectionReferenceID,                           // A globally unique value set, consisting of a  regionID and 
                                                                                                // intersection ID assignment provides a unique mapping to the intersection MAP in question which provides complete location and approach/move/lane data
                    revision            := PX_INTERSECTIONSTATE_REVISION,
                    status              := IntersectionStatusObject_manualControlIsEnabled_,
                                                                                                // General status of the controller(s)
                    moy                 := omit,                                                // Minute of current UTC year used only with messages to be archived 
                    timeStamp           := omit,                                                // The mSec point in the current UTC minute that this message was constructed
                    enabledLanes        := { 1, 2 },                                            // A list of lanes where the RevocableLane bit has been set which are now active andtherefore part of the current intersection
                    states              := m_movements,                                         // Each Movement is given in turn and contains its signal phase state, mapping to the lanes it applies to, and point in time it will end, and it may contain both active and future states
                    maneuverAssistList  := omit,                                                // Assist data
                    regional            := p_regional
                }
                
                template (value) IntersectionState m_intersection_maneuverAssistList (
                                          in template (omit) IntersectionState.maneuverAssistList p_maneuverAssistList := omit
                ) modifies m_intersection := {
                    name                := omit,                                                // Human readable name for intersection to be used only in debug mode
                    id                  := m_intersectionReferenceID,                           // A globally unique value set, consisting of a  regionID and 
                                                                                                // intersection ID assignment provides a unique mapping to the intersection MAP in question which provides complete location and approach/move/lane data
                    revision            := PX_INTERSECTIONSTATE_REVISION,
                    status              := IntersectionStatusObject_manualControlIsEnabled_,
                                                                                                // General status of the controller(s)
                    moy                 := omit,                                                // Minute of current UTC year used only with messages to be archived 
                    timeStamp           := omit,                                                // The mSec point in the current UTC minute that this message was constructed
                    enabledLanes        := { 1, 2 },                                            // A list of lanes where the RevocableLane bit has been set which are now active andtherefore part of the current intersection
                    states              := m_movements,                                         // Each Movement is given in turn and contains its signal phase state, mapping to the lanes it applies to, and point in time it will end, and it may contain both active and future states
                    maneuverAssistList  := p_maneuverAssistList,                                                // Assist data
                    regional            := omit
                }
                
                template (value) MovementList m_movements := { m_movement };
                template (value) MovementList m_movements := { m_movement };
                
                
                template (omit) MovementState m_movement := {
                template (omit) MovementState m_movement := {
@@ -785,6 +819,26 @@ module LibItsMapemSpatem_Templates {
                    regional           := *
                    regional           := *
                } // end mw_IntersectionState
                } // end mw_IntersectionState
                
                
                template (present) IntersectionState mw_IntersectionState_regional (
                                                                         template (present) IntersectionState.id p_id := ?,
                                                                         template (present) IntersectionState.revision p_revision := ?,
                                                                         template (present) IntersectionState.status p_status := ?,
                                                                         template (present) IntersectionState.states p_states := ?,
                                                                         template (present) IntersectionState.regional p_regional := ?
                ) modifies mw_IntersectionState := {
                    regional           := p_regional
                } // end mw_IntersectionState
                
                template (present) IntersectionState mw_IntersectionState_maneuverAssistList (
                                                                         template (present) IntersectionState.id p_id := ?,
                                                                         template (present) IntersectionState.revision p_revision := ?,
                                                                         template (present) IntersectionState.status p_status := ?,
                                                                         template (present) IntersectionState.states p_states := ?,
                                                                         template (present) IntersectionState.maneuverAssistList p_maneuverAssistList := ?
                ) modifies mw_IntersectionState := {
                    maneuverAssistList :=  p_maneuverAssistList
                } // end mw_IntersectionState
                
                template (present) IntersectionState mw_IntersectionState_moyAndTimeStamp(
                template (present) IntersectionState mw_IntersectionState_moyAndTimeStamp(
                                                                         template (present) IntersectionState.id p_id := ?,
                                                                         template (present) IntersectionState.id p_id := ?,
                                                                         template (present) IntersectionState.revision p_revision := ?,
                                                                         template (present) IntersectionState.revision p_revision := ?,
@@ -808,6 +862,69 @@ module LibItsMapemSpatem_Templates {
                       regional           := *                   //RegionalExtension {{Reg-MovementState}} OPTIONAL
                       regional           := *                   //RegionalExtension {{Reg-MovementState}} OPTIONAL
                }
                }
                
                
                template (present) MovementEvent mw_movementEvent(
                                                              in template (present) MovementPhaseState p_eventState := ?,
                                                              in template TimeChangeDetails p_timing := *,
                                                              in template MovementEvent.speeds p_speeds := *
                ) := {
                    eventState      := stop_Then_Proceed,   // Consisting of: Phase state (the basic 11 states) and Directional, protected, or permissive state
                    timing          := p_timing,            // Timing Data in UTC time stamps for event includes start and min/max end times of phase confidence and estimated next occurrence
                    speeds          := p_speeds,            // Various speed advisories for use by general and specific types of vehicles supporting green-wave and other flow needs
                    regional        := *
                }
                
                template (present) TimeChangeDetails mw_timeChangeDetails(
                                                              in template (present) TimeMark p_minEndTime := ?,
                                                              in template TimeMark p_startTime := *,
                                                              in template TimeMark p_nextTime := *
                ) := {
                    startTime     := p_startTime,   
                    minEndTime    := p_minEndTime,
                    maxEndTime    := *,
                    likelyTime    := *,
                    confidence    := *,
                    nextTime      := p_nextTime
                }
                
                template (present) ConnectionManeuverAssist mw_connectionManeuverAssist(
                                                                                    in template (present) LaneConnectionID p_connectionID := ?,
                                                                                    in template PedestrianBicycleDetect p_pedBicycleDetect := ?
                ) := { 
                    connectionID            := p_connectionID,
                    queueLength             := *,
                    availableStorageLength  := *,
                    waitOnStop              := *,
                    pedBicycleDetect        := p_pedBicycleDetect,
                    regional                := *
                }
                
                template (present) ConnectionManeuverAssist mw_connectionManeuverAssist_queueAndAvailableStorageLength(
                                                                                    in template (present) LaneConnectionID p_connectionID := ?,
                                                                                    in template ZoneLength p_queueLength := ?,
                                                                                    in template ZoneLength p_availableStorageLength := ?
                ) := { 
                    connectionID            := p_connectionID,
                    queueLength             := p_queueLength,
                    availableStorageLength  := p_availableStorageLength,
                    waitOnStop              := *,
                    pedBicycleDetect        := *,
                    regional                := *
                }
                
                template (present) AdvisorySpeed mw_advisorySpeed(
                                                              in template (present) AdvisorySpeedType p_type,
                                                              in template SpeedAdvice p_speed := *,
                                                              in template SpeedConfidenceDSRC p_confidence := *,
                                                              in template ZoneLength p_distance := *,
                                                              in template RestrictionClassID p_class := *
                ) := {
                    type_       := p_type,          // The type of advisory which this is.
                    speed       := p_speed, 
                    confidence  := p_confidence,    // A confidence value for the above speed
                    distance    := p_distance,      // The distance indicates the region for which the advised speed  is recommended, it is specified upstream from the stop bar   along the connected egressing lane
                    class       := p_class,         // The vehicle types to which it applies when absent, the AdvisorySpeed applies to all motor vehicle types
                    regional    := *
                }
                
                
            } // End of group spatemTemplates
            } // End of group spatemTemplates
            
            
+18 −0
Original line number Original line Diff line number Diff line
@@ -63,6 +63,13 @@ module LibItsMapemSpatem_TestSystem {
    
    
    } // End of group interfacePorts
    } // End of group interfacePorts
        
        
        /**
    * @desc ITS Main Test Component
    */
    type component ItsMtc extends ItsBaseMtc, ItsMapemSpatem {
            var ComponentTable vc_componentTable := {};
    } // end ItsMtc

    /**
    /**
    * @desc ITS System Adapter
    * @desc ITS System Adapter
    */
    */
@@ -157,4 +164,15 @@ module LibItsMapemSpatem_TestSystem {
        encode "LibIts_Interface" 
        encode "LibIts_Interface" 
    } // End of group ApplPrimitives
    } // End of group ApplPrimitives
    
    
    group misc {
        
        type record ComponentEntry {
           charstring          componentName,
           ItsMapemSpatem      msComponent optional
        }
        
        type record of ComponentEntry ComponentTable;
        
    } // end misc
    
} // End of module LibItsMapemSpatem_TestSystem
} // End of module LibItsMapemSpatem_TestSystem
+5 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,11 @@ module LibItsMapemSpatem_TypesAndValues {
    
    
    group mapSpatConstants {
    group mapSpatConstants {
        
        
        const charstring c_compIut := "IUT";
        const charstring c_compMTC := "MTC";
        const charstring c_compMap := "PtcMap";
        const charstring c_compSpat := "PtcSpat";
        
    } // end group mapSpatConstants
    } // end group mapSpatConstants
    
    
    group utPrimitives {
    group utPrimitives {