15 QVector< EqScanFit >& scanfits,
19 od_limit ( od_limit ),
22 setAttribute ( Qt::WA_DeleteOnClose );
26 QVBoxLayout*
main =
new QVBoxLayout(
this );
27 main->setContentsMargins( 2, 2, 2, 2 );
28 main->setSpacing ( 2 );
31 double min_extinc = 1.0e28;
32 double max_extinc = -1.0;
33 bool first_scan =
true;
34 bool multi_lamd =
false;
35 bool ext_define =
false;
36 bool plot_conc =
false;
39 for (
int ii = 0; ii < scanfits.size(); ii++ )
41 if ( ! scanfits[ ii ].scanFit )
continue;
43 int lambda = scanfits[ ii ].wavelen;
44 double extincv = scanfits[ ii ].extincts[ 0 ];
52 else if ( first_lamd != lambda )
58 min_extinc =
min( min_extinc, extincv );
59 max_extinc =
max( max_extinc, extincv );
70 msgstr = tr(
"You appear to be fitting multiple wavelengths\n"
71 "for which different extinction coefficients are\n"
72 "available. Would you like to correct the optical\n"
73 "density profile for extinction, and display real\n"
74 "concentations?\n\n" );
79 msgstr = tr(
"You have extinction coefficients defined for\n"
80 "your scans. Would you like to correct the optical\n"
81 "density profile for extinction, and display real\n"
82 "concentations?\n\n" );
85 msgstr += tr(
"NOTE: This program only corrects for the 1st component." );
88 msgBox.setWindowTitle(
"Display Concentrations?" );
89 msgBox.setText( msgstr );
90 msgBox.setStandardButtons( QMessageBox::Yes | QMessageBox::No );
92 if ( msgBox.exec() == QMessageBox::Yes )
102 double tmp_od_lim = ( od_limit == 0.0 ) ? 1.0 : od_limit;
103 double bin_low = 0.01 / ( 1.2 * max_extinc );
104 double bin_high = tmp_od_lim / ( 1.2 * min_extinc );
106 double x_valu = tmp_od_lim * x_incr;
111 x_incr *= ( bin_high - bin_low );
121 xplot[ jj ] = x_valu;
126 for (
int ii = 0; ii < scanfits.size(); ii++ )
130 if ( ! scnf->
scanFit )
continue;
134 int stopn = stopx + 1;
135 double scl_ext = plot_conc ?
137 double xpres = xplot[ 0 ] - x_incr;
139 int nx=scnf->
xvs.size();
140 qDebug() <<
"UH: ii" << ii <<
" strt,stop,nx" << strtx << stopx << nx
141 <<
" t_odlim scex" << tmp_od_lim << scl_ext <<
" yvs,e"
142 << scnf->
yvs[strtx] << scnf->
yvs[stopx];
148 xpres =
min( xpres, tmp_od_lim );
150 for (
int kk = strtx; kk < stopn; kk++ )
152 double xtest = scnf->
yvs[ kk ] * scl_ext;
154 if ( xtest > xlast && xtest <= xpres )
157 if ( jj < 3 || (jj+4) > ARRAY_SIZE )
158 qDebug() <<
"UH: jj" << jj <<
" xp" << xpres <<
" yplot[jj]" << yplot[jj];
163 QString odtype = tr(
"Optical Density" );
164 QString mctype = tr(
"Molar Concentration" );
165 QString htitle = odtype + tr(
" Histogram" );
166 QString hxaxis = odtype + tr(
" Bin" );
167 QString hyaxis = tr(
"Frequency" );
168 QString wtitle = tr(
"GlobalEquil " ) + htitle;
173 htitle.replace( odtype, mctype );
174 hxaxis.replace( odtype, mctype );
175 wtitle.replace( odtype, mctype );
178 qDebug() <<
"UH: wtitle" << wtitle;
179 setWindowTitle( wtitle );
184 grid->enableYMin(
true );
185 grid->enableY (
true );
188 hist_plot->setAxisScale( QwtPlot::xBottom, 0.0, 1.0 );
189 hist_plot->setAxisAutoScale( QwtPlot::yLeft );
193 hcurve->setPen( QPen( QBrush( Qt::red ), 6.0 ) );
194 hcurve->setStyle( QwtPlotCurve::Sticks );
195 qDebug() <<
"UH: x0 x1 xm xn" << xplot[0] << xplot[1] << xplot[48] << xplot[49];
196 qDebug() <<
"UH: y0 y1 ym yn" << yplot[0] << yplot[1] << yplot[48] << yplot[49];
197 hcurve->setData( xplot, yplot, points );
201 pcurve->setStyle( QwtPlotCurve::NoCurve );
203 sym.setStyle( QwtSymbol::Ellipse );
204 sym.setPen ( QPen( Qt::blue ) );
205 sym.setBrush( QBrush( Qt::yellow ) );
207 pcurve->setSymbol( sym );
208 pcurve->setData( xplot, yplot, points );
213 main->addLayout(
hplot );