14 #define DbgLv(a) if(dbg_level>=a)qDebug()
17 const QString
notapl = QObject::tr(
"" );
23 setWindowTitle (
"Discrete Model GA Constraints Editor" );
25 setWindowModality( Qt::WindowModal );
39 QGridLayout*
main =
new QGridLayout(
this );
40 main->setSpacing( 2 );
41 main->setContentsMargins( 2, 2, 2, 2 );
44 QLabel* lb_comps =
us_banner( tr(
"Components" ) );
48 QLabel* lb_attr =
us_label( tr(
"Attribute" ) );
49 QLabel* lb_avalue =
us_label( tr(
"Value" ) );
50 QLabel* lb_alow =
us_label( tr(
"Low" ) );
51 QLabel* lb_ahigh =
us_label( tr(
"High" ) );
52 QLabel* lb_float =
us_label( tr(
"Float?" ) );
53 QLabel* lb_locsc =
us_label( tr(
"LogSc?" ) );
60 tr(
"Molecular Wt. (mw)" ),
ck_sel_mw,
true );
62 tr(
"Frictional Ratio (f/f0)" ),
ck_sel_ff0,
true );
64 tr(
"Sedimentation Coeff. (s)" ),
ck_sel_s );
66 tr(
"Diffusion Coeff. (D)" ),
ck_sel_D );
68 tr(
"Frictional Coeff. (f)" ),
ck_sel_f );
78 DbgLv(1) <<
"cnG:main: hds,lbs defined";
102 DbgLv(1) <<
"cnG:main: le_vals defined";
109 ck_flt_s =
new QCheckBox(
"",
this );
110 ck_flt_D =
new QCheckBox(
"",
this );
111 ck_flt_f =
new QCheckBox(
"",
this );
129 DbgLv(1) <<
"cnG:main: flt/log defined";
132 tr(
"Extinction (OD/(cm*mol)):" ) );
134 tr(
"Wavelength (nm):" ) );
138 le_wavelength->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred );
141 QLabel* lb_oligomer =
us_label( tr(
"Oligomer" ) );
151 tr(
"Concentration Dependency of s (<span>σ</span>):" ) );
154 tr(
"Concentration Dependency of D (<span>δ</span>):" ) );
158 tr(
"Co-sedimenting Solute" ),
ck_co_sed );
161 tr(
"Re-compute unselected component attribute values" ) );
164 QLabel* lb_assocs =
us_banner( tr(
"Associations (reactions)" ) );
168 QLabel* lb_attra =
us_label( tr(
"Attribute" ) );
169 QLabel* lb_avala =
us_label( tr(
"Value" ) );
170 QLabel* lb_alowa =
us_label( tr(
"Low" ) );
171 QLabel* lb_ahigha =
us_label( tr(
"High" ) );
172 QLabel* lb_floata =
us_label( tr(
"Float?" ) );
173 QLabel* lb_logsca =
us_label( tr(
"LogSc?" ) );
194 DbgLv(1) <<
"cnG:main: assocs defined";
199 DbgLv(1) <<
"cnG:main: elements defined";
202 main->addWidget( lb_comps, row++, 0, 1, 12 );
203 main->addWidget(
lw_comps, row, 0, 3, 12 ); row += 3;
204 main->addWidget( lb_attr, row, 0, 1, 4 );
205 main->addWidget( lb_avalue, row, 4, 1, 2 );
206 main->addWidget( lb_alow, row, 6, 1, 2 );
207 main->addWidget( lb_ahigh, row, 8, 1, 2 );
208 main->addWidget( lb_float, row, 10, 1, 1 );
209 main->addWidget( lb_locsc, row++, 11, 1, 1 );
210 main->addLayout( lo_vbar, row, 0, 1, 4 );
215 main->addLayout( lo_mw, row, 0, 1, 4 );
216 main->addWidget(
le_val_mw, row, 4, 1, 2 );
217 main->addWidget(
le_min_mw, row, 6, 1, 2 );
218 main->addWidget(
le_max_mw, row, 8, 1, 2 );
219 main->addWidget(
ck_flt_mw, row, 10, 1, 1 );
220 main->addWidget(
ck_log_mw, row++, 11, 1, 1 );
221 main->addLayout( lo_ff0, row, 0, 1, 4 );
225 main->addWidget(
ck_flt_ff0, row++, 10, 1, 1 );
226 main->addLayout( lo_s, row, 0, 1, 4 );
227 main->addWidget(
le_val_s, row, 4, 1, 2 );
228 main->addWidget(
le_min_s, row, 6, 1, 2 );
229 main->addWidget(
le_max_s, row, 8, 1, 2 );
230 main->addWidget(
ck_flt_s, row++, 10, 1, 1 );
231 main->addLayout( lo_D, row, 0, 1, 4 );
232 main->addWidget(
le_val_D, row, 4, 1, 2 );
233 main->addWidget(
le_min_D, row, 6, 1, 2 );
234 main->addWidget(
le_max_D, row, 8, 1, 2 );
235 main->addWidget(
ck_flt_D, row++, 10, 1, 1 );
236 main->addLayout( lo_f, row, 0, 1, 4 );
237 main->addWidget(
le_val_f, row, 4, 1, 2 );
238 main->addWidget(
le_min_f, row, 6, 1, 2 );
239 main->addWidget(
le_max_f, row, 8, 1, 2 );
240 main->addWidget(
ck_flt_f, row++, 10, 1, 1 );
241 main->addLayout( lo_conc, row, 0, 1, 4 );
246 main->addWidget( lb_extinction, row, 0, 1, 4 );
248 main->addWidget( lb_wavelength, row, 6, 1, 4 );
250 main->addWidget( lb_oligomer, row, 0, 1, 4 );
252 main->addLayout( isreac_layout, row, 6, 1, 3 );
253 main->addLayout( isprod_layout, row++, 9, 1, 3 );
254 main->addWidget( lb_sigma, row, 0, 1, 6 );
255 main->addWidget(
le_sigma, row, 6, 1, 2 );
256 main->addLayout( co_sed_layout, row++, 8, 1, 4 );
257 main->addWidget( lb_delta, row, 0, 1, 6 );
258 main->addWidget(
le_delta, row, 6, 1, 2 );
259 main->addWidget(
pb_load_c0, row++, 8, 1, 4 );
260 main->addWidget( pb_recompute, row++, 0, 1, 12 );
261 main->addWidget( lb_assocs, row++, 0, 1, 12 );
262 main->addWidget(
lw_assocs, row, 0, 2, 12 ); row += 2;
263 main->addWidget( lb_attra, row, 0, 1, 4 );
264 main->addWidget( lb_avala, row, 4, 1, 2 );
265 main->addWidget( lb_alowa, row, 6, 1, 2 );
266 main->addWidget( lb_ahigha, row, 8, 1, 2 );
267 main->addWidget( lb_floata, row, 10, 1, 1 );
268 main->addWidget( lb_logsca, row++, 11, 1, 1 );
269 main->addWidget(
le_lbl_kd, row, 0, 1, 4 );
270 main->addWidget(
le_val_kd, row, 4, 1, 2 );
271 main->addWidget(
le_min_kd, row, 6, 1, 2 );
272 main->addWidget(
le_max_kd, row, 8, 1, 2 );
273 main->addWidget(
ck_flt_kd, row, 10, 1, 1 );
274 main->addWidget(
ck_log_kd, row++, 11, 1, 1 );
281 main->addWidget( pb_help, row, 0, 1, 4 );
282 main->addWidget( pb_close, row, 4, 1, 4 );
283 main->addWidget(
pb_accept, row++, 8, 1, 4 );
289 connect(
ck_co_sed, SIGNAL( stateChanged(
int ) ),
290 SLOT (
co_sed (
int ) ) );
291 connect( pb_recompute, SIGNAL( clicked () ),
293 connect( pb_help, SIGNAL( clicked () ),
295 connect( pb_close, SIGNAL( clicked () ),
297 connect(
pb_accept, SIGNAL( clicked () ),
300 DbgLv(1) <<
"cnG:main: connections made";
301 const QString clets(
"ABCDEFGHIJ" );
309 DbgLv(1) <<
"cnG:main: cmodel load rtn";
312 QString prenm = QString( clets ).mid( kk, 1 ) +
" ";
318 if ( ! flgnm.contains(
"V" ) ) ii++;
325 int nrc = rcomps.size();
326 int rc1 = ( nrc > 0 ) ? rcomps [ 0 ] : 0;
327 int rc2 = ( nrc > 1 ) ? rcomps [ 1 ] : 0;
328 int rc3 = ( nrc > 2 ) ? rcomps [ 2 ] : 0;
329 int st1 = ( nrc > 0 ) ? stoichs[ 0 ] : 1;
330 int st2 = ( nrc > 1 ) ? stoichs[ 1 ] : 1;
331 int st3 = ( nrc > 2 ) ? stoichs[ 2 ] : 1;
337 if ( rcomps.size() == 2 )
339 name = QString::number( st1 )
340 + QString( clets ).mid( rc1, 1 )
341 + QString::number( ol1 )
343 + QString::number( qAbs( st2 ) )
344 + QString( clets ).mid( rc2, 1 )
345 + QString::number( ol2 );
347 else if ( rcomps.size() == 3 )
349 name = QString::number( st1 )
350 + QString( clets ).mid( rc1, 1 )
351 + QString::number( ol1 )
353 + QString::number( st2 )
354 + QString( clets ).mid( rc2, 1 )
355 + QString::number( ol2 )
357 + QString::number( qAbs( st3 ) )
358 + QString( clets ).mid( rc3, 1 )
359 + QString::number( ol3 );
363 name =
"(reaction " + QString::number( ii + 1 ) +
")";
378 DbgLv(1) <<
"cnG:main: bmodel load rtn";
381 QString prenm = QString( clets ).mid( ii, 1 ) +
" ";
391 int nrc = rcomps.size();
392 int rc1 = ( nrc > 0 ) ? rcomps [ 0 ] : 0;
393 int rc2 = ( nrc > 1 ) ? rcomps [ 1 ] : 0;
394 int rc3 = ( nrc > 2 ) ? rcomps [ 2 ] : 0;
395 int st1 = ( nrc > 0 ) ? stoichs[ 0 ] : 1;
396 int st2 = ( nrc > 1 ) ? stoichs[ 1 ] : 1;
397 int st3 = ( nrc > 2 ) ? stoichs[ 2 ] : 1;
403 if ( rcomps.size() == 2 )
405 name = QString::number( st1 )
406 + QString( clets ).mid( rc1, 1 )
407 + QString::number( ol1 )
409 + QString::number( qAbs( st2 ) )
410 + QString( clets ).mid( rc2, 1 )
411 + QString::number( ol2 );
413 else if ( rcomps.size() == 3 )
415 name = QString::number( st1 )
416 + QString( clets ).mid( rc1, 1 )
417 + QString::number( ol1 )
419 + QString::number( st2 )
420 + QString( clets ).mid( rc2, 1 )
421 + QString::number( ol2 )
423 + QString::number( qAbs( st3 ) )
424 + QString( clets ).mid( rc3, 1 )
425 + QString::number( ol3 );
429 name =
"(reaction " + QString::number( ii + 1 ) +
")";
439 connect(
lw_comps, SIGNAL( currentRowChanged (
int ) ),
441 connect(
lw_assocs, SIGNAL( currentRowChanged (
int ) ),
445 QFontMetrics fm( font );
446 int fhigh = fm.lineSpacing();
447 int fwide = fm.width( QChar(
'6' ) );
448 int chigh = fhigh * 3 + 12;
449 int ahigh = fhigh * 2 + 12;
450 int lwide = width() - 10;
451 const int bmwide = 700;
452 const int bmhigh = 540;
453 const int bfwide = 8;
454 const int bfhigh = 16;
456 lw_comps ->setMinimumHeight( chigh );
464 DbgLv(1) <<
"cnG:main: set comp row";
468 DbgLv(1) <<
"cnG:main: m size" << size() <<
"fwide fhigh" << fwide << fhigh;
469 int mwide = ( bmwide * fwide ) / bfwide;
470 int mhigh = ( bmhigh * fhigh ) / bfhigh;
471 resize( mwide, mhigh );
472 DbgLv(1) <<
"cnG:main: m size" << size();
485 int response = QMessageBox::question(
this,
486 tr(
"Remove C0 Data?" ),
487 tr(
"The C0 information is loaded.\n"
489 QMessageBox::Yes, QMessageBox::No );
491 if ( response == QMessageBox::Yes )
503 QMessageBox::information(
this,
504 tr(
"UltraScan Information" ),
505 tr(
"Please note:\n\n"
506 "The initial concentration file should have\n"
507 "the following format:\n\n"
508 "radius_value1 concentration_value1\n"
509 "radius_value2 concentration_value2\n"
510 "radius_value3 concentration_value3\n"
512 "radius values smaller than the meniscus or\n"
513 "larger than the bottom of the cell will be\n"
514 "excluded from the concentration vector." ) );
516 QString fn = QFileDialog::getOpenFileName(
519 if ( ! fn.isEmpty() )
523 if ( f.open( QIODevice::ReadOnly | QIODevice::Text ) )
525 QTextStream ts( &f );
540 while ( ! ts.atEnd() )
557 QMessageBox::warning(
this,
558 tr(
"UltraScan Warning" ),
559 tr(
"UltraScan could not open the file specified\n" ) + fn );
567 if ( row < 0 )
return;
573 double signalConc =
le_val_conc ->text().toDouble();
575 if ( extinction > 0.0 )
583 DbgLv(1) <<
"cnG:aP:accept";
584 QVector< C_CONSTRAINT > cnsv;
586 DbgLv(1) <<
"cnG:aP: svcs crow" <<
crow <<
"cnsv sz" << cnsv.count();
588 DbgLv(1) <<
"cnG:aP: upd_(c)cnst rtn";
594 DbgLv(1) <<
"cnG:aP: svas arow" <<
arow <<
"cnsv sz" << cnsv.count();
596 DbgLv(1) <<
"cnG:aP: upd_(a)cnst rtn";
600 DbgLv(1) <<
"cnG:aP: get_cmo RTN";
610 if ( new_state == Qt::Checked )
616 int response = QMessageBox::question(
this,
617 tr(
"Change co-sedimenting solute?" ),
618 tr(
"Another component is marked as the co-sedimenting solute.\n"
619 "Change it to the current analyte?" ),
620 QMessageBox::Yes, QMessageBox::No );
622 if ( response == QMessageBox::No )
626 connect(
ck_co_sed, SIGNAL( stateChanged(
int ) ),
627 SLOT (
co_sed (
int ) ) );
640 qApp->processEvents();
645 DbgLv(1) <<
"cnG:check_mw checked" << checked;
654 DbgLv(1) <<
"cnG:check_ff0 checked" << checked;
662 DbgLv(1) <<
"cnG:check_s checked" << checked;
669 DbgLv(1) <<
"cnG:check_D checked" << checked;
676 DbgLv(1) <<
"cnG:check_f checked" << checked;
683 DbgLv(1) <<
"cnG:float_vbar floats" << floats;
689 DbgLv(1) <<
"cnG:float_mw floats" << floats;
695 DbgLv(1) <<
"cnG:float_ff0 floats" << floats;
701 DbgLv(1) <<
"cnG:float_s floats" << floats;
707 DbgLv(1) <<
"cnG:float_D floats" << floats;
713 DbgLv(1) <<
"cnG:float_f floats" << floats;
719 DbgLv(1) <<
"cnG:float_conc floats" << floats;
725 DbgLv(1) <<
"cnG:float_kd floats" << floats;
731 DbgLv(1) <<
"cnG:float_koff floats" << floats;
737 DbgLv(1) <<
"cnG:logsc_mw logscl" << logscl;
742 DbgLv(1) <<
"cnG:logsc_kd logscl" << logscl;
746 DbgLv(1) <<
"cnG:logsc_koff logscl" << logscl;
756 connect(
ck_sel_mw, SIGNAL( toggled (
bool ) ),
758 connect(
ck_flt_mw, SIGNAL( toggled (
bool ) ),
760 connect(
ck_log_mw, SIGNAL( toggled (
bool ) ),
762 connect(
ck_sel_ff0, SIGNAL( toggled (
bool ) ),
764 connect(
ck_flt_ff0, SIGNAL( toggled (
bool ) ),
766 connect(
ck_sel_s, SIGNAL( toggled (
bool ) ),
768 connect(
ck_flt_s, SIGNAL( toggled (
bool ) ),
770 connect(
ck_sel_D, SIGNAL( toggled (
bool ) ),
772 connect(
ck_flt_D, SIGNAL( toggled (
bool ) ),
774 connect(
ck_sel_f, SIGNAL( toggled (
bool ) ),
776 connect(
ck_flt_f, SIGNAL( toggled (
bool ) ),
804 connect(
ck_flt_kd, SIGNAL( toggled (
bool ) ),
806 connect(
ck_log_kd, SIGNAL( toggled (
bool ) ),
825 int nchecks = (
ck_sel_mw ->isChecked() ? 1 : 0 )
827 + (
ck_sel_s ->isChecked() ? 1 : 0 )
828 + (
ck_sel_D ->isChecked() ? 1 : 0 )
829 + (
ck_sel_f ->isChecked() ? 1 : 0 );
836 DbgLv(1) <<
"cnG: component_select row" << srow <<
crow;
837 QVector< C_CONSTRAINT > cnsv;
839 if ( srow < 0 )
return;
845 DbgLv(1) <<
"cnG: update_constraints call";
847 DbgLv(1) <<
"cnG: update_constraints rtn";
850 if ( srow == crow )
return;
854 DbgLv(1) <<
"cnG: comp_constraints call row" <<
crow;
856 DbgLv(1) <<
"cnG: comp_constraints rtn cnsv size" << cnsv.size();
858 bool not_prod = ! is_prod;
862 QVector< C_CONSTRAINT > old_cnsv = cnsv;
864 DbgLv(1) <<
"cnG: IS_PROD";
876 QVector< int >* rcomps = &as1->
rcomps;
877 DbgLv(1) <<
"cnG: ii" << ii <<
"rc0" << rcomps->at(0) <<
"crow" <<
crow;
878 if ( rcomps->at( 0 ) < 0 )
continue;
880 if ( rcomps->contains( crow ) )
882 QVector< int >* stoichs = &as1->
stoichs;
883 DbgLv(1) <<
"cnG: ii" << ii <<
"rc-cont-crow: rcsize stsize"
884 << rcomps->size() << stoichs->size();
886 for (
int jj = 0; jj < rcomps->size(); jj++ )
888 int rc1 = rcomps ->at( jj );
889 int st1 = stoichs->at( jj );
890 DbgLv(1) <<
"cnG: jj" << jj <<
"rc1" << rc1 <<
"st1" << st1;
891 if ( rc1 >= 0 && st1 > 0 )
894 QVector< C_CONSTRAINT > rcnsv;
899 double rst1 = (double)st1;
904 cval = ( cval == 0.0 ) ? conc : cval;
908 DbgLv(1) <<
"cnG: mcx" << mcx <<
"cval,vsum,wsum,esum"
909 << cval << vsum << wsum << esum;
926 for (
int ii = 0; ii < old_cnsv.size(); ii++ )
928 cnse = old_cnsv[ ii ];
934 cnse.high = cnse.low;
943 cnse.high = cnse.low;
958 cnse.high = cnse.low;
967 cnse.high = cnse.low;
973 DbgLv(1) <<
"cnG: miss_vb,mw,ff,co" << miss_vb << miss_mw << miss_ff << miss_co;
980 cnse.high = cnse.low;
990 cnse.high = cnse.low;
1000 cnse.high = cnse.low;
1001 cnse.floats =
false;
1002 cnse.logscl =
false;
1011 cnse.floats =
false;
1012 cnse.logscl =
false;
1018 DbgLv(1) <<
"cnG: comp_constraints rtn";
1064 for (
int ii = 0; ii < cnsv.size(); ii++ )
1066 bool floats = cnsv[ ii ].floats;
1068 DbgLv(1) <<
"cnG:cmp_sel: ii" << ii <<
"atype" << cnsv[ii].atype <<
"fl" << floats;
1083 ck_log_mw ->setChecked( cnsv[ ii ].logscl );
1127 le_extinction->setText( QString::number( cnsv[ ii ].low ) );
1156 DbgLv(1) <<
"cnG: association_select row" << srow <<
arow;
1157 QVector< C_CONSTRAINT > cnsv;
1159 if ( srow < 0 )
return;
1161 if ( srow != arow && arow >= 0 )
1170 constraints.assoc_constraints( arow, &cnsv, NULL );
1179 for (
int ii = 0; ii < cnsv.size(); ii++ )
1181 bool floats = cnsv[ ii ].floats;
1182 bool logscl = cnsv[ ii ].logscl;
1204 QVector< C_CONSTRAINT >& cnsv )
1206 DbgLv(1) <<
"cnG: svcs: save_comp_settings crow" <<
crow;
1209 bool floats =
false;
1217 cnse.low =
le_val_s ->text().toDouble();
1218 cnse.low = floats ?
le_min_s ->text().toDouble() : cnse.low;
1219 cnse.high = floats ?
le_max_s ->text().toDouble() : cnse.low;
1220 cnse.floats = floats;
1221 cnse.logscl =
false;
1224 DbgLv(1) <<
"cnG: svcs: ks" << kselect <<
"flt" << floats <<
"S";
1232 cnse.low = floats ?
le_min_ff0 ->text().toDouble() : cnse.low;
1233 cnse.high = floats ?
le_max_ff0 ->text().toDouble() : cnse.low;
1234 cnse.floats = floats;
1235 cnse.logscl =
false;
1238 DbgLv(1) <<
"cnG: svcs: ks" << kselect <<
"flt" << floats <<
"FF0";
1245 cnse.low =
le_val_mw ->text().toDouble();
1246 cnse.low = floats ?
le_min_mw ->text().toDouble() : cnse.low;
1247 cnse.high = floats ?
le_max_mw ->text().toDouble() : cnse.low;
1248 cnse.floats = floats;
1252 DbgLv(1) <<
"cnG: svcs: ks" << kselect <<
"flt" << floats <<
"MW";
1259 cnse.low =
le_val_D ->text().toDouble();
1260 cnse.low = floats ?
le_min_D ->text().toDouble() : cnse.low;
1261 cnse.high = floats ?
le_max_D ->text().toDouble() : cnse.low;
1262 cnse.floats = floats;
1263 cnse.logscl =
false;
1266 DbgLv(1) <<
"cnG: svcs: ks" << kselect <<
"flt" << floats <<
"D";
1273 cnse.low =
le_val_f ->text().toDouble();
1274 cnse.low = floats ?
le_min_f ->text().toDouble() : cnse.low;
1275 cnse.high = floats ?
le_max_f ->text().toDouble() : cnse.low;
1276 cnse.floats = floats;
1277 cnse.logscl =
false;
1280 DbgLv(1) <<
"cnG: svcs: ks" << kselect <<
"flt" << floats <<
"F";
1287 cnse.low = floats ?
le_min_vbar->text().toDouble() : cnse.low;
1288 cnse.high = floats ?
le_max_vbar->text().toDouble() : cnse.low;
1289 cnse.floats = floats;
1290 cnse.logscl =
false;
1293 DbgLv(1) <<
"cnG: svcs: ks" << kselect <<
"flt" << floats <<
"VBAR";
1299 cnse.low = floats ?
le_min_conc->text().toDouble() : cnse.low;
1300 cnse.high = floats ?
le_max_conc->text().toDouble() : cnse.low;
1301 cnse.floats = floats;
1302 cnse.logscl =
false;
1305 DbgLv(1) <<
"cnG: svcs: ks" << kselect <<
"flt" << floats <<
"CONC";
1310 qDebug() <<
"*ERROR* dmGA_Init: component" << cnse.mcompx + 1
1311 <<
"has" << kselect <<
"attributes selected (SB 4)";
1317 cnse.high = cnse.low;
1318 cnse.floats =
false;
1319 cnse.logscl =
false;
1322 DbgLv(1) <<
"cnG: svcs: ks" << kselect <<
"flt" << cnse.floats <<
"EXT"
1323 <<
"cnsv size" << cnsv.size();
1328 QVector< C_CONSTRAINT >& cnsv )
1334 cnse.low =
le_val_kd ->text().toDouble();
1335 cnse.low = floats ?
le_min_kd ->text().toDouble() : cnse.low;
1336 cnse.high = floats ?
le_max_kd ->text().toDouble() : cnse.low;
1337 cnse.floats = floats;
1340 DbgLv(1) <<
"cnG: svas: ks 1 flt" << floats <<
"KD";
1345 cnse.low = floats ?
le_min_koff->text().toDouble() : cnse.low;
1346 cnse.high = floats ?
le_max_koff->text().toDouble() : cnse.low;
1347 cnse.floats = floats;
1350 DbgLv(1) <<
"cnG: svas: ks 2 flt" << floats <<
"KOFF";
1355 QLineEdit* le_val, QLineEdit* le_min, QLineEdit* le_max )
1357 bool fixed = !floats;
1359 DbgLv(1) <<
"cnG:float_par floats" << floats;
1368 bool have_fl =
false;
1369 have_fl = ( have_fl ||
ck_flt_vbar->isChecked() );
1370 have_fl = ( have_fl ||
ck_flt_mw ->isChecked() );
1371 have_fl = ( have_fl ||
ck_flt_ff0 ->isChecked() );
1372 have_fl = ( have_fl ||
ck_flt_s ->isChecked() );
1373 have_fl = ( have_fl ||
ck_flt_D ->isChecked() );
1374 have_fl = ( have_fl ||
ck_flt_f ->isChecked() );
1375 have_fl = ( have_fl ||
ck_flt_conc->isChecked() );
1376 have_fl = ( have_fl ||
ck_flt_kd ->isChecked() );
1377 have_fl = ( have_fl ||
ck_flt_koff->isChecked() );
1381 le_val->setEnabled( fixed );
1382 le_min->setEnabled( floats );
1383 le_max->setEnabled( floats );
1391 QLineEdit* le_val, QLineEdit* le_min, QLineEdit* le_max )
1393 bool floats = cnse.floats;
1394 bool fixed = !floats;
1395 DbgLv(1) <<
"cnG:check_value: floats" << floats <<
"atype" << cnse.atype
1396 <<
"low high" << cnse.low << cnse.high;
1400 le_val->setText( QString::number( cnse.low ) );
1401 double vmin = cnse.low * 0.9;
1402 double vmax = cnse.low * 1.1;
1403 le_min->setText( QString::number( vmin ) );
1404 le_max->setText( QString::number( vmax ) );
1409 le_min->setText( QString::number( cnse.low ) );
1410 le_max->setText( QString::number( cnse.high ) );
1411 double vval = ( cnse.low + cnse.high ) * 0.5;
1412 le_val->setText( QString::number( vval ) );
1426 bool ckd_s =
ck_sel_s ->isChecked();
1427 bool ckd_D =
ck_sel_D ->isChecked();
1428 bool ckd_f =
ck_sel_f ->isChecked();
1432 bool flt_s =
ck_flt_s ->isChecked();
1433 bool flt_D =
ck_flt_D ->isChecked();
1434 bool flt_f =
ck_flt_f ->isChecked();
1435 bool flt_any = flt_vbar || flt_mw || flt_ff0 || flt_s || flt_D || flt_f;
1436 DbgLv(1) <<
"cnG:check_selects kcheck" << kcheck <<
"flt_any" << flt_any;
1469 DbgLv(1) <<
"cnG:ck_sels: ff0 B0" << scva.
f_f0;
1478 DbgLv(1) <<
"cnG:ck_sels: ff0 B1" << scva.
f_f0;
1499 DbgLv(1) <<
"cnG:ck_sels: ff0 B3" << scva.
f_f0;
1506 sclh.
s = ( ksel == 0 ) ? scll.
s : schh.
s ;
1507 schl.
s = ( ksel == 0 ) ? schh.
s : scll.
s ;
1516 sclh.
D = ( ksel == 0 ) ? scll.
D : schh.
D ;
1517 schl.
D = ( ksel == 0 ) ? schh.
D : scll.
D ;
1520 DbgLv(1) <<
"cnG:ck_sels: ff0 B6" << scva.
f_f0;
1527 sclh.
f = ( ksel == 0 ) ? scll.
f : schh.
f ;
1528 schl.
f = ( ksel == 0 ) ? schh.
f : scll.
f ;
1534 << sclh.
f_f0 << schl.
f_f0 <<
"ksel" << ksel;
1546 double vmin = qMin( scll.
mw, sclh.
mw );
1547 double vmax = qMax( scll.
mw, sclh.
mw );
1548 vmin = qMin( vmin, qMin( schh.
mw, schl.
mw ) );
1549 vmax = qMax( vmax, qMax( schh.
mw, schl.
mw ) );
1550 le_val_mw ->setText( QString::number( scva.
mw ) );
1551 le_min_mw ->setText( QString::number( vmin ) );
1552 le_max_mw ->setText( QString::number( vmax ) );
1557 double vmin = qMin( scll.
f_f0, sclh.
f_f0 );
1558 double vmax = qMax( scll.
f_f0, sclh.
f_f0 );
1559 vmin = qMin( vmin, qMin( schh.
f_f0, schl.
f_f0 ) );
1560 vmax = qMax( vmax, qMax( schh.
f_f0, schl.
f_f0 ) );
1562 le_min_ff0->setText( QString::number( vmin ) );
1563 le_max_ff0->setText( QString::number( vmax ) );
1568 double vmin = qMin( scll.
s, sclh.
s );
1569 double vmax = qMax( scll.
s, sclh.
s );
1570 vmin = qMin( vmin, qMin( schh.
s, schl.
s ) );
1571 vmax = qMax( vmax, qMax( schh.
s, schl.
s ) );
1572 le_val_s ->setText( QString::number( scva.
s ) );
1573 le_min_s ->setText( QString::number( vmin ) );
1574 le_max_s ->setText( QString::number( vmax ) );
1575 DbgLv(1) <<
"cnG:check_selects !CKD_S flt_any" << flt_any;
1580 double vmin = qMin( scll.
D, sclh.
D );
1581 double vmax = qMax( scll.
D, sclh.
D );
1582 vmin = qMin( vmin, qMin( schh.
D, schl.
D ) );
1583 vmax = qMax( vmax, qMax( schh.
D, schl.
D ) );
1584 le_val_D ->setText( QString::number( scva.
D ) );
1585 le_min_D ->setText( QString::number( vmin ) );
1586 le_max_D ->setText( QString::number( vmax ) );
1591 double vmin = qMin( scll.
f, sclh.
f );
1592 double vmax = qMax( scll.
f, sclh.
f );
1593 vmin = qMin( vmin, qMin( schh.
f, schl.
f ) );
1594 vmax = qMax( vmax, qMax( schh.
f, schl.
f ) );
1595 le_val_f ->setText( QString::number( scva.
f ) );
1596 le_min_f ->setText( QString::number( vmin ) );
1597 le_max_f ->setText( QString::number( vmax ) );
1616 DbgLv(1) <<
"cnG:check_selects END";
1621 QVector< C_CONSTRAINT >& cnsv )
1625 for (
int ii = 0; ii < cnsv.size(); ii++ )
1627 if ( cnsv[ ii ].atype == atype )
1629 double cmin = cnsv[ ii ].low;
1630 double cmax = cnsv[ ii ].high;
1632 if ( cnsv[ ii ].floats )
1634 cval = cnsv[ ii ].logscl
1635 ? exp( ( log( cmin ) + log( cmax ) ) * 0.5 )
1636 : ( ( cmin + cmax ) * 0.5 );