us-commits
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
July 2019
- 1 participants
- 12 discussions
r2799 - in trunk: programs/us_com_project programs/us_xpn_viewer utils
by svn@svn.aucsolutions.com July 24, 2019
by svn@svn.aucsolutions.com July 24, 2019
July 24, 2019
Author: alexey
Date: 2019-07-25 00:28:19 +0000 (Thu, 25 Jul 2019)
New Revision: 2799
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_com_project/us_com_project_gui.h
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h
trunk/utils/us_xpn_data.cpp
Log:
Autoflow:
* updates on properly stopping timers/threads when attempting to switch back centralizedto Managing Runs while LIVE UPDATE in full operation...
* multiple other updates
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-24 06:40:06 UTC (rev 2798)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-25 00:28:19 UTC (rev 2799)
@@ -33,6 +33,7 @@
// dbg_level = US_Settings::us_debug();
curr_panx = 0;
window_closed = false;
+ xpn_viewer_closed_soft = false;
us_mode_bool = true;
@@ -173,6 +174,7 @@
//connect( this, SIGNAL( clear_experiment( QString & ) ), epanExp, SLOT( clear_experiment( QString & ) ) );
connect( epanObserv, SIGNAL( close_everything() ), this, SLOT( close_all() ));
+ connect( this, SIGNAL( reset_live_update() ), epanObserv, SLOT( reset_live_update( ) ) );
//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 & ) ) );
@@ -197,6 +199,8 @@
curr_panx = 0;
window_closed = false;
+ xpn_viewer_closed_soft = false;
+
us_mode_bool = false;
setWindowTitle( tr( "UltraScan Optima AUC Interface" ) );
@@ -337,6 +341,7 @@
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( reset_live_update() ), epanObserv, SLOT( reset_live_update( ) ) );
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( ) ) );
@@ -381,18 +386,23 @@
2. More complex: Back to Managing runs from active LIVE_UPDATE stage -- stop all timers and other processes...
*/
qDebug() << "Jumping from LIVE UPDATE.";
+
+ //2. Stop all timers/threads, reset GUI - when stopping fully working LIVE UPDATE
+ if ( !xpn_viewer_closed_soft )
+ emit reset_live_update();
}
if ( curr_panx == 3 )
{
qDebug() << "Jumping from LIMS IMPORT.";
- //Send sigmal to reset LIMS IMPORT tab... Fully SET
+ //Send signal to reset LIMS IMPORT tab... Fully SET
emit reset_lims_import();
}
if ( curr_panx == 4 )
qDebug() << "Jumping from EDITING.";
-
+
+ xpn_viewer_closed_soft = false;
epanInit ->initAutoflowPanel();
}
@@ -627,6 +637,7 @@
// Slot to pass submitted to Optima run info to the Live Update tab
void US_ComProjectMain::close_all( void )
{
+ xpn_viewer_closed_soft = true;
tabWidget->setCurrentIndex( 0 );
//epanInit ->initAutoflowPanel(); //DO NOT Duplicate - was called in previous line while changing Tab!!!
qDebug() << "XPN viewer /US_convert closed!";
@@ -671,6 +682,12 @@
tabWidget->setCurrentIndex( 3 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
curr_panx = 3;
+ // Trigger resize to update size of the PostProcs
+ int curr_h = this->height() + 1;
+ int curr_w = this->width() + 1;
+
+ this->resize( QSize(curr_w, curr_h) );
+
for (int i = 1; i < tabWidget->count(); ++i )
{
if ( i == 3 )
@@ -1021,7 +1038,7 @@
{
QString list_instruments_in_use = occupied_instruments.join(", ");
- QMessageBox * msg_instr_use = new QMessageBox;
+ QMessageBox * msg_instr_use = new QMessageBox(this);
msg_instr_use->setIcon(QMessageBox::Information);
msg_instr_use->setText(tr( "The following Optima instrument(s)<br>"
"are currently in use: <br><br>"
@@ -1656,6 +1673,9 @@
//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( QMap < QString, QString > & ) ), this, SLOT( to_post_processing ( QMap < QString, QString > & ) ) );
+
+ //ALEXEY: to reset timers/threads and GUI when returning back to InitDialog
+ connect( this, SIGNAL( reset_live_update_passed( ) ), sdiag, SLOT( reset_liveupdate_panel ( ) ) );
//ALEXEY: close program, emitted from sdiag
connect( sdiag, SIGNAL( close_program() ), this, SLOT( to_close_program() ) );
@@ -1700,6 +1720,11 @@
QWidget::resizeEvent(event);
}
+void US_ObservGui::reset_live_update( void )
+{
+ emit reset_live_update_passed();
+}
+
// Live Update's get and use submitted run's protocol details
void US_ObservGui::process_protocol_details( QMap < QString, QString > & 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-24 06:40:06 UTC (rev 2798)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-07-25 00:28:19 UTC (rev 2799)
@@ -185,11 +185,13 @@
//void to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void to_post_processing( QMap < QString, QString > & );
void to_close_program( void );
+ void reset_live_update( 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( QMap < QString, QString > & );
void close_everything( void );
+ void reset_live_update_passed( void );
};
@@ -336,6 +338,8 @@
void close_initDialogue();
bool window_closed;
+ bool xpn_viewer_closed_soft;
+
int curr_panx; // Current panel index (0-7)
//QStringList occupied_instruments;
@@ -399,6 +403,7 @@
void us_comproject_closed( void );
void pass_used_instruments( QStringList & );
void reset_lims_import( void );
+ void reset_live_update( void );
};
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-24 06:40:06 UTC (rev 2798)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-25 00:28:19 UTC (rev 2799)
@@ -656,6 +656,7 @@
grid_rpm = us_grid( data_plot_rpm );
+ //ALEXEY: curves for sysdata must be re-defined in the reset_auto() !!!
curv_rpm = us_curve( data_plot_rpm, "RPM" );
curv_temp = us_curve( data_plot_rpm, "Temperature" );
curv_temp->setYAxis ( QwtPlot::yRight );
@@ -665,6 +666,8 @@
curv_temp->setPen( pen_red);
curv_rpm ->setPen( pen_green);
+ /*************************************************************************/
+
connect( plot_rpm, SIGNAL( zoomedCorners( QRectF ) ),
this, SLOT ( currentRectf ( QRectF ) ) );
@@ -1209,6 +1212,15 @@
data_plot_rpm->setAxisScale( QwtPlot::yRight , 0.0, 40 );
grid_rpm = us_grid( data_plot_rpm );
data_plot_rpm->replot();
+ //Curves for RPM/Temp.
+ curv_rpm = us_curve( data_plot_rpm, "RPM" );
+ curv_temp = us_curve( data_plot_rpm, "Temperature" );
+ curv_temp->setYAxis ( QwtPlot::yRight );
+ QPen pen_red ( Qt::red );
+ QPen pen_green ( Qt::green );
+ curv_temp->setPen( pen_red);
+ curv_rpm ->setPen( pen_green);
+
//RPM/Temp.
rpm_box->setSpeed(0);
temperature_box->setTemp(0);
@@ -1884,7 +1896,7 @@
remaining_time_text = QString::number(dhms_remain[1]) + ":" + QString::number(dhms_remain[2]) + ":" + QString::number(dhms_remain[3]);
le_remaining->setText( remaining_time_text );
qApp->processEvents();
-
+
//RPM/Temp. Plots:
//counter_mins += 500; //temporary for testing only
@@ -1901,7 +1913,7 @@
double* d_rpm = rpm_data.data();
double* d_temp = temp_data.data();
double* d_time = time_data.data();
-
+
//axis ranges, temporary
double rpm_min = 0;
double rpm_max = rpm + 5000;
@@ -1913,7 +1925,7 @@
//if (temp_data.size() != 0 )
curv_temp->setSamples( d_time, d_temp, time_data.size() );
curv_rpm->setSamples( d_time, d_rpm, time_data.size() );
-
+
//data_plot_rpm->setAxisScale( QwtPlot::xBottom, 0.0, double(elapsed_time_1/60.0) ); // <-- HERE
data_plot_rpm->setAxisScale( QwtPlot::xBottom, double(ElapsedTimeOffset/60.0), double(elapsed_time_1/60.0) ); //
//data_plot_rpm->setAxisScale( QwtPlot::xBottom, 0.0, double(exp_time/60.0 + counter_mins ) ); // for testing only
@@ -2121,15 +2133,84 @@
{
timer_data_init->stop();
disconnect(timer_data_init, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
+
+ reset_auto();
- reset_auto();
emit close_program();
}
}
}
+// Reset LIVE UPDATE panel && stop timers && quit threads
+void US_XpnDataViewer::reset_liveupdate_panel ( void )
+{
+ //Quit sys_thread, emit finished() to stop timer_check_sysdata from withing thread
+ if ( !sys_thread->isFinished() )
+ {
+ sys_thread->quit();
+ qApp->processEvents();
+ }
+
+ //Disconnect timer_check_sysdata
+ if ( timer_check_sysdata->isActive() )
+ {
+ timer_check_sysdata->stop();
+ disconnect(timer_check_sysdata, SIGNAL(timeout()), 0, 0);
+ }
+
+ //Stop other timers if active
+ if ( timer_all_data_avail->isActive() )
+ {
+ timer_all_data_avail->stop();
+ disconnect(timer_all_data_avail, SIGNAL(timeout()), 0, 0);
+ }
+
+ if ( timer_data_reload->isActive() )
+ {
+ timer_data_reload->stop();
+ disconnect(timer_data_reload, SIGNAL(timeout()), 0, 0);
+ }
+
+ if ( timer_data_init->isActive() )
+ {
+ timer_data_init->stop();
+ disconnect(timer_data_init, SIGNAL(timeout()), 0, 0);
+ }
+
+ qApp->processEvents();
+
+ /***** DEBUG ***********************/
+ if ( sys_thread->isFinished() )
+ qDebug() << "QThread STOPPED upon clickig Manage Optima runs !!! ";
+
+ if ( !timer_check_sysdata->isActive() )
+ qDebug() << "QTimer timer_check_sysdata STOPPED by clickig Manage Optima runs !!! ";
+
+ if ( !timer_data_init->isActive() )
+ qDebug() << "QTimer timer_data_init STOPPED by clickig Manage Optima runs !!! ";
+
+ if ( !timer_all_data_avail->isActive() )
+ qDebug() << "QTimer timer_all_data_avail STOPPED by clickig Manage Optima runs !!! ";
+
+ if ( !timer_data_reload->isActive() )
+ qDebug() << "QTimer timer_data_reload STOPPED by clickig Manage Optima runs !!! ";
+ /*************************************/
+
+ reset_auto();
+
+ qDebug() << in_reload_auto << ", " << in_reload_all_data << ", " << in_reload_data_init << ", " << in_reload_check_sysdata;
+
+ in_reload_auto = false;
+ in_reload_all_data = false;
+ in_reload_data_init = false;
+ in_reload_check_sysdata = false;
+
+ qApp->processEvents();
+}
+
+
//void US_XpnDataViewer::retrieve_xpn_raw_auto( QString & RunID )
-void US_XpnDataViewer::retrieve_xpn_raw_auto( )
+void US_XpnDataViewer::retrieve_xpn_raw_auto( void )
{
if ( in_reload_all_data ) // If already doing a reload,
return; // skip starting a new one
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-07-24 06:40:06 UTC (rev 2798)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-07-25 00:28:19 UTC (rev 2799)
@@ -303,6 +303,8 @@
bool load_xpn_raw_auto ( void );
void check_for_data ( QMap < QString, QString > & );
void check_for_sysdata ( void );
+
+ void reset_liveupdate_panel ( void );
//void retrieve_xpn_raw_auto ( QString & );
void retrieve_xpn_raw_auto ( void );
Modified: trunk/utils/us_xpn_data.cpp
===================================================================
--- trunk/utils/us_xpn_data.cpp 2019-07-24 06:40:06 UTC (rev 2798)
+++ trunk/utils/us_xpn_data.cpp 2019-07-25 00:28:19 UTC (rev 2799)
@@ -55,7 +55,7 @@
dbxpn.setUserName ( dbuser );
dbxpn.setPassword ( dbpasw );
- dbxpn.setConnectOptions("connect_timeout=3");
+ dbxpn.setConnectOptions("connect_timeout=5");
if ( dbxpn.open() )
{
1
0
r2798 - in trunk: gui programs/us_com_project programs/us_convert programs/us_xpn_viewer
by svn@svn.aucsolutions.com July 24, 2019
by svn@svn.aucsolutions.com July 24, 2019
July 24, 2019
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();
1
0
r2797 - in trunk: gui programs/us_com_project programs/us_convert
by svn@svn.aucsolutions.com July 23, 2019
by svn@svn.aucsolutions.com July 23, 2019
July 23, 2019
Author: alexey
Date: 2019-07-23 07:35:43 +0000 (Tue, 23 Jul 2019)
New Revision: 2797
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
Log:
Autoflow:
* some important updates in light of the generally accessible Manage Optima Runs panel
* All but the tab for ongoing stage are blocked (for sake of consistency and more control)
Modified: trunk/gui/us_select_item.cpp
===================================================================
--- trunk/gui/us_select_item.cpp 2019-07-22 02:15:00 UTC (rev 2796)
+++ trunk/gui/us_select_item.cpp 2019-07-23 07:35:43 UTC (rev 2797)
@@ -124,8 +124,8 @@
le_info->setPalette(p);
le_info->setText(tr( "<ul><li>Information on one or more experimental methods submitted to Bechman Optima(s) is available. "
- "You can reattach to the job by selecting the run from the list below. "
- "Alternatively, you can define and submit a new experiment method to the availabale Optima instrument(s). </ul></li>" ));
+ "<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>" ));
main->addWidget( le_info );
}
@@ -458,7 +458,14 @@
QMessageBox::warning( this,
tr( "Autoflow Record Not Deleted" ),
tr( "This record could not be deleted since\n"
- "it is not present in the LIMS DB." ) );
+ "it is not present in the LIMS DB. \n"
+ "It will be removed from the list of records." ) );
+
+ items.removeAt( AutoflowRow ); // Remove deleted item row
+ list_data(); // Rebuild protocol list in the dialog
+
+ emit accept_autoflow_deletion(); // Signal to pass to us_comproject to update (re-read reduced) autoflow records
+
return;
}
@@ -467,7 +474,7 @@
QString msg("Autoflow record has been successfully deleted.");
QMessageBox::information( this,
- tr( "Autoflow Record Deleted" ),
+ tr( "Autoflow Record Deleted" ),
msg );
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-22 02:15:00 UTC (rev 2796)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-23 07:35:43 UTC (rev 2797)
@@ -128,6 +128,15 @@
main->addWidget( tabWidget );
+ for (int i=0; i < tabWidget->count(); ++i )
+ {
+ //ALEXEY: OR enable all tabs ? (e.g. for demonstration, in a read-only mode or the like ?)
+ if ( i == 0 )
+ tabWidget->tabBar()->setTabEnabled(i, true);
+ else
+ tabWidget->tabBar()->setTabEnabled(i, false);
+ }
+
connect( tabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( initPanels( int ) ) );
@@ -162,14 +171,13 @@
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() ));
//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_exp( QString & ) ), this, SLOT( switch_to_experiment( QString & ) ) );
+ connect( epanPostProd, SIGNAL( switch_to_initAutoflow( ) ), this, SLOT( close_all( ) ) );
setMinimumSize( QSize( 1350, 800 ) );
adjustSize();
@@ -275,19 +283,24 @@
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 {} ");
-
- //QLabel * init_lbl;
- //init_lbl = new QLabel();
- //init_lbl->setText("Manage Optima Runs");
- //init_lbl->setStyleSheet("QLabel { background-color : blue; color : white; }");
- //tabWidget->tabBar()->setTabButton(0, QTabBar::LeftSide, init_lbl);
-
- //tabWidget->tabBar()->setTabTextColor(0, Qt::white);
+ main->addWidget( tabWidget );
- main->addWidget( tabWidget );
+ for (int i=0; i < tabWidget->count(); ++i )
+ {
+ //ALEXEY: OR enable all tabs ? (e.g. for demonstration, in a read-only mode or the like ?)
+ if ( i == 0 )
+ tabWidget->tabBar()->setTabEnabled(i, true);
+ else
+ tabWidget->tabBar()->setTabEnabled(i, false);
+ }
+ //QPalette pal = tabWidget->tabBar()->palette();
+ //qDebug() << "Palette: color, group: " << pal.color(QPalette::Background) << ", " << pal.currentColorGroup();
+ //pal.setCurrentColorGroup(QPalette::Active);
+ //tabWidget->tabBar()->setPalette(pal);
+
connect( tabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( initPanels( int ) ) );
logWidget = us_textedit();
@@ -322,13 +335,13 @@
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() ));
connect( epanPostProd, SIGNAL( switch_to_editing( QString &, QString &) ), this, SLOT( switch_to_editing( QString &, QString & ) ) );
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_exp( QString & ) ), this, SLOT( switch_to_experiment( QString & ) ) );
+ connect( epanPostProd, SIGNAL( switch_to_initAutoflow( ) ), this, SLOT( close_all( ) ) );
setMinimumSize( QSize( 1350, 800 ) );
adjustSize();
@@ -546,6 +559,14 @@
tabWidget->setCurrentIndex( 1 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
curr_panx = 1;
+ for (int i = 1; i < tabWidget->count(); ++i )
+ {
+ if ( i == 1 )
+ tabWidget->tabBar()->setTabEnabled(i, true);
+ else
+ tabWidget->tabBar()->setTabEnabled(i, false);
+ }
+
qDebug() << "In define_new_experiment( QStringList & occupied_instruments )";
emit pass_used_instruments( occupied_instruments );
@@ -557,9 +578,24 @@
// 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)
{
- tabWidget->setCurrentIndex( 2 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+ tabWidget->setCurrentIndex( 2 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()->setEnabled(false) ??
curr_panx = 2;
+
+ for (int i = 1; i < tabWidget->count(); ++i )
+ {
+ if ( i == 2 )
+ tabWidget->tabBar()->setTabEnabled(i, true);
+ else
+ tabWidget->tabBar()->setTabEnabled(i, false);
+ }
+
+ // QPalette pal = tabWidget->currentWidget()->palette();
+ // pal.setCurrentColorGroup(QPalette::Disabled);
+ // tabWidget->currentWidget()->setPalette(pal);
+
+ // qDebug() << "LIVE UPDATE palette: " << tabWidget->currentWidget()->palette().currentColorGroup();
+
// ALEXEY:
// (1) Make a record to 'autoflow' table - stage# = 1;
// (2) inside us_xpn_viewer - update 'curDirr' field with generated directory where .auc data saved
@@ -615,20 +651,29 @@
tabWidget->setCurrentIndex( 3 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
curr_panx = 3;
+ for (int i = 1; i < tabWidget->count(); ++i )
+ {
+ if ( i == 3 )
+ tabWidget->tabBar()->setTabEnabled(i, true);
+ else
+ tabWidget->tabBar()->setTabEnabled(i, 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
-void US_ComProjectMain::switch_to_experiment( QString & protocolName )
-{
- tabWidget->setCurrentIndex( 1 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
- curr_panx = 1;
- //delete_autoflow_record( runID );
+
+// Obsolete
+// // Slot to switch back from the Live Update to Experiment tab
+// void US_ComProjectMain::switch_to_experiment( QString & protocolName )
+// {
+// tabWidget->setCurrentIndex( 1 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+// curr_panx = 1;
+// //delete_autoflow_record( runID );
- emit clear_experiment( protocolName );
-}
+// emit clear_experiment( protocolName );
+// }
// Slot to switch from the Import to Editing tab
@@ -637,6 +682,17 @@
tabWidget->setCurrentIndex( 4 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
curr_panx = 4;
+ // ALEXEY: Temporariy NOT lock here... Will need later
+ /*
+ for (int i = 1; i < tabWidget->count(); ++i )
+ {
+ if ( i == 4 )
+ tabWidget->tabBar()->setTabEnabled(i, true);
+ else
+ tabWidget->tabBar()->setTabEnabled(i, false);
+ }
+ */
+
// ALEXEY: Make a record to 'autoflow' table: stage# = 3;
emit pass_to_editing( currDir, protocolName );
@@ -771,6 +827,15 @@
// Init Autoflow records
void US_InitDialogueGui::initRecords( void )
{
+ for (int i=0; i < mainw->tabWidget->count(); ++i )
+ {
+ //ALEXEY: OR enable all tabs ? (e.g. for demonstration, in a read-only mode or the like ?)
+ if ( i == 0 )
+ mainw->tabWidget->tabBar()->setTabEnabled(i, true);
+ else
+ mainw->tabWidget->tabBar()->setTabEnabled(i, false);
+ }
+
// Query 'autoflow': get count of records
autoflow_records = get_autoflow_records();
@@ -886,12 +951,9 @@
autoflow_btn = "AUTOFLOW_DA";
else
autoflow_btn = "AUTOFLOW_GMP";
-
- //US_SelectItem pdiag_autoflow( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
- //US_SelectItem* pdiag_autoflow = new US_SelectItem( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
pdiag_autoflow = new US_SelectItem( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
-
+
connect( pdiag_autoflow, SIGNAL( accept_autoflow_deletion() ), this, SLOT( update_autoflow_data() ));
pdiag_autoflow->setParent(this, Qt::Widget);
@@ -910,6 +972,10 @@
//pdiag_autoflow->setFrameShape( QFrame::Box);
//pdiag_autoflow->setLineWidth(2);
+ // pdiag_autoflow->setObjectName("hello");
+ // pdiag_autoflow->setWindowFlags(Qt::FramelessWindowHint);
+ // pdiag_autoflow->setStyleSheet("#hello{border:4px solid darkgrey}");
+
//disable 'Define Another Exp.' button if all instruments are in use
if ( occupied_instruments.size() >= instruments.size() )
pdiag_autoflow->pb_cancel->setEnabled( false );
@@ -1567,13 +1633,8 @@
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( 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 &) ) );
-
//ALEXEY: close program, emitted from sdiag
connect( sdiag, SIGNAL( close_program() ), this, SLOT( to_close_program() ) );
@@ -1641,10 +1702,6 @@
emit switch_to_post_processing( protocol_details );
}
-void US_ObservGui::to_experiment( QString & protocolName )
-{
- emit switch_to_experiment( protocolName );
-}
void US_ObservGui::to_close_program( void )
{
@@ -1701,7 +1758,8 @@
//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_exp( QString & ) ), this, SLOT( to_experiment ( QString & ) ) );
+ connect( sdiag, SIGNAL( saving_complete_back_to_initAutoflow( ) ), this, SLOT( to_initAutoflow ( ) ) );
offset = 0;
sdiag->move(offset, 2*offset);
@@ -1730,10 +1788,15 @@
emit switch_to_editing( currDir, protocolName );
}
-void US_PostProdGui::to_experiment( QString & protocolName )
+// void US_PostProdGui::to_experiment( QString & protocolName )
+// {
+// emit switch_to_exp( protocolName );
+// }
+
+void US_PostProdGui::to_initAutoflow( void )
{
- emit switch_to_exp( protocolName );
-}
+ emit switch_to_initAutoflow();
+}
void US_PostProdGui::resizeEvent(QResizeEvent *event)
{
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-07-22 02:15:00 UTC (rev 2796)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-07-23 07:35:43 UTC (rev 2797)
@@ -184,15 +184,11 @@
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( 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( QMap < QString, QString > & );
-
- void switch_to_experiment( QString & protocolName );
void close_everything( void );
};
@@ -220,14 +216,16 @@
void import_data_us_convert( QMap < QString, QString > &);
void to_editing( QString & currDir, QString & protocolName );
- void to_experiment( QString & protocolName );
+ //void to_experiment( QString & protocolName );
+ void to_initAutoflow( void );
signals:
//void to_post_prod( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void to_post_prod( QMap < QString, QString > & );
void switch_to_editing( QString & currDir, QString & protocolName );
- void switch_to_exp( QString & protocolName );
+ //void switch_to_exp( QString & protocolName );
+ void switch_to_initAutoflow( void);
};
@@ -377,7 +375,7 @@
void switch_to_post_processing( QMap < QString, QString > & );
void switch_to_editing( QString & currDir, QString & protocolName );
- void switch_to_experiment( QString & protocolName );
+ //void switch_to_experiment( QString & protocolName );
//void check_current_stage( void );
void close_all( void );
void closeEvent ( QCloseEvent* );
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-07-22 02:15:00 UTC (rev 2796)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-07-23 07:35:43 UTC (rev 2797)
@@ -1337,7 +1337,8 @@
{
delete_autoflow_record(); // TEMPORARILY - MUST BE UNCOMMENTED!!!
resetAll_auto();
- emit saving_complete_back_to_exp( ProtocolName_auto );
+ //emit saving_complete_back_to_exp( ProtocolName_auto );
+ emit saving_complete_back_to_initAutoflow( );
return;
}
}
@@ -1360,7 +1361,8 @@
//ALEXY: need to delete autoflow record here
delete_autoflow_record();
resetAll_auto();
- emit saving_complete_back_to_exp( ProtocolName_auto );
+ //emit saving_complete_back_to_exp( ProtocolName_auto );
+ emit saving_complete_back_to_initAutoflow();
return;
}
@@ -1391,7 +1393,8 @@
{
delete_autoflow_record();
resetAll_auto();
- emit saving_complete_back_to_exp( ProtocolName_auto );
+ //emit saving_complete_back_to_exp( ProtocolName_auto );
+ emit saving_complete_back_to_initAutoflow( );
return;
}
}
@@ -5068,7 +5071,8 @@
//ALEXY: need to delete autoflow record here
delete_autoflow_record();
resetAll_auto();
- emit saving_complete_back_to_exp( ProtocolName_auto );
+ //emit saving_complete_back_to_exp( ProtocolName_auto );
+ emit saving_complete_back_to_initAutoflow( );
return;
}
else // us_comproject
@@ -5085,7 +5089,8 @@
//ALEXY: need to delete autoflow record here
delete_autoflow_record();
resetAll_auto();
- emit saving_complete_back_to_exp( ProtocolName_auto );
+ //emit saving_complete_back_to_exp( ProtocolName_auto );
+ emit saving_complete_back_to_initAutoflow();
return;
}
else // us_comproject BUT the run IS GMP, so procced
Modified: trunk/programs/us_convert/us_convert_gui.h
===================================================================
--- trunk/programs/us_convert/us_convert_gui.h 2019-07-22 02:15:00 UTC (rev 2796)
+++ trunk/programs/us_convert/us_convert_gui.h 2019-07-23 07:35:43 UTC (rev 2797)
@@ -51,7 +51,8 @@
signals:
void saving_complete_auto( QString &, QString & );
- void saving_complete_back_to_exp( QString & );
+ //void saving_complete_back_to_exp( QString & );
+ void saving_complete_back_to_initAutoflow( void );
public slots:
1
0
July 21, 2019
Author: alexey
Date: 2019-07-22 02:15:00 +0000 (Mon, 22 Jul 2019)
New Revision: 2796
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_com_project/us_com_project_gui.h
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
Log:
Autoflow:
* important updates after testing...
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-21 01:25:03 UTC (rev 2795)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-22 02:15:00 UTC (rev 2796)
@@ -352,9 +352,18 @@
epanInit ->initAutoflowPanel();
}
// else
- // return;
+ // {
+ // 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 )
@@ -648,6 +657,8 @@
mainw = (US_ComProjectMain*)topw;
initDialogueOpen = false;
+ initMsgNorecOpen = false;
+ initMsgNorecDelOpen = false;
setPalette( US_GuiSettings::frameColor() );
QFont sfont( US_GuiSettings::fontFamily(), US_GuiSettings::fontSize() - 1 );
@@ -705,16 +716,33 @@
int new_main_w = mainw->width() - 3*offset - tab_width;
int new_main_h = mainw->height() - 4*offset - upper_height;
+ if ( initMsgNorecOpen )
+ {
+ int pos_x = this->width()/2 - msg_norec->width()/2;
+ int pos_y = this->height()/2 - msg_norec->height() * 0.75;
+ msg_norec->move(pos_x,pos_y);
+
+ update();
+ }
+
+ if ( initMsgNorecDelOpen )
+ {
+ int pos_x = this->width()/2 - msg_norec_del->width()/2;
+ int pos_y = this->height()/2 - msg_norec_del->height() * 0.75;
+ msg_norec_del->move(pos_x,pos_y);
+
+ update();
+ }
+
if ( initDialogueOpen ){
//qDebug() << "Is PDIAG visible? " << pdiag_autoflow->isVisible();
if ( new_main_w > pdiag_autoflow->width() || new_main_h > pdiag_autoflow->height()) {
int newWidth = qMax( new_main_w, pdiag_autoflow->width());
int newHeight = qMax( new_main_h, pdiag_autoflow->height());
-
- //qDebug() << "New sizes of PDIAG!! " << new_main_w << ", " << pdiag_autoflow->width();
pdiag_autoflow->setMaximumSize( newWidth, newHeight );
pdiag_autoflow->resize( QSize(newWidth, newHeight) );
+
update();
}
@@ -723,8 +751,10 @@
int newHeight = qMin( new_main_h, pdiag_autoflow->height());
pdiag_autoflow->setMaximumSize( newWidth, newHeight );
pdiag_autoflow->resize( QSize(newWidth, newHeight) );
- update();
+
+ update();
}
+
}
QWidget::resizeEvent(event);
}
@@ -778,14 +808,42 @@
// Init AutoflowRecords Dialogue: call from _main.cpp
void US_InitDialogueGui::initRecordsDialogue( void )
{
+
+ // ALEXEY: ensure that NO pdiag_dialog(s) open before initialization... IMPORTANT!
+ // Will Not be needed in the production version where all but currently active Tab is enabled...
+ // But may be a good idea to retain...
+ /* ---------------------------------------------------------------------------------------*/
+ if ( initDialogueOpen )
+ {
+ pdiag_autoflow->close();
+ initDialogueOpen = false;
+ qDebug() << "Spurious/Old Autoflow dialogues closed!!!";
+ }
+ if ( initMsgNorecOpen )
+ {
+ msg_norec->reject(); // Not just close() - as it triggers setting up exp panel...
+ initMsgNorecOpen = false;
+
+ qDebug() << "Spurious/Old NoRec msg closed!!!";
+ }
+ if ( initMsgNorecDelOpen )
+ {
+ msg_norec_del->reject(); // Not just close() - as it triggers setting up exp panel...
+ initMsgNorecDelOpen = false;
+
+ qDebug() << "Spurious/Old NoRec After Deletion msg closed!!!";
+ }
+ /* ---------------------------------------------------------------------------------------*/
+
if ( autoflow_records < 1 )
{
//ALEXEY: should close pdiag_autoflow if wasn't closed already
+ initMsgNorecOpen = true;
occupied_instruments.clear();
- QMessageBox * msg_norec = new QMessageBox;
+ msg_norec = new QMessageBox;
msg_norec->setIcon(QMessageBox::Information);
msg_norec->setText(tr( "There are no Optima runs to follow.<br><br>"
"You will be switched to <b>Experiment</b> stage to design and submit new protocol."
@@ -795,15 +853,19 @@
msg_norec->setStyleSheet("background-color: #36454f; color : #D3D9DF;");
//position
- int pos_x = msg_norec->width()/2;
- int pos_y = msg_norec->height()/2;
+ int pos_x = this->width()/2 - msg_norec->width()/2;
+ int pos_y = this->height()/2 - msg_norec->height()/4;
msg_norec->move(pos_x, pos_y);
+
+ if( msg_norec->exec() == QMessageBox::Ok )
+ {
+ msg_norec->close();
+ emit define_new_experiment_init( occupied_instruments );
+ //qApp->processEvents();
+ }
- connect(msg_norec, SIGNAL( accept() ), SLOT(close()) );
- msg_norec->exec();
+ //emit define_new_experiment_init( occupied_instruments );
- emit define_new_experiment_init( occupied_instruments );
-
return;
}
@@ -955,6 +1017,8 @@
void US_InitDialogueGui::update_autoflow_data( void )
{
qDebug() << "Updating autoflow records!!!";
+
+ initMsgNorecDelOpen = false;
US_Passwd pw;
US_DB2* dbP = new US_DB2( pw.getPasswd() );
@@ -964,7 +1028,9 @@
if ( autoflowdata.size() < 1 )
{
- pdiag_autoflow->reject();
+ initMsgNorecDelOpen = true;
+
+ //pdiag_autoflow->reject();
pdiag_autoflow->close();
qApp->processEvents();
@@ -972,7 +1038,7 @@
occupied_instruments.clear();
- QMessageBox * msg_norec_del = new QMessageBox;
+ msg_norec_del = new QMessageBox;
msg_norec_del->setIcon(QMessageBox::Information);
msg_norec_del->setText(tr( "There are no Optima runs to follow.<br><br>"
"You will be switched to <b>Experiment</b> stage to design and submit new protocol."
@@ -982,16 +1048,23 @@
msg_norec_del->setStyleSheet("background-color: #36454f; color : #D3D9DF;");
//position
- int pos_x = msg_norec_del->width()/2;
- int pos_y = msg_norec_del->height()/2;
+ int pos_x = this->width()/2 - msg_norec_del->width()/2;
+ int pos_y = this->height()/2 - msg_norec_del->height()/4;
msg_norec_del->move(pos_x, pos_y);
- connect(msg_norec_del, SIGNAL( accept() ), SLOT(close()) );
-
- msg_norec_del->exec();
+ //connect(msg_norec_del, SIGNAL( accept() ), SLOT(close()) );
+ if( msg_norec_del->exec() == QMessageBox::Ok )
+ {
+ msg_norec_del->close();
+ emit define_new_experiment_init( occupied_instruments );
+
+ //qApp->processEvents();
+ }
- emit define_new_experiment_init( occupied_instruments );
+ //msg_norec_del->exec();
+ //emit define_new_experiment_init( occupied_instruments );
+
return;
}
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-07-21 01:25:03 UTC (rev 2795)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-07-22 02:15:00 UTC (rev 2796)
@@ -77,10 +77,18 @@
US_SelectItem* pdiag_autoflow;
void initRecordsDialogue( void );
+
bool initDialogueOpen;
+ bool initMsgNorecOpen;
+ bool initMsgNorecDelOpen;
+
void initAutoflowPanel( void );
QLabel* movie_label;
+
+ QMessageBox * msg_norec;
+ QMessageBox * msg_norec_del;
+
private:
US_ComProjectMain* mainw; // Parent to all panels
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-21 01:25:03 UTC (rev 2795)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-22 02:15:00 UTC (rev 2796)
@@ -2106,6 +2106,7 @@
"the Optima panel and monitor the progress.")
.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")
1
0
Author: alexey
Date: 2019-07-21 01:25:03 +0000 (Sun, 21 Jul 2019)
New Revision: 2795
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_com_project/us_com_project_gui.h
Log:
Autoflow: small updates
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-20 04:32:37 UTC (rev 2794)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-21 01:25:03 UTC (rev 2795)
@@ -486,31 +486,46 @@
// Slot to define new exp. (from initial dialog)
void US_ComProjectMain::define_new_experiment( QStringList & occupied_instruments )
{
- msg_expsetup = new QMessageBox(this);
- msg_expsetup->setIcon(QMessageBox::Information);
- msg_expsetup->setWindowFlags ( Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowStaysOnTopHint);
- msg_expsetup->setStandardButtons(0);
- msg_expsetup->setText(tr( "Setting up Experiment panel... Please wait...") );
- msg_expsetup->setStyleSheet("background-color: #36454f; color : #D3D9DF;");
-
- //msg_expsetup->setWindowModality(Qt::NonModal);
- //msg_expsetup->setModal( false );
- //msg_expsetup->setAttribute( Qt::WA_DeleteOnClose );
- //msg_expsetup->raise();
-
- int tab_width = this->tabWidget->tabBar()->width();
- int upper_height = this->gen_banner->height() + //this->welcome->height()
- + this->logWidget->height() + this->test_footer->height();
- int pos_x = this->width()/2 - tab_width;
- int pos_y = this->height()/2 - upper_height;
- msg_expsetup->move(pos_x, pos_y);
+ msg_expsetup = new QMessageBox(this);
+ msg_expsetup->setIcon(QMessageBox::Information);
+
+ // QLabel m_label;
+ // QMovie * movie_diag = new QMovie(path_gif);
+ // m_label.setMovie(movie_diag);
+ // movie_diag->start();
+
+ // msg_expsetup->layout()->addWidget(&m_label);
- msg_expsetup->show();
- //msg_expsetup->repaint();
- qApp->processEvents();
+ // msg_expsetup->setIconPixmap(QPixmap(path_gif).scaledToWidth(50));
+ // QLabel icon_label;
+ // msg_expsetup->layout()->addWidget(&icon_label);
+ // QLabel *icon_label1 = msg_expsetup->findChild<QLabel*>("qt_msgboxex_icon_label");
+ // QMovie *movie = new QMovie(path_gif);
+ // icon_label1->setMovie(movie);
+ // movie->start();
+ // //icon_label1->show();
+ msg_expsetup->setWindowFlags ( Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowStaysOnTopHint);
+ msg_expsetup->setStandardButtons(0);
+ msg_expsetup->setWindowTitle(tr("Updating..."));
+ msg_expsetup->setText(tr( "Setting up Experiment panel... Please wait...") );
+ msg_expsetup->setStyleSheet("background-color: #36454f; color : #D3D9DF;");
+
+ int tab_width = this->tabWidget->tabBar()->width();
+ int upper_height = this->gen_banner->height() + //this->welcome->height()
+ + this->logWidget->height() + this->test_footer->height();
+
+ int pos_x = this->width()/2 - tab_width;
+ int pos_y = this->height()/2 - upper_height;
+ msg_expsetup->move(pos_x, pos_y);
+
+ msg_expsetup->show();
+ //msg_expsetup->repaint();
+ qApp->processEvents();
+
+
// //msg_expsetup->exec();
// diag_expsetup = new QDialog( this );
@@ -662,7 +677,18 @@
// int row = 0;
// genL->addWidget( panel_desc, row++, 0, 1, 12);
- // assemble main
+
+ // movie_label = new QLabel;
+ // QString icon_path = std::getenv("ULTRASCAN");
+ // icon_path.append("/etc/");
+ // QString path_gif = icon_path + "setup.gif";
+
+ // QMovie * movie_diag = new QMovie(path_gif);
+ // movie_label->setMovie(movie_diag);
+ // movie_diag->start();
+
+ //assemble main
+ //main->addWidget(movie_label);
main->addLayout(genL);
main->addStretch();
@@ -764,6 +790,16 @@
msg_norec->setText(tr( "There are no Optima runs to follow.<br><br>"
"You will be switched to <b>Experiment</b> stage to design and submit new protocol."
));
+
+ msg_norec->setParent(this, Qt::Widget);
+ msg_norec->setStyleSheet("background-color: #36454f; color : #D3D9DF;");
+
+ //position
+ int pos_x = msg_norec->width()/2;
+ int pos_y = msg_norec->height()/2;
+ msg_norec->move(pos_x, pos_y);
+
+ connect(msg_norec, SIGNAL( accept() ), SLOT(close()) );
msg_norec->exec();
emit define_new_experiment_init( occupied_instruments );
@@ -938,9 +974,20 @@
QMessageBox * msg_norec_del = new QMessageBox;
msg_norec_del->setIcon(QMessageBox::Information);
- msg_norec_del->setText(tr( "There are no Optima runs to follow (from update_autoflow_data()).<br><br>"
+ msg_norec_del->setText(tr( "There are no Optima runs to follow.<br><br>"
"You will be switched to <b>Experiment</b> stage to design and submit new protocol."
));
+
+ msg_norec_del->setParent(this, Qt::Widget);
+ msg_norec_del->setStyleSheet("background-color: #36454f; color : #D3D9DF;");
+
+ //position
+ int pos_x = msg_norec_del->width()/2;
+ int pos_y = msg_norec_del->height()/2;
+ msg_norec_del->move(pos_x, pos_y);
+
+ connect(msg_norec_del, SIGNAL( accept() ), SLOT(close()) );
+
msg_norec_del->exec();
emit define_new_experiment_init( occupied_instruments );
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-07-20 04:32:37 UTC (rev 2794)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-07-21 01:25:03 UTC (rev 2795)
@@ -78,7 +78,9 @@
void initRecordsDialogue( void );
bool initDialogueOpen;
- void initAutoflowPanel( void );
+ void initAutoflowPanel( void );
+
+ QLabel* movie_label;
private:
US_ComProjectMain* mainw; // Parent to all panels
1
0
Author: alexey
Date: 2019-07-20 04:32:37 +0000 (Sat, 20 Jul 2019)
New Revision: 2794
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
Log:
More updates on autoflow...
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-20 02:38:26 UTC (rev 2793)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-20 04:32:37 UTC (rev 2794)
@@ -548,7 +548,10 @@
void US_ComProjectMain::close_all( void )
{
tabWidget->setCurrentIndex( 0 );
- epanInit ->initAutoflowPanel();
+ //epanInit ->initAutoflowPanel(); //DO NOT Duplicate - was called in previous line while changing Tab!!!
+ qDebug() << "XPN viwer closed!";
+ qApp->processEvents();
+
//qDebug() << "CLOSING PROGRAM !!!";
//close();
@@ -925,8 +928,8 @@
if ( autoflowdata.size() < 1 )
{
+ pdiag_autoflow->reject();
pdiag_autoflow->close();
- pdiag_autoflow->close();
qApp->processEvents();
qDebug() << "Was pdiag closed ?? ";
@@ -935,7 +938,7 @@
QMessageBox * msg_norec_del = new QMessageBox;
msg_norec_del->setIcon(QMessageBox::Information);
- msg_norec_del->setText(tr( "There are no Optima runs to follow.<br><br>"
+ msg_norec_del->setText(tr( "There are no Optima runs to follow (from update_autoflow_data()).<br><br>"
"You will be switched to <b>Experiment</b> stage to design and submit new protocol."
));
msg_norec_del->exec();
1
0
r2793 - in trunk: gui programs/us_com_project programs/us_experiment programs/us_xpn_viewer
by svn@svn.aucsolutions.com July 19, 2019
by svn@svn.aucsolutions.com July 19, 2019
July 19, 2019
Author: alexey
Date: 2019-07-20 02:38:26 +0000 (Sat, 20 Jul 2019)
New Revision: 2793
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_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
Log:
Lots of logical updates for autoflow:
Modified: trunk/gui/us_select_item.cpp
===================================================================
--- trunk/gui/us_select_item.cpp 2019-07-19 07:07:20 UTC (rev 2792)
+++ trunk/gui/us_select_item.cpp 2019-07-20 02:38:26 UTC (rev 2793)
@@ -265,6 +265,7 @@
{ // Return now if there are no list items
QString clabel = tr( "No data found." );
tw_data->setItem ( 0, 0, new QTableWidgetItem( clabel ) );
+ qApp->processEvents();
return;
}
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-19 07:07:20 UTC (rev 2792)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-20 02:38:26 UTC (rev 2793)
@@ -127,7 +127,10 @@
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;} ");
main->addWidget( tabWidget );
+
+ connect( tabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( initPanels( int ) ) );
+
logWidget = us_textedit();
logWidget->setMaximumHeight(30);
logWidget->setReadOnly(true);
@@ -284,7 +287,9 @@
//tabWidget->tabBar()->setTabTextColor(0, Qt::white);
main->addWidget( tabWidget );
-
+
+ connect( tabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( initPanels( int ) ) );
+
logWidget = us_textedit();
logWidget->setMaximumHeight(30);
logWidget->setReadOnly(true);
@@ -332,6 +337,25 @@
//check_current_stage();
}
+// Slot to init some panels (mainly Manage Opima Runs)
+void US_ComProjectMain::initPanels( int panx )
+{
+ qDebug() << "NEWPanel panx=" << panx << "OLDPanel curr_panx=" << curr_panx;
+
+ // if ( curr_panx == panx )
+ // return;
+
+ if ( panx == 0 ) //Autoflow Records
+ {
+ // 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..
+ epanInit ->initAutoflowPanel();
+ }
+ // else
+ // return;
+
+ //curr_panx = panx; // Set new current panel
+}
void US_ComProjectMain::closeEvent( QCloseEvent* event )
{
@@ -347,7 +371,6 @@
}
-
void US_ComProjectMain::close_initDialogue( void )
{
epanInit->pdiag_autoflow->close();
@@ -463,11 +486,46 @@
// Slot to define new exp. (from initial dialog)
void US_ComProjectMain::define_new_experiment( QStringList & occupied_instruments )
{
+ msg_expsetup = new QMessageBox(this);
+ msg_expsetup->setIcon(QMessageBox::Information);
+ msg_expsetup->setWindowFlags ( Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowStaysOnTopHint);
+ msg_expsetup->setStandardButtons(0);
+ msg_expsetup->setText(tr( "Setting up Experiment panel... Please wait...") );
+ msg_expsetup->setStyleSheet("background-color: #36454f; color : #D3D9DF;");
+
+ //msg_expsetup->setWindowModality(Qt::NonModal);
+ //msg_expsetup->setModal( false );
+ //msg_expsetup->setAttribute( Qt::WA_DeleteOnClose );
+ //msg_expsetup->raise();
+
+ int tab_width = this->tabWidget->tabBar()->width();
+ int upper_height = this->gen_banner->height() + //this->welcome->height()
+ + this->logWidget->height() + this->test_footer->height();
+
+ int pos_x = this->width()/2 - tab_width;
+ int pos_y = this->height()/2 - upper_height;
+ msg_expsetup->move(pos_x, pos_y);
+
+ msg_expsetup->show();
+ //msg_expsetup->repaint();
+ qApp->processEvents();
+
+
+ // //msg_expsetup->exec();
+
+ // diag_expsetup = new QDialog( this );
+ // Qt::WindowFlags flags = diag_expsetup->windowFlags();
+ // diag_expsetup->setWindowFlags(flags | Qt::Tool);
+ // diag_expsetup->show();
+
+
tabWidget->setCurrentIndex( 1 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+ curr_panx = 1;
qDebug() << "In define_new_experiment( QStringList & occupied_instruments )";
-
+
emit pass_used_instruments( occupied_instruments );
+
}
@@ -476,21 +534,24 @@
void US_ComProjectMain::switch_to_live_update( QMap < QString, QString > & protocol_details)
{
tabWidget->setCurrentIndex( 2 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+ curr_panx = 2;
- // ALEXEY:
+ // ALEXEY:
// (1) Make a record to 'autoflow' table - stage# = 1;
// (2) inside us_xpn_viewer - update 'curDirr' field with generated directory where .auc data saved
emit pass_to_live_update( protocol_details );
}
+
// Slot to pass submitted to Optima run info to the Live Update tab
void US_ComProjectMain::close_all( void )
{
tabWidget->setCurrentIndex( 0 );
- qDebug() << "CLOSING PROGRAM !!!";
+ epanInit ->initAutoflowPanel();
- close();
+ //qDebug() << "CLOSING PROGRAM !!!";
+ //close();
// QProcess process;
// QString pgm("pgrep");
@@ -525,7 +586,8 @@
void US_ComProjectMain::switch_to_post_processing( QMap < QString, QString > & protocol_details )
{
tabWidget->setCurrentIndex( 3 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
-
+ curr_panx = 3;
+
// ALEXEY: Make a record to 'autoflow' table: stage# = 2;
emit import_data_us_convert( protocol_details );
@@ -534,8 +596,8 @@
// Slot to switch back from the Live Update to Experiment tab
void US_ComProjectMain::switch_to_experiment( QString & protocolName )
{
- tabWidget->setCurrentIndex( 1 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
-
+ tabWidget->setCurrentIndex( 1 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+ curr_panx = 1;
//delete_autoflow_record( runID );
emit clear_experiment( protocolName );
@@ -546,7 +608,8 @@
void US_ComProjectMain::switch_to_editing( QString & currDir, QString & protocolName)
{
tabWidget->setCurrentIndex( 4 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
-
+ curr_panx = 4;
+
// ALEXEY: Make a record to 'autoflow' table: stage# = 3;
emit pass_to_editing( currDir, protocolName );
@@ -638,12 +701,19 @@
}
+// Init Autoflow Panel
+void US_InitDialogueGui::initAutoflowPanel( void )
+{
+ initRecords();
+ initRecordsDialogue();
+}
+
// Init Autoflow records
void US_InitDialogueGui::initRecords( void )
{
// Query 'autoflow': get count of records
- int autoflow_records = get_autoflow_records();
+ autoflow_records = get_autoflow_records();
qDebug() << "Autoflow record #: " << autoflow_records;
@@ -673,12 +743,31 @@
occupied_instruments << autoflowdata[ i ][ 2 ];
}
- qDebug() << "Init Autoflow Records: DONE";
+ qDebug() << "Init Autoflow Records: DONE, occupied instruments: " << occupied_instruments;
}
// Init AutoflowRecords Dialogue: call from _main.cpp
void US_InitDialogueGui::initRecordsDialogue( void )
{
+
+ if ( autoflow_records < 1 )
+ {
+ //ALEXEY: should close pdiag_autoflow if wasn't closed already
+
+ occupied_instruments.clear();
+
+ QMessageBox * msg_norec = new QMessageBox;
+ msg_norec->setIcon(QMessageBox::Information);
+ msg_norec->setText(tr( "There are no Optima runs to follow.<br><br>"
+ "You will be switched to <b>Experiment</b> stage to design and submit new protocol."
+ ));
+ msg_norec->exec();
+
+ emit define_new_experiment_init( occupied_instruments );
+
+ return;
+ }
+
QString pdtitle( tr( "Select Optima Run to Follow" ) );
QStringList hdrs;
int prx;
@@ -723,6 +812,8 @@
//disable 'Define Another Exp.' button if all instruments are in use
if ( occupied_instruments.size() >= instruments.size() )
pdiag_autoflow->pb_cancel->setEnabled( false );
+
+ qDebug() << "occupied_instruments.size(), instruments.size()" << occupied_instruments.size() << ", " << instruments.size();
QString autoflow_id_selected("");
@@ -757,7 +848,6 @@
emit define_new_experiment_init( occupied_instruments );
return;
}
-
}
// -------------------------------------------------------------------------------------------------
@@ -787,8 +877,7 @@
qDebug() << "Exp. Label: " << protocol_details[ "label" ];
qDebug() << "GMP Run ? " << protocol_details[ "gmpRun" ];
-
-
+
if ( stage == "LIVE_UPDATE" )
{
//do something
@@ -834,6 +923,30 @@
//Re-read autoflow records
list_all_autoflow_records( autoflowdata, dbP );
+ if ( autoflowdata.size() < 1 )
+ {
+ pdiag_autoflow->close();
+ pdiag_autoflow->close();
+ qApp->processEvents();
+
+ qDebug() << "Was pdiag closed ?? ";
+
+ occupied_instruments.clear();
+
+ QMessageBox * msg_norec_del = new QMessageBox;
+ msg_norec_del->setIcon(QMessageBox::Information);
+ msg_norec_del->setText(tr( "There are no Optima runs to follow.<br><br>"
+ "You will be switched to <b>Experiment</b> stage to design and submit new protocol."
+ ));
+ msg_norec_del->exec();
+
+ emit define_new_experiment_init( occupied_instruments );
+
+ return;
+ }
+
+
+
//Re-count instruments in use
occupied_instruments.clear();
for ( int i=0; i < autoflowdata.size(); i++ )
@@ -848,6 +961,7 @@
else
pdiag_autoflow->pb_cancel->setEnabled( true );
+
qDebug() << "Define Another Exp. button reset";
}
@@ -855,6 +969,8 @@
// Slot to read all Optima machines <------------------------------- // New
void US_InitDialogueGui::read_optima_machines( US_DB2* db )
{
+ this->instruments.clear();
+
QStringList q( "" );
q.clear();
q << QString( "get_instrument_names" )
@@ -1127,12 +1243,13 @@
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() ) );
connect( this, SIGNAL( define_used_instruments( QStringList & ) ), sdiag, SLOT( exclude_used_instruments( QStringList & ) ) );
+
+ connect( sdiag, SIGNAL( close_expsetup_msg() ), this, SLOT ( expsetup_msg_closed() ) );
connect( sdiag, SIGNAL( to_live_update( QMap < QString, QString > & ) ),
this, SLOT( to_live_update( QMap < QString, QString > & ) ) );
@@ -1221,7 +1338,15 @@
emit to_autoflow_records();
}
+//Close msg on setting up new EXP
+void US_ExperGui::expsetup_msg_closed( void )
+{
+ mainw->msg_expsetup->accept();
+ //mainw->diag_expsetup->close();
+}
+
+
// On click to open US_Experiment <-- NOT USED, us_experimnet is loaded immediately
void US_ExperGui::manageExperiment()
{
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-07-19 07:07:20 UTC (rev 2792)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-07-20 02:38:26 UTC (rev 2793)
@@ -78,11 +78,14 @@
void initRecordsDialogue( void );
bool initDialogueOpen;
+ void initAutoflowPanel( void );
private:
US_ComProjectMain* mainw; // Parent to all panels
int offset;
+ int autoflow_records;
+
void initRecords( void );
//void initRecordsDialogue( void );
@@ -138,6 +141,7 @@
void clear_experiment( QString & protocolName);
void exp_cleared( void );
void pass_used_instruments( QStringList & );
+ void expsetup_msg_closed( void );
signals:
void switch_to_live_update( QMap < QString, QString > & protocol_details );
@@ -145,6 +149,7 @@
void reset_experiment( QString & protocolName);
void to_autoflow_records( void );
void define_used_instruments( QStringList & );
+ //void close_expsetup_msg( void );
};
@@ -310,6 +315,9 @@
bool us_mode_bool;
+ QMessageBox * msg_expsetup;
+ QDialog * diag_expsetup;
+
//QList< QStringList > autoflowdata;
//void check_current_stage( void );
@@ -318,7 +326,7 @@
void close_initDialogue();
bool window_closed;
-
+ int curr_panx; // Current panel index (0-7)
//QStringList occupied_instruments;
//US_SelectItem* pdiag_autoflow;
@@ -334,7 +342,7 @@
//int statflag; // Composite panels status flag
//int dbg_level; // Debug print flag
- int curr_panx; // Current panel index (0-7)
+ //int curr_panx; // Current panel index (0-7)
//int get_autoflow_records( void );
//QMap < QString, QString > read_autoflow_record( int );
@@ -344,6 +352,7 @@
//QList< QMap<QString, QString> > instruments;
private slots:
+ void initPanels ( int ); // Move to a new panel
//void reset ( void );
//void newPanel ( int ); // Move to a new panel
//void statUpdate( void ); // Get a status flag update
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.cpp
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-07-19 07:07:20 UTC (rev 2792)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-07-20 02:38:26 UTC (rev 2793)
@@ -148,6 +148,8 @@
currProto = US_RunProtocol();
loadProto = US_RunProtocol();
+ epanGeneral->resetPanel();
+
epanRotor->setFirstLab(); //need to reset Lab && savePanel() for Rotors
epanAProfile->reset_sdiag(); //need to reset basic AProfile's protocol to defaults
@@ -186,6 +188,21 @@
void US_ExperimentMain::exclude_used_instruments( QStringList & occupied_instruments )
{
+
+ // QMessageBox * msg_expsetup = new QMessageBox;
+ // msg_expsetup->setIcon(QMessageBox::Information);
+ // msg_expsetup->setWindowFlags ( Qt::CustomizeWindowHint | Qt::WindowTitleHint);
+ // msg_expsetup->setWindowTitle(tr( "Setting Up Experiment Stage") );
+ // msg_expsetup->setText(tr( "Preparing to set up new Experiment...") );
+ // msg_expsetup-> setInformativeText( "<font color='red'>Preparing to set up new Experiment...</font>" );
+ // msg_expsetup->setModal(false);
+ // //msg_expsetup->raise();
+ // msg_expsetup->show();
+ // msg_expsetup->update();
+ // qApp->processEvents();
+
+ reset();
+
instruments_in_use.clear();
qDebug() << "OCCUPIED IINSTRUMENTS: " << occupied_instruments;
@@ -194,6 +211,10 @@
//Re-initialize Instruments based on the passed excluded list
epanRotor->setFirstLab();
+
+ //qApp->processEvents();
+ //msg_expsetup->close();
+ emit close_expsetup_msg();
}
void US_ExperimentMain::us_mode_passed( void )
@@ -397,6 +418,16 @@
}
+//resetPanel
+void US_ExperGuiGeneral::resetPanel( void )
+{
+ le_runid ->setText ("");
+ le_protocol ->setText ("");
+ le_project ->setText ("");
+ le_label ->setText ("");
+
+}
+
// Return detail information for a specific centerpiece as named
bool US_ExperGuiGeneral::centpInfo( const QString cpname,
US_AbstractCenterpiece& cpEntry )
@@ -552,6 +583,7 @@
initPanel();
le_protocol->setText( "" );
le_project ->setText( "" );
+ le_label ->setText( "" );
currProto->exp_label = "";
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.h
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-07-19 07:07:20 UTC (rev 2792)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-07-20 02:38:26 UTC (rev 2793)
@@ -65,6 +65,8 @@
QLabel* lb_label;
QLineEdit* le_label; // Run name line edit
+
+ void resetPanel( void );
private:
US_ExperimentMain* mainw; // Parent to all panels
@@ -968,6 +970,7 @@
void us_exp_is_closed( void );
void to_live_update( QMap < QString, QString > &protocol_details );
void exp_cleared ( void );
+ void close_expsetup_msg( void );
};
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-19 07:07:20 UTC (rev 2792)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-20 02:38:26 UTC (rev 2793)
@@ -2096,11 +2096,11 @@
// QPushButton *okButton = msg_data_avail->addButton(tr("Ok"), QMessageBox::AcceptRole);
// okButton->hide();
- QPushButton *Close = msg_data_avail->addButton(tr("Close Program Now?"), QMessageBox::RejectRole);
+ QPushButton *Close = msg_data_avail->addButton(tr("Return to Managing Optima Runs?"), QMessageBox::RejectRole);
msg_data_avail->setText(tr( "Run named <b>%1</b> was submitted to: <br>"
"<br><b>%2</b> <br>"
"<br>Please start this method scan from the instrument panel. <br>"
- "<br>You may close program now and reattach later by reopening and "
+ "<br>You may return to managing Optima runs now and reattach later by reopening and "
"selecting <b>%1</b> among the list of Optima runs to follow. "
"Alternatively, you can wait untill the method is started from "
"the Optima panel and monitor the progress.")
@@ -2120,7 +2120,8 @@
{
timer_data_init->stop();
disconnect(timer_data_init, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
-
+
+ reset_auto();
emit close_program();
}
}
1
0
r2792 - in trunk: gui programs/us_com_project programs/us_com_project_academic
by svn@svn.aucsolutions.com July 19, 2019
by svn@svn.aucsolutions.com July 19, 2019
July 19, 2019
Author: alexey
Date: 2019-07-19 07:07:20 +0000 (Fri, 19 Jul 2019)
New Revision: 2792
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_com_project/us_com_project_main.cpp
trunk/programs/us_com_project_academic/us_com_project_academic_main.cpp
Log:
Autoflow:
* Towards major upgrade: Autoflow records and reattachements to different jobs will be available from any current stage, any time...
Modified: trunk/gui/us_select_item.cpp
===================================================================
--- trunk/gui/us_select_item.cpp 2019-07-17 03:34:02 UTC (rev 2791)
+++ trunk/gui/us_select_item.cpp 2019-07-19 07:07:20 UTC (rev 2792)
@@ -73,7 +73,7 @@
build_layout( titl );
tw_data->setSelectionMode( QAbstractItemView::SingleSelection );
-
+
show();
}
@@ -221,6 +221,7 @@
list_data();
show();
+
qDebug() << "SelI: main: post-ld tw size" << tw_data->size();
resize( ( tw_data->width() + 4 ), ( tw_data->height() + 30 ) );
qDebug() << "SelI: main: post-ld ma size" << size();
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-17 03:34:02 UTC (rev 2791)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-19 07:07:20 UTC (rev 2792)
@@ -82,7 +82,8 @@
//tabWidget = new QTabWidget;
tabWidget->setTabPosition( QTabWidget::West );
tabWidget->tabBar()->setStyle(new VerticalTabStyle);
-
+
+ epanInit = new US_InitDialogueGui ( this );
epanExp = new US_ExperGui ( this );
epanObserv = new US_ObservGui ( this );
epanPostProd = new US_PostProdGui( this );
@@ -92,6 +93,7 @@
// statflag = 0;
// Add panels to the tab widget
+ tabWidget->addTab( epanInit, tr( "Manage Optima Runs" ) );
tabWidget->addTab( epanExp, tr( "1: Experiment" ) );
tabWidget->addTab( epanObserv, tr( "2: Live Update" ) );
tabWidget->addTab( epanPostProd, tr( "3: LIMS Import" ) );
@@ -108,9 +110,9 @@
//tabWidget->setTabIcon(1,QIcon(icon_path + "live_update.gif"));
//tabWidget->setTabIcon(2,QIcon(icon_path + "analysis.png"));
- tabWidget->setTabIcon( 0, US_Images::getIcon( US_Images::SETUP_COM ) );
- tabWidget->setTabIcon( 1, US_Images::getIcon( US_Images::LIVE_UPDATE_COM ) );
- tabWidget->setTabIcon( 2, US_Images::getIcon( US_Images::IMPORT_COM_1 ) );
+ tabWidget->setTabIcon( 1, US_Images::getIcon( US_Images::SETUP_COM ) );
+ tabWidget->setTabIcon( 2, US_Images::getIcon( US_Images::LIVE_UPDATE_COM ) );
+ tabWidget->setTabIcon( 3, US_Images::getIcon( US_Images::IMPORT_COM_1 ) );
// tabWidget->setTabIcon( 3, US_Images::getIcon( US_Images::ANALYSIS_COM_2 ) );
// tabWidget->setTabIcon( 4, US_Images::getIcon( US_Images::REPORT_COM ) );
@@ -122,7 +124,8 @@
tabWidget->tabBar()->setIconSize(QSize(50,50));
- tabWidget->tabBar()->setStyleSheet("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;}");
+ 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;} ");
+
main->addWidget( tabWidget );
logWidget = us_textedit();
@@ -141,6 +144,10 @@
test_footer->setStyleSheet("color: #D3D9DF; background-color: #36454f;");
main->addWidget( test_footer );
+ connect( epanInit, SIGNAL( define_new_experiment_init( QStringList & ) ), this, SLOT( define_new_experiment( QStringList &) ) );
+ connect( epanInit, SIGNAL( switch_to_live_update_init( QMap < QString, QString > & ) ), this, SLOT( switch_to_live_update( QMap < QString, QString > & ) ) );
+ connect( epanInit, SIGNAL( switch_to_post_processing_init( QMap < QString, QString > & ) ), this, SLOT( switch_to_post_processing( QMap < QString, QString > & ) ) );
+
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 > & ) ) );
@@ -226,7 +233,8 @@
//tabWidget = new QTabWidget;
tabWidget->setTabPosition( QTabWidget::West );
tabWidget->tabBar()->setStyle(new VerticalTabStyle);
-
+
+ epanInit = new US_InitDialogueGui ( this );
epanExp = new US_ExperGui ( this );
epanObserv = new US_ObservGui ( this );
epanPostProd = new US_PostProdGui( this );
@@ -237,6 +245,7 @@
// statflag = 0;
// Add panels to the tab widget
+ tabWidget->addTab( epanInit, tr( "Manage Optima Runs" ) );
tabWidget->addTab( epanExp, tr( "1: Experiment" ) );
tabWidget->addTab( epanObserv, tr( "2: Live Update" ) );
tabWidget->addTab( epanPostProd, tr( "3: LIMS Import" ) );
@@ -254,16 +263,26 @@
//tabWidget->setTabIcon(1,QIcon(icon_path + "live_update.gif"));
//tabWidget->setTabIcon(2,QIcon(icon_path + "analysis.png"));
- tabWidget->setTabIcon( 0, US_Images::getIcon( US_Images::SETUP_COM ) );
- tabWidget->setTabIcon( 1, US_Images::getIcon( US_Images::LIVE_UPDATE_COM ) );
- tabWidget->setTabIcon( 2, US_Images::getIcon( US_Images::IMPORT_COM_1 ) );
- tabWidget->setTabIcon( 3, US_Images::getIcon( US_Images::EDITING_COM ) );
- tabWidget->setTabIcon( 4, US_Images::getIcon( US_Images::ANALYSIS_COM_2 ) );
- tabWidget->setTabIcon( 5, US_Images::getIcon( US_Images::REPORT_COM ) );
-
+ tabWidget->setTabIcon( 1, US_Images::getIcon( US_Images::SETUP_COM ) );
+ tabWidget->setTabIcon( 2, US_Images::getIcon( US_Images::LIVE_UPDATE_COM ) );
+ tabWidget->setTabIcon( 3, US_Images::getIcon( US_Images::IMPORT_COM_1 ) );
+ tabWidget->setTabIcon( 4, US_Images::getIcon( US_Images::EDITING_COM ) );
+ tabWidget->setTabIcon( 5, US_Images::getIcon( US_Images::ANALYSIS_COM_2 ) );
+ tabWidget->setTabIcon( 6, US_Images::getIcon( US_Images::REPORT_COM ) );
+
tabWidget->tabBar()->setIconSize(QSize(50,50));
- tabWidget->tabBar()->setStyleSheet("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;}");
+ 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;} ");
+
+
+ //QLabel * init_lbl;
+ //init_lbl = new QLabel();
+ //init_lbl->setText("Manage Optima Runs");
+ //init_lbl->setStyleSheet("QLabel { background-color : blue; color : white; }");
+ //tabWidget->tabBar()->setTabButton(0, QTabBar::LeftSide, init_lbl);
+
+ //tabWidget->tabBar()->setTabTextColor(0, Qt::white);
+
main->addWidget( tabWidget );
logWidget = us_textedit();
@@ -282,6 +301,11 @@
test_footer->setStyleSheet("color: #D3D9DF; background-color: #36454f;");
main->addWidget( test_footer );
+
+ connect( epanInit, SIGNAL( define_new_experiment_init( QStringList & ) ), this, SLOT( define_new_experiment( QStringList &) ) );
+ connect( epanInit, SIGNAL( switch_to_live_update_init( QMap < QString, QString > & ) ), this, SLOT( switch_to_live_update( QMap < QString, QString > & ) ) );
+ connect( epanInit, SIGNAL( switch_to_post_processing_init( QMap < QString, QString > & ) ), this, SLOT( switch_to_post_processing( QMap < QString, QString > & ) ) );
+
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 > & ) ) );
@@ -313,164 +337,334 @@
{
window_closed = true;
emit us_comproject_closed();
+ close_initDialogue();
event->accept();
}
void US_ComProjectMain::to_autoflow_records( void )
{
- check_current_stage();
+ //check_current_stage();
}
-// Function that checks for current program stage based on US-lims DB entry
-void US_ComProjectMain::check_current_stage( void )
+
+void US_ComProjectMain::close_initDialogue( void )
{
- // (0) 'autoflow' table is initially updated with protocol name/ID & returned Optima's ExpID in us_experimet (submitExperiment(); )
- // (1) Query 'autoflow' table for stage#, protocol name/ID, ExperimentID
- // (2) Query 'protocol' table for details: e.g. CellChNumber, TripleNumber
- // (3) Identify currDir where .auc data have been saved (unique name based on protocolName + runID)
- // * this maybe an 'autoflow' table field recorded after stage 1 (Live Update); DEFAULT empty
+ epanInit->pdiag_autoflow->close();
+}
- /*
-
- 1. Query 'autoflow' table - proc. 'count_autoflow_records()':
- if 0 - return;
- else
- sort by OptimaName:
- list active Optima machines:
- identify which Optima is running via autoflow, which is free & offer to chose - either monitor existing run, OR submit new run on free machine
- When to consider Optima "free" ? (after stage 'LIVE_UPDATE' passed ?)
-
- 2. If autoflow record exists:
- proc. 'read_autoflow_record()'
+
+//Slot to delete Postgres Optima ExperimentDefinition record
+void US_ComProjectMain::delete_psql_record( int ExpId )
+{
+ QString schname( "AUC_schema" );
- */
+ QString tabname_expdef( "ExperimentDefinition" );
+ QString tabname_fuge ( "CentrifugeRunProfile" );
+ QString tabname_abs ( "AbsorbanceScanParameters" );
+
+ QString qrytab_expdef = "\"" + schname + "\".\"" + tabname_expdef + "\"";
+ QString qrytab_fuge = "\"" + schname + "\".\"" + tabname_fuge + "\"";
+ QString qrytab_abs = "\"" + schname + "\".\"" + tabname_abs + "\"";
+
+
+ QString dbhost = "demeler5.uleth.ca";
+ int dbport = 5552;
+ QString dbname = "AUC_DATA_DB";
+ QString dbuser = "";
+ QString dbpasw = "";
- // // Ling's exp. Optima 1!!!
- // QMap < QString, QString > protocol_details;
- // protocol_details[ "experimentId" ] = QString("465");
- // protocol_details[ "protocolName" ] = QString("CCLing-PZ5077-27k-021519");
- // protocol_details[ "experimentName" ] = QString("some_name");
- // protocol_details[ "CellChNumber" ] = QString("2");
- // protocol_details[ "TripleNumber" ] = QString("2");
- // protocol_details[ "OptimaName" ] = QString("Optima 1"); // <-- Optima 1
- // protocol_details[ "duration" ] = QString("27000");
- // protocol_details[ "invID_passed" ] = QString("34"); //Ling's ID
- // QDir directory( currDir );
+ QSqlDatabase dbxpn;
- // -------------------------------------------------------------------------------------------
+ dbxpn = QSqlDatabase::addDatabase( "QPSQL", "" );
+ dbxpn.setDatabaseName( "XpnData" );
+ dbxpn.setHostName ( dbhost );
+ dbxpn.setPort ( dbport );
+ dbxpn.setDatabaseName( dbname );
+ dbxpn.setUserName ( dbuser );
+ dbxpn.setPassword ( dbpasw );
- // // Nemetchek's exp. Optima 2 !!!
- // QMap < QString, QString > protocol_details;
- // protocol_details["experimentId"] = QString("287");
- // protocol_details["protocolName"] = QString("RxRPPARhet-PPRE-MWL_180419");
- // protocol_details[ "experimentName" ] = QString("some_name");
- // protocol_details[ "CellChNumber" ] = QString("8");
- // protocol_details[ "TripleNumber" ] = QString("38");
- // //protocol_details[ "TripleNumber" ] = QString("39"); //ALEXEY - incorrect - for testing
- // protocol_details[ "OptimaName" ] = QString("Optima 2"); // <-- Optima 2
- // protocol_details[ "duration" ] = QString("36000");
- // protocol_details[ "dataPath" ] = QString("/home/alexey/ultrascan/imports/RxRPPARhet-PPRE-MWL_180419-run352");
- // protocol_details[ "invID_passed" ] = QString("41"); //Nemetchek's ID
+ qDebug() << "Opening Postgres Connection!!!";
- // QString stage = "LIVE_UPDATE";
- // QString currDir = protocol_details[ "dataPath" ];
- // QString ProtName = protocol_details[ "protocolName" ];
- // QString invID_passed = protocol_details[ "invID_passed" ];
- // QDir directory( currDir );
+ if ( dbxpn.open() )
+ {
+ qDebug() << "Connected !!!";
+
+ QSqlQuery query_expdef(dbxpn);
+ QSqlQuery query_fuge(dbxpn);
+ QSqlQuery query_abs_scan(dbxpn);
+
+ /*
+ // AbsorbanceScanParameters
+ QString ScanId = "5996";
+ if(! query_abs_scan.prepare(QString("DELETE FROM %1 WHERE \"ScanId\" = %2").arg(qrytab_abs).arg(ScanId) ) )
+ qDebug() << query_abs_scan.lastError().text();
- // // --------------------------------------------------------------------------------------------
+ if (query_abs_scan.exec())
+ {
+ qDebug() << "AbsorbanceScanParameters record # :" << ScanId << "deleted !";
+ }
+ else
+ {
+ QString errmsg = "Delete record error: " + query_abs_scan.lastError().text();
+ QMessageBox::critical( this,
+ tr( "*ERROR* in Deleting Absorbance Record" ),
+ tr( "An error occurred in the attempt to delete"
+ " AbsorbanceScanParameters from AUC DB\n %1 table\n %2 ." ).arg( qrytab_abs ).arg( errmsg ) );
+ return;
+ }
+
+ // Cell Parameters
+
+
+ // FugeProfile
+ int FugeId = 308;
+ if(! query_fuge.prepare(QString("DELETE FROM %1 WHERE \"FugeRunProfileId\" = %2").arg(qrytab_fuge).arg(FugeId) ) )
+ qDebug() << query_fuge.lastError().text();
+
+ if (query_fuge.exec())
+ {
+ qDebug() << "FugeProfile record # :" << FugeId << "deleted !";
+ }
+ else
+ {
+ QString errmsg = "Delete record error: " + query_fuge.lastError().text();;
+ QMessageBox::critical( this,
+ tr( "*ERROR* in Deleting Fuge Profile" ),
+ tr( "An error occurred in the attempt to delete"
+ " FugeProfile from AUC DB\n %1 table\n %2 ." ).arg( qrytab_fuge ).arg( errmsg ) );
+ return;
+ }
+
+ */
+
+ // ExperimentalDefinition
+ if(! query_expdef.prepare(QString("DELETE FROM %1 WHERE \"ExperimentId\" = %2").arg(qrytab_expdef).arg(ExpId) ) )
+ qDebug() << query_expdef.lastError().text();
+
+ if (query_expdef.exec())
+ {
+ qDebug() << "ExperimentDefinition record # :" << ExpId << "deleted !";
+ }
+ else
+ {
+ QString errmsg = "Delete record error: " + query_expdef.lastError().text();;
+ QMessageBox::critical( this,
+ tr( "*ERROR* in Deleting Experimental Method" ),
+ tr( "An error occurred in the attempt to delete"
+ " exp. method from AUC DB\n %1 table\n %2 ." ).arg( qrytab_expdef ).arg( errmsg ) );
+ return;
+ }
+
+ }
+}
+
+
+// Slot to define new exp. (from initial dialog)
+void US_ComProjectMain::define_new_experiment( QStringList & occupied_instruments )
+{
+ tabWidget->setCurrentIndex( 1 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+
+ qDebug() << "In define_new_experiment( QStringList & occupied_instruments )";
+
+ 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)
+{
+ tabWidget->setCurrentIndex( 2 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+
+ // ALEXEY:
+ // (1) Make a record to 'autoflow' table - stage# = 1;
+ // (2) inside us_xpn_viewer - update 'curDirr' field with generated directory where .auc data saved
+
+ emit pass_to_live_update( protocol_details );
+}
+
+// Slot to pass submitted to Optima run info to the Live Update tab
+void US_ComProjectMain::close_all( void )
+{
+ tabWidget->setCurrentIndex( 0 );
+ qDebug() << "CLOSING PROGRAM !!!";
+
+ close();
- // // Amy's exp. Optima 2 !!!
- // QMap < QString, QString > protocol_details;
- // protocol_details["experimentId"] = QString("299");
- // protocol_details["protocolName"] = QString("data-aquisition-test29");
- // protocol_details[ "experimentName" ] = QString("some_name");
- // protocol_details[ "CellChNumber" ] = QString("8");
- // protocol_details[ "TripleNumber" ] = QString("12");
- // protocol_details[ "OptimaName" ] = QString("Optima 2"); // <-- Optima 2
- // protocol_details[ "duration" ] = QString("300");
- // protocol_details[ "dataPath" ] = QString("/home/alexey/ultrascan/imports/data-aquisition-test29-run364");
- // protocol_details[ "invID_passed" ] = QString("6"); //Amy's ID
-
- // QString stage = "LIVE_UPDATE";
- // QString currDir = protocol_details[ "dataPath" ];
- // QString ProtName = protocol_details[ "protocolName" ];
- // QString invID_passed = protocol_details[ "invID_passed" ];
- // QDir directory( currDir );
+ // QProcess process;
+ // QString pgm("pgrep");
+ // QStringList args = QStringList() << "us_comproject";
+ // process.start(pgm, args);
+ // process.waitForReadyRead();
+ // if(!process.readAllStandardOutput().isEmpty())
+ // {
+ // //app still running
+ // //Linux
+ // system("pkill us_comproject");
+ // //Windows
+ // system("taskkill /im us_comproject /f");
+
+ // process.kill();
+ // }
- // --------------------------------------------------------------------------------------------
+ //Linux
+ //system("pkill us_comproject");
- // // --------------------------------------------------------------------------------------------
- // // D Souza exp. Optima 1 !!!
- // QMap < QString, QString > protocol_details;
- // protocol_details["experimentId"] = QString("577");
- // protocol_details["protocolName"] = QString("DsouzaS_RVFV1-DDX17-MWL1_060819");
- // protocol_details[ "experimentName" ] = QString("some_name");
- // protocol_details[ "CellChNumber" ] = QString("4");
- // protocol_details[ "TripleNumber" ] = QString("80");
- // protocol_details[ "OptimaName" ] = QString("Optima 1"); // <-- Optima 1
- // protocol_details[ "duration" ] = QString("61320");
- // protocol_details[ "dataPath" ] = QString("/home/alexey/ultrascan/imports/DsouzaS_RVFV1-DDX17-MWL1_060819-run865");
- // protocol_details[ "invID_passed" ] = QString("20"); //D'Souza ID
- // protocol_details[ "label" ] = QString("DsouzaS_RVFV1-DDX17-MWL1_060819");
+ //system("pkill us_comproject_academic");
+ //Windows//
+ //system("taskkill /im us_comproject /f");
+ //system("taskkill /im us_comproject_academic /f");
+ //Mac ??
- // QString stage = "EDITING";
- // QString currDir = protocol_details[ "dataPath" ];
- // QString ProtName = protocol_details[ "protocolName" ];
- // QString invID_passed = protocol_details[ "invID_passed" ];
- // QDir directory( currDir );
+}
- // // --------------------------------------------------------------------------------------------
+
+// Slot to switch from the Live Update to Editing tab
+void US_ComProjectMain::switch_to_post_processing( QMap < QString, QString > & protocol_details )
+{
+ tabWidget->setCurrentIndex( 3 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
- // // --------------------------------------------------------------------------------------------
+ // ALEXEY: Make a record to 'autoflow' table: stage# = 2;
- // // H Steele exp. Optima 1 !!!
- // QMap < QString, QString > protocol_details;
- // protocol_details["experimentId"] = QString("581");
- // protocol_details["protocolName"] = QString("SteeleH_Cytc-ND-titrations_061719");
- // protocol_details[ "experimentName" ] = QString("some_name");
- // protocol_details[ "CellChNumber" ] = QString("8");
- // protocol_details[ "TripleNumber" ] = QString("16");
- // protocol_details[ "OptimaName" ] = QString("Optima 1"); // <-- Optima 1
- // protocol_details[ "duration" ] = QString("45000");
- // protocol_details[ "dataPath" ] = QString("/home/alexey/ultrascan/imports/SteeleH_Cytc-ND-titrations_061719-run872");
- // protocol_details[ "invID_passed" ] = QString("22"); //Harmen's
- // protocol_details[ "label" ] = QString("SteeleH_Cytc-ND-titrations_061719");
+ emit import_data_us_convert( protocol_details );
+}
+
+// Slot to switch back from the Live Update to Experiment tab
+void US_ComProjectMain::switch_to_experiment( QString & protocolName )
+{
+ tabWidget->setCurrentIndex( 1 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
+
+ //delete_autoflow_record( runID );
+
+ emit clear_experiment( protocolName );
+}
+
+
+// Slot to switch from the Import to Editing tab
+void US_ComProjectMain::switch_to_editing( QString & currDir, QString & protocolName)
+{
+ tabWidget->setCurrentIndex( 4 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
- // QString stage = "EDITING";
- // QString currDir = protocol_details[ "dataPath" ];
- // QString ProtName = protocol_details[ "protocolName" ];
- // QString invID_passed = protocol_details[ "invID_passed" ];
- // QDir directory( currDir );
+ // ALEXEY: Make a record to 'autoflow' table: stage# = 3;
- // // --------------------------------------------------------------------------------------------
+ emit pass_to_editing( currDir, protocolName );
+}
-
+// Function to Call initiation of the Autoflow Record Dialogue form _main.cpp
+void US_ComProjectMain::call_AutoflowDialogue( void )
+{
+ epanInit->initRecordsDialogue();
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//New Initial Decision-making Tab:
+US_InitDialogueGui::US_InitDialogueGui( QWidget* topw )
+ : US_WidgetsDialog( topw, 0 )
+{
+ mainw = (US_ComProjectMain*)topw;
+
+ initDialogueOpen = false;
+
+ setPalette( US_GuiSettings::frameColor() );
+ QFont sfont( US_GuiSettings::fontFamily(), US_GuiSettings::fontSize() - 1 );
+ QFontMetrics fmet( sfont );
+ //int fwid = fmet.maxWidth();
+ //int lwid = fwid * 4;
+ //int swid = lwid + fwid;
+
+ // Main VBox
+ QVBoxLayout* main = new QVBoxLayout (this);
+ main->setSpacing ( 2 );
+ main->setContentsMargins( 2, 2, 2, 2 );
+
+ QGridLayout* genL = new QGridLayout();
+
+ // // //QPlainTextEdit* panel_desc = new QPlainTextEdit(this);
+ // QTextEdit* panel_desc = new QTextEdit(this);
+ // panel_desc->viewport()->setAutoFillBackground(false);
+ // panel_desc->setFrameStyle(QFrame::NoFrame);
+ // panel_desc->setPlainText(" Tab to Show Init Dialogue... ---UNDER CONSTRUCTION--- ");
+ // panel_desc->setReadOnly(true);
+ // //panel_desc->setMaximumHeight(30);
+ // QFontMetrics m (panel_desc -> font()) ;
+ // int RowHeight = m.lineSpacing() ;
+ // panel_desc -> setFixedHeight (2* RowHeight) ;
+
+ // int row = 0;
+ // genL->addWidget( panel_desc, row++, 0, 1, 12);
+
+ // assemble main
+ main->addLayout(genL);
+ main->addStretch();
+
+ initRecords( );
+
+}
+
+void US_InitDialogueGui::resizeEvent(QResizeEvent *event)
+{
+ int tab_width = mainw->tabWidget->tabBar()->width();
+ int upper_height = mainw->gen_banner->height() + //mainw->welcome->height()
+ + mainw->logWidget->height() + mainw->test_footer->height();
+
+ int new_main_w = mainw->width() - 3*offset - tab_width;
+ int new_main_h = mainw->height() - 4*offset - upper_height;
+
+ if ( initDialogueOpen ){
+ //qDebug() << "Is PDIAG visible? " << pdiag_autoflow->isVisible();
+
+ if ( new_main_w > pdiag_autoflow->width() || new_main_h > pdiag_autoflow->height()) {
+ int newWidth = qMax( new_main_w, pdiag_autoflow->width());
+ int newHeight = qMax( new_main_h, pdiag_autoflow->height());
+
+ //qDebug() << "New sizes of PDIAG!! " << new_main_w << ", " << pdiag_autoflow->width();
+ pdiag_autoflow->setMaximumSize( newWidth, newHeight );
+ pdiag_autoflow->resize( QSize(newWidth, newHeight) );
+ update();
+ }
+
+ if ( new_main_w < pdiag_autoflow->width() || new_main_h < pdiag_autoflow->height() ) {
+ int newWidth = qMin( new_main_w, pdiag_autoflow->width());
+ int newHeight = qMin( new_main_h, pdiag_autoflow->height());
+ pdiag_autoflow->setMaximumSize( newWidth, newHeight );
+ pdiag_autoflow->resize( QSize(newWidth, newHeight) );
+ update();
+ }
+ }
+ QWidget::resizeEvent(event);
+}
+
+
+
+// Init Autoflow records
+void US_InitDialogueGui::initRecords( void )
+{
// Query 'autoflow': get count of records
int autoflow_records = get_autoflow_records();
-
+
qDebug() << "Autoflow record #: " << autoflow_records;
-
+
// //Temporary: delete ExperimentDefinition record ( ExpId = 306, 301 )
// int ExpId = 285;
// delete_psql_record( ExpId );
-
+
if ( autoflow_records < 1 )
return;
-
+
// Dialog of existing autoflow records
US_Passwd pw;
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++ )
@@ -478,8 +672,13 @@
if ( autoflowdata[ i ][ 5 ] == "LIVE_UPDATE" )
occupied_instruments << autoflowdata[ i ][ 2 ];
}
-
-
+
+ qDebug() << "Init Autoflow Records: DONE";
+}
+
+// Init AutoflowRecords Dialogue: call from _main.cpp
+void US_InitDialogueGui::initRecordsDialogue( void )
+{
QString pdtitle( tr( "Select Optima Run to Follow" ) );
QStringList hdrs;
int prx;
@@ -493,7 +692,7 @@
QString autoflow_btn;
- if ( us_mode_bool )
+ if ( mainw->us_mode_bool )
autoflow_btn = "AUTOFLOW_DA";
else
autoflow_btn = "AUTOFLOW_GMP";
@@ -501,14 +700,26 @@
//US_SelectItem pdiag_autoflow( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
//US_SelectItem* pdiag_autoflow = new US_SelectItem( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
- pdiag_autoflow = new US_SelectItem( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
+ pdiag_autoflow = new US_SelectItem( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
connect( pdiag_autoflow, SIGNAL( accept_autoflow_deletion() ), this, SLOT( update_autoflow_data() ));
-
- pdiag_autoflow->setParent(this, Qt::Window);
- pdiag_autoflow->setWindowFlags(Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint );
- //pdiag_autoflow->setWindowFlags(Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint );
+ pdiag_autoflow->setParent(this, Qt::Widget);
+ offset = 20;
+ pdiag_autoflow->move(offset, 2*offset);
+
+ initDialogueOpen = true;
+
+ // Trigger resize to update size of the InitDialogue
+ int curr_h = this->height() + 1;
+ int curr_w = this->width() + 1;
+
+ this->resize( QSize(curr_w, curr_h) );
+ //qDebug() << "Size of the InitDialogue widget: " << this->size();
+
+ //pdiag_autoflow->setFrameShape( QFrame::Box);
+ //pdiag_autoflow->setLineWidth(2);
+
//disable 'Define Another Exp.' button if all instruments are in use
if ( occupied_instruments.size() >= instruments.size() )
pdiag_autoflow->pb_cancel->setEnabled( false );
@@ -523,6 +734,9 @@
//ALEXEY: define what to do if some Optima(s) are occupied
// should emit signal sending list of optima's in use to us_experiment.
+ if ( mainw-> window_closed)
+ return;
+
if ( occupied_instruments.size() == 0 )
return;
else
@@ -540,9 +754,10 @@
msg_instr_use->exec();
- define_new_experiment( occupied_instruments );
+ emit define_new_experiment_init( occupied_instruments );
return;
}
+
}
// -------------------------------------------------------------------------------------------------
@@ -577,7 +792,10 @@
if ( stage == "LIVE_UPDATE" )
{
//do something
- switch_to_live_update( protocol_details );
+ //switch_to_live_update( protocol_details );
+
+ emit switch_to_live_update_init( protocol_details );
+
return;
}
@@ -587,9 +805,15 @@
//switch_to_post_processing( currDir, ProtName, invID_passed, correctRadii );
if ( currDir.isEmpty() || !directory.exists() )
- switch_to_live_update( protocol_details );
- else
- switch_to_post_processing( protocol_details );
+ {
+ //switch_to_live_update( protocol_details );
+ emit switch_to_live_update_init( protocol_details );
+ }
+ else
+ {
+ //switch_to_post_processing( protocol_details );
+ emit switch_to_post_processing_init( protocol_details );
+ }
return;
@@ -598,8 +822,9 @@
}
+
//Re-evaluate autoflow records & occupied instruments & if Define Another Exp. should be enabled....
-void US_ComProjectMain::update_autoflow_data( void )
+void US_InitDialogueGui::update_autoflow_data( void )
{
qDebug() << "Updating autoflow records!!!";
@@ -627,114 +852,8 @@
}
-
-//Slot to delete Postgres Optima ExperimentDefinition record
-void US_ComProjectMain::delete_psql_record( int ExpId )
-{
- QString schname( "AUC_schema" );
-
- QString tabname_expdef( "ExperimentDefinition" );
- QString tabname_fuge ( "CentrifugeRunProfile" );
- QString tabname_abs ( "AbsorbanceScanParameters" );
-
- QString qrytab_expdef = "\"" + schname + "\".\"" + tabname_expdef + "\"";
- QString qrytab_fuge = "\"" + schname + "\".\"" + tabname_fuge + "\"";
- QString qrytab_abs = "\"" + schname + "\".\"" + tabname_abs + "\"";
-
-
- QString dbhost = "demeler5.uleth.ca";
- int dbport = 5552;
- QString dbname = "AUC_DATA_DB";
- QString dbuser = "";
- QString dbpasw = "";
-
- QSqlDatabase dbxpn;
-
- dbxpn = QSqlDatabase::addDatabase( "QPSQL", "" );
- dbxpn.setDatabaseName( "XpnData" );
- dbxpn.setHostName ( dbhost );
- dbxpn.setPort ( dbport );
- dbxpn.setDatabaseName( dbname );
- dbxpn.setUserName ( dbuser );
- dbxpn.setPassword ( dbpasw );
-
- qDebug() << "Opening Postgres Connection!!!";
-
- if ( dbxpn.open() )
- {
- qDebug() << "Connected !!!";
-
- QSqlQuery query_expdef(dbxpn);
- QSqlQuery query_fuge(dbxpn);
- QSqlQuery query_abs_scan(dbxpn);
-
- /*
- // AbsorbanceScanParameters
- QString ScanId = "5996";
- if(! query_abs_scan.prepare(QString("DELETE FROM %1 WHERE \"ScanId\" = %2").arg(qrytab_abs).arg(ScanId) ) )
- qDebug() << query_abs_scan.lastError().text();
-
- if (query_abs_scan.exec())
- {
- qDebug() << "AbsorbanceScanParameters record # :" << ScanId << "deleted !";
- }
- else
- {
- QString errmsg = "Delete record error: " + query_abs_scan.lastError().text();
- QMessageBox::critical( this,
- tr( "*ERROR* in Deleting Absorbance Record" ),
- tr( "An error occurred in the attempt to delete"
- " AbsorbanceScanParameters from AUC DB\n %1 table\n %2 ." ).arg( qrytab_abs ).arg( errmsg ) );
- return;
- }
-
- // Cell Parameters
-
-
- // FugeProfile
- int FugeId = 308;
- if(! query_fuge.prepare(QString("DELETE FROM %1 WHERE \"FugeRunProfileId\" = %2").arg(qrytab_fuge).arg(FugeId) ) )
- qDebug() << query_fuge.lastError().text();
-
- if (query_fuge.exec())
- {
- qDebug() << "FugeProfile record # :" << FugeId << "deleted !";
- }
- else
- {
- QString errmsg = "Delete record error: " + query_fuge.lastError().text();;
- QMessageBox::critical( this,
- tr( "*ERROR* in Deleting Fuge Profile" ),
- tr( "An error occurred in the attempt to delete"
- " FugeProfile from AUC DB\n %1 table\n %2 ." ).arg( qrytab_fuge ).arg( errmsg ) );
- return;
- }
-
- */
-
- // ExperimentalDefinition
- if(! query_expdef.prepare(QString("DELETE FROM %1 WHERE \"ExperimentId\" = %2").arg(qrytab_expdef).arg(ExpId) ) )
- qDebug() << query_expdef.lastError().text();
-
- if (query_expdef.exec())
- {
- qDebug() << "ExperimentDefinition record # :" << ExpId << "deleted !";
- }
- else
- {
- QString errmsg = "Delete record error: " + query_expdef.lastError().text();;
- QMessageBox::critical( this,
- tr( "*ERROR* in Deleting Experimental Method" ),
- tr( "An error occurred in the attempt to delete"
- " exp. method from AUC DB\n %1 table\n %2 ." ).arg( qrytab_expdef ).arg( errmsg ) );
- return;
- }
-
- }
-}
-
// Slot to read all Optima machines <------------------------------- // New
-void US_ComProjectMain::read_optima_machines( US_DB2* db )
+void US_InitDialogueGui::read_optima_machines( US_DB2* db )
{
QStringList q( "" );
q.clear();
@@ -793,7 +912,7 @@
// Query autoflow for # records
-int US_ComProjectMain::list_all_autoflow_records( QList< QStringList >& autoflowdata, US_DB2* dbP )
+int US_InitDialogueGui::list_all_autoflow_records( QList< QStringList >& autoflowdata, US_DB2* dbP )
{
int nrecs = 0;
autoflowdata.clear();
@@ -844,7 +963,7 @@
// Query autoflow for # records
-int US_ComProjectMain::get_autoflow_records( void )
+int US_InitDialogueGui::get_autoflow_records( void )
{
// Check DB connection
US_Passwd pw;
@@ -870,7 +989,7 @@
// Query autoflow for # records
-QMap< QString, QString> US_ComProjectMain::read_autoflow_record( int autoflowID )
+QMap< QString, QString> US_InitDialogueGui::read_autoflow_record( int autoflowID )
{
// Check DB connection
US_Passwd pw;
@@ -921,111 +1040,14 @@
}
-// 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) ??
- qDebug() << "In define_new_experiment( QStringList & occupied_instruments )";
-
- 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)
-{
- tabWidget->setCurrentIndex( 1 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
- // ALEXEY:
- // (1) Make a record to 'autoflow' table - stage# = 1;
- // (2) inside us_xpn_viewer - update 'curDirr' field with generated directory where .auc data saved
-
- emit pass_to_live_update( protocol_details );
-}
-// Slot to pass submitted to Optima run info to the Live Update tab
-void US_ComProjectMain::close_all( void )
-{
- tabWidget->setCurrentIndex( 0 );
- qDebug() << "CLOSING PROGRAM !!!";
- close();
-
- // QProcess process;
- // QString pgm("pgrep");
- // QStringList args = QStringList() << "us_comproject";
- // process.start(pgm, args);
- // process.waitForReadyRead();
- // if(!process.readAllStandardOutput().isEmpty())
- // {
- // //app still running
- // //Linux
- // system("pkill us_comproject");
- // //Windows
- // system("taskkill /im us_comproject /f");
-
- // process.kill();
- // }
- //Linux
- //system("pkill us_comproject");
-
-
- //system("pkill us_comproject_academic");
- //Windows//
- //system("taskkill /im us_comproject /f");
- //system("taskkill /im us_comproject_academic /f");
- //Mac ??
-
-}
-
-// // 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( 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( protocol_details );
-}
-
-// Slot to switch back from the Live Update to Experiment tab
-void US_ComProjectMain::switch_to_experiment( QString & protocolName )
-{
- tabWidget->setCurrentIndex( 0 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
-
- //delete_autoflow_record( runID );
-
- emit clear_experiment( protocolName );
-}
-
-
-// Slot to switch from the Import to Editing tab
-void US_ComProjectMain::switch_to_editing( QString & currDir, QString & protocolName)
-{
- tabWidget->setCurrentIndex( 3 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
-
- // ALEXEY: Make a record to 'autoflow' table: stage# = 3;
-
- emit pass_to_editing( currDir, protocolName );
-}
-
-
-
-
-
-
+//////////////////////////////////////////////////////////////////////////////////
// US_ExperGUI
US_ExperGui::US_ExperGui( QWidget* topw )
: US_WidgetsDialog( topw, 0 )
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-07-17 03:34:02 UTC (rev 2791)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-07-19 07:07:20 UTC (rev 2792)
@@ -62,6 +62,52 @@
};
+//! \brief Initial panel
+class US_InitDialogueGui : public US_WidgetsDialog
+{
+ Q_OBJECT
+
+ public:
+ US_InitDialogueGui( QWidget* );
+ ~US_InitDialogueGui() {};
+
+
+ QList< QStringList > autoflowdata;
+ QStringList occupied_instruments;
+ US_SelectItem* pdiag_autoflow;
+
+ void initRecordsDialogue( void );
+ bool initDialogueOpen;
+
+ private:
+ US_ComProjectMain* mainw; // Parent to all panels
+ int offset;
+
+ void initRecords( void );
+ //void initRecordsDialogue( void );
+
+ int get_autoflow_records( void );
+ QMap < QString, QString > read_autoflow_record( int );
+ static int list_all_autoflow_records( QList< QStringList >&, US_DB2* );
+
+ void read_optima_machines( US_DB2* = 0 );
+ QList< QMap<QString, QString> > instruments;
+
+
+ protected:
+ void resizeEvent(QResizeEvent *event) override;
+
+ private slots:
+ void update_autoflow_data( void );
+
+ signals:
+ void define_new_experiment_init ( QStringList & );
+ void switch_to_live_update_init( QMap < QString, QString > & protocol_details );
+ void switch_to_post_processing_init( QMap < QString, QString > & protocol_details );
+};
+
+
+
//! \brief Experiment panel
class US_ExperGui : public US_WidgetsDialog
{
@@ -264,17 +310,21 @@
bool us_mode_bool;
- QList< QStringList > autoflowdata;
+ //QList< QStringList > autoflowdata;
- void check_current_stage( void );
+ //void check_current_stage( void );
+ void call_AutoflowDialogue();
+ void close_initDialogue();
+
bool window_closed;
- QStringList occupied_instruments;
+ //QStringList occupied_instruments;
- US_SelectItem* pdiag_autoflow;
+ //US_SelectItem* pdiag_autoflow;
private:
+ US_InitDialogueGui* epanInit; // US_Init panel
US_ExperGui* epanExp; // US_Exp panel
US_ObservGui* epanObserv; // US_Observ panel
US_PostProdGui* epanPostProd; // US_PostProd panel
@@ -286,13 +336,12 @@
//int dbg_level; // Debug print flag
int curr_panx; // Current panel index (0-7)
- //void check_current_stage( void );
- int get_autoflow_records( void );
- QMap < QString, QString > read_autoflow_record( int );
- static int list_all_autoflow_records( QList< QStringList >&, US_DB2* );
+ //int get_autoflow_records( void );
+ //QMap < QString, QString > read_autoflow_record( int );
+ //static int list_all_autoflow_records( QList< QStringList >&, US_DB2* );
- void read_optima_machines( US_DB2* = 0 );
- QList< QMap<QString, QString> > instruments;
+ //void read_optima_machines( US_DB2* = 0 );
+ //QList< QMap<QString, QString> > instruments;
private slots:
//void reset ( void );
@@ -319,7 +368,7 @@
void define_new_experiment( QStringList & );
void delete_psql_record( int );
- void update_autoflow_data( void );
+ //void update_autoflow_data( void );
signals:
void pass_to_live_update( QMap < QString, QString > & protocol_details );
Modified: trunk/programs/us_com_project/us_com_project_main.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_main.cpp 2019-07-17 03:34:02 UTC (rev 2791)
+++ trunk/programs/us_com_project/us_com_project_main.cpp 2019-07-19 07:07:20 UTC (rev 2792)
@@ -17,8 +17,9 @@
//w.setLineWidth(1);
w->show(); //!< \memberof QWidget
- w->check_current_stage();
-
+ //w->check_current_stage();
+ w->call_AutoflowDialogue();
+
if ( w->window_closed )
return 0;
Modified: trunk/programs/us_com_project_academic/us_com_project_academic_main.cpp
===================================================================
--- trunk/programs/us_com_project_academic/us_com_project_academic_main.cpp 2019-07-17 03:34:02 UTC (rev 2791)
+++ trunk/programs/us_com_project_academic/us_com_project_academic_main.cpp 2019-07-19 07:07:20 UTC (rev 2792)
@@ -17,8 +17,9 @@
//w.setLineWidth(1);
w->show(); //!< \memberof QWidget
- w->check_current_stage();
-
+ //w->check_current_stage();
+ w->call_AutoflowDialogue();
+
if ( w->window_closed )
return 0;
1
0
r2791 - in trunk: gui programs/us_com_project programs/us_experiment programs/us_xpn_viewer sql
by svn@svn.aucsolutions.com July 16, 2019
by svn@svn.aucsolutions.com July 16, 2019
July 16, 2019
Author: alexey
Date: 2019-07-17 03:34:02 +0000 (Wed, 17 Jul 2019)
New Revision: 2791
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_experiment/us_proto_ranges.cpp
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
trunk/sql/us3_autoflow_procs.sql
Log:
Autoflow, new featres && updates:
* Times in LIVE_UPDATE, bug fixed for proper times in hh:mm:ss format when total duration is more than a day
* In setting protocol, wavelength range is correted to [180-800] nm
* Delete Autoflow record with re-avaluation of machine states and possibility of submission another experiment is added.
Needs testing.
Modified: trunk/gui/us_select_item.cpp
===================================================================
--- trunk/gui/us_select_item.cpp 2019-07-16 01:50:11 UTC (rev 2790)
+++ trunk/gui/us_select_item.cpp 2019-07-17 03:34:02 UTC (rev 2791)
@@ -42,6 +42,7 @@
{
multi_sel = false;
deleted_button = false;
+ deleted_button_autoflow = false;
autoflow_button = false;
autoflow_da = false;
@@ -51,10 +52,14 @@
if ( add_label == "DELETE" )
deleted_button = true;
if ( add_label == "AUTOFLOW_GMP" )
- autoflow_button = true;
+ {
+ autoflow_button = true;
+ deleted_button_autoflow = true;
+ }
if ( add_label == "AUTOFLOW_DA" )
{
autoflow_button = true;
+ deleted_button_autoflow = true;
autoflow_da = true;
}
}
@@ -189,19 +194,26 @@
accept_pb_label );
- QPushButton* pb_delete = us_pushbutton( tr( "Delete Item" ) );
+ QPushButton* pb_delete = us_pushbutton( tr( "Delete Item" ) );
+ QPushButton* pb_delete_autoflow = us_pushbutton( tr( "Delete Record" ) );
buttons->addWidget( pb_cancel );
buttons->addWidget( pb_delete );
+ buttons->addWidget( pb_delete_autoflow );
buttons->addWidget( pb_accept );
connect( pb_cancel, SIGNAL( clicked() ), SLOT( cancelled() ) );
connect( pb_accept, SIGNAL( clicked() ), SLOT( accepted() ) );
connect( pb_delete, SIGNAL( clicked() ), SLOT( deleted() ) );
+ connect( pb_delete_autoflow, SIGNAL( clicked() ), SLOT( deleted_autoflow() ) );
if ( !deleted_button )
pb_delete->hide();
+ if ( !deleted_button_autoflow )
+ pb_delete_autoflow->hide();
+
+
main->addLayout( buttons );
resize( 700, 250 );
@@ -378,12 +390,91 @@
// Delete button:
/* ALEXEY: For future Delete() function:
- to get ptotID -> items[selxP][2];
+ to get autoflow ID -> items[selxP][0];
delete (stored procedure)
+ emit signal to us_experiment to update protdata BEFORE any selection;
then remove items[selxP] from QList;
then rebuild list by running list_data(); [move part of ]
*/
+void US_SelectItem::deleted_autoflow()
+{
+ QList< QTableWidgetItem* > selitems = tw_data->selectedItems();
+
+ int AutoflowRow;
+ QString AutoflowID;
+ if ( selitems.size() == 0 )
+ {
+ QMessageBox::information( this,
+ tr( "No Autoflow Record Selected" ),
+ tr( "You have not selected any auflow record.\nSelect or Cancel" ) );
+ return;
+ }
+
+ // Return the index to the selected item
+ QTableWidgetItem* twi = selitems.at( 0 );
+ int irow = twi->row();
+ twi = tw_data->item( irow, 0 );
+
+ AutoflowRow = qMax( 0, itemlist.indexOf( twi->text() ) );
+
+ AutoflowID = items[ AutoflowRow ][ 0 ];
+
+ //Attempt autoflow record deletion:
+ qDebug() << "Autoflow ID to delete: ID, name, run status: " << AutoflowID << ", " << items[ AutoflowRow ][ 1 ] << ", " << items[ AutoflowRow ][ 4 ];
+
+ QMessageBox msgBox;
+ msgBox.setText(tr( "You have selected the following Record to delete:<br><br>" )
+ + tr("<b>ID: </b>") + items[ AutoflowRow ][ 0 ]
+ + tr("<br>")
+ + tr("<b>Name: </b>") + items[ AutoflowRow ][ 1 ]
+ + tr("<br>")
+ + tr("<b>Status: </b> ") + items[ AutoflowRow ][ 4 ]
+ + tr( "<br><br>Proceed?" ));
+ msgBox.setInformativeText("<font color='red'><b>NOTE:</b> if deleted, this run cannot be monitored with this program anymore!</font>");
+ msgBox.setWindowTitle(tr("Delete Autoflow Record"));
+ QPushButton *Confirm = msgBox.addButton(tr("Delete"), QMessageBox::YesRole);
+ QPushButton *Cancel = msgBox.addButton(tr("Cancel"), QMessageBox::RejectRole);
+
+ msgBox.setIcon(QMessageBox::Question);
+ msgBox.exec();
+
+ if (msgBox.clickedButton() == Cancel)
+ return;
+ else if (msgBox.clickedButton() == Confirm)
+ {
+ US_Passwd pw;
+ US_DB2* db = new US_DB2( pw.getPasswd() );
+ QStringList q( "" );
+ q.clear();
+ q << QString( "delete_autoflow_record_by_id" )
+ << AutoflowID;
+
+ int status = db->statusQuery( q );
+
+ if ( status == US_DB2::NO_AUTOFLOW_RECORD )
+ {
+ QMessageBox::warning( this,
+ tr( "Autoflow Record Not Deleted" ),
+ tr( "This record could not be deleted since\n"
+ "it is not present in the LIMS DB." ) );
+ return;
+ }
+
+ items.removeAt( AutoflowRow ); // Remove deleted item row
+ list_data(); // Rebuild protocol list in the dialog
+
+ QString msg("Autoflow record has been successfully deleted.");
+ QMessageBox::information( this,
+ tr( "Autoflow Record Deleted" ),
+ msg );
+
+
+ emit accept_autoflow_deletion(); // Signal to pass to us_comproject to update (re-read reduced) autoflow records
+
+ }
+}
+
+
void US_SelectItem::deleted()
{
QList< QTableWidgetItem* > selitems = tw_data->selectedItems();
Modified: trunk/gui/us_select_item.h
===================================================================
--- trunk/gui/us_select_item.h 2019-07-16 01:50:11 UTC (rev 2790)
+++ trunk/gui/us_select_item.h 2019-07-17 03:34:02 UTC (rev 2791)
@@ -63,6 +63,7 @@
bool multi_sel; //!< Flag: multiple selections enabled?
bool deleted_button; //If Delete button is present
+ bool deleted_button_autoflow; //If Delete Autoflow button is present
bool autoflow_button; //If autoflow, Cancel becomes define another Experiment
bool autoflow_da; // If called by non-GMP us_comproject (DA)
@@ -78,10 +79,12 @@
void cancelled ( void );
void accepted ( void );
void deleted ( void );
+ void deleted_autoflow ( void );
void help ( void )
{ showHelp.show_help( "select_item.html" ); };
signals:
- void accept_deletion( void );
+ void accept_deletion( void );
+ void accept_autoflow_deletion( void );
};
#endif
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-16 01:50:11 UTC (rev 2790)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-17 03:34:02 UTC (rev 2791)
@@ -13,7 +13,7 @@
#include "us_crypto.h"
#include "us_select_item.h"
#include "us_images.h"
-#include "us_select_item.h"
+//#include "us_select_item.h"
#if QT_VERSION < 0x050000
#define setSamples(a,b,c) setData(a,b,c)
@@ -498,21 +498,25 @@
else
autoflow_btn = "AUTOFLOW_GMP";
- //US_SelectItem pdiag( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
- US_SelectItem* pdiag = new US_SelectItem( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
+ //US_SelectItem pdiag_autoflow( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
+ //US_SelectItem* pdiag_autoflow = new US_SelectItem( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
+
+ pdiag_autoflow = new US_SelectItem( autoflowdata, hdrs, pdtitle, &prx, autoflow_btn, -2 );
- 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 );
+ connect( pdiag_autoflow, SIGNAL( accept_autoflow_deletion() ), this, SLOT( update_autoflow_data() ));
+
+ pdiag_autoflow->setParent(this, Qt::Window);
+ pdiag_autoflow->setWindowFlags(Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint );
+ //pdiag_autoflow->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 );
+ pdiag_autoflow->pb_cancel->setEnabled( false );
QString autoflow_id_selected("");
- if ( pdiag->exec() == QDialog::Accepted )
+ if ( pdiag_autoflow->exec() == QDialog::Accepted )
autoflow_id_selected = autoflowdata[ prx ][ 0 ];
else
{
@@ -591,10 +595,39 @@
return;
}
//and so on...
+
+}
+
+//Re-evaluate autoflow records & occupied instruments & if Define Another Exp. should be enabled....
+void US_ComProjectMain::update_autoflow_data( void )
+{
+ qDebug() << "Updating autoflow records!!!";
+ US_Passwd pw;
+ US_DB2* dbP = new US_DB2( pw.getPasswd() );
+
+ //Re-read autoflow records
+ list_all_autoflow_records( autoflowdata, dbP );
+
+ //Re-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 ];
+ }
+ //Re-set Define Another Exp. button
+ if ( occupied_instruments.size() >= instruments.size() )
+ pdiag_autoflow->pb_cancel->setEnabled( false );
+ else
+ pdiag_autoflow->pb_cancel->setEnabled( true );
+
+ qDebug() << "Define Another Exp. button reset";
+
}
+
//Slot to delete Postgres Optima ExperimentDefinition record
void US_ComProjectMain::delete_psql_record( int ExpId )
{
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-07-16 01:50:11 UTC (rev 2790)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-07-17 03:34:02 UTC (rev 2791)
@@ -33,6 +33,7 @@
#include "us_license_t.h"
#include "us_plot.h"
#include "us_license.h"
+#include "us_select_item.h"
class US_ComProjectMain;
@@ -270,6 +271,8 @@
bool window_closed;
QStringList occupied_instruments;
+
+ US_SelectItem* pdiag_autoflow;
private:
US_ExperGui* epanExp; // US_Exp panel
@@ -315,7 +318,8 @@
void define_new_experiment( QStringList & );
- void delete_psql_record( int );
+ void delete_psql_record( int );
+ void update_autoflow_data( void );
signals:
void pass_to_live_update( QMap < QString, QString > & protocol_details );
Modified: trunk/programs/us_experiment/us_proto_ranges.cpp
===================================================================
--- trunk/programs/us_experiment/us_proto_ranges.cpp 2019-07-16 01:50:11 UTC (rev 2790)
+++ trunk/programs/us_experiment/us_proto_ranges.cpp 2019-07-17 03:34:02 UTC (rev 2791)
@@ -1034,8 +1034,8 @@
QLabel* lb_strwln = us_label( tr( "Start Wavelength" ) );
QLabel* lb_endwln = us_label( tr( "End Wavelength" ) );
QLabel* lb_incwln = us_label( tr( "Wavelength Increment" ) );
- ct_strwln = us_counter( 2, 100, 800, 1 );
- ct_endwln = us_counter( 2, 100, 800, 1 );
+ ct_strwln = us_counter( 2, 180, 800, 1 );
+ ct_endwln = us_counter( 2, 180, 800, 1 );
ct_incwln = us_counter( 2, 1, 20, 1 );
const int def_swl = 200;
const int def_ewl = 600;
@@ -1352,7 +1352,7 @@
qDebug() << "First and Last element: " << selected[0].toDouble() << ", " << selected[ selected.size() -1 ].toDouble();
- if ( selected[0].toDouble() < 100.0 || selected[ selected.size() -1 ].toDouble() > 800.0 ) // Boundaries [100-800] nm
+ if ( selected[0].toDouble() < 180.0 || selected[ selected.size() -1 ].toDouble() > 800.0 ) // Boundaries [100-800] nm
{
QPalette *palette = new QPalette();
palette->setColor(QPalette::Text,Qt::red);
@@ -1360,7 +1360,7 @@
le_wrange->setPalette(*palette);
QString mtitle_error = tr( "Error" );
- QString message_error = tr( "Selected wavelengths are outside of accepted range of [100-800] nm!" );
+ QString message_error = tr( "Selected wavelengths are outside of accepted range of [180-800] nm!" );
QMessageBox::critical( this, mtitle_error, message_error );
selected.clear();
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-16 01:50:11 UTC (rev 2790)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-07-17 03:34:02 UTC (rev 2791)
@@ -1846,6 +1846,10 @@
timeToList( running_time, dhms_r );
QString running_time_text;
//ALEXEY: hh:mm:ss - OR do we need dd:hh:mm instead ?
+ //ALEXEY: if times >~1 day, update #hours
+ if ( dhms_r[0] > 0 )
+ dhms_r[1] += 24;
+
running_time_text = QString::number(dhms_r[1]) + ":" + QString::number(dhms_r[2]) + ":" + QString::number(dhms_r[3]);
le_running->setText( running_time_text );
qApp->processEvents();
@@ -1859,6 +1863,10 @@
timeToList( elapsed_time, dhms_e );
QString elapsed_time_text;
//ALEXEY: hh:mm:ss - OR do we need dd:hh:mm instead ?
+ //ALEXEY: if times >~1 day, update #hours
+ if ( dhms_e[0] > 0 )
+ dhms_e[1] += 24;
+
elapsed_time_text = QString::number(dhms_e[1]) + ":" + QString::number(dhms_e[2]) + ":" + QString::number(dhms_e[3]);
le_elapsed->setText( elapsed_time_text );
qApp->processEvents();
@@ -1869,6 +1877,10 @@
timeToList( remaining_time, dhms_remain );
QString remaining_time_text;
//ALEXEY: hh:mm:ss - OR do we need dd:hh:mm instead ?
+ //ALEXEY: if times >~1 day, update #hours
+ if ( dhms_remain[0] > 0 )
+ dhms_remain[1] += 24;
+
remaining_time_text = QString::number(dhms_remain[1]) + ":" + QString::number(dhms_remain[2]) + ":" + QString::number(dhms_remain[3]);
le_remaining->setText( remaining_time_text );
qApp->processEvents();
Modified: trunk/sql/us3_autoflow_procs.sql
===================================================================
--- trunk/sql/us3_autoflow_procs.sql 2019-07-16 01:50:11 UTC (rev 2790)
+++ trunk/sql/us3_autoflow_procs.sql 2019-07-17 03:34:02 UTC (rev 2791)
@@ -126,6 +126,45 @@
+-- DELETE autoflow record by ID
+DROP PROCEDURE IF EXISTS delete_autoflow_record_by_id$$
+CREATE PROCEDURE delete_autoflow_record_by_id ( p_personGUID CHAR(36),
+ p_password VARCHAR(80),
+ p_ID INT )
+ MODIFIES SQL DATA
+
+BEGIN
+ DECLARE count_records INT;
+
+ CALL config();
+ SET @US3_LAST_ERRNO = @OK;
+ SET @US3_LAST_ERROR = '';
+
+ IF ( verify_user( p_personGUID, p_password ) = @OK ) THEN
+
+ -- Find out if record exists for associated runID
+ SELECT COUNT(*) INTO count_records
+ FROM autoflow
+ WHERE ID = p_ID;
+
+ IF ( count_records = 0 ) THEN
+ SET @US3_LAST_ERRNO = @NO_AUTOFLOW_RECORD;
+ SET @US3_LAST_ERROR = 'Record cannot be deleted as it does not exist for current experiment run';
+
+ ELSE
+ DELETE FROM autoflow
+ WHERE ID = p_ID;
+
+ END IF;
+
+ END IF;
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+END$$
+
+
+
-- Returns complete information about autoflow record
DROP PROCEDURE IF EXISTS read_autoflow_record$$
CREATE PROCEDURE read_autoflow_record ( p_personGUID CHAR(36),
1
0
July 15, 2019
Author: alexey
Date: 2019-07-16 01:50:11 +0000 (Tue, 16 Jul 2019)
New Revision: 2790
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
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
Log:
Autoflow:
* Bug fix: when trying to submit another run while some Optima machine(s) occupied and the protocol loaded presumes use of the occupied instrument, reset instrument in use to the first available instrument and inform user of the change...
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-06 04:52:30 UTC (rev 2789)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-16 01:50:11 UTC (rev 2790)
@@ -524,13 +524,18 @@
else
{
QString list_instruments_in_use = occupied_instruments.join(", ");
- QMessageBox::warning( this, tr( "Occupied Instruments" ),
- tr( "The following Optima instrument(s) \n"
- "are currently in use: \n\n"
- "%1 \n\n"
- "You will not be able to submit another run \n"
- "to these instruments at the moment.").arg( list_instruments_in_use ) );
+ QMessageBox * msg_instr_use = new QMessageBox;
+ msg_instr_use->setIcon(QMessageBox::Information);
+ msg_instr_use->setText(tr( "The following Optima instrument(s)<br>"
+ "are currently in use: <br><br>"
+ "<b>%1</b> <br><br>"
+ "You will not be able to submit another run<br>"
+ "to these instruments at the moment." )
+ .arg( list_instruments_in_use ) );
+
+ msg_instr_use->exec();
+
define_new_experiment( occupied_instruments );
return;
}
@@ -985,6 +990,9 @@
+
+
+
// US_ExperGUI
US_ExperGui::US_ExperGui( QWidget* topw )
: US_WidgetsDialog( topw, 0 )
Modified: trunk/programs/us_experiment/us_exp_utils.cpp
===================================================================
--- trunk/programs/us_experiment/us_exp_utils.cpp 2019-07-06 04:52:30 UTC (rev 2789)
+++ trunk/programs/us_experiment/us_exp_utils.cpp 2019-07-16 01:50:11 UTC (rev 2790)
@@ -726,8 +726,31 @@
QString optima_name = QString::number( rpRotor->instID ) + ": "
+ rpRotor->instrname;
- //optima machine
- changeOptima( cb_optima->findText( optima_name ) ); //<-- Do actual connection test in changeLab();
+ qDebug() << "OPTIMA NAME in initPANEL() :" << optima_name;
+ qDebug() << "OPTIMA INDEX in initPANEL() :" << cb_optima->findText( optima_name ) ;
+
+ // optima machine
+ // IF optima_name is NOT present in the list of the available instruments (from autoflow),
+ // then use 1st available instr. with informimng user that Optima was changed
+ if( cb_optima->findText( optima_name ) < 0 )
+ {
+ changeOptima( 0 ); //<-- Do actual connection test in changeLab();
+ //Message
+ QMessageBox * msg_instr_avail = new QMessageBox;
+ msg_instr_avail->setIcon(QMessageBox::Information);
+ msg_instr_avail->setText(tr( "Loaded protocol specified <b>%1</b> as the instrument in use.<br><br>"
+ "However, due to its current unavailability, the instrument in use will be changed to the first available intrument, <b>%2</b>." )
+ .arg( rpRotor->instrname ).arg( mainw->currentInstrument[ "name" ] ));
+
+ if ( !message_instr_shown )
+ {
+ msg_instr_avail->show();
+ message_instr_shown = true;
+ }
+ }
+ else
+ changeOptima( cb_optima->findText( optima_name ) ); //<-- Do actual connection test in changeLab();
+
//setCbCurrentText( cb_optima, optima_name ); // <-- NOT ENOUGH, no connection check
//operator
@@ -2592,8 +2615,12 @@
<< have_run << have_proj << have_cells << have_solus << have_range;
proto_ena = ( have_cells && have_solus && have_optic &&
have_range );
+ // subm_enab = ( have_run && have_proj && proto_ena &&
+ // connected );
+
subm_enab = ( have_run && have_proj && proto_ena &&
- connected );
+ mainw->connection_status && // ALEXEY: use top-level connection boolean!
+ !currProto->exp_label.isEmpty() ); // ALEXEY: and label is present
ck_run ->setChecked( have_run );
ck_project ->setChecked( have_proj );
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.cpp
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-07-06 04:52:30 UTC (rev 2789)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-07-16 01:50:11 UTC (rev 2790)
@@ -840,6 +840,7 @@
changeLab( curr_rotor );
savePanel();
changed = false;
+ message_instr_shown = false;
initPanel();
@@ -1012,8 +1013,10 @@
changeOperator(0);
- if ( !mainw->connection_for_instrument.contains( mainw->currentInstrument[ "name" ] ) )
- test_optima_connection();
+ // if ( !mainw->connection_for_instrument.contains( mainw->currentInstrument[ "name" ] ) )
+ // test_optima_connection();
+
+ test_optima_connection();
}
// Slot for change in ExpType selection
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.h
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-07-06 04:52:30 UTC (rev 2789)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-07-16 01:50:11 UTC (rev 2790)
@@ -138,6 +138,8 @@
void help ( void )
{ showHelp.show_help( "manual/experiment_rotor.html" ); };
+ bool message_instr_shown;
+
private:
US_ExperimentMain* mainw;
US_RunProtocol::RunProtoRotor* rpRotor; // Rotor protocol
1
0