Esempio n. 1
0
        private void AnalyzeLog(string deviceId)
        {
            string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            string fileName    = @"dataLog.csv";
            string filePath    = desktopPath + "\\" + fileName;
            int    faultCount  = 0;

            if (!File.Exists(filePath))
            {
                return;
            }
            LogParser    parser = new LogParser();
            StreamReader sr     = new StreamReader(filePath);

            //Build log for device Id
            parser.ParseEvents(deviceId, sr);

            //Get pattern count
            faultCount = parser.GetEventCount(deviceId);

            //Update count in list view
            var item = Devices.FirstOrDefault(x => x.DeviceId == deviceId);

            if (item != null)
            {
                item.FaultCount = faultCount;
            }
        }