// Tester.cs created with MonoDevelop
// User: klose at 16:44 17.04.2009
// CVS release: $Id: Tester.cs,v 1.3 2009-07-31 11:10:44 klose Exp $
//
//    QuickStep: Acquire, view and identify spectra 
//    Copyright (C) 2009  Thomas Klose, 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.Threading;

using Hiperscan.Spectroscopy;


namespace Hiperscan.GUI
{
	
	
	public class Tester
	{
		
		public static void DoGenerateSpectra(object o)
		{
			//UserInterface ui = o as UserInterface;
			
			Random rand = new Random();
			
			for (;;)
			{
				List<double> x = new List<double>();
				List<double> y = new List<double>();
				
				double a = (double)rand.Next(1, 10);
				
				for (int ix=1000; ix <= 1900; ++ix)
				{
					x.Add((double)ix);
					y.Add(a*Math.Sin((double)ix/10f));
				}
				
				DataSet ds = new DataSet(x, y);
				Spectrum spectrum = new Spectrum(ds, WavelengthLimits.DefaultWavelengthLimits);
				spectrum.Id = "test";
				spectrum.Label = "Test spectrum";
				
				UserInterface.Queues.SpectrumQueue.Enqueue(spectrum);

				Thread.Sleep(500);
			}
		}
	}
}
