Exemple #1
0
        /// <remarks>
        /// Constructs a new instance of this <type>FileSegment</type> by copying
        /// important attributes.
        /// </remarks>
        public object Clone()
        {
            if (this.SourceMetadata == null)
            {
                throw new NullReferenceException($"{nameof(this.SourceMetadata)} must not be null to clone segment");
            }

            var newSegment = new FileSegment(
                source: this.Source,
                sampleRate: this.SourceMetadata.SampleRate,
                duration: this.SourceMetadata.Duration,
                suppliedDate: this.TargetFileStartDate);

            return(newSegment);
        }
        internal SegmentSettingsBase(AnalysisSettings analysisSettings, FileSegment preparedFile, DirectoryInfo segmentTempDirectory, DirectoryInfo segmentOutputDirectory)
        {
            Contract.Requires <ArgumentNullException>(analysisSettings != null, $"{nameof(analysisSettings)} must not be null");
            Contract.Requires <ArgumentNullException>(segmentOutputDirectory != null, $"{nameof(segmentOutputDirectory)} must not be null");
            Contract.Requires <ArgumentNullException>(segmentTempDirectory != null, $"{nameof(segmentTempDirectory)} must not be null");
            Contract.Requires <ArgumentNullException>(preparedFile != null, $"{nameof(preparedFile)} must not be null");

            this.AnalysisSettings       = analysisSettings;
            this.SegmentTempDirectory   = segmentTempDirectory;
            this.SegmentOutputDirectory = segmentOutputDirectory;
            this.PreparedFile           = preparedFile;

            string basename = Path.GetFileNameWithoutExtension(preparedFile.Source.Name);

            // if user requests, save the intermediate csv files

            // always save csv to output dir
            this.SegmentEventsFile               = AnalysisResultPath(segmentOutputDirectory, basename, StandardEventsSuffix, "csv").ToFileInfo();
            this.SegmentSummaryIndicesFile       = AnalysisResultPath(segmentOutputDirectory, basename, StandardIndicesSuffix, "csv").ToFileInfo();
            this.SegmentSpectrumIndicesDirectory = this.SegmentOutputDirectory;

            this.SegmentImageFile = AnalysisResultPath(segmentOutputDirectory, basename, "Image", "png").ToFileInfo();
        }
Exemple #3
0
 /// <inheritdoc/>
 public abstract void SummariseResults(AnalysisSettings settings, FileSegment inputFileSegment, EventBase[] events, SummaryIndexBase[] indices, SpectralIndexBase[] spectralIndices, AnalysisResult2[] results);