Exemple #1
0
        public override void processMessage(D2LogicalModel d2LogicalModel)
        {
            if (logWrapper.isInfo())
            {
                logWrapper.Info("VMSAndMatrix Update");
            }

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

            if (feedType.ToLower().Contains(FULL_REFRESH_TEXT))
            {
                if (logWrapper.isInfo())
                {
                    logWrapper.Info("VMS Full Refresh received");
                }
                fullRefresh = true;
                vMSDataStore.clearDataStore();
            }

            VmsPublication payloadPublication = (VmsPublication)d2LogicalModel.payloadPublication;
            DateTime       publicationTime    = payloadPublication.publicationTime;

            if (payloadPublication != null)
            {
                VmsUnit[] vmsUnits = payloadPublication.vmsUnit;

                if (logWrapper.isInfo())
                {
                    logWrapper.Info("VMS Update(" + vmsUnits.Length + " objects)");
                }

                for (int vmsUnitsPos = 0; vmsUnitsPos < vmsUnits.Length; vmsUnitsPos++)
                {
                    VmsUnit vmsUnit = vmsUnits[vmsUnitsPos];
                    processVmsUnit(vmsUnit, publicationTime, fullRefresh);
                }
            }

            if (logWrapper.isInfo())
            {
                logWrapper.Info("VMSAndMatrix 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");
            }
        }