Ejemplo n.º 1
0
        public override void processMessage(D2LogicalModel d2LogicalModel)
        {
            if (logWrapper.isDebug())
            {
                logWrapper.Debug("ANPR Update");
            }

            MeasuredDataPublication measuredDataPublication = (MeasuredDataPublication)d2LogicalModel.payloadPublication;

            if (measuredDataPublication != null)
            {
                DateTime publicationTime = measuredDataPublication.publicationTime;

                SiteMeasurements[] siteMeasurementsList = measuredDataPublication.siteMeasurements;

                if (logWrapper.isDebug())
                {
                    logWrapper.Debug("ANPR Update(" + siteMeasurementsList.Length + " objects)");
                }

                for (int siteMeasurementsListPos = 0; siteMeasurementsListPos < siteMeasurementsList.Length; siteMeasurementsListPos++)
                {
                    SiteMeasurements siteMeasurements = siteMeasurementsList[siteMeasurementsListPos];
                    processSituation(siteMeasurements, publicationTime);
                }
            }

            if (logWrapper.isDebug())
            {
                logWrapper.Debug("ANPR Update Complete");
            }
        }
        public override void processMessage(D2LogicalModel d2LogicalModel)
        {
            if (logWrapper.isDebug())
            {
                logWrapper.Debug("NTIS Model Predefined Location Update");
            }

            linkShapeStaticDataStore.clearDataStore();
            nwkLinkStaticDataStore.clearDataStore();
            anprRouteStaticDataStore.clearDataStore();
            hatrisSectionStaticDataStore.clearDataStore();
            nwkNodeStaticDataStore.clearDataStore();
            alternateRouteStaticDataStore.clearDataStore();

            PredefinedLocationsPublication predefinedLocationsPublication = (PredefinedLocationsPublication)d2LogicalModel.payloadPublication;

            if (predefinedLocationsPublication != null)
            {
                DateTime publicationTime = predefinedLocationsPublication.publicationTime;

                PredefinedLocationContainer[] predefinedLocationContainerList = predefinedLocationsPublication.predefinedLocationContainer;

                for (int predefinedLocationContainerListPos = 0; predefinedLocationContainerListPos < predefinedLocationContainerList.Length; predefinedLocationContainerListPos++)
                {
                    PredefinedLocationContainer predefinedLocationContainer = predefinedLocationContainerList[predefinedLocationContainerListPos];
                    processPredefinedLocationContainer(predefinedLocationContainer, publicationTime);
                }
            }

            if (logWrapper.isDebug())
            {
                logWrapper.Debug("NTIS Model Predefined Location Update Complete");
            }
        }
Ejemplo n.º 3
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");
            }
        }
Ejemplo n.º 4
0
        public override void processMessage(D2LogicalModel d2LogicalModel)
        {
            if (logWrapper.isDebug())
            {
                logWrapper.Debug("NTIS Model VMS Tables Update");
            }

            vmsStaticDataStore.clearDataStore();
            matrixSignalStaticDataStore.clearDataStore();

            VmsTablePublication vmsTablePublication = (VmsTablePublication)d2LogicalModel.payloadPublication;

            if (vmsTablePublication != null)
            {
                DateTime publicationTime = vmsTablePublication.publicationTime;

                VmsUnitTable[] vmsUnitTableList = vmsTablePublication.vmsUnitTable;

                for (int vmsUnitTableListPos = 0; vmsUnitTableListPos < vmsUnitTableList.Length; vmsUnitTableListPos++)
                {
                    VmsUnitTable vmsUnitTable = vmsUnitTableList[vmsUnitTableListPos];
                    processVmsUnitTable(vmsUnitTable, publicationTime);
                }
            }

            if (logWrapper.isDebug())
            {
                logWrapper.Debug("NTIS Model VMS Tables Update Complete");
            }
        }
