/***************************************************************************
 *   Copyright (C) 2005 by Armando Navarro-Vazquez                         *
 *   armando@linux                                                         *
 *                                                                         *
 *   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 2 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, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef NMRSPECTRUM_H
#define NMRSPECTRUM_H

#include <spectrum.h>

/**
A class for management of 1D NMR Spectra

@author Armando Navarro-Vazquez
*/
class NMRSpectrum : public Spectrum
{
public:
  enum datatype { FID, SPECTRUM };
  enum frequencyunit { HZ, PPM };
  enum vendor { UNKNOWN, BRUKER, VARIAN };
public:
    NMRSpectrum();

    ~NMRSpectrum();
  void SetField(float field) { m_field=field; }
  float Field() const { return m_field; }
  bool IsSequential() const { return m_bsequential; }
  void SetSequential(bool bseq) { m_bsequential=bseq; }
   /** convert point to ppm*/
  float PointToXUnits(size_t point) const;
  virtual void GetLimits(float& min,float& max);
  /** Return the type of data as FID or spectrum*/
  datatype DataType() const { return m_type; } 
  /** Set the data as FID or Spectrum*/
  void SetDataType(datatype t); 
  /** Return the vendor*/
  vendor Vendor() const { return m_vendor; }
  /** Set the vendor company*/
  void SetVendor(vendor v) { m_vendor=v; }

  QString Info(const QRect& rect, const QPoint& pos) const;
private:
  float m_field;
  bool m_bsequential;
  datatype m_type;
  vendor m_vendor;
  frequencyunit m_frequencyunits;
};

#endif
