ItsRSUsSimulator_Pics.ttcn 34.1 KB
Newer Older
garciay's avatar
garciay committed
module ItsRSUsSimulator_Pics {
    
    // LibCommon
    import from LibCommon_BasicTypesAndValues all;
    
    // LibIts
    import from ITS_Container 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 MAPEM_PDU_Descriptions language "ASN.1:1997" all;
    import from SPATEM_PDU_Descriptions language "ASN.1:1997" all;
    import from IVIM_PDU_Descriptions language "ASN.1:1997" all;
    import from SREM_PDU_Descriptions language "ASN.1:1997" all;
    import from SSEM_PDU_Descriptions language "ASN.1:1997" all;
    
    // LibItsBtp
    import from LibItsBtp_TypesAndValues all;
    import from LibItsBtp_Templates all;
    
    // LibItsGeoNetworking
    import from LibItsGeoNetworking_TypesAndValues all;
    
    // ItsRSUsSimulator
    import from ItsRSUsSimulator_TypesAndValues all;
    
    group rsuParameters {
        
        group rsu1 {
            
            /**
             * @desc RSU GN address
             */
            modulepar GN_Address PICS_RSU_GN_ADDRESS_RSU1 := {
                typeOfAddress         := e_manual,
                stationType           := e_roadSideUnit,
                stationCountryCode    := 33,
                mid                   := 'AABBCCDDEEFF'O
            } // End of PICS_RSU_GN_ADDRESS_RSU1
            
            modulepar RsuParm PICS_RSU_1 := {
                gnAddress := PICS_RSU_GN_ADDRESS_RSU1,
                longPosVector := {
                    gnAddr        := PICS_RSU_GN_ADDRESS_RSU1,
                    timestamp_    := 0,
                    latitude      := 435517392,
                    longitude     := 103018217,
                    pai           := '0'B,
                    speed         := 0,
                    heading       := 0
                },
                stationID := 1111111,
                geoShape := e_geoCircle,
                geoParms := {
                    radius := 500
                },
                pathHistory := PICS_RSU_PATH_HISTORY_RSU1
            } // End of PICS_RSU_1
            
            /**
             * @desc Path history to approch the RSU
             */
            modulepar PathHistory PICS_RSU_PATH_HISTORY_RSU1 := {};
            
        } // End of group rsu1
        
        group rsu2 {
            // TODO To be done
        } // End of group rsu1
        
        modulepar RsuParmList PICS_RSU_PARAMS := {
            PICS_RSU_1
            // TODO To be done
        } // End of PICS_RSU_PARAMS
        
    } // End of group rsuParameters 
    
    group camParams {
        
        group camCommonParams {
            
            modulepar BtpPortId PICS_CAM_BTP_DESTINATION_PORT := 2001;
            
garciay's avatar
garciay committed
            modulepar BtpPortId PICS_CAM_BTP_SOURCE_PORT      := 0;
garciay's avatar
garciay committed
            
        } // End of group camCommonParams
        
    } // End of group rsuParameters 
    
