app_databox.h

Go to the documentation of this file.
00001 /* Gnome gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 1999 The Free Software Foundation
00006  *
00007  * Authors: Percy Zahl <zahl@fkp.uni-hannover.de>
00008  * additional features: Andreas Klust <klust@fkp.uni-hannover.de>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00023  */
00024 
00025 #ifndef APP_DATABOX__H
00026 #define APP_DATABOX__H
00027 
00028 #include <gtkdatabox.h>
00029 #include <iostream.h>
00030 #include <iomanip.h>
00031 
00032 #define NUMCHANNELS 8
00033 
00034 typedef float PLOTTYP;
00035 
00036 class DataBox{
00037 public:
00038   DataBox(gchar *title, gint ux=0, gint uy=0);
00039   DataBox(GtkWidget *vbox);
00040   virtual ~DataBox();
00041 
00042   void SetHeading(gchar *title, gchar *tx, gchar *ty);
00043   void Init();
00044 
00045   void setTyp( GtkDataboxDataType typ){ BoxType=typ; };
00046   void setWidth( gint w){ BoxWidth=w; };
00047   void removeData ();
00048   void setSetType ( gint idx, GtkDataboxDataType typ=(GtkDataboxDataType)(-1), gint dotsize=-1);
00049   void setSetColor ( gint idx, GdkColor color );
00050   void setxyData    (PLOTTYP *SetX, PLOTTYP *SetY, int n, int cpy=TRUE);
00051   void setxyData    (PLOTTYP *SetX, PLOTTYP *SetY[NUMCHANNELS], int n, int cpy=TRUE);
00052   void updatexyData (PLOTTYP *SetX, PLOTTYP *SetY);
00053   void updatexyData (PLOTTYP *SetX, PLOTTYP *SetY[NUMCHANNELS]);
00054   void GetVisible( GtkDataboxValue *vmin, GtkDataboxValue *vmax);
00055   void print(gchar *name);
00056   void load(gchar *name);
00057   virtual void checkheader(gchar *line){};
00058 
00059   void save(gchar *name);
00060 
00061   virtual void addheader(std::ofstream &out){};
00062   virtual int Xprec(){ return 6; };
00063   virtual int Yprec(int n){ return 6; };
00064 
00065   void cut();
00066   void copy();
00067   void paste();
00068 
00069   void rerun(){ if(CbId){ stop(); run(); } };
00070   void run();
00071   void stop();
00072   virtual gint atrun(){ return FALSE; };
00073   virtual void atstop(){};
00074   void draw(int autoskl=FALSE, GtkDataboxValue *vmin=NULL, GtkDataboxValue *vmax=NULL);
00075   virtual void getdata(){};
00076 
00077   static gint loop(DataBox *db);
00078   
00079   GtkWidget *vbox;
00080   double delay;
00081 
00082   GtkWidget *Screen;
00083 
00084 private:
00085   void make_copy();
00086 
00087   GtkWidget *hbox_t;
00088   GtkWidget *label_t;
00089   GtkWidget *label_x;
00090   GtkWidget *label_y;
00091   GtkWidget *Window;
00092   GtkDataboxDataType BoxType;
00093   gint BoxWidth;
00094   gint CbId, LoopActive;
00095   gint CpyMode;
00096 
00097   PLOTTYP *Xpoints, *Ypoints[NUMCHANNELS];
00098   int nPoints;
00099 
00100   PLOTTYP *CXpoints, *CYpoints[NUMCHANNELS];
00101   int CnPoints;
00102 
00103 };
00104 
00105 #endif

Generated on Sat Apr 1 09:04:11 2006 for GXSM by  doxygen 1.4.6