Ejemplo n.º 1
0
        public void GetMessages()
        {
            session  = new SerializerSession();
            Messages = new ByteMessageCollection(session);
            int nr        = 1;
            var parameter = Lines.FirstOrDefault(e => e.Contains("; RadioChannel:"));

            if (parameter != null)
            {
                int start = parameter.IndexOf(';') + 2;
                parameter = parameter.Substring(start).Trim();
                session.SetParametersByString(parameter);

                foreach (var item in Lines)
                {
                    var split = item.Split(';');
                    if (split.Length == 2)
                    {
                        string bytestr = split[1].Trim();
                        if (bytestr.StartsWith("00-"))
                        {
                            Messages.Add(bytestr.GetBytes(), nr, split[0]);
                            nr += 1;
                        }
                        else
                        {
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public LogFileReader(string path, SerializerSession settings)
        {
            _session = settings;
            Messages = new ByteMessageCollection(_session);
            var lines = System.IO.File.ReadAllLines(path);
            int nr    = 1;

            //6/1/2017 12:02:23 AM; 00-00-00-00-01-58
            foreach (var item in lines)
            {
                var split = item.Split(';');
                if (split.Length == 2)
                {
                    string bytestr = split[1].Trim();
                    if (bytestr.StartsWith("00-"))
                    {
                        Messages.Add(bytestr.GetBytes(), nr, split[0]);
                        nr += 1;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public LogFileReader(string path, SerializerSession settings)
        {
            _session = settings;
            Messages = new ByteMessageCollection(_session);
            var lines = System.IO.File.ReadAllLines(path);
            int nr    = 1;

            var parameter = lines.FirstOrDefault(e => e.Contains("; RadioChannel:"));

            if (parameter != null)
            {
                int start = parameter.IndexOf(';') + 2;
                parameter = parameter.Substring(start).Trim();
                _session.SetParametersByString(parameter);
            }
            else
            {
                //throw new Exception("Parameter string in logfile.Line should start with 'RadioChannel'.");
            }
            //6/1/2017 12:02:23 AM; 00-00-00-00-01-58
            foreach (var item in lines)
            {
                var split = item.Split(';');
                if (split.Length == 2)
                {
                    string bytestr = split[1].Trim();
                    if (bytestr.StartsWith("00-"))
                    {
                        Messages.Add(bytestr.GetBytes(), nr, split[0]);
                        nr += 1;
                    }
                    else
                    {
                    }
                }
            }
            _session.PumpDataHistory.ExtractHistoryEvents();
        }