21 setWindowTitle( tr(
"Predict f and axial ratios for 4 basic shapes" ) );
24 QGridLayout*
main =
new QGridLayout(
this );
25 main->setSpacing ( 2 );
26 main->setContentsMargins ( 2, 2, 2, 2 );
30 QGridLayout* controls =
new QGridLayout;
33 QLabel* lb_density =
us_label( tr(
"Density (20w)" ) );
34 controls->addWidget( lb_density, c_row, 0 );
41 QLabel* lb_viscosity =
us_label( tr(
"Viscosity (20w)" ) );
42 controls->addWidget( lb_viscosity, c_row, 0 );
50 connect( pb_vbar, SIGNAL( clicked() ), SLOT(
get_peptide() ) );
51 controls->addWidget( pb_vbar, c_row, 0 );
55 connect(
le_vbar, SIGNAL( textChanged(
const QString& ) ),
56 SLOT (
vbar (
const QString& ) ) );
57 controls->addWidget(
le_vbar, c_row++, 1 );
59 QLabel* lb_temperature =
us_label( tr(
"Temperature (" ) +
DEGC +
"):" );
60 controls->addWidget( lb_temperature, c_row, 0 );
63 le_temperature->setText( QString::number(
NORMAL_TEMP,
'f', 1 ) );
65 controls->addWidget( le_temperature, c_row++, 1 );
67 QLabel* lb_info =
us_label( tr(
"Select a Parameter Combination:" ) );
68 controls->addWidget( lb_info, c_row++, 0, 1, 2 );
71 controls->addWidget(
lb_param1, c_row, 0 );
74 connect(
le_param1, SIGNAL( textChanged (
const QString& ) ),
76 controls->addWidget(
le_param1, c_row++, 1 );
79 controls->addWidget(
lb_param2, c_row, 0 );
82 connect(
le_param2, SIGNAL( textChanged (
const QString& ) ),
84 controls->addWidget(
le_param2, c_row++, 1 );
86 main->addLayout( controls, row, 0, 7, 1 );
89 QLabel* lb_model =
us_label( tr(
"Model:" ) );
90 main->addWidget( lb_model, row, 2 );
92 QLabel* lb_a =
us_label( tr(
"a (<span>Å</span>)" ) );
93 lb_a->setAlignment( Qt::AlignCenter );
94 main->addWidget( lb_a, row, 3 );
96 QLabel* lb_b =
us_label( tr(
"b (<span>Å</span>)" ) );
97 lb_b->setAlignment( Qt::AlignCenter );
98 main->addWidget( lb_b, row, 4 );
100 QLabel* lb_ab =
us_label( tr(
"a/b" ) );
101 lb_ab->setAlignment( Qt::AlignCenter );
102 main->addWidget( lb_ab, row++, 5 );
105 QLabel* lb_prolate =
us_label( tr(
"Prolate:" ) );
106 main->addWidget( lb_prolate, row, 2 );
122 QLabel* lb_oblate =
us_label( tr(
"Oblate:" ) );
123 main->addWidget( lb_oblate, row, 2 );
138 QLabel* lb_rod =
us_label( tr(
"Long Rod:" ) );
139 main->addWidget( lb_rod, row, 2 );
143 main->addWidget(
le_rod_a, row, 3 );
147 main->addWidget(
le_rod_b, row, 4 );
155 QLabel* lb_fCoef =
us_label( tr(
"Frict. Coefficient:" ) );
156 main->addWidget( lb_fCoef, row, 2 );
160 main->addWidget(
le_fCoef, row, 3 );
162 QLabel* lb_r0 =
us_label( tr(
"R0 (Sphere):" ) );
163 main->addWidget( lb_r0, row, 4 );
167 main->addWidget(
le_r0, row++, 5 );
176 QLabel* lb_f0 =
us_label( tr(
"f0 (Sphere):" ) );
177 main->addWidget( lb_f0, row, 4 );
181 main->addWidget(
le_f0, row++, 5 );
183 QLabel* lb_volume =
us_label( tr(
"Volume (Å<sup>3</sup>):" ) );
184 main->addWidget( lb_volume, row, 2 );
190 QLabel* lb_ff0 =
us_label( tr(
"f/f0:" ) );
191 main->addWidget( lb_ff0, row, 4 );
195 main->addWidget(
le_ff0, row++, 5 );
199 QGridLayout* buttons =
new QGridLayout;
203 tr(
"Molecular Weight + Sedimentation Coeff." ) );
205 buttons->addWidget(
pb_mw_s, b_row, 0 );
208 tr(
"Molecular Weight + Diffusion Coeff." ) );
210 buttons->addWidget(
pb_mw_d, b_row, 1 );
213 tr(
"Sedimentation Coeff. + Diffusion Coeff." ) );
214 connect(
pb_s_d, SIGNAL( clicked() ), SLOT(
do_s_d() ) );
215 buttons->addWidget(
pb_s_d, b_row++, 2 );
218 connect( pb_reset, SIGNAL( clicked() ), SLOT(
update() ) );
219 buttons->addWidget( pb_reset, b_row, 0 );
222 connect( pb_help, SIGNAL( clicked() ), SLOT(
help() ) );
223 buttons->addWidget( pb_help, b_row, 1 );
226 connect( pb_accept, SIGNAL( clicked() ), SLOT( close() ) );
227 buttons->addWidget( pb_accept, b_row++, 2 );
230 main->addLayout( buttons, row, 0, 1, 6 );
242 lb_param1->setText( tr(
"Molecular Weight:" ) );
243 lb_param2->setText( tr(
"Sed. Coefficient:" ) );
244 lb_param3->setText( tr(
"Diff. Coefficient:" ) );
250 p.setColor( QPalette::Button, Qt::darkGreen );
263 lb_param1->setText( tr(
"Molecular Weight:" ) );
264 lb_param2->setText( tr(
"Diff. Coefficient:" ) );
265 lb_param3->setText( tr(
"Sed. Coefficient:" ) );
271 p.setColor( QPalette::Button, Qt::darkGreen );
284 lb_param1->setText( tr(
"Sed. Coefficient:" ) );
285 lb_param2->setText( tr(
"Diff. Coefficient:" ) );
286 lb_param3->setText( tr(
"Molecular Weight:" ) );
292 p.setColor( QPalette::Button, Qt::darkGreen );
298 if (
le_param1->text().toDouble() == 0.0 ||
320 double vol_per_molecule;
323 double frict_coeff = 0.0;
334 if (
mw == 0.0 )
return;
350 if (
mw == 0.0 )
return;
377 le_param3->setText( QString::number(
mw,
'e', 4 ) );
381 rad_sphere = pow( vol_per_molecule * 0.75 / M_PI, 1.0 / 3.0 );
383 double ff0 = sc.
f_f0;
384 double r0 = rad_sphere * 1.0e+08;
385 f0 = frict_coeff / ff0;
393 vol_per_molecule = 4.0 * M_PI / 3.0 * pow( r0, 3.0 );
395 le_fCoef ->setText( QString::number( frict_coeff,
'e', 4 ) );
396 le_r0 ->setText( QString::number( r0,
'e', 4 ) );
397 le_f0 ->setText( QString::number( f0,
'e', 4 ) );
398 le_volume->setText( QString::number( vol_per_molecule,
'e', 4 ) );
399 le_ff0 ->setText( QString::number( ff0,
'f', 4 ) );
403 double ap = r0 * pow( ratio, 2.0 / 3.0 );
404 double bp = ap / ratio;
406 le_prolate_a ->setText( QString::number( ap,
'e', 4 ) );
407 le_prolate_b ->setText( QString::number( bp,
'e', 4 ) );
412 double bo = r0 / pow( ratio, 2.0 / 3.0 );
413 double ao = ratio * bo;
414 le_oblate_a ->setText( QString::number( ao,
'e', 4 ) );
415 le_oblate_b ->setText( QString::number( bo,
'e', 4 ) );
416 le_oblate_ab->setText( QString::number( ratio,
'e', 4 ) );
422 double br = r0 * pow( 2.0 / ( 3.0 * ratio ), 1.0 / 3.0 );
423 double ar = ratio * br;
424 le_rod_a ->setText( QString::number( ar,
'e', 4 ) );
425 le_rod_b ->setText( QString::number( br,
'e', 4 ) );
426 le_rod_ab->setText( QString::number( ratio,
'e', 4 ) );
430 le_rod_a ->setText(
"f/f0 < 1.32, n/a" );
431 le_rod_b ->setText(
"f/f0 < 1.32, n/a" );
432 le_rod_ab->setText(
"f/f0 < 1.32, n/a" );
467 le_ff0 ->setText( QString::number( f_f0,
'f', 4 ) +
" !!!!" );
496 test = goal - pow( x, -1.0 / 3.0 ) * sqrt(
sq( x ) - 1.0 ) /
497 log( x + sqrt(
sq( x ) - 1.0 ) );
515 xdiff = ( x2 - x1 ) / 2.0;
518 }
while ( fabs( xdiff / x ) > 1.0e-4 );
521 else if ( shape ==
OBLATE )
525 test = goal - sqrt(
sq( x ) - 1.0 ) /
526 ( pow( x, 2.0 / 3.0 ) * atan( sqrt(
sq( x ) - 1.0 ) ) );
541 xdiff = ( x2 - x1 ) / 2.0;
544 }
while ( fabs( xdiff / x ) > 1.0e-4 );
547 else if ( shape ==
ROD )
554 test = goal - pow( 2.0 / 3.0, 1.0 / 3.0 ) * pow( x, 2.0 / 3.0 ) /
555 ( log( 2.0 * x ) - 0.3 );
573 xdiff = ( x2 - x1 ) / 2.0;
576 }
while ( fabs( xdiff / x ) > 1.0e-4 );
632 QMessageBox::information(
this,
634 tr(
"Select a parameter combination and define\n"
635 "those parameters first.") );
640 connect( buffer_dialog, SIGNAL( valueChanged (
double,
double ) ),
642 buffer_dialog->setWindowTitle( tr(
"Buffer Calculation" ) );
643 buffer_dialog->exec();
651 le_density ->setText( QString::number( density,
'f', 4 ) );
652 le_viscosity->setText( QString::number( viscosity,
'f', 4 ) );
663 QMessageBox::information(
this,
665 tr(
"Select a parameter combination and define\n"
666 "those parameters first.") );
672 connect( dialog, SIGNAL( valueChanged(
US_Analyte ) ),
674 dialog->setWindowTitle( tr(
"VBar Calculation" ) );
691 QMessageBox::information(
this,
693 tr(
"Select a parameter combination and define\n"
694 "those parameters first.") );
699 connect( dialog, SIGNAL( updateSolutionGuiSelection(
US_Solution ) ),
701 dialog->setWindowTitle( tr(
"VBar Calculation" ) );
717 QMessageBox::warning(
this,
719 tr(
"There is no analyte in the solution" ) );
731 connect( dialog, SIGNAL( choice(
int ) ),
734 qApp->processEvents();
743 le_param1->setText( QString::number( analyte.
mw,
'e', 4 ) );