// Copyright 2003 Regents of the University of California

// SETI_BOINC 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, or (at your option) any later
// version.

// SETI_BOINC 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 SETI_BOINC; see the file COPYING.  If not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

// In addition, as a special exception, the Regents of the University of
// California give permission to link the code of this program with libraries
// that provide specific optimized fast Fourier transform (FFT) functions and
// distribute a linked executable.  You must obey the GNU General Public
// License in all respects for all of the code used other than the FFT library
// itself.  Any modification required to support these libraries must be
// distributed in source code form.  If you modify this file, you may extend
// this exception to your version of the file, but you are not obligated to
// do so. If you do not wish to do so, delete this exception statement from
// your version.

// $Id: gdata.h,v 1.3 2007/04/04 16:55:37 korpela Exp $

// AP_GDATA is a collection of information generated by the worker thread
// that might be useful for graphics.
// It does not contain any user preference info,
// or anything related to a particular style of graphics.

#ifndef _AP_GDATA_
#define _AP_GDATA_

#include "ap_version.h"
#include "reduce.h"


// Power of time array sizes for graphics routines only.
// I don't think these are needed for astropulse, only SETI?
#define GAUSS_POT_LEN   64
#define PULSE_POT_LEN   256
#define TRIPLET_POT_LEN 256


// AP_GDATA represents the totality of data needed to draw the display.
// edit: except for the reduced array (power) and time_series information?

struct AP_GDATA {
  AP_GDATA();
  bool ready;
  int version_major;
  int version_minor;

  Astropulse::state_t state;

// sah's gdata.h has an additional variable called simply "progress"
  double local_progress;
  double cpu_time;

  char status[80];

};

// gmajor_version and gminor_version are declared in version.h
inline AP_GDATA::AP_GDATA() :
    version_major(gmajor_version),
    version_minor(gminor_version),
local_progress(0) {
  memset(status,0,sizeof(status));
}

// AP_SHMEM is the shared-memory structure

struct AP_SHMEM {
	AP_GDATA ap_gdata;
	Astropulse::time_series_f_t time_series_shmem;
	REDUCED_ARRAY_DATA rarray_data;
};

#endif

