00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef COMPLEX1D_H
00019 #define COMPLEX1D_H
00020
00021 #include <qgroupbox.h>
00022
00023 #include "odinqt.h"
00024
00025 #define SYMBOL_MAX_NUMOF_POINTS 20
00026
00027 class GuiPlot;
00028
00029 class DetachedComplexfloatBox1D;
00030
00034 class complexfloatBox1D : public QGroupBox {
00035 Q_OBJECT
00036
00037 public:
00038 complexfloatBox1D(const float *data1, const float *data2, int n,QWidget *parent, const char *name, bool fixed_size, const char *xAxisLabel=0, const char *yAxisLabelLeft=0, const char *yAxisLabelRight=0, float min_x=0.0, float max_x=0.0, bool detachable=false);
00039 complexfloatBox1D(const double *data1,const double *data2,int n,QWidget *parent, const char *name, bool fixed_size, const char *xAxisLabel=0, const char *yAxisLabelLeft=0, const char *yAxisLabelRight=0, float min_x=0.0, float max_x=0.0, bool detachable=false);
00040 ~complexfloatBox1D();
00041
00042
00043 public slots:
00044 void refresh(const float *data1,const float *data2,int n, float min_x, float max_x);
00045 void refresh(const float *data1,const float *data2,int n) {refresh(data1,data2,n,0.0,0.0);}
00046
00047 void refresh(const double *data1,const double *data2,int n, float min_x, float max_x);
00048 void refresh(const double *data1,const double *data2,int n) {refresh(data1,data2,n,0.0,0.0);}
00049
00050
00051
00052 private slots:
00053 void autoscale();
00054 void detach();
00055
00056 void mousePressedInPlot(const QMouseEvent& qme);
00057 void mouseReleasedInPlot(const QMouseEvent& qme);
00058
00059
00060 private:
00061 void common_init(const char *name, bool fixed_size, bool data1, bool data2, const char *xAxisLabel, const char *yAxisLabelLeft, const char *yAxisLabelRight, bool detachable);
00062
00063 void create_x_cache(float min_x, float max_x, int n);
00064
00065
00066 long curveid1;
00067 long curveid2;
00068
00069 dvector data1_cache;
00070 dvector data2_cache;
00071 dvector x_cache;
00072 const double* data1_ptr;
00073 const double* data2_ptr;
00074
00075
00076 STD_string name_cache;
00077 STD_string xAxisLabel_cache;
00078 STD_string yAxisLabelLeft_cache;
00079 STD_string yAxisLabelRight_cache;
00080 float min_x_cache;
00081 float max_x_cache;
00082 int n_cache;
00083 bool detachable_cache;
00084
00085
00086 GuiGridLayout *grid;
00087 GuiPlot* plotter;
00088
00089 int x_pressed,y_pressed;
00090
00091 DetachedComplexfloatBox1D* detached;
00092 };
00093
00094
00096
00097
00098 class DetachedComplexfloatBox1D : public GuiDialog {
00099
00100 public:
00101 DetachedComplexfloatBox1D(const double *data1,const double *data2,int n,complexfloatBox1D *parent, const char *name, bool fixed_size, const char *xAxisLabel, const char *yAxisLabelLeft, const char *yAxisLabelRight, float min_x, float max_x);
00102
00103 ~DetachedComplexfloatBox1D();
00104
00105 void refresh(const double *data1,const double *data2,int n, float min_x, float max_x);
00106
00107 private:
00108 void create_grid();
00109
00110 GuiGridLayout *grid;
00111 complexfloatBox1D* cfb;
00112
00113 };
00114
00115 #endif