Ejemplo n.º 5
0
        public override void processMessage(D2LogicalModel d2LogicalModel)
        {
            if (logWrapper.isDebug())
            {
                logWrapper.Debug("NTIS Model Measurement Site Tables Update");
            }

            tameStaticDataStore.clearDataStore();
            midasStaticDataStore.clearDataStore();
            anprStaticDataStore.clearDataStore();
            tmuStaticDataStore.clearDataStore();

            MeasurementSiteTablePublication measurementSiteTablePublication = (MeasurementSiteTablePublication)d2LogicalModel.payloadPublication;

            if (measurementSiteTablePublication != null)
            {
                DateTime publicationTime = measurementSiteTablePublication.publicationTime;
                MeasurementSiteTable[] measurementSiteTableList = measurementSiteTablePublication.measurementSiteTable;

                for (int measurementSiteTableListPos = 0; measurementSiteTableListPos < measurementSiteTableList.Length; measurementSiteTableListPos++)
                {
                    MeasurementSiteTable measurementSiteTable = measurementSiteTableList[measurementSiteTableListPos];
                    processMeasurementSiteTable(measurementSiteTable, publicationTime);
                }
            }

            if (logWrapper.isDebug())
            {
                logWrapper.Debug("NTIS Model Measurement Site Tables Update Complete");
            }
        }
        public static void processDATEXIIUpdateXML(object source, ElapsedEventArgs e)
        {
            working++;
            if (logWrapper.isDebug() == true)
            {
                logWrapper.Debug("Polling for messages");
            }

            UpdateMessage xml = null;

            lock (messageQueue){
                if (messageQueue.Count() > QUEUE_EMPTY)
                {
                    xml = messageQueue.Dequeue();
                }
            }
            while (xml != null)
            {
                try {
                    XmlSerializer myDIISerializer = new XmlSerializer(typeof(D2LogicalModel));
                    XmlReader     xmlReader       = XmlReader.Create(new StringReader(Encoding.ASCII.GetString(xml.Buffer)));
                    Boolean       soap            = true;
                    try {
                        xmlReader.ReadStartElement("Envelope", "http://schemas.xmlsoap.org/soap/envelope/");
                        xmlReader.ReadStartElement("Body", "http://schemas.xmlsoap.org/soap/envelope/");
                    } catch (XmlException ex)
                    {
                        soap = false;
                    }
                    D2LogicalModel d2lm = (D2LogicalModel)myDIISerializer.Deserialize(xmlReader);
                    if (soap)
                    {
                        xmlReader.ReadEndElement();
                        xmlReader.ReadEndElement();
                    }
                    string feedType = FeedType.getFeedType(d2lm.payloadPublication.feedType);
                    DATEXIIProcessService datexiiProcessService = datexiiProcessServiceFactory.getServiceType(feedType);
                    if (datexiiProcessService != null)
                    {
                        datexiiProcessService.processMessage(d2lm);
                    }
                } catch (Exception ex)
                {
                    logWrapper.Error(ex.ToString());
                }
                lock (messageQueue){
                    if (messageQueue.Count() > QUEUE_EMPTY)
                    {
                        xml = messageQueue.Dequeue();
                    }
                    else
                    {
                        xml = null;
                    }
                }
            }
            working--;
        }
        public override void processMessage(D2LogicalModel d2LogicalModel)
        {
            if (logWrapper.isDebug())
            {
                logWrapper.Debug("Event Update");
            }

            bool   fullRefresh = false;
            String feedType    = d2LogicalModel.payloadPublication.feedType;

            if (feedType.ToLower().Contains(fullRefreshText))
            {
                logWrapper.Info("Event Full Refresh received");
                fullRefresh = true;
                lock (eventDataStore){
                    eventDataStore.clearDataStore();
                }
            }

            SituationPublication situationPublication = (SituationPublication)d2LogicalModel.payloadPublication;
            DateTime             publicationTime      = situationPublication.publicationTime;

            if (situationPublication != null)
            {
                Situation[] situationList = situationPublication.situation;

                if (logWrapper.isDebug())
                {
                    logWrapper.Debug("Event Update(" + situationList.Length + " objects)");
                }

                for (int situationListPos = 0; situationListPos < situationList.Length; situationListPos++)
                {
                    Situation situation = situationList[situationListPos];
                    processSituation(situation, publicationTime, fullRefresh);
                }
            }

            if (logWrapper.isDebug())
            {
                logWrapper.Debug("Event Update Complete");
            }
        }
        public override void processMessage(D2LogicalModel d2LogicalModel)
        {
            if (logWrapper.isInfo())
            {
                logWrapper.Info("TMU Update");
            }

            MeasuredDataPublication measuredDataPublication = (MeasuredDataPublication)d2LogicalModel.payloadPublication;

            if (measuredDataPublication != null)
            {
                DateTime publicationTime = measuredDataPublication.publicationTime;

                SiteMeasurements[] siteMeasurementsList = measuredDataPublication.siteMeasurements;

                if (logWrapper.isDebug())
                {
                    logWrapper.Debug("TMU Update(" + siteMeasurementsList.Length + " objects)");
                }

                Dictionary <String, LinkedList <SiteMeasurements> > siteMeasurementsIndex =
                    new Dictionary <String, LinkedList <SiteMeasurements> >();

                for (int siteMeasurementsListPos = 0; siteMeasurementsListPos < siteMeasurementsList.Length; siteMeasurementsListPos++)
                {
                    SiteMeasurements siteMeasurements = siteMeasurementsList[siteMeasurementsListPos];
                    processSituation(siteMeasurements, publicationTime, siteMeasurementsIndex);
                }

                foreach (String tmuIdentifier in siteMeasurementsIndex.Keys)
                {
                    TMUData tmuData = new TMUData(tmuIdentifier, publicationTime, siteMeasurementsIndex[tmuIdentifier]);

                    tmuDataStore.updateData(tmuData);
                }
            }

            if (logWrapper.isDebug())
            {
                logWrapper.Debug("TMU Update Complete");
            }
        }