00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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