Skip to content

Commit

Permalink
Merge pull request #133 from ehb54/alexey-dev-issue361
Browse files Browse the repository at this point in the history
R&D : Labs/Rotor -- allow choosing operator...
  • Loading branch information
demeler authored Sep 13, 2024
2 parents b293d87 + 033486a commit 5448bc6
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 14 deletions.
56 changes: 43 additions & 13 deletions programs/us_experiment/us_exp_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,9 +1016,13 @@ DbgLv(1) << "EGRo: inP: calib_entr" << cal_entr;
//setCbCurrentText( cb_optima, optima_name ); // <-- NOT ENOUGH, no connection check

//operator
qDebug() << "init Labs: operID + name -- "
<< QString::number( rpRotor->operID ) + ": " + rpRotor->opername;

setCbCurrentText( cb_operator, QString::number( rpRotor->operID ) + ": "
+ rpRotor->opername );

qDebug() << "init Labs: operator text: " << cb_operator->currentText();

setCbCurrentText( cb_exptype, rpRotor->exptype );

Expand Down Expand Up @@ -1076,9 +1080,13 @@ DbgLv(1) << "EGRo: inP: calib_entr" << cal_entr;
lb_smes_to_assign -> hide();
te_smes_to_assign -> hide();
pb_remove_sme -> hide();


//show Operator Info:
lb_operator -> setVisible(true);
cb_operator -> setVisible(true);
}


expType_old = cb_exptype ->currentText();

qDebug() << "Rotor::initPanel(), expType_old -- " << expType_old;
Expand Down Expand Up @@ -1453,7 +1461,40 @@ void US_ExperGuiRotor::savePanel()
QString lab = cb_lab ->currentText();
QString rot = cb_rotor ->currentText();
QString cal = cb_calibr->currentText();
QString oper = cb_operator->currentText();

//And save info on selected assigned oper(s) & rev(s)
QString oper_list = te_opers_to_assign->toPlainText();
QString rev_list = te_revs_to_assign->toPlainText();
QString appr_list = te_apprs_to_assign->toPlainText();
QString sme_list = te_smes_to_assign->toPlainText();

rpRotor->operListAssign = oper_list;
rpRotor->revListAssign = rev_list;
rpRotor->apprListAssign = appr_list;
rpRotor->smeListAssign = sme_list;

qDebug() << "Lists of o,r,a: "
<< oper_list << rev_list << appr_list;

//QString oper = cb_operator->currentText();
QString oper;
if ( mainw->usmode )
oper = cb_operator->currentText();
else
{
QString oper_t = oper_list.split("\n")[0];
qDebug() << "oper_t: " << oper_t;
if ( !oper_t.isEmpty() && oper_t.contains(".") )
{
QString oper_t_id = oper_t.split(".")[0].simplified();
QString oper_t_name = oper_t.split(".")[1].simplified();
QString oper_t_lname = oper_t_name.split(",")[0].simplified();
QString oper_t_fname = oper_t_name.split(",")[1].simplified();

oper = oper_t_id + ": " + oper_t_fname + " " + oper_t_lname;
}
}

QString exptype = cb_exptype ->currentText();
QString instr = cb_optima ->currentText();

Expand Down Expand Up @@ -1513,17 +1554,6 @@ DbgLv(1) << "EGRo: svP: calndx" << ii << "calGUID" << rpRotor->calGUID;

qDebug() << "Rotor Save panel Done: " ;

//And save info on selected assigned oper(s) & rev(s)
QString oper_list = te_opers_to_assign->toPlainText();
QString rev_list = te_revs_to_assign->toPlainText();
QString appr_list = te_apprs_to_assign->toPlainText();
QString sme_list = te_smes_to_assign->toPlainText();

rpRotor->operListAssign = oper_list;
rpRotor->revListAssign = rev_list;
rpRotor->apprListAssign = appr_list;
rpRotor->smeListAssign = sme_list;


//if ABDE expType -- translate to 8. AProfie
bool expType_changed = ( exptype == expType_old ) ? false : true;
Expand Down
2 changes: 1 addition & 1 deletion programs/us_experiment/us_experiment_gui_optima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ US_ExperGuiRotor::US_ExperGuiRotor( QWidget* topw )
QLabel* lb_optima_connected = us_label( tr( "Connection Status: " ) );
le_optima_connected = us_lineedit( "", 0, true );

QLabel* lb_operator = us_label( tr( "Select Operator:" ) );
lb_operator = us_label( tr( "Select Operator:" ) );
cb_operator = new QComboBox( this );

QLabel* lb_exptype = us_label( tr( "Experiment Type:" ) );
Expand Down
1 change: 1 addition & 0 deletions programs/us_experiment/us_experiment_gui_optima.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class US_ExperGuiRotor : public US_WidgetsDialog
QComboBox* cb_rotor; // Rotor combo box
QComboBox* cb_calibr; // Calibration combo box
QComboBox* cb_operator; // Operator combo box
QLabel* lb_operator;
QComboBox* cb_exptype; // Exp. Type combo box
QComboBox* cb_optima;
QStringList sl_optimas;
Expand Down

0 comments on commit 5448bc6

Please sign in to comment.