// Created with MonoDevelop
//
//    Copyright (C) 2024 Hiperscan GmbH Dresden, Germany
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;

using Hiperscan.Spectroscopy;
using Hiperscan.Spectroscopy.Processing;

namespace Hiperscan.Spectroscopy.ReferenceChecks
{
    public partial class ReferenceChecks
    {
        public delegate void SaveReferenceHandler(Spectrum spectrum, SpectrumType spectrum_type, bool error, string name);

        public delegate void FailureMathodHandler();

        public ReferenceChecks()
            :this(null)
        { }

        public ReferenceChecks(SpectrumProcessor spectrum_processor)
            :this(spectrum_processor, true)
        { }

        public ReferenceChecks(SpectrumProcessor spectrum_processor, bool use_correlation)
        {
            this.SpectrumProcessor = spectrum_processor;
            this.UseCorrelation = use_correlation;
            this.PlausibilityChecks = true;

            this.CallFailureMethod = true;
            this.CallSaveReferenceMethodOnFailure = true;
        }

        public SpectrumProcessor SpectrumProcessor { get; set; }

        public bool CallFailureMethod { get; set; }

        public bool CallSaveReferenceMethodOnFailure { get; set; }

        public bool UseCorrelation { get; set; }

        public bool PlausibilityChecks { get; set; }

        public SaveReferenceHandler SaveReferenceMethod { get; set; }

        public FailureMathodHandler FailureMethod { get; set; }
    }
}