    group denmEvents {
        
        group denmCommonParams {
            
            modulepar BtpPortId PICS_DENM_BTP_DESTINATION_PORT := 2002;
            
garciay's avatar
garciay committed
            modulepar BtpPortId PICS_DENM_BTP_SOURCE_PORT      := 0;
garciay's avatar
garciay committed
            
            modulepar PosConfidenceEllipse PICS_DENM_POSITION_CONFIDENCE_ELLIPSE := {
                semiMajorConfidence   := SemiAxisLength_oneCentimeter_,
                semiMinorConfidence   := SemiAxisLength_oneCentimeter_,
                semiMajorOrientation  := HeadingValue_wgs84North_
            } // End of PICS_DENM_POSITION_CONFIDENCE_ELLIPSE
            
            modulepar Altitude PICS_DENM_ALTITUDE := {
                altitudeValue := AltitudeValue_referenceEllipsoidSurface_,
                altitudeConfidence := unavailable
            } // End of PICS_DENM_ALTITUDE
            
            /**
             * @desc DENM repetition interval, in ms
             */
            modulepar TransmissionInterval PICS_DENM_REPETITION_INTERVAL := 1000;
            
garciay's avatar
garciay committed
        } // End of group denmCommonParams
        
        group denmZone1 {
            
            modulepar DenmParm PICS_Z1_D1_EP := {
                eventPosition   := {
garciay's avatar
garciay committed
                    latitude                                := 435517392,
                    longitude                               := 103018217,
                    positionConfidenceEllipse               := PICS_DENM_POSITION_CONFIDENCE_ELLIPSE,
                    altitude                                := PICS_DENM_ALTITUDE
garciay's avatar
garciay committed
                },
                causeCodeType   := CauseCodeType_roadworks_,
                eventHistory    := {
                    {
                        eventPosition := {
                            deltaLatitude                   := -3295,
                            deltaLongitude                  := -2347,
                            deltaAltitude                   := 0
                        },
                        eventDeltaTime                      := omit,
                        informationQuality                  := 0
                    },
                    {
                        eventPosition := {
                            deltaLatitude                   := -719,
                            deltaLongitude                  := -7055,
                            deltaAltitude                   := 0
                        },
                        eventDeltaTime                      := omit,
                        informationQuality                  := 0
                    }
                },
                roadWorksContainerExtended := {
                    lightBarSirenInUse                      := omit,
                    closedLanes := {
                        hardShoulderStatus                  := availableForDriving,
                        drivingLaneStatus                   := '0001'B
                    },
                    restriction                             := omit,
                    speedLimit                              := 30,
                    incidentIndication                      := omit,
                    recommendedPath                         := omit,
                    startingPointSpeedLimit := {
                        deltaLatitude                       := 0,
                        deltaLongitude                      := 0,
                        deltaAltitude                       := 0
                    },
                    trafficFlowRule                         := passToRight,
                    referenceDenms                          := omit
garciay's avatar
garciay committed
                }
            } // End of PICS_Z1_D1_EP
            
            modulepar DenmParm PICS_Z1_D2_EP := {
                eventPosition := {
                    latitude := 435517392,
                    longitude := 103018217,
                    positionConfidenceEllipse := PICS_DENM_POSITION_CONFIDENCE_ELLIPSE,
                    altitude := PICS_DENM_ALTITUDE
                },
                causeCodeType   := CauseCodeType_roadworks_,
                eventHistory    := {
                    {
                        eventPosition := {
                            deltaLatitude                   := -3295,
                            deltaLongitude                  := -2347,
                            deltaAltitude                   := 0
                        },
                        eventDeltaTime                      := omit,
                        informationQuality                  := 0
                    },
                    {
                        eventPosition := {
                            deltaLatitude                   := -719,
                            deltaLongitude                  := -7055,
                            deltaAltitude                   := 0
                        },
                        eventDeltaTime                      := omit,
                        informationQuality                  := 0
                    }
                },
                roadWorksContainerExtended := {
                    lightBarSirenInUse                      := omit,
                    closedLanes := {
                        hardShoulderStatus                  := availableForDriving,
                        drivingLaneStatus                   := '0011'B
                    },
                    restriction                             := omit,
                    speedLimit                              := 30,
                    incidentIndication                      := omit,
                    recommendedPath                         := omit,
                    startingPointSpeedLimit := {
                        deltaLatitude                       := 0,
                        deltaLongitude                      := 0,
                        deltaAltitude                       := 0
                    },
                    trafficFlowRule                         := passToRight,
                    referenceDenms                          := omit
garciay's avatar
garciay committed
                }
garciay's avatar
garciay committed

garciay's avatar
garciay committed
            } // End of PICS_Z1_D2_EP
            
            modulepar DenmParm PICS_Z1_D3_EP := {
                eventPosition := {
                    latitude := 435517392,
                    longitude := 103018217,
                    positionConfidenceEllipse := PICS_DENM_POSITION_CONFIDENCE_ELLIPSE,
                    altitude := PICS_DENM_ALTITUDE
                },
                causeCodeType   := CauseCodeType_roadworks_,
                eventHistory    := {
                    {
                        eventPosition := {
                            deltaLatitude                   := -3295,
                            deltaLongitude                  := -2347,
                            deltaAltitude                   := 0
                        },
                        eventDeltaTime                      := omit,
                        informationQuality                  := 0
                    },
                    {
                        eventPosition := {
                            deltaLatitude                   := -719,
                            deltaLongitude                  := -7055,
                            deltaAltitude                   := 0
                        },
                        eventDeltaTime                      := omit,
                        informationQuality                  := 0
                    }
                },
                roadWorksContainerExtended := {
                    lightBarSirenInUse                      := omit,
                    closedLanes := {
                        hardShoulderStatus                  := closed,
                        drivingLaneStatus                   := '01'B
                    },
                    restriction                             := omit,
                    speedLimit                              := 30,
                    incidentIndication                      := omit,
                    recommendedPath                         := omit,
                    startingPointSpeedLimit := {
                        deltaLatitude                       := 0,
                        deltaLongitude                      := 0,
                        deltaAltitude                       := 0
                    },
                    trafficFlowRule                         := passToRight,
                    referenceDenms                          := omit
garciay's avatar
garciay committed
                }
garciay's avatar
garciay committed

garciay's avatar
garciay committed
            } // End of PICS_Z1_D3_EP
            
        } // End of group denmZone1 
        
        group denmZone2 {
            // TODO To be done
        } // End of group denmZone2
        
        group denmUseCase1 {
            
            modulepar DenmEventsParmsUseCase PICS_DENM_PARMS_UC1_RWW := {
                PICS_Z1_D1_EP,
                PICS_Z1_D2_EP,
                PICS_Z1_D3_EP
            } // End of PICS_DENM_PARMS_UC1_RWW
            
        } // End of group denmUseCase1 
        
        group denmUseCase2 {
            // TODO To be done
        } // End of group denmUseCase2 
            
        modulepar DenmEventsParmsUseCaseRsu PICS_DENM_EVENTS_RSU := {
            PICS_DENM_PARMS_UC1_RWW
        } // End of PICS_DENM_EVENTS_RSU
        
    } // End of group denmEvents 
    
