Author: alexey Date: 2019-07-24 06:40:06 +0000 (Wed, 24 Jul 2019) New Revision: 2798 Modified: trunk/gui/us_select_item.cpp 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_xpn_viewer/us_xpn_viewer_gui.cpp Log: Autoflow: * many logical updates (for centralized accessibility of the Manage Runs) Modified: trunk/gui/us_select_item.cpp =================================================================== --- trunk/gui/us_select_item.cpp 2019-07-23 07:35:43 UTC (rev 2797) +++ trunk/gui/us_select_item.cpp 2019-07-24 06:40:06 UTC (rev 2798) @@ -111,22 +111,28 @@ //Inormation field for autoflow QTextEdit* le_info; + QFont le_info_font( US_Widgets::fixedFont().family(), + US_GuiSettings::fontSize() ); + if ( autoflow_button ) { le_info = us_textedit(); QFontMetrics m (le_info -> font()) ; int RowHeight = m.lineSpacing() ; - le_info -> setFixedHeight (5 * RowHeight) ; + le_info -> setFixedHeight (10 * RowHeight) ; QPalette p = le_info->palette(); p.setColor(QPalette::Base, Qt::lightGray); p.setColor(QPalette::Text, Qt::darkRed); le_info->setPalette(p); - le_info->setText(tr( "<ul><li>Information on one or more experimental methods submitted to Bechman Optima(s) is available. " - "<br>You can reattach to the job by selecting the run from the list below. " - "<br>Alternatively, you can define and submit a new experiment method to the availabale Optima instrument(s). </ul></li>" )); + le_info->setText(tr( "Information on one or more experimental methods submitted to Bechman Optima(s) is available." + "<ul><li>You can reattach to specific job by selecting from the list below and clicking \"Select Optima Run to Follow\"</ul></li>" + "<ul><li>Alternatively, you can click \"Define Another Experiment\" to design and/or submit a new experiment method to the availabale Optima instrument(s)</ul></li>" + "<ul><li>Finally, records can be deleted (\"Delete Record\"). Use with caution</ul></li>" )); + + le_info->setFont(le_info_font); main->addWidget( le_info ); } Modified: trunk/programs/us_com_project/us_com_project_gui.cpp =================================================================== --- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-23 07:35:43 UTC (rev 2797) +++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-24 06:40:06 UTC (rev 2798) @@ -124,8 +124,11 @@ tabWidget->tabBar()->setIconSize(QSize(50,50)); - tabWidget->tabBar()->setStyleSheet( "QTabBar::tab {min-width: 70;} QTabBar::tab:selected {background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #fafafa, stop: 0.4 #f4f4f4, stop: 0.5 #e7e7e7, stop: 1.0 #fafafa); } QTabBar::tab:hover {background: lightgray;} QTabBar::tab:first {background: blue; color: lightgray; min-width: 50;} "); + //tabWidget->tabBar()->setStyleSheet( "QTabBar::tab {min-width: 70;} QTabBar::tab:selected {background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #fafafa, stop: 0.4 #f4f4f4, stop: 0.5 #e7e7e7, stop: 1.0 #fafafa); } QTabBar::tab:hover {background: lightgray;} QTabBar::tab:first {background: blue; color: lightgray; min-width: 50;} QTabBar::tab:first:hover {background: #4169E1; color: white} QTabBar::tab:disabled { color: rgba(0, 0, 0, 70%) } "); + //no hoover + tabWidget->tabBar()->setStyleSheet( "QTabBar::tab {min-width: 70;} QTabBar::tab:selected {background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #fafafa, stop: 0.4 #f4f4f4, stop: 0.5 #e7e7e7, stop: 1.0 #fafafa); } QTabBar::tab:first {background: blue; color: lightgray; min-width: 50;} QTabBar::tab:first:hover {background: #4169E1; color: white} QTabBar::tab:disabled { color: rgba(0, 0, 0, 70%) } "); + main->addWidget( tabWidget ); for (int i=0; i < tabWidget->count(); ++i ) @@ -138,8 +141,7 @@ } connect( tabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( initPanels( int ) ) ); - - + logWidget = us_textedit(); logWidget->setMaximumHeight(30); logWidget->setReadOnly(true); @@ -166,18 +168,17 @@ 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( 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( this, SIGNAL( clear_experiment( QString & ) ), epanExp, SLOT( clear_experiment( QString & ) ) ); + //connect( this, SIGNAL( clear_experiment( QString & ) ), epanExp, SLOT( clear_experiment( QString & ) ) ); connect( epanObserv, SIGNAL( close_everything() ), this, SLOT( close_all() )); //connect( epanPostProd, SIGNAL( switch_to_analysis( QString &, QString &) ), this, SLOT( switch_to_analysis( QString &, QString & ) ) ); //connect( this, SIGNAL( pass_to_analysis( QString &, QString & ) ), epanAnalysis, SLOT( do_analysis( QString &, QString & ) ) ); //connect( epanPostProd, SIGNAL( switch_to_exp( QString & ) ), this, SLOT( switch_to_experiment( QString & ) ) ); connect( epanPostProd, SIGNAL( switch_to_initAutoflow( ) ), this, SLOT( close_all( ) ) ); + connect( this, SIGNAL( reset_lims_import() ), epanPostProd, SLOT( reset_lims_import( ) ) ); setMinimumSize( QSize( 1350, 800 ) ); adjustSize(); @@ -283,8 +284,11 @@ tabWidget->tabBar()->setIconSize(QSize(50,50)); - tabWidget->tabBar()->setStyleSheet( "QTabBar::tab {min-width: 70;} QTabBar::tab:selected {background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #fafafa, stop: 0.4 #f4f4f4, stop: 0.5 #e7e7e7, stop: 1.0 #fafafa); } QTabBar::tab:hover {background: lightgray;} QTabBar::tab:first {background: blue; color: lightgray; min-width: 50;} QTabBar::tab:first:hover {background: #4169E1; color: white} QTabBar::tab:disabled {} "); + //tabWidget->tabBar()->setStyleSheet( "QTabBar::tab {min-width: 70;} QTabBar::tab:selected {background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #fafafa, stop: 0.4 #f4f4f4, stop: 0.5 #e7e7e7, stop: 1.0 #fafafa); } QTabBar::tab:hover {background: lightgray;} QTabBar::tab:first {background: blue; color: lightgray; min-width: 50;} QTabBar::tab:first:hover {background: #4169E1; color: white} QTabBar::tab:disabled { color: rgba(0, 0, 0, 70%) } "); + //no hoover + tabWidget->tabBar()->setStyleSheet( "QTabBar::tab {min-width: 70;} QTabBar::tab:selected {background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #fafafa, stop: 0.4 #f4f4f4, stop: 0.5 #e7e7e7, stop: 1.0 #fafafa); } QTabBar::tab:first {background: blue; color: lightgray; min-width: 50;} QTabBar::tab:first:hover {background: #4169E1; color: white} QTabBar::tab:disabled { color: rgba(0, 0, 0, 70%) } "); + main->addWidget( tabWidget ); for (int i=0; i < tabWidget->count(); ++i ) @@ -330,19 +334,18 @@ 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( 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( close_everything() ), this, SLOT( close_all() )); - connect( this, SIGNAL( clear_experiment( QString & ) ), epanExp, SLOT( clear_experiment( QString & ) ) ); - connect( epanObserv, SIGNAL( close_everything() ), this, SLOT( close_all() )); - connect( epanPostProd, SIGNAL( switch_to_editing( QString &, QString &) ), this, SLOT( switch_to_editing( QString &, QString & ) ) ); + connect( this, SIGNAL( reset_lims_import() ), epanPostProd, SLOT( reset_lims_import( ) ) ); + connect( this, SIGNAL( pass_to_editing( QString &, QString & ) ), epanEditing, SLOT( do_editing( QString &, QString & ) ) ); - //connect( epanPostProd, SIGNAL( switch_to_exp( QString & ) ), this, SLOT( switch_to_experiment( QString & ) ) ); connect( epanPostProd, SIGNAL( switch_to_initAutoflow( ) ), this, SLOT( close_all( ) ) ); + + setMinimumSize( QSize( 1350, 800 ) ); adjustSize(); @@ -362,21 +365,38 @@ { // Depending on from we jump to InitDialogue, we may need to stop/reset current stages: // E.g., LIVE_UPDATE: stop all timers, reset GUI etc.. + // Maybe a warning message "You are going to leave this panel.." needs to be shown + + if ( curr_panx == 1 ) + { + //Fully set: nothing needs to be done/reset: + qDebug() << "Jumping from EXPERIMENT."; + } + + if ( curr_panx == 2 ) + { + // 2 cases: + /* + 1. Avaiting for run to be launched ("Back to Managing Optima Runs") -- SET + 2. More complex: Back to Managing runs from active LIVE_UPDATE stage -- stop all timers and other processes... + */ + qDebug() << "Jumping from LIVE UPDATE."; + } + + if ( curr_panx == 3 ) + { + qDebug() << "Jumping from LIMS IMPORT."; + //Send sigmal to reset LIMS IMPORT tab... Fully SET + emit reset_lims_import(); + } + + if ( curr_panx == 4 ) + qDebug() << "Jumping from EDITING."; + epanInit ->initAutoflowPanel(); } - // else - // { - // if ( epanInit->initMsgNorecOpen ) - // { - // epanInit->msg_norec->reject(); - // //epanInit->msg_norec->close(); - // } - // if ( epanInit->initMsgNorecDelOpen ) - // epanInit->msg_norec_del->close(); - // } - - - curr_panx = panx; // Set new current panel + + //curr_panx = panx; // Set new current panel } void US_ComProjectMain::closeEvent( QCloseEvent* event ) @@ -609,7 +629,7 @@ { tabWidget->setCurrentIndex( 0 ); //epanInit ->initAutoflowPanel(); //DO NOT Duplicate - was called in previous line while changing Tab!!! - qDebug() << "XPN viwer closed!"; + qDebug() << "XPN viewer /US_convert closed!"; qApp->processEvents(); @@ -1431,7 +1451,6 @@ sdiag = new US_ExperimentMain; sdiag->setParent(this, Qt::Widget); - 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() ) ); @@ -1515,12 +1534,15 @@ mainw->logWidget->append("US_Experiment has been closed!"); } -//Clear Experiment after manual abortion & data not saved .. -void US_ExperGui::clear_experiment( QString & protocolName ) -{ - emit reset_experiment( protocolName ); -} +//Obsolete +// //Clear Experiment after manual abortion & data not saved .. +// void US_ExperGui::clear_experiment( QString & protocolName ) +// { +// emit reset_experiment( protocolName ); +// } + + //Upon clearing Experiment .. void US_ExperGui::exp_cleared( void ) { @@ -1755,10 +1777,11 @@ //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 > & ) ) ); + connect( this, SIGNAL( reset_lims_import_passed( ) ), sdiag, SLOT( reset_limsimport_panel ( ) ) ); + //ALEXEY: switch to Editing connect( sdiag, SIGNAL( saving_complete_auto( QString &, QString & ) ), this, SLOT( to_editing ( QString &, QString &) ) ); //ALEXEY: for academic ver. switch back to experiment - //connect( sdiag, SIGNAL( saving_complete_back_to_exp( QString & ) ), this, SLOT( to_experiment ( QString & ) ) ); connect( sdiag, SIGNAL( saving_complete_back_to_initAutoflow( ) ), this, SLOT( to_initAutoflow ( ) ) ); offset = 0; @@ -1778,6 +1801,11 @@ // emit to_post_prod( currDir, protocolName, invID_passed, correctRadii ); // } +void US_PostProdGui::reset_lims_import( void ) +{ + emit reset_lims_import_passed(); +} + void US_PostProdGui::import_data_us_convert( QMap < QString, QString > & protocol_details ) { emit to_post_prod( protocol_details ); Modified: trunk/programs/us_com_project/us_com_project_gui.h =================================================================== --- trunk/programs/us_com_project/us_com_project_gui.h 2019-07-23 07:35:43 UTC (rev 2797) +++ trunk/programs/us_com_project/us_com_project_gui.h 2019-07-24 06:40:06 UTC (rev 2798) @@ -148,7 +148,7 @@ void manageExperiment ( void ); // Slot for exp. button clicked void us_exp_is_closed_set_button( void ); void to_live_update( QMap < QString, QString > & protocol_details ); - void clear_experiment( QString & protocolName); + //void clear_experiment( QString & protocolName); void exp_cleared( void ); void pass_used_instruments( QStringList & ); void expsetup_msg_closed( void ); @@ -218,6 +218,7 @@ void to_editing( QString & currDir, QString & protocolName ); //void to_experiment( QString & protocolName ); void to_initAutoflow( void ); + void reset_lims_import( void ); signals: //void to_post_prod( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii ); @@ -226,6 +227,7 @@ void switch_to_editing( QString & currDir, QString & protocolName ); //void switch_to_exp( QString & protocolName ); void switch_to_initAutoflow( void); + void reset_lims_import_passed( void ); }; @@ -393,9 +395,10 @@ void import_data_us_convert( QMap < QString, QString > & ); void pass_to_editing( QString & currDir, QString & protocolName ); - void clear_experiment( QString & protocolName); + //void clear_experiment( QString & protocolName); void us_comproject_closed( void ); void pass_used_instruments( QStringList & ); + void reset_lims_import( void ); }; Modified: trunk/programs/us_convert/us_convert_gui.cpp =================================================================== --- trunk/programs/us_convert/us_convert_gui.cpp 2019-07-23 07:35:43 UTC (rev 2797) +++ trunk/programs/us_convert/us_convert_gui.cpp 2019-07-24 06:40:06 UTC (rev 2798) @@ -1160,6 +1160,18 @@ data_plot->setTitle( tr( "Absorbance Data" ) ); } +// +void US_ConvertGui::reset_limsimport_panel( void ) +{ + qDebug() << "Resetting panel BEFORE going to Manage runs... "; + + resetAll_auto( ); + //emit saving_complete_back_to_initAutoflow( ); // Not needed... + + qDebug() << "LIMS IMPROT reset .."; +} + + void US_ConvertGui::resetAll_auto( void ) { QApplication::restoreOverrideCursor(); @@ -1407,6 +1419,15 @@ qDebug() << "IMPORT MWL auto..."; importMWL(); + //ALEXEY: For autoflow: Reset to-do list && maybe solutions, triple desc. + if ( us_convert_auto_mode ) + { + lw_todoinfo->clear(); + le_solutionDesc ->setText( "" ); + le_description ->setText( "" ); + le_centerpieceDesc -> setText( ""); + } + editRuninfo_auto(); readProtocol_auto(); getLabInstrumentOperatorInfo_auto(); @@ -1419,6 +1440,15 @@ qDebug() << "IMPORT AUC auto..."; importAUC(); + //ALEXEY: For autoflow: Reset to-do list && maybe solutions, triple desc. + if ( us_convert_auto_mode ) + { + lw_todoinfo->clear(); + le_solutionDesc ->setText( "" ); + le_description ->setText( "" ); + le_centerpieceDesc -> setText( ""); + } + editRuninfo_auto(); readProtocol_auto(); getLabInstrumentOperatorInfo_auto(); Modified: trunk/programs/us_convert/us_convert_gui.h =================================================================== --- trunk/programs/us_convert/us_convert_gui.h 2019-07-23 07:35:43 UTC (rev 2797) +++ trunk/programs/us_convert/us_convert_gui.h 2019-07-24 06:40:06 UTC (rev 2798) @@ -369,6 +369,7 @@ void resetAll ( void ); void resetAll_auto ( void ); + void reset_limsimport_panel( void ); void source_changed ( bool ); void update_disk_db ( bool ); Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp =================================================================== --- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-23 07:35:43 UTC (rev 2797) +++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-24 06:40:06 UTC (rev 2798) @@ -190,7 +190,7 @@ void WheelBox::setTemp( double v ) { - qDebug() << "Setting Temperature!!!"; + qDebug() << "Setting Temperature!!! Value: " << v ; d_thermo->setValue( v ); setNum( v ); @@ -1940,13 +1940,18 @@ //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?? + //Maybe add this? + sys_thread->quit(); // ALEXEY: I think this emits Qthread's finished() signal... (connected to stopping timer_sysdata) + qApp->processEvents(); // <-- IMPORTANT to process event loop while stopping thread!!! + if ( sys_thread->isFinished() ) + qDebug() << "QThread STOPPED !!! "; + + if ( !timer_check_sysdata->isActive() ) + qDebug() << "QTimer timer_check_sysdata STOPPED by quitting the QThread !!! "; + qDebug() << "ExpStat: 5/0 - sys_timer STOPPED here: "; - - if ( !timer_check_sysdata->isActive() ) - qDebug() << "QTimer timer_check_sysdata STOPPED by quitting the QThread !!! "; - + rpm_box->setSpeed( 0 ); le_remaining->setText( "00:00:00" ); qApp->processEvents(); @@ -2107,12 +2112,7 @@ .arg(RunName).arg(OptimaName) ); msg_data_avail->setWindowTitle(tr("Live Update")); - //msg_data_avail->setText(tr( "Run named %1 was submitted to:\n\n" - // "%2 \n\n" - // "Please start this method scan from the instrument panel. \n\n\n") - // - // .arg(RunName).arg(OptimaName) ); - + if ( runID_passed.isEmpty() || runID_passed == "NULL" ) { msg_data_avail->exec(); @@ -2418,6 +2418,8 @@ //ALEXEY: Add Exp. Abortion Exception HERE... if ( CheckExpComplete_auto( RunID_to_retrieve ) == 0 ) //ALEXEY should be == 3 as per documentation { + qDebug() << "ABORTION IN EARLY STAGE..."; + experimentAborted = true; timer_all_data_avail->stop(); @@ -3830,9 +3832,12 @@ timer_data_reload->stop(); disconnect(timer_data_reload, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything + qDebug() << "STOPPING timer_data_reload..."; if ( !timer_check_sysdata->isActive() ) // Check if sys_data Timer is stopped { + + qDebug() << "Exporing/Writing to disk..."; // ALEXEY Export AUC data: devise export_auc_auto() function which would return directory name with saved data - to pass to emit signal below... export_auc_auto();