Example #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");
            }
        }
Example #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");
            }
        }
Example #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");
            }
        }
Example #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 void ThrowLoggingEvent_NotSubscribed_Fact()
        {
            _wrapper.OnLoggingEvent -= WrapperOnOnLoggingEvent;

            _wrapper.Debug("This is a Fact");

            _eventArgs.Should().BeNull();
            //Assert.That(_eventArgs, Is.Null.After(100));
        }
Example #7
0
        private void AddLog(string Msg, StackTrace stack = null, string Tittle = "", int TenantId = 0, int UserId = 0, LogType logtype = LogType.Debug, Object Context = null)
        {
            try
            {
                if (stack == null)
                {
                    stack = new StackTrace(true);
                }
                var    methodBase = stack.GetFrame(1).GetMethod();
                Type   stacktype  = methodBase.DeclaringType;
                string fileName   = stacktype.FullName; //文件名
                string methodName = methodBase.Name;    //方法名
                var    logModel   = new LogModel
                {
                    TenantId   = TenantId,
                    UserId     = UserId,
                    Message    = Msg,
                    Title      = Tittle,
                    MethodName = methodName,
                    FileName   = fileName,
                    CodeLine   = "0"
                };
                var jsonValue = JsonConvert.SerializeObject(logModel);
                switch (logtype)
                {
                case LogType.Debug:
                    _log.Debug(jsonValue);
                    break;

                case LogType.Info:
                    _log.Info(jsonValue);
                    break;

                case LogType.Warn:
                    _log.Warn(jsonValue);
                    break;

                case LogType.Error:
                    _log.Error(jsonValue);
                    break;

                case LogType.Fatal:
                    _log.Fatal(jsonValue);
                    break;

                default:
                    _log.Debug(jsonValue);
                    break;
                }
            }
            catch
            {
            }
        }
Example #8
0
        private static void FrequencyBoundLogDebug(string message)
        {
            ParameterlessDelegate logDelegate;

            if (!_errorLogDelegates.TryGetValue(message, out logDelegate))
            {
                lock (ErrorLogSync)
                {
                    if (!_errorLogDelegates.TryGetValue(message, out logDelegate))
                    {
                        var errorDelegates = new Dictionary <string, ParameterlessDelegate>(_errorLogDelegates);
                        logDelegate = Algorithm.FrequencyBoundMethod(
                            count =>
                        {
                            if (count > 1)
                            {
                                log.DebugFormat("{0} occurances: {1}", count + 1, message);
                            }
                            else
                            {
                                log.Debug(message);
                            }
                        }
                            , TimeSpan.FromMinutes(1));

                        errorDelegates[message] = logDelegate;
                        Interlocked.Exchange(ref _errorLogDelegates, errorDelegates);
                    }
                }
            }
            logDelegate();
        }
        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");
            }
        }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _logger.Debug("home页面2");
            Configuration     config        = WebConfigurationManager.OpenWebConfiguration("/");
            MachineKeySection configSection = (MachineKeySection)config.GetSection("system.web/machineKey");

            configSection.ValidationKey = CreateKey(64);
            configSection.DecryptionKey = CreateKey(24);
            configSection.Validation    = MachineKeyValidation.SHA1;
            configSection.Decryption    = "3DES";
            if (!configSection.SectionInformation.IsLocked)
            {
                config.Save();
            }
        }
Example #13
0
 /// <summary>
 /// debug
 /// </summary>
 /// <param name="info"></param>
 public static void Debug(string info)
 {
     _log.Debug(info);
 }
Example #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _logger.Debug("info页面");
 }