    group mapemEvents {
        
        group mapemCommonParams {
            
garciay's avatar
garciay committed
            modulepar BtpPortId PICS_MAPEM_BTP_DESTINATION_PORT  := 2003;
garciay's avatar
garciay committed
            modulepar BtpPortId PICS_MAPEM_BTP_SOURCE_PORT       := 0;
garciay's avatar
garciay committed
            
        } // End of group mapemCommonParams
        
        group mapemZone1 {
garciay's avatar
garciay committed
            
            modulepar MapemParm PICS_MAPEM_PARMS_RSU_1 := {
                intersections := {
                    { // Start of intersection #0
                        name                                := "PICS_MAPEM_PARMS_RSU_1",
                        id := {
                            region                          := 0,
                            id                              := 0
                        },
                        revision                            := 0,
                        refPoint := {
                            lat                             := 435517392,
                            long                            := 103018217,
                            elevation                       := omit,
                            regional                        := omit
                        },
                        laneWidth                           := omit,
                        speedLimits                         := omit,
                        laneSet := {
                            { // Start of Lane #1
                                laneID                      :=  1,
                                name                        := omit,
                                ingressApproach             := 1,
                                egressApproach              := 1,
                                laneAttributes := {
                                    directionalUse          := '10'B,
                                    sharedWith              := '0000000000'B,
                                    laneType := {
                                        vehicle             := '00000000'B
                                    },
                                    regional                := omit
                                },
                                maneuvers                   := omit,
                                nodeList := {
                                    nodes := {
                                        {
                                            delta := {
                                                node_XY1 := {
                                                    x       := -10,
                                                    y       := 10
                                                }
                                            },
                                            attributes      := omit
                                        },
                                        {
                                            delta := {
                                                node_XY1 := {
                                                    x       := -10,
                                                    y       := 10
                                                }
                                            },
                                            attributes      := omit
                                        }
                                    }
                                },
                                connectsTo := {
                                    {
                                        connectingLane := {
                                            lane            := 1,
                                            maneuver        := omit
                                        }, 
                                        remoteIntersection  := omit,  
                                        signalGroup         := 1,    
                                        userClass           := omit, 
                                        connectionID        := omit
                                    }
                                },
                                overlays                    := omit,
                                regional                    := omit
                            }, // End of Lane #1
                            { // Start of Lane #2
                                laneID                      :=  1,
                                name                        := omit,
                                ingressApproach             := 1,
                                egressApproach              := 2,
                                laneAttributes := {
                                    directionalUse          := '01'B,
                                    sharedWith              := '0000000000'B,
                                    laneType := {
                                        vehicle             := '00000000'B
                                    },
                                    regional                := omit
                                },
                                maneuvers                   := omit,
                                nodeList := {
                                    nodes := {
                                        {
                                            delta := {
                                                node_XY1 := {
                                                    x       := -10,
                                                    y       := 10
                                                }
                                            },
                                            attributes      := omit
                                        },
                                        {
                                            delta := {
                                                node_XY1 := {
                                                    x       := -10,
                                                    y       := 10
                                                }
                                            },
                                            attributes      := omit
                                        }
                                    }
                                },
                                connectsTo                  := omit,
                                overlays                    := omit,
                                regional                    := omit
                            } // End of Lane #1
                        }, // End of LaneSet
                        preemptPriorityData                 := omit,
                        regional                            := omit
                    } // End of intersection #0
                }, // End of field intersections
                roadSegments := omit
            } // End of PICS_MAPEM_PARMS_RSU_1
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
        } // End of group mapemZone1 
        
        group mapemZone2 {
garciay's avatar
garciay committed
            
            modulepar MapemParm PICS_MAPEM_PARMS_RSU_2 := {
                intersections := {
                    { // Start of intersection #0
                        name                                := "PICS_MAPEM_PARMS_RSU_1",
                        id := {
                            region                          := 0,
                            id                              := 0
                        },
                        revision                            := 0,
                        refPoint := {
                            lat                             := 435517392,
                            long                            := 103018217,
                            elevation                       := omit,
                            regional                        := omit
                        },
                        laneWidth                           := omit,
                        speedLimits                         := omit,
                        laneSet := {
                            { // Start of Lane #1
                                laneID                      :=  1,
                                name                        := omit,
                                ingressApproach             := 1,
                                egressApproach              := 1,
                                laneAttributes := {
                                    directionalUse          := '10'B,
                                    sharedWith              := '0000000000'B,
                                    laneType := {
                                        vehicle             := '00000000'B
                                    },
                                    regional                := omit
                                },
                                maneuvers                   := omit,
                                nodeList := {
                                    nodes := {
                                        {
                                            delta := {
                                                node_XY1 := {
                                                    x       := -10,
                                                    y       := 10
                                                }
                                            },
                                            attributes      := omit
                                        },
                                        {
                                            delta := {
                                                node_XY1 := {
                                                    x       := -10,
                                                    y       := 10
                                                }
                                            },
                                            attributes      := omit
                                        }
                                    }
                                },
                                connectsTo := {
                                    {
                                        connectingLane := {
                                            lane            := 1,
                                            maneuver        := omit
                                        }, 
                                        remoteIntersection  := omit,  
                                        signalGroup         := 1,    
                                        userClass           := omit, 
                                        connectionID        := omit
                                    }
                                },
                                overlays                    := omit,
                                regional                    := omit
                            }, // End of Lane #1
                            { // Start of Lane #2
                                laneID                      :=  1,
                                name                        := omit,
                                ingressApproach             := 1,
                                egressApproach              := 2,
                                laneAttributes := {
                                    directionalUse          := '01'B,
                                    sharedWith              := '0000000000'B,
                                    laneType := {
                                        vehicle             := '00000000'B
                                    },
                                    regional                := omit
                                },
                                maneuvers                   := omit,
                                nodeList := {
                                    nodes := {
                                        {
                                            delta := {
                                                node_XY1 := {
                                                    x       := -10,
                                                    y       := 10
                                                }
                                            },
                                            attributes      := omit
                                        },
                                        {
                                            delta := {
                                                node_XY1 := {
                                                    x       := -10,
                                                    y       := 10
                                                }
                                            },
                                            attributes      := omit
                                        }
                                    }
                                },
                                connectsTo                  := omit,
                                overlays                    := omit,
                                regional                    := omit
                            } // End of Lane #1
                        }, // End of LaneSet
                        preemptPriorityData                 := omit,
                        regional                            := omit
                    } // End of intersection #0
                }, // End of field intersections
                roadSegments := omit
            } // End of PICS_MAPEM_PARMS_RSU_2
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
        } // End of group mapemZone2 
        
        modulepar MapemParmListRsu PICS_MAPEM_PARMS_RSUs := {
garciay's avatar
garciay committed
            PICS_MAPEM_PARMS_RSU_1,
            PICS_MAPEM_PARMS_RSU_2
        } // End of PICS_MAPEM_PARMS_RSU
garciay's avatar
garciay committed
        
    } // End of group mapemEvents 
    
