// Created with MonoDevelop
//
//    QuickStep: Acquire, view and identify spectra 
//    Copyright (C) 2017 Thomas Klose & Torsten Schache, 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 System.Collections.Generic;
using System.Globalization;

using Hiperscan.Common.I18n;
using Hiperscan.PdfLib;
using Hiperscan.Spectroscopy.IdentServer;


namespace Hiperscan.Extensions.ApoIdent.RankingList
{

    public class Switzerland : Hiperscan.Extensions.ApoIdent.RankingList.Generic
    {

        public Switzerland(ApoIdentResultSet result, string test_id) : base(result, test_id, new CultureInfo("de-DE"))
        {
        }

        protected override void CreateContent ()
        {
            string text = String.Format("Details zur Messung mit der Prüfnummer {0}", this.TestId);

            this.AddHeaderLine(text);
            this.MeasureRanking("Rang");
            this.MeasureClassificationNames("Klassifikation");
            this.MeasureCellWidth();

            List<string> headers = new List<string>();
            headers.Add("Rang");
            headers.Add("Klassifikation");
            headers.Add("Proben-ID");
            headers.Add("Signifikanz");
            headers.Add("Konfidenz");
            headers.Add("Korrelation");
            headers.Add("Abstand");
            headers.Add("Bewertung");

            this.CreateTableHeader(headers);
            this.CreateList();
        }

        protected override void CreateFooter ()
        {
            //copyright
            this.Document.XPosition = 0;
            this.Document.YPosition = this.Document.InnerPageHeight - 20;
            this.Document.SetFont(PdfFontTypes.HELVETICA, 8, PdfColors.Black);
            this.Document.AddFooter(PdfFooter.ShortVersion(Configurations.ReportCountryType.Switzerland));

            //date
            string date = Locale.LocalizedDate(DateTime.Now, this.Culture);
            this.Document.AddParagraph(date, PdfTextAlignments.Right);
        }
    }
}

