コード例 #1
0
        private void processSituation(ElaboratedData elaboratedData, DateTime publicationTime, DateTime timeDefault)
        {
            LocationByReference locationByReference = null;
            BasicData           basicData           = elaboratedData.basicData;

            if (basicData.GetType() == typeof(TrafficHeadway))
            {
                TrafficHeadway data = (TrafficHeadway)basicData;
                locationByReference = (LocationByReference)data.pertinentLocation;
            }
            else if (basicData.GetType() == typeof(TrafficFlow))
            {
                TrafficFlow data = (TrafficFlow)basicData;
                locationByReference = (LocationByReference)data.pertinentLocation;
            }
            else if (basicData.GetType() == typeof(TrafficConcentration))
            {
                TrafficConcentration data = (TrafficConcentration)basicData;
                locationByReference = (LocationByReference)data.pertinentLocation;
            }
            else if (basicData.GetType() == typeof(TrafficSpeed))
            {
                TrafficSpeed data = (TrafficSpeed)basicData;
                locationByReference = (LocationByReference)data.pertinentLocation;
            }
            else if (basicData.GetType() == typeof(TravelTimeData))
            {
                TravelTimeData data = (TravelTimeData)basicData;
                locationByReference = (LocationByReference)data.pertinentLocation;
            }
            else
            {
                logWrapper.Warning("basicData instance of -" + basicData.GetType().ToString());
            }

            String linkIdentifier = null;

            if (locationByReference != null)
            {
                linkIdentifier = basicData.GetType().ToString() + locationByReference.predefinedLocationReference.id;

                if (logWrapper.isDebug())
                {
                    logWrapper.Debug("Processing Fused FVD And Sensor Identifier(" + linkIdentifier + ")");
                }

                FusedFVDAndSensorData fusedFVDAndSensorData = new FusedFVDAndSensorData(linkIdentifier, publicationTime, timeDefault, elaboratedData);
                fusedFVDAndSensorDataStore.updateData(fusedFVDAndSensorData);
            }
            else
            {
                logWrapper.Error("Failed to Process elaboratedData, " + elaboratedData.ToString());
            }
        }
コード例 #2
0
 public override void updateData(DataObject data)
 {
     lock (this)
     {
         FusedFVDAndSensorData fusedFVDAndSensorData = (FusedFVDAndSensorData)data;
         String linkIdentifier = fusedFVDAndSensorData.getFusedFVDSensorIdentifier();
         if (dataMap.ContainsKey(linkIdentifier))
         {
             dataMap.Remove(linkIdentifier);
             dataMap.Add(linkIdentifier, fusedFVDAndSensorData);
         }
         else
         {
             dataMap.Add(linkIdentifier, fusedFVDAndSensorData);
         }
     }
 }