11 #include "qwt_legend.h"
19 base_analyte( a_data ),
20 access ( disk_access ),
21 signal ( signal_wanted )
36 for (
int i = 0; i <
ARRAYSIZE; i++, x += 0.1 )
38 prolate[ i ] = pow( x, -1.0 / 3.0 ) * sqrt(
sq( x ) - 1.0 ) /
39 log( x + sqrt(
sq( x ) - 1.0 ) );
41 oblate[ i ] = sqrt(
sq( x ) - 1.0 ) /
42 ( pow( x, 2.0 / 3.0 ) * atan( sqrt(
sq( x ) - 1.0 ) ) );
44 rod[ i ] = pow( 2.0 / 3.0, 1.0 / 3.0 ) * pow( x, 2.0 / 3.0 ) /
45 ( log( 2.0 * x ) - 0.3 );
50 setWindowTitle( tr(
"Modeling s, D, and f from MW for 4 basic shapes" ) );
55 gray.setColor( QPalette::Base, QColor( 0xe0, 0xe0, 0xe0 ) );
57 QBoxLayout*
main =
new QVBoxLayout(
this );
58 main->setSpacing ( 2 );
59 main->setContentsMargins ( 2, 2, 2, 2 );
61 QBoxLayout* top =
new QHBoxLayout;
63 QGridLayout* controls =
new QGridLayout;
66 QPushButton* pb_solution =
us_pushbutton( tr(
"Select Solution" ) );
67 connect( pb_solution, SIGNAL( clicked() ), SLOT(
get_solution() ) );
68 controls->addWidget( pb_solution, c_row++, 0, 1, 2 );
73 QLabel* lb_density =
us_label( tr(
"Density" ) );
74 controls->addWidget( lb_density, c_row, 0 );
82 QLabel* lb_viscosity =
us_label( tr(
"Viscosity" ) );
83 controls->addWidget( lb_viscosity, c_row, 0 );
94 connect( pb_density, SIGNAL( clicked() ), SLOT(
get_buffer() ) );
95 controls->addWidget( pb_density, c_row, 0 );
99 connect(
le_density, SIGNAL( textChanged(
const QString& ) ),
100 SLOT (
density (
const QString& ) ) );
101 controls->addWidget(
le_density, c_row++, 1 );
103 QPushButton* pb_viscosity =
us_pushbutton( tr(
"Viscosity" ) );
104 connect( pb_viscosity, SIGNAL( clicked() ), SLOT(
get_buffer() ) );
105 controls->addWidget( pb_viscosity, c_row, 0 );
109 connect(
le_viscosity, SIGNAL( textChanged(
const QString& ) ),
115 connect( pb_vbar, SIGNAL( clicked() ), SLOT(
get_peptide() ) );
116 controls->addWidget( pb_vbar, c_row, 0 );
120 connect(
le_vbar, SIGNAL( textChanged(
const QString& ) ),
121 SLOT (
vbar (
const QString& ) ) );
122 controls->addWidget(
le_vbar, c_row++, 1 );
124 QLabel* lb_mw =
us_label( tr(
"Molecular Weight:" ) );
125 controls->addWidget( lb_mw, c_row, 0 );
128 le_mw->setText( QString::number(
mw,
'e', 3 ) );
129 connect(
le_mw, SIGNAL( textChanged(
const QString& ) ),
131 controls->addWidget(
le_mw, c_row++, 1 );
134 tr(
"Temperature (" ) +
DEGC + tr(
"):" ) );
135 controls->addWidget( lb_temperature, c_row, 0 );
138 le_temperature->setText( QString::number(
temperature,
'f', 1 ) );
142 le_temperature->setReadOnly(
true );
143 le_temperature->setPalette( gray );
147 connect( le_temperature, SIGNAL( textChanged(
const QString& ) ),
148 SLOT (
degC (
const QString& ) ) );
150 controls->addWidget( le_temperature, c_row++, 1 );
153 QLabel* lb_axial =
us_label( tr(
"Axial Ratio:" ) );
154 controls->addWidget( lb_axial, c_row, 0 );
158 connect(
le_axial, SIGNAL( editingFinished(
void ) ),
160 controls->addWidget(
le_axial, c_row++, 1 );
166 tr(
"Please select an axial ratio by\n"
167 "dragging the white bar with the\n"
168 "mouse to change the axial ratio" ) );
170 controls->addWidget(
lb_info, c_row, 0, 3, 2 );
174 QBoxLayout* buttons =
new QHBoxLayout;
177 connect( pb_help, SIGNAL( clicked() ), SLOT(
help() ) );
178 buttons->addWidget( pb_help );
181 connect( pb_close, SIGNAL( clicked() ), SLOT( close() ) );
182 buttons->addWidget( pb_close );
185 connect( pb_accept, SIGNAL( clicked() ), SLOT(
complete() ) );
186 buttons->addWidget( pb_accept );
188 controls->addLayout( buttons, c_row++, 0, 1, 2 );
190 top->addLayout ( controls );
194 tr(
"f/f0 Dependence on Axial Ratios" ),
198 plot->setAxisScale(QwtPlot::xBottom, 0.0, 100.0 );
199 plot->setAxisScale(QwtPlot::yLeft , 1.0, 4.5 );
200 plot->setMinimumSize( 650, 350 );
204 pick->setRubberBand( QwtPicker::VLineRubberBand );
205 connect(
pick, SIGNAL( moved (
const QwtDoublePoint& ) ),
206 SLOT (
new_value(
const QwtDoublePoint& ) ) );
207 connect(
pick, SIGNAL( mouseDown(
const QwtDoublePoint& ) ),
208 SLOT (
new_value(
const QwtDoublePoint& ) ) );
209 connect(
pick, SIGNAL( mouseUp (
const QwtDoublePoint& ) ),
210 SLOT (
mouseU (
const QwtDoublePoint& ) ) );
213 grid->attach(
plot );
216 prolate_curve->setPen ( QPen( QBrush( Qt::magenta ), 2.0 ) );
220 oblate_curve ->setPen ( QPen( QBrush( Qt::yellow ), 2.0 ) );
224 rod_curve->setPen( QPen( QBrush( Qt::cyan ), 2.0 ) );
233 vline_curve->setPen ( QPen( QBrush( Qt::white ), 1.5 ) );
236 QwtLegend* legend =
new QwtLegend();
237 plot->insertLegend( legend, QwtPlot::BottomLegend, 0.1 );
240 main->addLayout( top );
242 QGridLayout* values =
new QGridLayout;
246 titles[ 0 ] =
us_label( tr(
"Model:" ) );
247 titles[ 1 ] =
us_label(
"s (sec)" );
248 titles[ 2 ] =
us_label(
"D (cm<sup>2</sup>/sec)" );
251 titles[ 5 ] =
us_label(
"a (<span>Å</span>)" );
252 titles[ 6 ] =
us_label(
"b (<span>Å</span>)" );
253 titles[ 7 ] =
us_label( tr(
"Volume " ) +
"(Å<sup>3</sup>)" );
257 for (
int i = 0; i < 8; i++ )
259 titles[ i ]->setAlignment( Qt::AlignCenter );
260 values->addWidget( titles[ i ], row, i );
270 for (
int i = 0; i < 8; i++ )
282 lb_rod [ i ]->setPalette( p );
285 lb_sphere [ i ]->setAlignment( Qt::AlignCenter );
286 lb_prolate[ i ]->setAlignment( Qt::AlignCenter );
287 lb_oblate [ i ]->setAlignment( Qt::AlignCenter );
288 lb_rod [ i ]->setAlignment( Qt::AlignCenter );
290 values->addWidget(
lb_sphere [ i ], row , i );
291 values->addWidget(
lb_prolate[ i ], row + 1, i );
292 values->addWidget(
lb_oblate [ i ], row + 2, i );
293 values->addWidget(
lb_rod [ i ], row + 3, i );
296 main->addLayout( values );
312 QwtDoublePoint
p(
le_axial->text().toDouble(), 0.0 );
336 connect( dialog, SIGNAL( valueChanged(
US_Analyte ) ),
339 connect( dialog, SIGNAL(
use_db (
bool ) ),
350 le_mw ->setText( QString::number( (
int)
mw,
'e', 3 ) );
363 connect( dialog, SIGNAL( valueChanged (
US_Buffer ) ),
366 connect( dialog, SIGNAL(
use_db (
bool ) ),
413 connect(
le_axial, SIGNAL( editingFinished(
void ) ),
426 msg = tr(
"Attention:\n\n"
427 "The lower axial ratio limit is 1.1!" );
431 else if ( ratio < 6.0 && ratio >= 1.1 )
432 msg = tr(
"Attention:\n\n"
433 "The rod model is unreliable\n"
434 "for axial ratios less than 6.0" );
437 msg = tr(
"Please select an axial ratio by\n"
438 "dragging the white bar with the\n"
439 "mouse to change the axial ratio" );
441 else if (
ratio > 100 )
443 msg = tr(
"Attention:\n\n"
444 "The upper axial ratio limit is 100!" );
459 connect(
le_axial, SIGNAL( editingFinished(
void ) ),
513 qApp->processEvents();
565 connect( dialog, SIGNAL( updateSolutionGuiSelection(
US_Solution ) ),
567 dialog->setWindowTitle( tr(
"Solutions" ) );
583 QMessageBox::warning(
this,
585 tr(
"There is no analyte in the solution" ) );
596 le_mw->setText( QString::number(
mw,
'e', 4 ) );
601 connect( dialog, SIGNAL( choice(
int ) ),
604 qApp->processEvents();
612 le_mw->setText( QString::number(
mw,
'e', 4 ) );