    group spatemEvents {
        
        group spatemCommonParams {
            
            modulepar BtpPortId PICS_SPATEM_BTP_DESTINATION_PORT := 2004;
            
            modulepar BtpPortId PICS_SPATEM_BTP_SOURCE_PORT      := 0;
            
        } // End of group spatemCommonParams
        
        group spatemZone1 {
            
            modulepar SignalGroupParm PICS_SPATEM_PARMS_SG_1_RS_1 := {
                signalGroupID                               := 1,
                intersections := {
                    {
                        name                                := "PICS_SPATEM_PARMS_SG_1_RS_1",
                        id := {
                            region                          := 0,
                            id                              := 0
                        },
                        revision                            := 0,   
                        status                              := int2bit(0, 16),
                        moy                                 := omit,
                        timeStamp                           := omit, 
                        enabledLanes                        := omit,  
                        states := {
                            {
                               movementName                 := "protected-Movement-Allowed",
                               signalGroup                  := 1, 
                               state_time_speed:= {
                                   {
                                       eventState           := protected_Movement_Allowed,
                                       timing               := omit,
                                       speeds               := omit,
                                       regional             := omit
                                   }
                               },   
                               maneuverAssistList           := omit,
                               regional                     := omit
                            },
                            {
                               movementName                 := "protected-clearance",
                               signalGroup                  := 1, 
                               state_time_speed:= {
                                   {
                                       eventState           := protected_clearance,
                                       timing               := omit,
                                       speeds               := omit,
                                       regional             := omit
                                   }
                               },   
                               maneuverAssistList           := omit,
                               regional                     := omit
                            },
                            {
                               movementName                 := "stop_Then_Proceed",
                               signalGroup                  := 1, 
                               state_time_speed:= {
                                   {
                                       eventState           := stop_Then_Proceed,
                                       timing               := omit,
                                       speeds               := omit,
                                       regional             := omit
                                   }
                               },   
                               maneuverAssistList           := omit,
                               regional                     := omit
                            }
                        },
                        maneuverAssistList                  := omit,
                        regional                            := omit
                    }
                } // End of field states
            } // End of type PICS_SPATEM_PARMS_SG_1_RS_1
            
            modulepar SignalGroupParmList PICS_SPATEM_PARMS_RSU_1 := {
                PICS_SPATEM_PARMS_SG_1_RS_1
            } // End of type PICS_SPATEM_PARMS_RSU_1
            
        }
        
        group spatemZone2 {
            
            modulepar SignalGroupParm PICS_SPATEM_PARMS_SG_1_RS_2 := {
                signalGroupID                               := 1,
                intersections := {
                    {
                        name                                := "PICS_SPATEM_PARMS_SG_1_RS_2",
                        id := {
                            region                          := 0,
                            id                              := 0
                        },
                        revision                            := 0,   
                        status                              := int2bit(0, 16),
                        moy                                 := omit,
                        timeStamp                           := omit, 
                        enabledLanes                        := omit,  
                        states := {
                            {
                               movementName                 := "stop_Then_Proceed",
                               signalGroup                  := 1, 
                               state_time_speed:= {
                                   {
                                       eventState           := stop_Then_Proceed,
                                       timing               := omit,
                                       speeds               := omit,
                                       regional             := omit
                                   }
                               },   
                               maneuverAssistList           := omit,
                               regional                     := omit
                            }
                        },
                        maneuverAssistList                  := omit,
                        regional                            := omit
                    }
                } // End of field states
            } // End of type PICS_SPATEM_PARMS_SG_1_RS_2
            
            modulepar SignalGroupParmList PICS_SPATEM_PARMS_RSU_2 := {
                PICS_SPATEM_PARMS_SG_1_RS_2
            } // End of type PICS_SPATEM_PARMS_RSU_1_RS_2
            
        }
        
        modulepar SpatemParmRsu PICS_SPATEM_PARMS_RSUs := {
            PICS_SPATEM_PARMS_RSU_1,
            PICS_SPATEM_PARMS_RSU_2
        } // End of PICS_SPATEM_PARMS_RSUs
        
    } // End of group spatemEvents
    
garciay's avatar
garciay committed
    group ivimEvents {
        
        group ivimCommonParams {
            
            modulepar BtpPortId PICS_IVIM_BTP_DESTINATION_PORT := 2005;
            
garciay's avatar
garciay committed
            modulepar BtpPortId PICS_IVIM_BTP_SOURCE_PORT      := 0;
garciay's avatar
garciay committed
            
        } // End of group ivimCommonParams
        
        group ivimZone1 {
            // TODO To be done
        } // End of group ivimZone1 
        
        group ivimZone2 {
            // TODO To be done
        } // End of group ivimZone2 
        
        group ivimUseCase1 {
            // TODO To be done
        } // End of group ivimUseCase1 
        
        group ivimUseCase2 {
            // TODO To be done
        } // End of group ivimUseCase2 
            
    } // End of group ivimEvents 
    
