예제 #1
0
        public LogGroup(LogFileWriter writer, string name, IDataNode dataSource)
        {
            FileWriter = writer;
            Name = name;
            DataSource = dataSource;
            Subscribed = true;

            TimeStream = new LogGroupStream(this, LogFileType.Time, 1024 * 1024);
            DataStream = new LogGroupStream(this, LogFileType.Data, 1024 * 1024);

            _fields = dataSource.GetDataFields().Select(x => new LogField(this, x, GetNewFieldId())).ToList();
        }
예제 #2
0
        public bool Resubscribe(IDataNode dataSource)
        {
            DataSource = dataSource;
            Subscribed = true;

            var newFields = dataSource
                .GetDataFields()
                .Where(x => !_fields.Any(y => y.Name == x.Name))
                .Select(x => new LogField(this, x, GetNewFieldId()))
                .ToList();

            _fields.AddRange(newFields);

            // Reinit streams

            TimeStream = new LogGroupStream(this, LogFileType.Time, 1024 * 1024);
            DataStream = new LogGroupStream(this, LogFileType.Data, 1024 * 1024);

            return false;
        }