QlightRead package | ESS final project 1.22-beta
|
00001 00044 #include "dataplot.h" 00045 00057 CurveData::CurveData( int size ) 00058 { 00059 dc_x.resize( size ); 00060 dc_y.resize( size ); 00061 da_x.resize( size ); 00062 da_y.resize( size ); 00063 for (int i = 0; i< size; i++) 00064 { 00065 da_x[i] = 0.5 * i; // time axis 00066 da_y[i] = 0; 00067 dc_x[i] = 0.5 * i; // time axis 00068 dc_y[i] = 0; 00069 } 00070 } 00071 00072 00083 const double *CurveData::xa() const 00084 { 00085 return da_x.data(); 00086 } 00087 00098 const double *CurveData::ya() const 00099 { 00100 return da_y.data(); 00101 } 00102 00113 const double *CurveData::xc() const 00114 { 00115 return dc_x.data(); 00116 } 00117 00128 const double *CurveData::yc() const 00129 { 00130 return dc_y.data(); 00131 } 00132 00133 00144 DataPlot::DataPlot( QWidget* parent ): QwtPlot( parent ) 00145 { 00146 // Create curve 00147 curve_a = new QwtPlotCurve(); 00148 curve_a->setStyle(QwtPlotCurve::Lines); 00149 curve_a->setPen(QPen(Qt::blue)); 00150 curve_a->attach( this ); 00151 curve_c = new QwtPlotCurve(); 00152 curve_c->setPen(QPen(Qt::red)); 00153 curve_c->setStyle(QwtPlotCurve::Lines); 00154 curve_c->attach( this ); 00155 }