Skip to content

Commit

Permalink
GMP | 1. EXP. -- bug fixed for proper storing of solution comments in…
Browse files Browse the repository at this point in the history
…ternally and in the DB; proper read/write...
  • Loading branch information
alexsav815 committed Jan 14, 2024
1 parent 750cc53 commit 245d135
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 47 deletions.
11 changes: 9 additions & 2 deletions programs/us_convert/us_convert_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,11 @@ DbgLv(1) << "CGui: reset complete";
// QString protname = QString("eGFP-DNA-MW-AUG2223");
// QString invid = QString("165");
// QString aprofileguid = QString("b31d4669-a9f5-4488-a5e4-567bd0051679");

// QString curdir = QString("/home/alexey/ultrascan/imports/11JAN2024-PAPBM1M2-Mabanglo-run1607");
// QString protname = QString("11JAN2024-PAPBM1M2-Mabanglo-test");
// QString invid = QString("19");
// QString aprofileguid = QString("3fb72b82-6e93-4ecb-9d47-ecbf552f2234");

// QMap < QString, QString > protocol_details;
// protocol_details[ "dataPath" ] = curdir;
Expand All @@ -609,9 +614,9 @@ DbgLv(1) << "CGui: reset complete";
// //protocol_details[ "runID" ] = ;
// protocol_details[ "label" ] = QString("Some label");
// protocol_details[ "aprofileguid" ] = aprofileguid;
// protocol_details[ "CellChNumber" ] = QString("2");
// protocol_details[ "CellChNumber" ] = QString("12");

// /*********************************************************************************/
// // /*********************************************************************************/


// import_data_auto( protocol_details );
Expand Down Expand Up @@ -4546,6 +4551,8 @@ DbgLv(1) << "chgTrp: trDx trLx" << tripDatax << tripListx
// le_description ->setText( outData[ tripDatax ]->description );
// }
// else

//ALEXEY: USE ::correct_description() here? plus make sure outData[ tripDatax ]->description IS changed?
le_description ->setText( outData[ tripDatax ]->description );

le_solutionDesc->setText( out_chaninfo[ tripListx ].solution.solutionDesc );
Expand Down
131 changes: 86 additions & 45 deletions programs/us_experiment/us_exp_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2358,58 +2358,97 @@ void US_ExperGuiSolutions::savePanel()
suchans.clear();
susolus.clear();

qDebug() << "sol save 1";

