12 const QVector< double >& data,
13 const QVector< double >& scan )
16 setWindowTitle( tr(
"Details for Average Intensity Values" ) );
18 setAttribute( Qt::WA_DeleteOnClose );
20 QGridLayout*
main =
new QGridLayout(
this );
21 main->setSpacing ( 2 );
22 main->setContentsMargins( 2, 2, 2, 2 );
28 tr(
"Intensity Profile" ),
35 grid->enableXMin(
false );
37 main->addLayout( plot, row, 0, 5, 6 );
40 QHBoxLayout* buttons =
new QHBoxLayout();
43 pb_close->setFixedWidth( 100 );
44 connect( pb_close, SIGNAL( clicked() ), SLOT( close() ) );
45 buttons->insertStretch( 0, 10 );
46 buttons->addWidget( pb_close );
48 main->addLayout( buttons, row++, 2, 1, 4 );
51 if ( triple.contains(
"-" ) )
53 data_plot->setTitle( tr(
"Intensity Profile\n"
56 data_plot->setAxisTitle( QwtPlot::xBottom,
57 tr(
"Wavelength.Scan Number" ) );
64 if ( ! QDir( dir ).exists() )
67 QString filename = dir +
"/cnvt." + ctriple +
".intensity.svgz";
71 qDebug() << filename <<
"plot not saved";
76 const QVector< double >& scanNbrs )
79 QwtText axisTitle =
data_plot->axisTitle( QwtPlot::yLeft );
81 int szdata = scanData.size();
82 double xmin = qFloor( scanNbrs[ 0 ] );
83 double xmax = qFloor( scanNbrs[ szdata - 1 ] ) + 1.0;
84 data_plot->setAxisAutoScale( QwtPlot::yLeft );
85 data_plot->setAxisScale ( QwtPlot::xBottom, xmin, xmax );
86 data_plot->setAxisMaxMinor ( QwtPlot::xBottom, 0 );
87 data_plot->setAxisTitle ( QwtPlot::yLeft,
"Intensity" );
91 sym.setStyle( QwtSymbol::Ellipse );
92 sym.setPen ( QPen( Qt::yellow ) );
93 sym.setBrush( Qt::white );
97 QVector< double > xvec( szdata );
98 QVector< double > yvec( szdata );
99 double* xx = xvec.data();
100 double* yy = yvec.data();
102 for (
int ii = 0; ii < szdata; ii++ )
104 xx[ ii ] = scanNbrs[ ii ];
105 yy[ ii ] = scanData[ ii ];
107 qDebug() <<
"Ints:dr_pl: xx0 xxn" << xx[0] << xx[scanData.size()-1];
110 c1->setPen ( QPen( QBrush( Qt::yellow ), 2 ) );
111 c1->setSymbol( sym );
112 c1->setData ( xx, yy, szdata );