10 #include <qwt_legend.h>
17 setWindowTitle( tr(
"Finite Element Data/Residuals Viewer" ) );
20 QSize p1size( 560, 240 );
21 QSize p2size( 560, 240 );
35 QLabel* lb_datctrls =
us_banner( tr(
"FE Analysis Data Viewer" ) );
36 QLabel* lb_resctrls =
us_banner( tr(
"FE Analysis Residuals Viewer" ) );
37 QLabel* lb_vari =
us_label( tr(
"Variance:" ) );
38 QLabel* lb_rmsd =
us_label( tr(
"RMSD:" ) );
90 tr(
"Experimental Data" ),
97 tr(
"OD Difference" ) );
115 connect(
ck_plteda, SIGNAL( toggled(
bool ) ),
117 connect(
ck_subtin, SIGNAL( toggled(
bool ) ),
119 connect(
ck_subrin, SIGNAL( toggled(
bool ) ),
121 connect(
ck_pltsda, SIGNAL( toggled(
bool ) ),
123 connect(
ck_addtin, SIGNAL( toggled(
bool ) ),
125 connect(
ck_addrin, SIGNAL( toggled(
bool ) ),
127 connect(
ck_pltres, SIGNAL( toggled(
bool ) ),
129 connect(
ck_plttin, SIGNAL( toggled(
bool ) ),
131 connect(
ck_pltrin, SIGNAL( toggled(
bool ) ),
133 connect(
ck_pltran, SIGNAL( toggled(
bool ) ),
135 connect(
ck_shorbm, SIGNAL( toggled(
bool ) ),
138 connect( pb_close, SIGNAL( clicked() ),
171 qDebug() <<
"*ERROR* unable to get RP parent";
203 else if ( plotf == 2 )
208 else if ( plotf == 0 )
357 connect(
resbmap, SIGNAL( destroyed() ),
412 if ( !do_plteda && !do_pltsda )
418 if ( do_plteda && !do_pltsda )
419 data_plot1->setTitle( tr(
"Experimental Data" ) );
421 else if ( do_plteda && do_pltsda )
422 data_plot1->setTitle( tr(
"Experimental and Simulated Data" ) );
424 else if ( do_pltsda )
425 data_plot1->setTitle( tr(
"Simulated Data" ) );
442 data_plot1->setAxisTitle( QwtPlot::yLeft, tr(
"Absorbance" ) );
447 count = ( points > count ) ? points : count;
449 QVector< double > rvec( count, 0.0 );
450 QVector< double > vvec( count, 0.0 );
451 double* rr = rvec.data();
452 double* vv = vvec.data();
456 QPen pen_red( Qt::red );
466 for (
int jj = 0; jj < points; jj++ )
471 for (
int ii = 0; ii < count; ii++ )
473 if (
excllist->contains( ii ) )
continue;
478 for (
int jj = 0; jj < points; jj++ )
483 vv[ jj ] =
edata->
value( ii, jj ) - rinoi - tinoi;
486 title = tr(
"Curve " ) + QString::number( ii );
489 curv->setPen( pen_plot );
490 curv->setData( rr, vv, points );
501 for (
int jj = 0; jj < points; jj++ )
506 for (
int ii = 0; ii < count; ii++ )
508 if (
excllist->contains( ii ) )
continue;
513 for (
int jj = 0; jj < points; jj++ )
518 if ( rr[ jj ] >= rl )
519 sval =
sdata->
value( ii, jj ) + rinoi + tinoi;
522 sval =
edata->
value( ii, jj ) - rinoi - tinoi;
530 title = tr(
"S-Curve " ) + QString::number( ii );
533 curv->setPen( pen_red );
534 curv->setData( rr, vv, points );
564 if ( !do_pltres && !do_plttin && !do_pltrin &&
565 !do_pltran && !do_shorbm )
572 data_plot2->setAxisTitle( QwtPlot::xBottom, tr(
"Radius (cm)" ) );
576 QVector< double > rvec( vsize, 0.0 );
577 QVector< double > vvec( vsize, 0.0 );
578 double* rr = rvec.data();
579 double* vv = vvec.data();
583 QPen pen_plot( Qt::green );
588 rr[ 0 ] = !do_pltrin ? rmin : 0.0;
589 rr[ 1 ] = !do_pltrin ? rmax : double( count );
593 curv->setPen( QPen( QBrush( Qt::red ), 2 ) );
594 curv->setData( rr, vv, 2 );
600 for (
int jj = 0; jj < points; jj++ )
607 for (
int ii = 0; ii < count; ii++ )
609 if (
excllist->contains( ii ) )
continue;
617 for (
int jj = 0; jj < points; jj++ )
634 title = tr(
"resids " ) + QString::number( ii );
637 curv->setPen( pen_plot );
638 curv->setStyle( QwtPlotCurve::Dots );
639 curv->setData( rr, vv, points );
643 rmsd /= (double)( kpts );
644 le_vari->setText( QString::number( rmsd ) );
646 le_rmsd->setText( QString::number( rmsd ) );
667 else if ( do_plttin )
669 data_plot2->setTitle( tr(
"Time-Invariant Noise" ) );
671 for (
int jj = 0; jj < points; jj++ )
677 title = tr(
"ti_noise" );
680 curv->setPen( pen_plot );
681 curv->setData( rr, vv, points );
684 else if ( do_pltrin )
686 data_plot2->setTitle( tr(
"Radially-Invariant Noise" ) );
688 for (
int ii = 0; ii < count; ii++ )
690 rr[ ii ] = (double)( ii + 1 );
694 title = tr(
"ri_noise" );
697 data_plot2->setAxisTitle( QwtPlot::xBottom, tr(
"Scan Number" ) );
698 curv->setPen( pen_plot );
699 curv->setData( rr, vv, count );
702 else if ( do_pltran )
708 for (
int jj = 0; jj < points; jj++ )
715 for (
int ii = 0; ii < count; ii++ )
717 if (
excllist->contains( ii ) )
continue;
721 for (
int jj = 0; jj < points; jj++ )
733 title = tr(
"random noise " ) + QString::number( ii );
736 curv->setPen( pen_plot );
737 curv->setStyle( QwtPlotCurve::Dots );
738 curv->setData( rr, vv, points );
742 rmsd /= (double)( kpts );
743 le_vari->setText( QString::number( rmsd ) );
745 le_rmsd->setText( QString::number( rmsd ) );
752 QVector< QVector< double > > resids;
753 QVector< double > resscan;
755 resids .resize( count );
756 resscan.resize( points );
760 for (
int ii = 0; ii < count; ii++ )
765 resids[ ii ] = resscan;
775 for (
int jj = 0; jj < points; jj++ )
789 resscan[ jj ] = rvalu;
792 resids[ ii ] = resscan;
795 rmsd /= (double)( kpts );
796 le_vari->setText( QString::number( rmsd ) );
798 le_rmsd->setText( QString::number( rmsd ) );
810 connect(
resbmap, SIGNAL( destroyed() ),
812 resbmap->move( this->pos() + QPoint( 100, 100 ) );
817 qApp->processEvents();
822 data_plot2->setAxisScale( QwtPlot::xBottom, rmin, rmax );
829 DbgLv(1) <<
"Resids BitMap Closed!!!";