for ( int ii = 0; ii < mxrow; ii++ )
{ // Fill panel lists and parameters from GUI elements
QString channel = cc_labls[ ii ]->text();
DbgLv(1) << "EGSo: svP: ii" << ii << "channel" << channel;

if ( channel == chn_none )
{ // Fill panel lists and parameters from GUI elements
QString channel = cc_labls[ ii ]->text();
DbgLv(1) << "EGSo: svP: ii" << ii << "channel" << channel;
if ( channel == chn_none )
break;

nchant++;
srchans << channel;
QString solution = cc_solus[ ii ]->currentText();
DbgLv(1) << "EGSo: svP: nchant" << nchant << "solution" << solution;

if ( solution == unspec )
nchant++;
srchans << channel;
QString solution = cc_solus[ ii ]->currentText();
DbgLv(1) << "EGSo: svP: nchant" << nchant << "solution" << solution;
if ( solution == unspec )
continue;

nchanf++;
suchans << channel;
susolus << solution;
QString sol_id = solu_ids[ solution ];
QString ch_comment;
QStringList cs;
DbgLv(1) << "EGSo: svP: nchanf" << nchanf << "sol_id" << sol_id;

qDebug() << "sol save 2";

// //resize here!
// rpSolut->chsols.resize( nchanf );


qDebug() << "ii, rpSolut->chsols.size(): -- " << ii << rpSolut->chsols.size();

QString iistr = QString::number(ii);
//if ( pro_comms.keys().contains( solution ) )
if ( pro_comms.keys().contains( iistr ) )
{
//ch_comment = pro_comms[ solution ];
ch_comment = pro_comms[ iistr ];
//ALEXEY - to remember changes to Soluton comments if manual commnets was added while returning to "Solutons" tab

qDebug() << "sol save 2a";

commentStrings( solution, ch_comment, cs, ii );
}
else
{
//commentStrings( solution, ch_comment, cs, ii ); //<-- incorrect as always sets comment to solname!
qDebug() << "sol save 2aB";

if ( rpSolut->chsols.size() == 0 )
{
qDebug() << "sol save 2aBc";
ch_comment = QString("");
commentStrings( solution, ch_comment, cs, ii );
qDebug() << "sol save 2aBc_1: went through 1st time zero";
}
else
{
qDebug() << "sol save 2aBd, ii, rpSolut->chsols.size(): -- " << ii << rpSolut->chsols.size();
ch_comment = rpSolut->chsols[ ii ].ch_comment;
if ( solution_comment_init[ ii ] )
commentStrings( solution, ch_comment, cs, ii );
qDebug() << "sol save 2aBd_1: went through 1st time NON-zero";
}

//ch_comment = rpSolut->chsols[ ii ].ch_comment;
QString ch_comment_tmp = ch_comment;
ch_comment_tmp.replace(solution, "");
ch_comment_tmp.remove( QRegExp("^[,\\s*]+") );

qDebug() << "SolInit, row: " << ii;
manual_comment[ iistr ] = ch_comment_tmp.trimmed();
}

qDebug() << "sol save 3";

US_Solution soludata;
solutionData( solution, soludata );
solu_ids [ solution ] = sol_id;
solu_data[ solution ] = soludata;
//pro_comms[ solution ] = ch_comment;
pro_comms[ iistr ] = ch_comment;
}

nchanf++;
suchans << channel;
susolus << solution;
QString sol_id = solu_ids[ solution ];
QString ch_comment;
QStringList cs;
DbgLv(1) << "EGSo: svP: nchanf" << nchanf << "sol_id" << sol_id;


QString iistr = QString::number(ii);
//if ( pro_comms.keys().contains( solution ) )
if ( pro_comms.keys().contains( iistr ) )
{
//ch_comment = pro_comms[ solution ];
ch_comment = pro_comms[ iistr ];
//ALEXEY - to remember changes to Soluton comments if manual commnets was added while returning to "Solutons" tab

commentStrings( solution, ch_comment, cs, ii );
}
else
{
commentStrings( solution, ch_comment, cs, ii );
}

US_Solution soludata;
solutionData( solution, soludata );
solu_ids [ solution ] = sol_id;
solu_data[ solution ] = soludata;
//pro_comms[ solution ] = ch_comment;
pro_comms[ iistr ] = ch_comment;
}

//resize here
rpSolut->chsols.resize( nchanf );
QStringList solus; // Unique solutions list
QStringList sids; // Corresponding Id list
DbgLv(1) << "EGSo: svP: nchanf" << nchanf << "nchant" << nchant;
DbgLv(1) << "EGSo: svP: nchanf" << nchanf << "nchant" << nchant;

for ( int ii = 0; ii < nchanf; ii++ )
{ // Now fill protocol from internal lists and parameters
Expand All @@ -2424,6 +2463,8 @@ DbgLv(1) << "EGSo: svP: nchanf" << nchanf << "nchant" << nchant;
QString iistr = QString::number(ii);
rpSolut->chsols[ ii ].ch_comment = pro_comms[ iistr ];

qDebug() << "at saveSolPanel: ch_comment -- " << pro_comms[ iistr ];

if ( !solus.contains( solution ) )
{
solus << solution;
Expand Down
2 changes: 2 additions & 0 deletions programs/us_experiment/us_experiment_gui_optima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4282,6 +4282,8 @@ void US_ExperGuiSolutions::commentStrings( const QString solname,
{
comment += ", " + mancmt;
//comstrngs << "," + mancmt;

qDebug() << "Updated comment is: " << comment;
}
}

Expand Down

0 comments on commit 245d135

Please sign in to comment.