Example #1
0
        public async Task <FileParserResult> ParseFileAsync(string fileName)
        {
            Throw.IfNullOrEmpty(fileName, nameof(fileName));

            IFileParser fileParser = _fileParserFactory.Create(fileName);

            FileParserResult fileParserResult = await fileParser.ParseEntireContentAsync();

            return(fileParserResult);
        }
        public async Task <FileParserResult> ParseFileAsync(string fileName)
        {
            Logger.Trace("Start file {0} handling.", fileName);

            FileParserResult fileParserResult = await _fileParserManager.ParseFileAsync(fileName);

            Logger.Trace("End file {0} handling.", fileName);

            return(fileParserResult);
        }
        public static SignalData Map(FileParserResult fileParserResult)
        {
            Throw.IfNull(fileParserResult, nameof(fileParserResult));

            var fileMetadata = fileParserResult.FileMetadata;
            var signalMetadata = SignalMetadata.Create(
                fileMetadata.Signature,
                fileMetadata.ChannelNumber,
                fileMetadata.ChannelSize,
                fileMetadata.SpectrumLineNumber,
                fileMetadata.CutoffFrequency,
                fileMetadata.FrequencyDefinition,
                fileMetadata.DataBlockReceiveTime,
                fileMetadata.TotalReceiveTime,
                fileMetadata.DataBlockNumber,
                fileMetadata.DataSize,
                fileMetadata.ReceivedBlocksNumber,
                fileMetadata.MaxValue,
                fileMetadata.MinValue);

            return new SignalData(signalMetadata, fileParserResult.SignalValues);
        }