// 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.Unix;
using Hiperscan.Spectroscopy;

using Hiperscan.Spectroscopy.Processing;

namespace Hiperscan.Spectroscopy.ReferenceChecks
{
    public partial class ReferenceChecks
    {
        public bool CheckWhiteReference(Spectrum spectrum, bool throw_exception = true)
        {
            if (this.PlausibilityChecks == false)
                return true;

            switch (spectrum.ProbeType)
            {

                case ProbeType.Unknown:
                case ProbeType.FinderStandard:
                case ProbeType.FinderSDStandard:
                    return this.CheckStandardWhiteReference(spectrum, throw_exception);

                case ProbeType.FinderInsert:
                case ProbeType.FinderSDInsert:
                    return this.CheckSampleInsertWhiteReference(spectrum, throw_exception);

                case ProbeType.FinderSDSampleSpinner:
                    return this.CheckSampleSpinnerWhiteReference(spectrum, throw_exception);

                case ProbeType.FinderXStandard:
                case ProbeType.FinderXLineScan:
                    return this.CheckFix2GlassWhiteReference(spectrum, throw_exception);

                default:
                    if (throw_exception)
                        throw new Exception(string.Format(Catalog.GetString("Not supported Probe Type: {0}"), spectrum.ProbeType));
                    return false;

            }
        }
    }
}
