Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Feature Branch #127

Merged
merged 11 commits into from
Aug 19, 2024
9 changes: 9 additions & 0 deletions programs/us_analysis_profile/us_analysis_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ DbgLv(1) << "MAIN: CALL check_runname()";
DbgLv(1) << "MAIN: CALL reset()";
//reset();
resize( 500, 450 );

// //test
// US_AnaProfile profile1;
// US_AnaProfile profile2;

// if ( profile1 == profile2 )
// qDebug() << "ana profs EQUAL";
// else
// qDebug() << "ana profs NOT EQUAL";
}


Expand Down
57 changes: 49 additions & 8 deletions programs/us_edit/us_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,10 +936,19 @@ lambdas << "250" << "350" << "450" << "550" << "580" << "583" << "650";

// Air Gap (hidden by default)
pb_airGap = us_pushbutton( tr( "Specify Air Gap" ), false );
lb_airGap = us_label( tr( "Air Gap:" ), -1 );
le_airGap = us_lineedit( "", 1, true );
pb_airGap->setHidden( true );
pb_airGap->setVisible( false );
lb_airGap->setHidden( true );
le_airGap->setHidden( true );


// // Air Gap (hidden by default)
// pb_airGap = us_pushbutton( tr( "Specify Air Gap" ), false );
// le_airGap = us_lineedit( "", 1, true );
// pb_airGap->setHidden( true );
// le_airGap->setHidden( true );

// Data range
pb_dataRange = us_pushbutton( tr( "Specify Data Range" ), false );
le_dataRange = us_lineedit( "", 1, true );
Expand Down Expand Up @@ -1213,21 +1222,30 @@ pb_plateau->setVisible(false);
main->setStretchFactor( plot, 3 );
top ->addLayout( main );

qDebug() << "US_Edit manual setup 1";

reset();

qDebug() << "US_Edit manual setup 2";

//Load already selected data
this->allData = allData;
this->triples = triples;
this->workingDir = workingDir;
load_manual_auto();

qDebug() << "US_Edit manual setup 3";
load_manual_auto();
qDebug() << "US_Edit manual setup 4";

//pre-select channel passed from main window:
cb_triple->setCurrentIndex( currenChtInd );
qDebug() << "US_Edit manual setup 5";
new_triple( currenChtInd );

qDebug() << "US_Edit manual setup 6";
cb_lplot ->setCurrentIndex( plotind );

qDebug() << "US_Edit manual setup 7";
show_mwl_controls( false );
qDebug() << "US_Edit manual setup 8";
}


Expand Down Expand Up @@ -1678,6 +1696,8 @@ void US_Edit::sel_investigator( void )
// Reset parameters to their defaults
void US_Edit::reset( void )
{

qDebug() << "reset 1";
changes_made = false;
floatingData = false;

Expand Down Expand Up @@ -1724,16 +1744,21 @@ void US_Edit::reset( void )

cb_triple->disconnect();

qDebug() << "reset 2";

data_plot->detachItems( QwtPlotItem::Rtti_PlotCurve );
data_plot->detachItems( QwtPlotItem::Rtti_PlotMarker );
v_line = NULL;
pick ->disconnect();

qDebug() << "reset 3";
data_plot->setAxisScale( QwtPlot::xBottom, 5.7, 7.3 );
data_plot->setAxisScale( QwtPlot::yLeft , 0.0, 1.5 );
grid = us_grid( data_plot );
qDebug() << "reset 4";
data_plot->replot();

qDebug() << "reset 5";

// Disable pushbuttons
pb_details ->setEnabled( false );

Expand Down Expand Up @@ -1766,6 +1791,7 @@ void US_Edit::reset( void )

ck_writemwl ->setEnabled( false );

qDebug() << "reset 6";
// Remove icons
pb_meniscus ->setIcon( QIcon() );
pb_airGap ->setIcon( QIcon() );
Expand All @@ -1778,6 +1804,8 @@ void US_Edit::reset( void )

pb_float ->setIcon( QIcon() );

qDebug() << "reset 61";

editLabel .clear();
data.scanData .clear();
includes .clear();
Expand All @@ -1786,6 +1814,8 @@ void US_Edit::reset( void )
triples .clear();
cb_triple ->clear();
cb_rpms ->disconnect();

qDebug() << "reset 62";
cb_rpms ->clear();
editGUIDs .clear();
editIDs .clear();
Expand All @@ -1809,24 +1839,31 @@ void US_Edit::reset( void )
rb_radius ->setChecked( true );
rb_waveln ->setChecked( false );
pb_custom ->setEnabled( false );
qDebug() << "reset 63";
if (pb_airGap != nullptr)
{
pb_airGap->setHidden( true );
}
qDebug() << "reset 64";
if (le_airGap != nullptr)
{
le_airGap->setHidden( true );
}
qDebug() << "reset 65";
if (lb_airGap != nullptr)
{
lb_airGap->setHidden( true );
}
qDebug() << "reset 7";
connect_mwl_ctrls( true );

qDebug() << "reset 8";

set_pbColors( NULL );
lb_triple->setText( tr( "Cell / Channel / Wavelength" ) );
qDebug() << "reset 9";

show_mwl_controls( false );
qDebug() << "reset 10";
}