    group ssemEvents {
        
        group ssemCommonParams {
            
            modulepar BtpPortId PICS_SSEM_BTP_DESTINATION_PORT := 2005;
            
            modulepar BtpPortId PICS_SSEM_BTP_SOURCE_PORT      := 0;
            
        } // End of group ssemCommonParams
        
    } // End of group ssemEvents
    
garciay's avatar
garciay committed
    group generationFrequencies {
        
        modulepar boolean PICS_GENERATE_CAM := true;
        
        modulepar boolean PICS_GENERATE_DENM := true;
        
        modulepar boolean PICS_GENERATE_IVIM := true;
        
garciay's avatar
garciay committed
        modulepar boolean PICS_GENERATE_MAPEM := true;
        
        modulepar boolean PICS_GENERATE_SPATEM := true;
        
        modulepar boolean PICS_GENERATE_SSEM := true;
        
garciay's avatar
garciay committed
        /**
         * @desc CAM frequency timer
         */
        modulepar float PICS_CAM_FREQUENY       := 0.1;
        
        /**
         * @desc DENM frequency timer
         */
        modulepar float PICS_DENM_FREQUENY      := int2float(PICS_DENM_REPETITION_INTERVAL) / 1000.0;
garciay's avatar
garciay committed
        
        /**
         * @desc MAPEM frequency timer
         */
garciay's avatar
garciay committed
        modulepar float PICS_MAPEM_FREQUENY     := 2.0;
garciay's avatar
garciay committed
        
        /**
         * @desc SPATEMM frequency timer
         */
garciay's avatar
garciay committed
        modulepar float PICS_SPATEM_FREQUENY    := 2.0;
garciay's avatar
garciay committed
        
        /**
         * @desc IVIM frequency timer
         */
garciay's avatar
garciay committed
        modulepar float PICS_IVIM_FREQUENY      := 2.0;
garciay's avatar
garciay committed
        
    } // End of group generationFrequencies 
    
} // End of module ItsRSUsSimulator_Pics