コード例 #1
0
ファイル: LogGroup.cs プロジェクト: nlhans/SimTelemetry
        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
ファイル: LogGroup.cs プロジェクト: nlhans/SimTelemetry
        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;
        }