// Reset parameters for a new triple
Expand Down Expand Up @@ -3811,8 +3848,12 @@ double US_Edit::find_meniscus_auto()
//ALEXEY: maybe to be on safer side, take indexRight = meniscus_init + ( aprofile_right - meniscus_init )/2.0
//int indexRight = meniscus_init + ( data.xindex( range_right ) - meniscus_init )/2.0;

int indexRight = data.xindex( range_right );
// qDebug() << "indexLeft = " << indexLeft << "; indexRight = " << indexRight;
//int indexRight = data.xindex( range_right );
//ALEXEY: maybe to be on safer side, take indexRight = meniscus_init + ( aprofile_right - meniscus_init )/2.0!!!
int indexRight = data.xindex( meniscus_init + ( range_right - meniscus_init )/2.0 );

qDebug() << "data.xindex( range_right ) = " << data.xindex( range_right );
qDebug() << "indexLeft = " << indexLeft << "; indexRight = " << indexRight;

for ( int j = indexLeft; j <= indexRight; j++ )
{
Expand Down
41 changes: 41 additions & 0 deletions programs/us_experiment/us_exp_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,20 @@ void US_ExperGuiRotor::addOpertoList( void )
.arg( c_oper ) );
return;
}

//also, check if to-be-added operator is in other role(s) already [rev, appr]
QString e_revList = te_revs_to_assign->toPlainText();
QString e_apprList = te_apprs_to_assign->toPlainText();
if ( e_revList. contains( c_oper ) || e_apprList. contains( c_oper ) )
{
QMessageBox::information( this, tr( "Cannot add Operator" ),
tr( "<font color='red'><b>ATTENTION:</b> </font> Selected operator: <br><br>"
"<font ><b>%1</b><br><br>"
"is already set as REVIEWER or APPROVER.<br>"
"Please choose other operator.")
.arg( c_oper ) );
return;
}

te_opers_to_assign->append( c_oper );
}
Expand Down Expand Up @@ -1244,6 +1258,19 @@ void US_ExperGuiRotor::addRevtoList( void )
.arg( c_rev ) );
return;
}

//also, check if to-be-added reviewer is an operator already
QString e_operList = te_opers_to_assign->toPlainText();
if ( e_operList. contains( c_rev ) )
{
QMessageBox::information( this, tr( "Cannot add Reviewer" ),
tr( "<font color='red'><b>ATTENTION:</b> </font> Selected reviewer: <br><br>"
"<font ><b>%1</b><br><br>"
"is already set as an OPERATOR.<br>"
"Please choose other reviewer.")
.arg( c_rev ) );
return;
}

te_revs_to_assign->append( c_rev );

Expand Down Expand Up @@ -1284,6 +1311,20 @@ void US_ExperGuiRotor::addApprtoList( void )
.arg( c_appr) );
return;
}

//also, check if to-be-added approver is an operator already
QString e_operList = te_opers_to_assign->toPlainText();
if ( e_operList. contains( c_appr ) )
{
QMessageBox::information( this, tr( "Cannot add Approver" ),
tr( "<font color='red'><b>ATTENTION:</b> </font> Selected approver: <br><br>"
"<font ><b>%1</b><br><br>"
"is already set as an OPERATOR.<br>"
"Please choose other approver.")
.arg( c_appr ) );
return;
}


te_apprs_to_assign->append( c_appr );

Expand Down
10 changes: 9 additions & 1 deletion utils/us_ana_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,22 @@ bool US_AnaProfile::operator== ( const US_AnaProfile& ap ) const
if ( aprofGUID != ap.aprofGUID ) return false;
if ( protoname != ap.protoname ) return false;
if ( protoGUID != ap.protoGUID ) return false;
if ( nchan != ap.nchan ) return false;

qDebug() << "[ANA comp] Gen1 OK";

qDebug() << "nchan: " << nchan << ap.nchan;
//if ( nchan != ap.nchan ) return false;

qDebug() << "[ANA comp] Gen2 OK";

if ( lc_ratios != ap.lc_ratios ) return false;
if ( lc_tolers != ap.lc_tolers ) return false;
if ( l_volumes != ap.l_volumes ) return false;
if ( lv_tolers != ap.lv_tolers ) return false;
if ( data_ends != ap.data_ends ) return false;

qDebug() << "[ANA comp] Gen3 OK";

//abde
if ( ld_dens_0s != ap.ld_dens_0s ) return false;
if ( gm_vbars != ap.gm_vbars ) return false;
Expand Down
Loading