コード例 #1
0
        public override void processMessage(D2LogicalModel d2LogicalModel)
        {
            if (logWrapper.isDebug())
            {
                logWrapper.Debug("FusedFVDAndSensorData Update");
            }

            fusedFVDAndSensorDataStore.clearDataStore();

            ElaboratedDataPublication elaboratedDataPublication = (ElaboratedDataPublication)d2LogicalModel.payloadPublication;

            if (elaboratedDataPublication != null)
            {
                DateTime         publicationTime    = elaboratedDataPublication.publicationTime;
                DateTime         timeDefault        = elaboratedDataPublication.timeDefault;
                ElaboratedData[] elaboratedDataList = elaboratedDataPublication.elaboratedData;

                if (logWrapper.isDebug())
                {
                    logWrapper.Debug("FusedFVDAndSensorData Update(" + elaboratedDataList.Length + " objects)");
                }

                for (int elaboratedDataListPos = 0; elaboratedDataListPos < elaboratedDataList.Length; elaboratedDataListPos++)
                {
                    ElaboratedData elaboratedData = elaboratedDataList[elaboratedDataListPos];
                    processSituation(elaboratedData, publicationTime, timeDefault);
                }
            }

            if (logWrapper.isDebug())
            {
                logWrapper.Debug("FusedFVDAndSensorData Update Complete");
            }
        }
コード例 #2
0
        public void Handle(D2LogicalModel deliverGetFusedSensorOnlyTrafficDataRequest)
        {
            log.Info("New FusedSensorOnlyTrafficData received.");

            // Validate the D2Logical Model
            if (!ExampleDataCheckOk(deliverGetFusedSensorOnlyTrafficDataRequest))
            {
                throw new SoapException("Incoming request does not appear to be valid!", SoapException.ClientFaultCode);
            }

            ElaboratedDataPublication elaboratedDataPublication = null;

            try
            {
                elaboratedDataPublication = (ElaboratedDataPublication)deliverGetFusedSensorOnlyTrafficDataRequest.payloadPublication;

                if (elaboratedDataPublication != null)
                {
                    ElaboratedData[] elaboratedDataList = elaboratedDataPublication.elaboratedData;

                    log.Info("Number of data items in the publication: " + elaboratedDataList.Length);

                    foreach (ElaboratedData dataItem in elaboratedDataList)
                    {
                        extractTrafficDataFromElaboratedData(dataItem);
                    }

                    log.Info("FusedSensorOnlyTrafficData: processed successfully.");
                }
            } catch (Exception e)
            {
                log.Error(e.Message);
            }
        }
        public void Handle(D2LogicalModel deliverFVDTrafficDataRequest)
        {
            log.Info("New FusedFvdAndSensorTrafficData received");
            ElaboratedDataPublication elaboratedDataPublication = null;

            try
            {
                elaboratedDataPublication = (ElaboratedDataPublication)deliverFVDTrafficDataRequest.payloadPublication;

                if (elaboratedDataPublication != null)
                {
                    ElaboratedData[] elaboratedDataList = elaboratedDataPublication.elaboratedData;
                    log.Info("Number of data items in the publication: " + elaboratedDataList.Length);

                    foreach (ElaboratedData dataItem in elaboratedDataList)
                    {
                        extractTrafficDataFromElaboratedData(dataItem);
                    }
                }
                log.Info("FusedFvdAndSensorTrafficData: processed successfully.");
            }
            catch (Exception e) {
                log.Error(e.Message);
            }
        }
コード例 #4
0
        public putDatex2DataResponse GetDeliverFVDTrafficDataResponse(D2LogicalModel deliverFVDTrafficDataRequest)
        {
            log.Info("Handling Fused FVD and Sensor PTD Request");

            // Validate the D2Logical Model
            if (!ExampleDataCheckOk(deliverFVDTrafficDataRequest))
            {
                throw new SoapException("Incoming request does not appear to be valid!", SoapException.ClientFaultCode);
            }


            ElaboratedDataPublication elaboratedDataPublication = deliverFVDTrafficDataRequest.payloadPublication as ElaboratedDataPublication;

            if (elaboratedDataPublication != null)
            {
                ElaboratedData[] trafficDataList = filterEnumerableByType(elaboratedDataPublication.elaboratedData, typeof(TrafficSpeed))
                                                   .ToArray();
                ElaboratedData[] travelTimeDataList = filterEnumerableByType(elaboratedDataPublication.elaboratedData, typeof(TravelTimeData))
                                                      .ToArray();

                log.Info("Publication Time is " + elaboratedDataPublication.publicationTime);
                log.Info("Time Default is  " + elaboratedDataPublication.timeDefault);
                log.Info("Total Traffic Data objects  are " + trafficDataList.Length);
                log.Info("Total Travel Time Data objects  are " + travelTimeDataList.Length);
            }

            log.Info("Fused FVD and Sensor PTD Request: Processing Completed Successfuly");

            return(new putDatex2DataResponse {
                d2LogicalModel = new D2LogicalModel()
            });
        }
        public putDatex2DataResponse GetDeliverSensorTrafficDataResponse(D2LogicalModel request)
        {
            log.Info("Handling Fused Sensor-only PTD Request!");

            // Validate the D2Logical Model
            if (!ExampleDataCheckOk(request))
            {
                throw new SoapException("Incoming request does not appear to be valid!", SoapException.ClientFaultCode);
            }


            ElaboratedDataPublication elaboratedDataPublication = request.payloadPublication as ElaboratedDataPublication;

            if (elaboratedDataPublication != null)
            {
                log.Info("Publication Time is " + elaboratedDataPublication.publicationTime);
                log.Info("Time Default is  " + elaboratedDataPublication.timeDefault);
                log.Info("Total Elaborated Data objects  are " + elaboratedDataPublication.elaboratedData.Length);
            }

            log.Info("Fused Sensor-only PTD Request: Processing Completed Successfuly");

            return(new putDatex2DataResponse {
                d2LogicalModel = new D2LogicalModel()
            });
        }