[us-commits] r2768 - in trunk: gui programs/us_com_project programs/us_convert programs/us_experiment programs/us_xpn_viewer sql
svn at svn.aucsolutions.com
svn at svn.aucsolutions.com
Fri May 17 22:00:56 MDT 2019
Author: alexey
Date: 2019-05-18 04:00:52 +0000 (Sat, 18 May 2019)
New Revision: 2768
Modified:
trunk/gui/us_select_item.cpp
trunk/gui/us_select_item.h
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_com_project/us_com_project_gui.h
trunk/programs/us_convert/us_convert_gui.cpp
trunk/programs/us_convert/us_convert_gui.h
trunk/programs/us_experiment/us_exp_utils.cpp
trunk/programs/us_experiment/us_experiment_gui_optima.cpp
trunk/programs/us_experiment/us_experiment_gui_optima.h
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h
trunk/sql/us3.sql
trunk/sql/us3_autoflow_procs.sql
Log:
Lots of updates on autoflow:
* redesign of manual abortion of experiemnt
-- stored procs, different logic for stage update
* Logic for 'Define Another Experiment' implemented
-- exclusion of instruments in-use
Needs LOTS of testing....
Modified: trunk/gui/us_select_item.cpp
===================================================================
--- trunk/gui/us_select_item.cpp 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/gui/us_select_item.cpp 2019-05-18 04:00:52 UTC (rev 2768)
@@ -169,8 +169,10 @@
if ( autoflow_button )
cancel_pb_label = tr("Define Another Experiment");
- QPushButton* pb_cancel = us_pushbutton( cancel_pb_label );
+ //QPushButton* pb_cancel = us_pushbutton( cancel_pb_label );
+ pb_cancel = us_pushbutton( cancel_pb_label );
+
QString accept_pb_label( tr( "Select Item" ) );
if ( autoflow_button )
accept_pb_label = tr("Select Optima Run to Follow");
Modified: trunk/gui/us_select_item.h
===================================================================
--- trunk/gui/us_select_item.h 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/gui/us_select_item.h 2019-05-18 04:00:52 UTC (rev 2768)
@@ -43,6 +43,8 @@
US_SelectItem( QList< QStringList >&, QStringList&, const QString,
QList< int >*, const int = (-2) );
+ QPushButton* pb_cancel;
+
private:
QList< QStringList >& items;
QStringList& hdrs;
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-05-18 04:00:52 UTC (rev 2768)
@@ -141,12 +141,17 @@
test_footer->setStyleSheet("color: #D3D9DF; background-color: #36454f;");
main->addWidget( test_footer );
+ connect( this, SIGNAL( pass_used_instruments( QStringList & ) ), epanExp, SLOT( pass_used_instruments( QStringList &) ) );
+
connect( epanExp, SIGNAL( switch_to_live_update( QMap < QString, QString > &) ), this, SLOT( switch_to_live_update( QMap < QString, QString > & ) ) );
connect( this , SIGNAL( pass_to_live_update( QMap < QString, QString > &) ), epanObserv, SLOT( process_protocol_details( QMap < QString, QString > & ) ) );
connect( epanExp, SIGNAL( to_autoflow_records( ) ), this, SLOT( to_autoflow_records( ) ) );
- connect( epanObserv, SIGNAL( switch_to_post_processing( QString &, QString &, QString &, SQtring &) ), this, SLOT( switch_to_post_processing( QString &, QString &, QString &, QString &) ) );
- connect( this, SIGNAL( import_data_us_convert( QString &, QString &, QString &, QString & ) ), epanPostProd, SLOT( import_data_us_convert( QString &, QString &, QString &, QString & ) ) );
+ // connect( epanObserv, SIGNAL( switch_to_post_processing( QString &, QString &, QString &, SQtring &) ), this, SLOT( switch_to_post_processing( QString &, QString &, QString &, QString &) ) );
+ // connect( this, SIGNAL( import_data_us_convert( QString &, QString &, QString &, QString & ) ), epanPostProd, SLOT( import_data_us_convert( QString &, QString &, QString &, QString & ) ) );
+ connect( epanObserv, SIGNAL( switch_to_post_processing( QMap < QString, QString > & ) ), this, SLOT( switch_to_post_processing( QMap < QString, QString > & ) ) );
+ connect( this, SIGNAL( import_data_us_convert( QMap < QString, QString > & ) ), epanPostProd, SLOT( import_data_us_convert( QMap < QString, QString > & ) ) );
+
connect( epanObserv, SIGNAL( switch_to_experiment( QString &) ), this, SLOT( switch_to_experiment( QString & ) ) );
connect( this, SIGNAL( clear_experiment( QString & ) ), epanExp, SLOT( clear_experiment( QString & ) ) );
connect( epanObserv, SIGNAL( close_everything() ), this, SLOT( close_all() ));
@@ -274,12 +279,17 @@
test_footer->setStyleSheet("color: #D3D9DF; background-color: #36454f;");
main->addWidget( test_footer );
+ connect( this, SIGNAL( pass_used_instruments( QStringList & ) ), epanExp, SLOT( pass_used_instruments( QStringList &) ) );
+
connect( epanExp, SIGNAL( switch_to_live_update( QMap < QString, QString > &) ), this, SLOT( switch_to_live_update( QMap < QString, QString > & ) ) );
connect( this , SIGNAL( pass_to_live_update( QMap < QString, QString > &) ), epanObserv, SLOT( process_protocol_details( QMap < QString, QString > & ) ) );
connect( epanExp, SIGNAL( to_autoflow_records( ) ), this, SLOT( to_autoflow_records( ) ) );
- connect( epanObserv, SIGNAL( switch_to_post_processing( QString &, QString &, QString &, QString & ) ), this, SLOT( switch_to_post_processing( QString &, QString &, QString &, QString & )));
- connect( this, SIGNAL( import_data_us_convert( QString &, QString &, QString &, QString & ) ), epanPostProd, SLOT( import_data_us_convert( QString &, QString &, QString &, QString & ) ) );
+ // connect( epanObserv, SIGNAL( switch_to_post_processing( QString &, QString &, QString &, QString & ) ), this, SLOT( switch_to_post_processing( QString &, QString &, QString &, QString & )));
+ // connect( this, SIGNAL( import_data_us_convert( QString &, QString &, QString &, QString & ) ), epanPostProd, SLOT( import_data_us_convert( QString &, QString &, QString &, QString & ) ) );
+ connect( epanObserv, SIGNAL( switch_to_post_processing( QMap < QString, QString > & ) ), this, SLOT( switch_to_post_processing( QMap < QString, QString > & ) ) );
+ connect( this, SIGNAL( import_data_us_convert( QMap < QString, QString > & ) ), epanPostProd, SLOT( import_data_us_convert( QMap < QString, QString > & ) ) );
+
connect( epanObserv, SIGNAL( switch_to_experiment( QString &) ), this, SLOT( switch_to_experiment( QString & ) ) );
connect( this, SIGNAL( clear_experiment( QString & ) ), epanExp, SLOT( clear_experiment( QString & ) ) );
connect( epanObserv, SIGNAL( close_everything() ), this, SLOT( close_all() ));
@@ -408,8 +418,20 @@
US_DB2* dbP = new US_DB2( pw.getPasswd() );
//read_optima_machines
+ read_optima_machines( dbP );
+
+ //read autoflow records
list_all_autoflow_records( autoflowdata, dbP );
+
+ //count instruments in use
+ occupied_instruments.clear();
+ for ( int i=0; i < autoflowdata.size(); i++ )
+ {
+ if ( autoflowdata[ i ][ 5 ] == "LIVE_UPDATE" )
+ occupied_instruments << autoflowdata[ i ][ 2 ];
+ }
+
QString pdtitle( tr( "Select Optima Run to Follow" ) );
QStringList hdrs;
int prx;
@@ -417,7 +439,8 @@
<< "Run Name"
<< "Optima Name"
<< "Created"
- << "Started";
+ << "Run Status"
+ << "Stage";
QString autoflow_btn = "AUTOFLOW";
@@ -427,16 +450,22 @@
pdiag->setParent(this, Qt::Window);
pdiag->setWindowFlags(Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint );
//pdiag->setWindowFlags(Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint );
+
+ //disable 'Define Another Exp.' button if all instruments are in use
+ if ( occupied_instruments.size() == instruments.size() )
+ pdiag->pb_cancel->setEnabled( false );
+
QString autoflow_id_selected("");
if ( pdiag->exec() == QDialog::Accepted )
autoflow_id_selected = autoflowdata[ prx ][ 0 ];
else
{
- //ALEXEY: define what to do if Optima is occupied, OR if there is another Optima (occupied or not)
- // autoflowdata[ i ][ 2 ]; // <-- gives Optima Name
- // autoflowdata[ i ][ 4 ]; // <-- STARTED / NOT STARTED
+ //ALEXEY: define what to do if some Optima(s) are occupied
+ // should emit signal sending list of optima's in use to us_experiment.
+
+ define_new_experiment( occupied_instruments );
return;
}
@@ -452,6 +481,7 @@
QString invID_passed = protocol_details[ "invID_passed" ];
QString ProtName = protocol_details[ "protocolName" ];
QString correctRadii = protocol_details[ "correctRadii" ];
+ QString expAborted = protocol_details[ "expAborted" ];
//ALEXEY: if stage=="EDITING" && curDir.isEmpty() (NULL)
/*
@@ -470,8 +500,9 @@
if ( stage == "EDITING" )
{
//do something
- switch_to_post_processing( currDir, ProtName, invID_passed, correctRadii );
-
+ //switch_to_post_processing( currDir, ProtName, invID_passed, correctRadii );
+ switch_to_post_processing( protocol_details );
+
//ALEXEY: should pass investigator as well: should be saved in 'autoflow'
/*
switch_to_post_processing( currDir, ProtName, invID_passed );
@@ -505,7 +536,6 @@
{
QList< int > instrumentIDs;
- // Grab all the IDs so we can reuse the db connection
while ( db->next() )
{
int ID = db->value( 0 ).toString().toInt();
@@ -570,6 +600,7 @@
QStringList autoflowentry;
QString id = dbP->value( 0 ).toString();
QString runname = dbP->value( 5 ).toString();
+ QString status = dbP->value( 8 ).toString();
QString optimaname = dbP->value( 10 ).toString();
QDateTime time_started = dbP->value( 11 ).toDateTime().toUTC();
@@ -582,9 +613,16 @@
if ( time_started.toString().isEmpty() )
autoflowentry << QString( tr( "NOT STARTED" ) );
else
- autoflowentry << QString( tr( "STARTED" ) );
- //autoflowentry << time_started.toString();
+ {
+ if ( status == "LIVE_UPDATE" )
+ autoflowentry << QString( tr( "RUNNING" ) );
+ if ( status == "EDITING" )
+ autoflowentry << QString( tr( "COMPLETED" ) );
+ //autoflowentry << time_started.toString();
+ }
+ autoflowentry << status;
+
autoflowdata << autoflowentry;
nrecs++;
}
@@ -659,6 +697,7 @@
protocol_details[ "runStarted" ] = db->value( 10 ).toString();
protocol_details[ "invID_passed" ] = db->value( 11 ).toString();
protocol_details[ "correctRadii" ] = db->value( 12 ).toString();
+ protocol_details[ "expAborted" ] = db->value( 13 ).toString();
}
}
@@ -666,7 +705,15 @@
}
+// Slot to define new exp. (from initial dialog)
+void US_ComProjectMain::define_new_experiment( QStringList & occupied_instruments )
+{
+ tabWidget->setCurrentIndex( 0 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+ emit pass_used_instruments( occupied_instruments );
+}
+
+
// Slot to pass submitted to Optima run info to the Live Update tab
void US_ComProjectMain::switch_to_live_update( QMap < QString, QString > & protocol_details)
{
@@ -715,14 +762,24 @@
}
+// // Slot to switch from the Live Update to Editing tab
+// void US_ComProjectMain::switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii )
+// {
+// tabWidget->setCurrentIndex( 2 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+
+// // ALEXEY: Make a record to 'autoflow' table: stage# = 2;
+
+// emit import_data_us_convert( currDir, protocolName, invID_passed, correctRadii );
+// }
+
// Slot to switch from the Live Update to Editing tab
-void US_ComProjectMain::switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii )
+void US_ComProjectMain::switch_to_post_processing( QMap < QString, QString > & protocol_details )
{
- tabWidget->setCurrentIndex( 2 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
-
- // ALEXEY: Make a record to 'autoflow' table: stage# = 2;
-
- emit import_data_us_convert( currDir, protocolName, invID_passed, correctRadii );
+ tabWidget->setCurrentIndex( 2 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+
+ // ALEXEY: Make a record to 'autoflow' table: stage# = 2;
+
+ emit import_data_us_convert( protocol_details );
}
// Slot to switch back from the Live Update to Experiment tab
@@ -831,6 +888,9 @@
connect( sdiag, SIGNAL( us_exp_is_closed() ), this, SLOT( us_exp_is_closed_set_button() ) );
//connect( this, SIGNAL( set_auto_mode() ), sdiag, SLOT( auto_mode_passed() ) );
+
+ connect( this, SIGNAL( define_used_instruments( QStringList & ) ), sdiag, SLOT( exclude_used_instruments( QStringList & ) ) );
+
connect( sdiag, SIGNAL( to_live_update( QMap < QString, QString > & ) ),
this, SLOT( to_live_update( QMap < QString, QString > & ) ) );
@@ -885,7 +945,12 @@
QWidget::resizeEvent(event);
}
+void US_ExperGui::pass_used_instruments( QStringList & occupied_instruments )
+{
+ emit define_used_instruments( occupied_instruments );
+}
+
//When run is submitted to Optima & protocol details are passed ..
void US_ExperGui::to_live_update( QMap < QString, QString > & protocol_details)
{
@@ -1010,8 +1075,10 @@
connect( this, SIGNAL( to_xpn_viewer( QMap < QString, QString > &) ), sdiag, SLOT( check_for_data ( QMap < QString, QString > & ) ) );
//ALEXEY: devise SLOT saying what to do upon completion of experiment and exporting AUC data to hard drive - Import Experimental Data !!!
- connect( sdiag, SIGNAL( experiment_complete_auto( QString &, QString &, QString &, QString & ) ), this, SLOT( to_post_processing ( QString &, QString &, QString &, QString & ) ) );
-
+ //connect( sdiag, SIGNAL( experiment_complete_auto( QString &, QString &, QString &, QString & ) ), this, SLOT( to_post_processing ( QString &, QString &, QString &, QString & ) ) );
+ connect( sdiag, SIGNAL( experiment_complete_auto( QMap < QString, QString > & ) ), this, SLOT( to_post_processing ( QMap < QString, QString > & ) ) );
+
+
//ALEXEY: return to 1st panel when exp. aborted & no data saved..
connect( sdiag, SIGNAL( return_to_experiment( QString & ) ), this, SLOT( to_experiment ( QString &) ) );
@@ -1072,9 +1139,14 @@
emit to_xpn_viewer( protocol_details );
}
-void US_ObservGui::to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii )
+// void US_ObservGui::to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii )
+// {
+// emit switch_to_post_processing( currDir, protocolName, invID_passed, correctRadii );
+// }
+
+void US_ObservGui::to_post_processing( QMap < QString, QString > & protocol_details )
{
- emit switch_to_post_processing( currDir, protocolName, invID_passed, correctRadii );
+ emit switch_to_post_processing( protocol_details );
}
void US_ObservGui::to_experiment( QString & protocolName )
@@ -1131,7 +1203,9 @@
sdiag = new US_ConvertGui("AUTO");
sdiag->setParent(this, Qt::Widget);
- connect( this, SIGNAL( to_post_prod( QString &, QString &, QString &, QString & ) ), sdiag, SLOT( import_data_auto ( QString &, QString &, QString &, QString & ) ) );
+ //connect( this, SIGNAL( to_post_prod( QString &, QString &, QString &, QString & ) ), sdiag, SLOT( import_data_auto ( QString &, QString &, QString &, QString & ) ) );
+ connect( this, SIGNAL( to_post_prod( QMap < QString, QString > & ) ), sdiag, SLOT( import_data_auto ( QMap < QString, QString > & ) ) );
+
//ALEXEY: switch to Analysis
connect( sdiag, SIGNAL( saving_complete_auto( QString &, QString & ) ), this, SLOT( to_analysis ( QString &, QString &) ) );
//ALEXEY: for academic ver. switch back to experiment
@@ -1149,9 +1223,14 @@
}
-void US_PostProdGui::import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii )
+// void US_PostProdGui::import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii )
+// {
+// emit to_post_prod( currDir, protocolName, invID_passed, correctRadii );
+// }
+
+void US_PostProdGui::import_data_us_convert( QMap < QString, QString > & protocol_details )
{
- emit to_post_prod( currDir, protocolName, invID_passed, correctRadii );
+ emit to_post_prod( protocol_details );
}
void US_PostProdGui::to_analysis( QString & currDir, QString & protocolName )
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-05-18 04:00:52 UTC (rev 2768)
@@ -90,12 +90,14 @@
void to_live_update( QMap < QString, QString > & protocol_details );
void clear_experiment( QString & protocolName);
void exp_cleared( void );
+ void pass_used_instruments( QStringList & );
signals:
void switch_to_live_update( QMap < QString, QString > & protocol_details );
void set_auto_mode( void );
void reset_experiment( QString & protocolName);
void to_autoflow_records( void );
+ void define_used_instruments( QStringList & );
};
@@ -118,12 +120,16 @@
private slots:
void process_protocol_details( QMap < QString, QString > & protocol_details );
- void to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ //void to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ void to_post_processing( QMap < QString, QString > & );
+
void to_experiment( QString & protocolName );
void to_close_program( void );
signals:
void to_xpn_viewer( QMap < QString, QString > & protocol_details );
- void switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ //void switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ void switch_to_post_processing( QMap < QString, QString > & );
+
void switch_to_experiment( QString & protocolName );
void close_everything( void );
};
@@ -148,12 +154,16 @@
void resizeEvent(QResizeEvent *event) override;
private slots:
- void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ //void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ void import_data_us_convert( QMap < QString, QString > &);
+
void to_analysis( QString & currDir, QString & protocolName );
void to_experiment( QString & protocolName );
signals:
- void to_post_prod( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ //void to_post_prod( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ void to_post_prod( QMap < QString, QString > & );
+
void switch_to_analysis( QString & currDir, QString & protocolName );
void switch_to_exp( QString & protocolName );
};
@@ -233,6 +243,8 @@
bool window_closed;
+ QStringList occupied_instruments;
+
private:
US_ExperGui* epanExp; // US_Exp panel
US_ObservGui* epanObserv; // US_Observ panel
@@ -250,7 +262,6 @@
static int list_all_autoflow_records( QList< QStringList >&, US_DB2* );
void read_optima_machines( US_DB2* = 0 );
- QMap<QString, QString> currentInstrument;
QList< QMap<QString, QString> > instruments;
private slots:
@@ -264,7 +275,9 @@
//void unable_tabs_buttons( void); // Slot to unable Tabs and Buttons when user level is low
//void enable_tabs_buttons( void); // Slot to enable Tabs and Buttons after protocol is loaded
void switch_to_live_update( QMap < QString, QString > & protocol_details );
- void switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ //void switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ void switch_to_post_processing( QMap < QString, QString > & );
+
void switch_to_analysis( QString & currDir, QString & protocolName );
void switch_to_experiment( QString & protocolName );
//void check_current_stage( void );
@@ -272,13 +285,18 @@
void closeEvent ( QCloseEvent* );
void to_autoflow_records( void );
+
+ void define_new_experiment( QStringList & );
signals:
void pass_to_live_update( QMap < QString, QString > & protocol_details );
- void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ //void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
+ void import_data_us_convert( QMap < QString, QString > & );
+
void pass_to_analysis( QString & currDir, QString & protocolName );
void clear_experiment( QString & protocolName);
void us_comproject_closed( void );
+ void pass_used_instruments( QStringList & );
};
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-05-18 04:00:52 UTC (rev 2768)
@@ -1123,7 +1123,8 @@
}
-void US_ConvertGui::import_data_auto( QString &currDir, QString &protocolName, QString &invID_passed, QString &correctRadii )
+//void US_ConvertGui::import_data_auto( QString &currDir, QString &protocolName, QString &invID_passed, QString &correctRadii )
+void US_ConvertGui::import_data_auto( QMap < QString, QString > & details_at_live_update )
{
// ALEXEY TO BE ADDED...
/*
@@ -1132,20 +1133,61 @@
ExpData.invID = invID_passed.toInt();
*/
- //ExpData.invID = 41; // Nemetchek's ID
- ExpData.invID = invID_passed.toInt();
+ // //ExpData.invID = 41; // Nemetchek's ID
+ // ExpData.invID = invID_passed.toInt();
- qDebug() << "US_CONVERT: ExpData.invID, invID_passed: " << ExpData.invID << ", " << invID_passed;
+ // qDebug() << "US_CONVERT: ExpData.invID, invID_passed: " << ExpData.invID << ", " << invID_passed;
- QStringList currDir_list = currentDir.split("-run");
- runID_numeric = currDir_list[ currDir_list.size() - 1 ];
- runID_numeric.replace("/","");
+ // int impType = getImports_auto( currDir );
+ // ProtocolName_auto = protocolName;
+
+ // QStringList currDir_list = currDir.split("-run");
+ // runID_numeric = currDir_list[ currDir_list.size() - 1 ];
+ // runID_numeric.replace("/","");
- int impType = getImports_auto( currDir );
- ProtocolName_auto = protocolName;
+ // qDebug() << "RunID_numeric from CurrentDir: " << runID_numeric;
+ ExpData.invID = details_at_live_update[ "invID_passed" ].toInt();
+ ProtocolName_auto = details_at_live_update[ "protocolName" ];
+ runID_numeric = details_at_live_update[ "runID" ];
+
+ int impType = getImports_auto( details_at_live_update[ "dataPath" ] );
+
+
+ /* -------------------------------------------------------------------------------------------------------------------*/
+ //ALEXEY: Case when Run was manually aborted from Optima panel:
+ if ( details_at_live_update[ "expAborted" ] == "YES" )
+ {
+ QMessageBox msgBox;
+ msgBox.setText(tr("Experiment was aborted!"));
+ msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. "
+ "If saved, the program will proceed to the next stage (Editing). "
+ "Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
+ msgBox.setWindowTitle(tr("Experiment Abortion"));
+ QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
+ QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
+
+ msgBox.setIcon(QMessageBox::Question);
+ msgBox.exec();
+
+ if (msgBox.clickedButton() == Save)
+ {
+ msgBox.accept();
+ }
+
+ else if (msgBox.clickedButton() == Ignore)
+ {
+ delete_autoflow_record();
+ emit saving_complete_back_to_exp( ProtocolName_auto );
+ return;
+ }
+ }
+
+
+ /* ----------------------------------------------------------------------------------------------------------------------------*/
//ALEXEY: if there is no radii_correction data found, return for commercial, and present dialog for academic:
- if ( correctRadii == "NO" )
+ //if ( correctRadii == "NO" )
+ if ( details_at_live_update[ "correctRadii" ] == "NO" )
{
if ( !usmode ) // us_comprojetc
{
@@ -1193,7 +1235,7 @@
}
}
}
-
+ /* ----------------------------------------------------------------------------------------------------------------------------*/
if ( impType == 1 )
@@ -1598,11 +1640,6 @@
// runID += QString("-test");
qDebug() << "RUNID from files[0]: files[0]" << fname << ", runID: " << runID;
- // QStringList currDir_list = currentDir.split("-run");
- // QString runID_num = currDir_list[ currDir_list.size() - 1 ];
- // runID_num.replace("/","");
- // qDebug() << "Exp. RunID: " << runID_num;
-
le_runID2->setText( runID );
le_runID ->setText( runID );
Modified: trunk/programs/us_convert/us_convert_gui.h
===================================================================
--- trunk/programs/us_convert/us_convert_gui.h 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/programs/us_convert/us_convert_gui.h 2019-05-18 04:00:52 UTC (rev 2768)
@@ -303,7 +303,8 @@
*/
void assign_investigator( int );
- void import_data_auto (QString &, QString &, QString &, QString &);
+ //void import_data_auto (QString &, QString &, QString &, QString &);
+ void import_data_auto ( QMap < QString, QString > & ) ;
void import ( void );
void reimport ( void );
Modified: trunk/programs/us_experiment/us_exp_utils.cpp
===================================================================
--- trunk/programs/us_experiment/us_exp_utils.cpp 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/programs/us_experiment/us_exp_utils.cpp 2019-05-18 04:00:52 UTC (rev 2768)
@@ -737,6 +737,7 @@
DbgLv(1) << "EGRo: inP: rotID" << rpRotor->rotID << "rotor" << rpRotor->rotor
<< "cb_rotor text" << cb_rotor->currentText();
DbgLv(1) << "EGRo: inP: calID" << rpRotor->calID << "calib" << rpRotor->calibration;
+
}
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.cpp
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-05-18 04:00:52 UTC (rev 2768)
@@ -45,8 +45,9 @@
automode = false;
usmode = false;
global_reset = false;
+ instruments_in_use.clear();
- // Create tab and panel widgets
+ // Create tab and panel widgets
tabWidget = us_tabwidget();
tabWidget->setTabPosition( QTabWidget::North );
@@ -183,6 +184,18 @@
}
+void US_ExperimentMain::exclude_used_instrument( QStringList & occupied_instruments )
+{
+ instruments_in_use.clear();
+ qDebug() << "OCCUPIED IINSTRUMENTS: " << occupied_instruments;
+
+ for ( int i=0; i < occupied_instruments.size(); i++)
+ instruments_in_use << occupied_instruments[i];
+
+ //Re-initialize Instruments based on the passed excluded list
+ epanRotor->setFirstLab();
+}
+
void US_ExperimentMain::us_mode_passed( void )
{
qDebug() << "US_MODE SIGNAL: ";
@@ -887,9 +900,36 @@
foreach ( US_Rotor::Instrument instrument, instruments )
{
if(instrument.name.contains("Optima"))
- sl_optimas << QString::number( instrument.ID )
- + ": " + instrument.name;
+ {
+ if ( !mainw->automode )
+ {
+ // Regular us_experiment: populate ALL instruments
+ sl_optimas << QString::number( instrument.ID ) + ": " + instrument.name;
+
+ qDebug() << "ASSIGNING INSTRUMENTS: " << instrument.name;
+ }
+ else
+ {
+ //ALEXEY: passed from autoflow: Exclude instruments in USE
+ bool optima_in_use = false;
+ for (int ll = 0; ll < mainw->instruments_in_use.size(); ll++)
+ {
+ if ( instrument.name == mainw->instruments_in_use[ll] )
+ {
+ optima_in_use = true;
+ break;
+ }
+ }
+
+ if ( !optima_in_use)
+ {
+ sl_optimas << QString::number( instrument.ID ) + ": " + instrument.name;
+ qDebug() << "ASSIGNING FREE INSTRUMENTS: " << instrument.name;
+ }
+ }
+ }
}
+
cb_optima->clear();
cb_optima->addItems( sl_optimas );
@@ -5306,6 +5346,7 @@
protocol_details[ "duration" ] = QString::number(Total_duration);
protocol_details[ "invID_passed" ] = QString::number(US_Settings::us_inv_ID());
protocol_details[ "correctRadii" ] = QString("YES");
+ protocol_details[ "expAborted" ] = QString("NO");
int nwavl_tot = 0;
for ( int kk = 0; kk < rpRange->nranges; kk++ )
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.h
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-05-18 04:00:52 UTC (rev 2768)
@@ -914,6 +914,9 @@
void auto_mode_passed( void );
void us_mode_passed( void );
+ void exclude_used_instrument( QStringList &);
+ QStringList instruments_in_use;
+
int tabHeight;
int buttLHeight;
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-05-18 04:00:52 UTC (rev 2768)
@@ -221,7 +221,8 @@
QGridLayout* live_params = new QGridLayout;
QGridLayout* time_params = new QGridLayout;
- auto_mode_bool = true;
+ auto_mode_bool = true;
+ experimentAborted = false;
navgrec = 10;
dbg_level = US_Settings::us_debug();
@@ -745,7 +746,8 @@
QGridLayout* settings = new QGridLayout;
auto_mode_bool = false;
-
+ experimentAborted = false;
+
navgrec = 10;
dbg_level = US_Settings::us_debug();
QFont sfont( US_GuiSettings::fontFamily(), US_GuiSettings::fontSize() - 1 );
@@ -1646,6 +1648,9 @@
//Delete autoflow record upon Run abortion
void US_XpnDataViewer::updateautoflow_record_atLiveUpdate( void )
{
+
+ details_at_live_update[ "runID" ] = RunID_to_retrieve;
+
// Check DB connection
US_Passwd pw;
QString masterpw = pw.getPasswd();
@@ -1665,6 +1670,8 @@
db->query( qry );
+ details_at_live_update[ "dataPath" ] = currentDir;
+
//ALEXEY: if there is NO chromatic Abber. data, set corrRadii in autoflow record to 'NO'
if ( correctRadii == "NO" )
{
@@ -1673,7 +1680,21 @@
<< RunID_to_retrieve;
db->query( qry );
+
+ details_at_live_update[ "correctRadii" ] = QString("NO"); //currentDir;
}
+
+ //ALEXEY: if run was aborted manually from the Optima panel, set expAborted to 'YES'
+ if ( experimentAborted )
+ {
+ qry.clear();
+ qry << "update_autoflow_at_live_update_expaborted"
+ << RunID_to_retrieve;
+
+ db->query( qry );
+
+ details_at_live_update[ "expAborted" ] = QString("YES");
+ }
// // OR
@@ -1812,15 +1833,18 @@
int exp_status = CheckExpComplete_auto( RunID_to_retrieve );
- if ( exp_status == 5 )
+ if ( exp_status == 5 || exp_status == 0 )
{
+ if ( exp_status == 0)
+ experimentAborted = true;
+
//timer_check_sysdata->stop();
//ALEXEY: This timer cannot be stopped from another thread, but can be dealt with signal/slot upon Qthread termination..
// disconnection maybe enough...
disconnect(timer_check_sysdata, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
sys_thread->quit(); // ALEXEY: does this emit Qthread's finished() signal??
- qDebug() << "ExpStat: 5 - sys_timer STOPPED here: ";
+ qDebug() << "ExpStat: 5/0 - sys_timer STOPPED here: ";
if ( !timer_check_sysdata->isActive() )
qDebug() << "QTimer timer_check_sysdata STOPPED by quitting the QThread !!! ";
@@ -1833,8 +1857,8 @@
{
if ( !timer_data_reload->isActive() )
{
- qDebug() << "TRY PROCEED INTO ==5 from check_for_sys_data()....";
- // ALEXEY Export AUC data: devise export_auc_auto() function which would return directory name with saved data - to pass to emit signal below...
+ qDebug() << "TRY PROCEED INTO == 5/0 from check_for_sys_data()....";
+
export_auc_auto();
// QString mtitle_complete = tr( "Complete!" );
@@ -1842,63 +1866,67 @@
// QMessageBox::information( this, mtitle_complete, message_done );
updateautoflow_record_atLiveUpdate();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
-
+ //emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
+
+ reset();
+ emit experiment_complete_auto( details_at_live_update );
+
return;
}
}
}
- if ( exp_status == 0 ) //ALEXEY should be == 3 as per documentation
- {
- //timer_check_sysdata->stop();
- disconnect(timer_check_sysdata, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
- sys_thread->quit(); // ALEXEY: does this emit Qthread's finished() signal??
- qDebug() << "ExpStat: 3 - sys_timer STOPPED here: ";
+ // if ( exp_status == 0 ) //ALEXEY should be == 3 as per documentation
+ // {
+ // experimentAborted = true;
+ // //timer_check_sysdata->stop();
+ // disconnect(timer_check_sysdata, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
+ // sys_thread->quit(); // ALEXEY: does this emit Qthread's finished() signal??
+ // qDebug() << "ExpStat: 3 - sys_timer STOPPED here: ";
- rpm_box->setSpeed( 0 );
- le_remaining->setText( "00:00:00" );
+ // rpm_box->setSpeed( 0 );
+ // le_remaining->setText( "00:00:00" );
- if ( !timer_all_data_avail->isActive() ) // Check if reload_data Timer is stopped
- {
- if ( !timer_data_reload->isActive() )
- {
- // Ask if data retrived so far should be saved:
+ // if ( !timer_all_data_avail->isActive() ) // Check if reload_data Timer is stopped
+ // {
+ // if ( !timer_data_reload->isActive() )
+ // {
+ // // Ask if data retrived so far should be saved:
- QMessageBox msgBox;
- msgBox.setText(tr("Experiment was aborted!"));
- msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
- msgBox.setWindowTitle(tr("Experiment Abortion"));
- QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
- QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
+ // QMessageBox msgBox;
+ // msgBox.setText(tr("Experiment was aborted!"));
+ // msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
+ // msgBox.setWindowTitle(tr("Experiment Abortion"));
+ // QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
+ // QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
- msgBox.setIcon(QMessageBox::Question);
- msgBox.exec();
+ // msgBox.setIcon(QMessageBox::Question);
+ // msgBox.exec();
- if (msgBox.clickedButton() == Save)
- {
- export_auc_auto();
+ // if (msgBox.clickedButton() == Save)
+ // {
+ // export_auc_auto();
- QString mtitle_complete = tr( "Complete!" );
- QString message_done = tr( "Experiment was completed. Optima data saved..." );
- QMessageBox::information( this, mtitle_complete, message_done );
+ // QString mtitle_complete = tr( "Complete!" );
+ // QString message_done = tr( "Experiment was completed. Optima data saved..." );
+ // QMessageBox::information( this, mtitle_complete, message_done );
- updateautoflow_record_atLiveUpdate();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
- return;
- }
+ // updateautoflow_record_atLiveUpdate();
+ // emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
+ // return;
+ // }
- else if (msgBox.clickedButton() == Ignore)
- {
- reset();
- delete_autoflow_record();
- emit return_to_experiment( ProtocolName );
- return;
- }
- }
- }
- }
+ // else if (msgBox.clickedButton() == Ignore)
+ // {
+ // reset();
+ // delete_autoflow_record();
+ // emit return_to_experiment( ProtocolName );
+ // return;
+ // }
+ // }
+ // }
+ // }
qDebug() << "sys_timer RAN here: ";
@@ -1942,13 +1970,16 @@
ExpID_to_use = protocol_details["experimentId"];
ProtocolName = protocol_details["protocolName"];
RunName = protocol_details[ "experimentName" ];
- CellChNumber = protocol_details[ "CellChNumber" ];
+ CellChNumber = protocol_details[ "CellChNumber" ];
TripleNumber = protocol_details[ "TripleNumber" ];
OptimaName = protocol_details[ "OptimaName" ]; //New
TotalDuration = protocol_details[ "duration" ];
invID_passed = protocol_details[ "invID_passed" ];
correctRadii = protocol_details[ "correctRadii" ];
+ expAborted = protocol_details[ "expAborted" ];
+ details_at_live_update = protocol_details;
+
selectOptimaByName_auto( OptimaName ); //New
timer_data_init = new QTimer;
@@ -2273,45 +2304,66 @@
//ALEXEY: Add Exp. Abortion Exception HERE...
if ( CheckExpComplete_auto( RunID_to_retrieve ) == 0 ) //ALEXEY should be == 3 as per documentation
{
+ experimentAborted = true;
+
timer_all_data_avail->stop();
disconnect(timer_all_data_avail, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
if ( !timer_check_sysdata->isActive() ) // Check if sys_data Timer is stopped
{
- // Ask if data retrived so far should be saved:
+ export_auc_auto();
+ updateautoflow_record_atLiveUpdate();
+
+ reset();
+ emit experiment_complete_auto( details_at_live_update );
+ return;
+ }
+ }
+
+ // //ALEXEY: Add Exp. Abortion Exception HERE...
+ // if ( CheckExpComplete_auto( RunID_to_retrieve ) == 0 ) //ALEXEY should be == 3 as per documentation
+ // {
+ // experimentAborted = true;
+
+ // timer_all_data_avail->stop();
+ // disconnect(timer_all_data_avail, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
+
+ // if ( !timer_check_sysdata->isActive() ) // Check if sys_data Timer is stopped
+ // {
+ // // Ask if data retrived so far should be saved:
- QMessageBox msgBox;
- msgBox.setText(tr("Experiment was aborted!"));
- msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
- msgBox.setWindowTitle(tr("Experiment Abortion"));
- QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
- QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
+ // QMessageBox msgBox;
+ // msgBox.setText(tr("Experiment was aborted!"));
+ // msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
+ // msgBox.setWindowTitle(tr("Experiment Abortion"));
+ // QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
+ // QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
- msgBox.setIcon(QMessageBox::Question);
- msgBox.exec();
+ // msgBox.setIcon(QMessageBox::Question);
+ // msgBox.exec();
- if (msgBox.clickedButton() == Save)
- {
- export_auc_auto();
+ // if (msgBox.clickedButton() == Save)
+ // {
+ // export_auc_auto();
- QString mtitle_complete = tr( "Complete!" );
- QString message_done = tr( "Experiment was completed. Optima data saved..." );
- QMessageBox::information( this, mtitle_complete, message_done );
+ // QString mtitle_complete = tr( "Complete!" );
+ // QString message_done = tr( "Experiment was completed. Optima data saved..." );
+ // QMessageBox::information( this, mtitle_complete, message_done );
- updateautoflow_record_atLiveUpdate();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
- return;
- }
+ // updateautoflow_record_atLiveUpdate();
+ // emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
+ // return;
+ // }
- else if (msgBox.clickedButton() == Ignore)
- {
- reset();
- delete_autoflow_record();
- emit return_to_experiment( ProtocolName );
- return;
- }
- }
- }
+ // else if (msgBox.clickedButton() == Ignore)
+ // {
+ // reset();
+ // delete_autoflow_record();
+ // emit return_to_experiment( ProtocolName );
+ // return;
+ // }
+ // }
+ // }
@@ -3637,8 +3689,11 @@
/*** Check Experiement Status: if completed, kill the timer, export the data into AUC format, return, signal to switch panels in US_comproject ***/
int statusExp = CheckExpComplete_auto( RunID_to_retrieve );
- if ( statusExp == 5 )
+ if ( statusExp == 5 || statusExp == 0 )
{
+ if ( statusExp == 0 )
+ experimentAborted = true;
+
timer_data_reload->stop();
disconnect(timer_data_reload, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
@@ -3653,59 +3708,61 @@
// QMessageBox::information( this, mtitle_complete, message_done );
updateautoflow_record_atLiveUpdate();
+ reset();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
- //QString temp_protname("DemchukA_exosomes40K_111418");
- //emit experiment_complete_auto( currentDir, temp_protname );
-
+ //emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
+ emit experiment_complete_auto( details_at_live_update );
+
return;
}
}
- /** Experiment Aborted ***/
+ // /** Experiment Aborted ***/
- if ( statusExp == 0 ) //ALEXEY should be == 3 as per documentation
- {
- timer_data_reload->stop();
- disconnect(timer_data_reload, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
+ // if ( statusExp == 0 ) //ALEXEY should be == 3 as per documentation
+ // {
+ // experimentAborted = true;
- if ( !timer_check_sysdata->isActive() ) // Check if sys_data Timer is stopped
- {
- // Ask if data retrived so far should be saved:
+ // timer_data_reload->stop();
+ // disconnect(timer_data_reload, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
+
+ // if ( !timer_check_sysdata->isActive() ) // Check if sys_data Timer is stopped
+ // {
+ // // Ask if data retrived so far should be saved:
- QMessageBox msgBox;
- msgBox.setText(tr("Experiment was aborted!"));
- msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
- msgBox.setWindowTitle(tr("Experiment Abortion"));
- QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
- QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
+ // QMessageBox msgBox;
+ // msgBox.setText(tr("Experiment was aborted!"));
+ // msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
+ // msgBox.setWindowTitle(tr("Experiment Abortion"));
+ // QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
+ // QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
- msgBox.setIcon(QMessageBox::Question);
- msgBox.exec();
+ // msgBox.setIcon(QMessageBox::Question);
+ // msgBox.exec();
- if (msgBox.clickedButton() == Save)
- {
- export_auc_auto();
+ // if (msgBox.clickedButton() == Save)
+ // {
+ // export_auc_auto();
- QString mtitle_complete = tr( "Complete!" );
- QString message_done = tr( "Experiment was completed. Optima data saved..." );
- QMessageBox::information( this, mtitle_complete, message_done );
+ // QString mtitle_complete = tr( "Complete!" );
+ // QString message_done = tr( "Experiment was completed. Optima data saved..." );
+ // QMessageBox::information( this, mtitle_complete, message_done );
- updateautoflow_record_atLiveUpdate();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
- return;
- }
+ // updateautoflow_record_atLiveUpdate();
+ // emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
+ // return;
+ // }
- else if (msgBox.clickedButton() == Ignore)
- {
- reset();
- delete_autoflow_record();
- emit return_to_experiment( ProtocolName );
- return;
- }
- }
- }
+ // else if (msgBox.clickedButton() == Ignore)
+ // {
+ // reset();
+ // delete_autoflow_record();
+ // emit return_to_experiment( ProtocolName );
+ // return;
+ // }
+ // }
+ // }
in_reload_auto = false; // Flag no longer in the midst of reload
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-05-18 04:00:52 UTC (rev 2768)
@@ -283,6 +283,11 @@
QString TotalDuration; //New
QString invID_passed;
QString correctRadii;
+ QString expAborted;
+
+ QMap < QString, QString > details_at_live_update;
+
+ bool experimentAborted;
int ElapsedTimeOffset;
@@ -351,7 +356,9 @@
void test_optima_connection( void ); //New
signals:
- void experiment_complete_auto( QString &, QString &, QString &, QString & );
+ //void experiment_complete_auto( QString &, QString &, QString &, QString & );
+ void experiment_complete_auto( QMap < QString, QString > &);
+
void return_to_experiment( QString & );
void close_program( void );
};
Modified: trunk/sql/us3.sql
===================================================================
--- trunk/sql/us3.sql 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/sql/us3.sql 2019-05-18 04:00:52 UTC (rev 2768)
@@ -102,6 +102,7 @@
invID INT NULL,
created TIMESTAMP NULL,
corrRadii enum('YES', 'NO') NOT NULL,
+ expAborted enum('NO', 'YES') NOT NULL,
PRIMARY KEY (ID) )
ENGINE = InnoDB;
Modified: trunk/sql/us3_autoflow_procs.sql
===================================================================
--- trunk/sql/us3_autoflow_procs.sql 2019-05-17 17:01:58 UTC (rev 2767)
+++ trunk/sql/us3_autoflow_procs.sql 2019-05-18 04:00:52 UTC (rev 2768)
@@ -151,8 +151,8 @@
SELECT @OK AS status;
SELECT protName, cellChNum, tripleNum, duration, runName, expID,
- runID, status, dataPath, optimaName, runStarted, invID, created, corrRadii
- FROM autoflow
+ runID, status, dataPath, optimaName, runStarted, invID, created, corrRadii, expAborted
+ FROM autoflow
WHERE ID = p_autoflowID;
END IF;
@@ -323,6 +323,47 @@
END$$
+
+-- Update autoflow record with expAborted value at LIVE_UPDATE
+DROP PROCEDURE IF EXISTS update_autoflow_at_live_update_expaborted$$
+CREATE PROCEDURE update_autoflow_at_live_update_expaborted ( p_personGUID CHAR(36),
+ p_password VARCHAR(80),
+ p_runID INT )
+
+ MODIFIES SQL DATA
+
+BEGIN
+ DECLARE count_records INT;
+
+ CALL config();
+ SET @US3_LAST_ERRNO = @OK;
+ SET @US3_LAST_ERROR = '';
+
+ SELECT COUNT(*)
+ INTO count_records
+ FROM autoflow
+ WHERE runID = p_runID;
+
+ IF ( verify_user( p_personGUID, p_password ) = @OK ) THEN
+ IF ( count_records = 0 ) THEN
+ SET @US3_LAST_ERRNO = @NO_AUTOFLOW_RECORD;
+ SET @US3_LAST_ERROR = 'MySQL: no rows returned';
+
+ ELSE
+ UPDATE autoflow
+ SET expAborted = 'YES'
+ WHERE runID = p_runID;
+
+ END IF;
+
+ END IF;
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+END$$
+
+
+
---- get initial elapsed time upon reattachment -----------------------------
DROP FUNCTION IF EXISTS read_autoflow_times$$
CREATE FUNCTION read_autoflow_times ( p_personGUID CHAR(36),
More information about the us-commits
mailing list