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
September 2019
- 1 participants
- 9 discussions
Author: alexey
Date: 2019-09-26 17:52:45 +0000 (Thu, 26 Sep 2019)
New Revision: 2837
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
Log:
autoflow: when program see 0 occupied instruments but there run(s) in a queue (e.g. with status not equal to LIVE_UPDATE), allow submission another experiment to any machine...
Temporary solution...
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-09-25 23:09:24 UTC (rev 2836)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-09-26 17:52:45 UTC (rev 2837)
@@ -1085,7 +1085,11 @@
return;
if ( occupied_instruments.size() == 0 )
- return;
+ {
+ qDebug() << "No occuied instruments (No LIVE_UPDATE status)";
+ emit define_new_experiment_init( occupied_instruments );
+ return;
+ }
else
{
QString list_instruments_in_use = occupied_instruments.join(", ");
1
0
Author: alexey
Date: 2019-09-25 23:09:24 +0000 (Wed, 25 Sep 2019)
New Revision: 2836
Modified:
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
Log:
In autoflow, removed correction of the runID - wouldn't work anyway. Beckman inout required to prohibit manual re-launching same protocol form Optima panel ()bypassing the program
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-09-25 13:31:51 UTC (rev 2835)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-09-25 23:09:24 UTC (rev 2836)
@@ -1596,15 +1596,15 @@
//msg_data_avail->close();
//ok_msg_data->click();
- //ALEXEY: make sure ExpID is coupled to the RunID which is already in the autoflow DB
- if ( runID_passed != "NULL" )
- {
- if ( runID_passed.toInt() != RunID_to_retrieve.toInt() )
- {
- RunID_to_retrieve = runID_passed;
- qDebug() << "Correcting RunID to : " << RunID_to_retrieve;
- }
- }
+ // //ALEXEY: make sure ExpID is coupled to the RunID which is already in the autoflow DB
+ // if ( runID_passed != "NULL" )
+ // {
+ // if ( runID_passed.toInt() != RunID_to_retrieve.toInt() )
+ // {
+ // RunID_to_retrieve = runID_passed;
+ // qDebug() << "Correcting RunID to : " << RunID_to_retrieve;
+ // }
+ // }
//ALEXEY: need to update 'autoflow' table with the unique RunID_to_retrieve && Start Run Time fields !!!
//Conditional: Do it ONLY once !!!
1
0
Author: alexey
Date: 2019-09-25 13:31:51 +0000 (Wed, 25 Sep 2019)
New Revision: 2835
Modified:
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
Log:
Merging mine and Gary's mods to us_xpn_viewer_gui.cpp..
(accidentally overwrote last time)
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-09-25 07:35:36 UTC (rev 2834)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-09-25 13:31:51 UTC (rev 2835)
@@ -1598,15 +1598,14 @@
//ALEXEY: make sure ExpID is coupled to the RunID which is already in the autoflow DB
if ( runID_passed != "NULL" )
- {
- if ( runID_passed.toInt() != RunID_to_retrieve.toInt() )
- {
- RunID_to_retrieve = runID_passed;
- qDebug() << "Correcting RunID to : " << RunID_to_retrieve;
- }
- }
-
-
+ {
+ if ( runID_passed.toInt() != RunID_to_retrieve.toInt() )
+ {
+ RunID_to_retrieve = runID_passed;
+ qDebug() << "Correcting RunID to : " << RunID_to_retrieve;
+ }
+ }
+
//ALEXEY: need to update 'autoflow' table with the unique RunID_to_retrieve && Start Run Time fields !!!
//Conditional: Do it ONLY once !!!
update_autoflow_runId_timeStarted();
@@ -2343,14 +2342,14 @@
// US_XpnRunRaw* lddiag = new US_XpnRunRaw( drDesc, runInfo );
// if ( lddiag->exec() == QDialog::Rejected ) //ALEXEY need drDesc but do NOT need dialog
// {
-// DbgLv(1) << "RDr: rtn fr XpnRunRaw dialog: CANCEL";
+// DbgLv(1) << "RDa: rtn fr XpnRunRaw dialog: CANCEL";
// return;
// }
// // Restore area beneath dialog
// qApp->processEvents();
-// DbgLv(1) << "RDr: rtn fr XpnRunRaw dialog";
-// DbgLv(1) << "RDr: drDesc" << drDesc;
+// DbgLv(1) << "RDa: rtn fr XpnRunRaw dialog";
+// DbgLv(1) << "RDa: drDesc" << drDesc;
// See if we need to fix the runID
@@ -2411,16 +2410,16 @@
scanmask += QString( sMasks ).mid( 2, 1 ) == "1" ? 2 : 0;
scanmask += QString( sMasks ).mid( 4, 1 ) == "1" ? 4 : 0;
scanmask += QString( sMasks ).mid( 6, 1 ) == "1" ? 8 : 0;
-DbgLv(1) << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
+DbgLv(1) << "RDa: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
- qDebug() << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
-
//ALEXEY: maybe put in_reload_check_sysdata = true; and then false (after xpn_data->import_data( iRunId, scanmask ); )
//in_reload_check_sysdata = true; //ALEXEY
- xpn_data->import_data( iRunId, scanmask ); // ALEXEY <-- actual data retreiving
+
+ xpn_data->import_data( iRunId, scanmask ); // ALEXEY <-- actual data retreiving
+
int ntsrows = xpn_data->countOf( "scan_rows" );
-DbgLv(1) << "RDr: ntsrows" << ntsrows;
-DbgLv(1) << "RDr: knt(triple) " << xpn_data->countOf( "triple" );
+DbgLv(1) << "RDa: ntsrows" << ntsrows;
+DbgLv(1) << "RDa: knt(triple) " << xpn_data->countOf( "triple" );
qApp->processEvents();
if ( ntsrows < 1 )
@@ -2428,8 +2427,8 @@
le_status->setText( tr( "Run %1 has no associated data..." )
.arg( fRunId ) );
- in_reload_all_data = false;
-
+ in_reload_all_data = false;
+
//ALEXEY: rare case when no data but exp. aborted !!!!
if ( CheckExpComplete_auto( RunID_to_retrieve ) == 0 ) //ALEXEY should be == 3 as per documentation
{
@@ -2509,65 +2508,80 @@
drtype2 = ( runType2 == "RI" ) ? "Absorbance" : drtype2;
drtype2 = ( runType2 == "FI" ) ? "Fluorescence" : drtype2;
drtype2 = ( runType2 == "WI" ) ? "Wavelength" : drtype2;
- opsys << drtype1 << drtype2;
-
QString msg = tr( "Multiple scan data types are present:\n" )
+ "'" + drtype1 + "'\n or \n"
- + "'" + drtype2 + "' .\n\n"
- + tr( "Choose one for initial display." );
- QMessageBox mbox;
- mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
- mbox.setText( msg );
- QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
- QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
- mbox.setEscapeButton ( pb_opt2 );
- mbox.setDefaultButton( pb_opt1 );
+ + "'" + drtype2 + "' .\n";
+DbgLv(1) << "RDa: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
+ << xpn_data->countOf( "iscn_rows" )
+ << xpn_data->countOf( "fscn_rows" )
+ << xpn_data->countOf( "wscn_rows" );
+ if ( ( runType2 == "IP" && xpn_data->countOf( "iscn_rows" ) == 0 ) ||
+ ( runType2 == "FI" && xpn_data->countOf( "fscn_rows" ) == 0 ) ||
+ ( runType2 == "WI" && xpn_data->countOf( "wscn_rows" ) == 0 ) )
+ {
+ msg += tr( "\nScans are missing so only " ) + drtype1
+ + tr( " scans are processed." );
+ QMessageBox::warning( this,
+ tr( "Multiple Types with Missing Scans" ),
+ msg );
+ }
- mbox.exec();
- if ( mbox.clickedButton() == pb_opt2 )
+ else
{
- runType = runType2;
- optndx = 1;
+ opsys << drtype1 << drtype2;
+ msg += tr( "\nChoose one for initial display." );
+ QMessageBox mbox;
+ mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
+ mbox.setText( msg );
+ QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
+ QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
+ mbox.setEscapeButton ( pb_opt2 );
+ mbox.setDefaultButton( pb_opt1 );
+
+ mbox.exec();
+ if ( mbox.clickedButton() == pb_opt2 )
+ {
+ runType = runType2;
+ optndx = 1;
+DbgLv(1) << "RDa: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
+ << xpn_data->countOf( "iscn_rows" )
+ << xpn_data->countOf( "fscn_rows" )
+ << xpn_data->countOf( "wscn_rows" );
+ }
}
}
qApp->processEvents(); //ALEXEY: maybe this will help
-
- qDebug() << "1. Crashes HERE!!!!";
+DbgLv(1) << "RDa: 1. Crashes HERE!!!!";
cb_optsys->disconnect();
cb_optsys->clear();
-
- qDebug() << "1a. Crashes HERE!!!!";
+DbgLv(1) << "RDa: 1a. Crashes HERE!!!!";
cb_optsys->addItems( opsys ); // ALEXEY fill out Optics listbox
-
- qDebug() << "1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys";
+DbgLv(1) << "RDa: 1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys";
cb_optsys->setCurrentIndex( optndx );
- qDebug() << "1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys";
+DbgLv(1) << "RDa: 1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys";
connect( cb_optsys, SIGNAL( currentIndexChanged( int ) ),
this, SLOT ( changeOptics( ) ) );
-
- qDebug() << "1b. Crashes HERE!!!!";
+DbgLv(1) << "RDa: 1b. Crashes HERE!!!!";
runID = new_runID;
-DbgLv(1) << "RDr: runID" << runID << "runType" << runType;
+DbgLv(1) << "RDa: runID" << runID << "runType" << runType;
xpn_data->set_run_values( runID, runType ); // ALEXEY
+DbgLv(1) << "RDa: 2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )";
- qDebug() << "2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )";
-
// Build the AUC equivalent
//QApplication::setOverrideCursor( QCursor( Qt::WaitCursor) );
le_status->setText( tr( "Building AUC data ..." ) );
qApp->processEvents();
xpn_data->build_rawData( allData ); // ALEXEY Builds Raw Data
-
- qDebug() << "3. Crashes HERE!!!! (after xpn_data->build_rawData( allData ))";
+DbgLv(1) << "RDa: 3. Crashes HERE!!!! (after xpn_data->build_rawData( allData ))";
double tm2=(double)sttime.msecsTo(QDateTime::currentDateTime())/1000.0;
-DbgLv(1) << "RDr: build-raw done: tm1 tm2" << tm1 << tm2;
+DbgLv(1) << "RDa: build-raw done: tm1 tm2" << tm1 << tm2;
QApplication::restoreOverrideCursor();
QApplication::restoreOverrideCursor();
@@ -2579,10 +2593,10 @@
nscan = allData[ 0 ].scanCount();
npoint = allData[ 0 ].pointCount();
-DbgLv(1) << "RDr: mwr ntriple" << ntriple;
-DbgLv(1) << "RDr: ncellch" << ncellch << cellchans.count();
-DbgLv(1) << "RDr: nscan" << nscan << "npoint" << npoint;
-DbgLv(1) << "RDr: rvS rvE" << r_radii[0] << r_radii[npoint-1];
+DbgLv(1) << "RDa: mwr ntriple" << ntriple;
+DbgLv(1) << "RDa: ncellch" << ncellch << cellchans.count();
+DbgLv(1) << "RDa: nscan" << nscan << "npoint" << npoint;
+DbgLv(1) << "RDa: rvS rvE" << r_radii[0] << r_radii[npoint-1];
cb_cellchn->disconnect();
cb_cellchn->clear();
cb_cellchn->addItems( cellchans ); // ALEXEY fill out Cells/Channels listbox
@@ -2595,7 +2609,7 @@
#if 0
ntriple = nlambda * ncellch; // Number triples
ntpoint = npoint * nscan; // Number radius points per triple
-DbgLv(1) << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
+DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
<< "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple;
triples.clear();
@@ -2609,18 +2623,18 @@
#endif
#if 1
ntriple = xpn_data->data_triples( triples ); // ALEXEY triples
-DbgLv(1) << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
+DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
<< "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple
<< triples.count();
- qDebug() << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
+ qDebug() << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
<< "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple
<< triples.count();
#endif
-DbgLv(1) << "RDr: allData size" << allData.size();
+DbgLv(1) << "RDa: allData size" << allData.size();
- qDebug() << "RDr: allData size" << allData.size();
+ qDebug() << "RDa: allData size" << allData.size();
//QApplication::restoreOverrideCursor();
QString tspath = currentDir + "/" + runID + ".time_state.tmst";
@@ -2784,12 +2798,12 @@
scanmask += QString( sMasks ).mid( 6, 1 ) == "1" ? 8 : 0;
DbgLv(1) << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
- xpn_data->import_data( iRunId, scanmask );
+ xpn_data->import_data( iRunId, scanmask );
+
int ntsrows = xpn_data->countOf( "scan_rows" );
DbgLv(1) << "RDr: ntsrows" << ntsrows;
DbgLv(1) << "RDr: knt(triple) " << xpn_data->countOf( "triple" );
-
if ( ntsrows < 1 )
{
le_status->setText( tr( "Run %1 has no associated data..." )
@@ -2808,7 +2822,7 @@
if ( scanmask == 1 || scanmask == 2 ||
scanmask == 4 || scanmask == 8 )
- {
+ { // Single type of data present
runType = ( scanmask == 2 ) ? "FI" : runType;
runType = ( scanmask == 4 ) ? "IP" : runType;
runType = ( scanmask == 8 ) ? "WI" : runType;
@@ -2823,7 +2837,7 @@
}
else if ( ( scanmask & 1 ) != 0 )
- {
+ { // Multiple data types present
QApplication::restoreOverrideCursor();
QApplication::restoreOverrideCursor();
QString runType2( "IP" );
@@ -2837,25 +2851,46 @@
drtype2 = ( runType2 == "RI" ) ? "Absorbance" : drtype2;
drtype2 = ( runType2 == "FI" ) ? "Fluorescence" : drtype2;
drtype2 = ( runType2 == "WI" ) ? "Wavelength" : drtype2;
- opsys << drtype1 << drtype2;
-
QString msg = tr( "Multiple scan data types are present:\n" )
+ "'" + drtype1 + "'\n or \n"
- + "'" + drtype2 + "' .\n\n"
- + tr( "Choose one for initial display." );
- QMessageBox mbox;
- mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
- mbox.setText( msg );
- QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
- QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
- mbox.setEscapeButton ( pb_opt2 );
- mbox.setDefaultButton( pb_opt1 );
+ + "'" + drtype2 + "' .\n";
+DbgLv(1) << "RDr: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
+ << xpn_data->countOf( "iscn_rows" )
+ << xpn_data->countOf( "fscn_rows" )
+ << xpn_data->countOf( "wscn_rows" );
+ if ( ( runType2 == "IP" && xpn_data->countOf( "iscn_rows" ) == 0 ) ||
+ ( runType2 == "FI" && xpn_data->countOf( "fscn_rows" ) == 0 ) ||
+ ( runType2 == "WI" && xpn_data->countOf( "wscn_rows" ) == 0 ) )
+ {
+ msg += tr( "\nScans are missing so only " ) + drtype1
+ + tr( " scans are processed." );
+ QMessageBox::warning( this,
+ tr( "Multiple Types with Missing Scans" ),
+ msg );
+ }
- mbox.exec();
- if ( mbox.clickedButton() == pb_opt2 )
+ else
{
- runType = runType2;
- optndx = 1;
+ opsys << drtype1 << drtype2;
+ msg += tr( "\nChoose one for initial display." );
+ QMessageBox mbox;
+ mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
+ mbox.setText( msg );
+ QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
+ QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
+ mbox.setEscapeButton ( pb_opt2 );
+ mbox.setDefaultButton( pb_opt1 );
+
+ mbox.exec();
+ if ( mbox.clickedButton() == pb_opt2 )
+ {
+ runType = runType2;
+ optndx = 1;
+DbgLv(1) << "RDr: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
+ << xpn_data->countOf( "iscn_rows" )
+ << xpn_data->countOf( "fscn_rows" )
+ << xpn_data->countOf( "wscn_rows" );
+ }
}
}
1
0
Sept. 25, 2019
Author: alexey
Date: 2019-09-25 07:35:36 +0000 (Wed, 25 Sep 2019)
New Revision: 2834
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
Log:
autoflow: updates for proper handling job reattachement, jumping back and forth to Manage Optima Runs, and premature job abortion when no data yet generated....
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-09-22 14:56:01 UTC (rev 2833)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-09-25 07:35:36 UTC (rev 2834)
@@ -175,6 +175,8 @@
//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( epanObserv, SIGNAL( processes_stopped() ), this, SLOT( liveupdate_stopped() ));
+ connect( epanObserv, SIGNAL( stop_nodata() ), 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 & ) ) );
@@ -343,6 +345,7 @@
connect( epanObserv, SIGNAL( close_everything() ), this, SLOT( close_all() ));
connect( this, SIGNAL( reset_live_update() ), epanObserv, SLOT( reset_live_update( ) ) );
connect( epanObserv, SIGNAL( processes_stopped() ), this, SLOT( liveupdate_stopped() ));
+ connect( epanObserv, SIGNAL( stop_nodata() ), 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( ) ) );
@@ -1730,6 +1733,9 @@
connect( sdiag, SIGNAL( close_program() ), this, SLOT( to_close_program() ) );
connect( sdiag, SIGNAL( liveupdate_processes_stopped() ), this, SLOT( processes_stopped_passed() ) );
+
+ //ALEXEY: premature abortion with no data
+ connect( sdiag, SIGNAL( aborted_back_to_initAutoflow( ) ), this, SLOT( to_initAutoflow_xpnviewer ( ) ) );
offset = 0;
sdiag->move(offset, 2*offset);
@@ -1771,6 +1777,11 @@
QWidget::resizeEvent(event);
}
+void US_ObservGui::to_initAutoflow_xpnviewer ( void )
+{
+ emit stop_nodata();
+}
+
void US_ObservGui::processes_stopped_passed( void )
{
emit processes_stopped();
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-09-22 14:56:01 UTC (rev 2833)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-09-25 07:35:36 UTC (rev 2834)
@@ -189,14 +189,16 @@
void to_post_processing( QMap < QString, QString > & );
void to_close_program( void );
void reset_live_update( void );
- void processes_stopped_passed( void );
+ void processes_stopped_passed( void );
+ void to_initAutoflow_xpnviewer ( 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 );
- void processes_stopped( void );
+ void processes_stopped( void );
+ void stop_nodata( void );
};
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-09-22 14:56:01 UTC (rev 2833)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-09-25 07:35:36 UTC (rev 2834)
@@ -1597,14 +1597,14 @@
//ok_msg_data->click();
//ALEXEY: make sure ExpID is coupled to the RunID which is already in the autoflow DB
- if ( !runID_passed.isEmpty() || runID_passed != "NULL" )
- {
- if ( runID_passed.toInt() != RunID_to_retrieve.toInt() )
- {
- RunID_to_retrieve = runID_passed;
- qDebug() << "Correcting RunID to : " << RunID_to_retrieve;
- }
- }
+ if ( runID_passed != "NULL" )
+ {
+ if ( runID_passed.toInt() != RunID_to_retrieve.toInt() )
+ {
+ RunID_to_retrieve = runID_passed;
+ qDebug() << "Correcting RunID to : " << RunID_to_retrieve;
+ }
+ }
//ALEXEY: need to update 'autoflow' table with the unique RunID_to_retrieve && Start Run Time fields !!!
@@ -2343,14 +2343,14 @@
// US_XpnRunRaw* lddiag = new US_XpnRunRaw( drDesc, runInfo );
// if ( lddiag->exec() == QDialog::Rejected ) //ALEXEY need drDesc but do NOT need dialog
// {
-// DbgLv(1) << "RDa: rtn fr XpnRunRaw dialog: CANCEL";
+// DbgLv(1) << "RDr: rtn fr XpnRunRaw dialog: CANCEL";
// return;
// }
// // Restore area beneath dialog
// qApp->processEvents();
-// DbgLv(1) << "RDa: rtn fr XpnRunRaw dialog";
-// DbgLv(1) << "RDa: drDesc" << drDesc;
+// DbgLv(1) << "RDr: rtn fr XpnRunRaw dialog";
+// DbgLv(1) << "RDr: drDesc" << drDesc;
// See if we need to fix the runID
@@ -2411,16 +2411,16 @@
scanmask += QString( sMasks ).mid( 2, 1 ) == "1" ? 2 : 0;
scanmask += QString( sMasks ).mid( 4, 1 ) == "1" ? 4 : 0;
scanmask += QString( sMasks ).mid( 6, 1 ) == "1" ? 8 : 0;
-DbgLv(1) << "RDa: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
+DbgLv(1) << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
+ qDebug() << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
+
//ALEXEY: maybe put in_reload_check_sysdata = true; and then false (after xpn_data->import_data( iRunId, scanmask ); )
//in_reload_check_sysdata = true; //ALEXEY
-
- xpn_data->import_data( iRunId, scanmask ); // ALEXEY <-- actual data retreiving
-
+ xpn_data->import_data( iRunId, scanmask ); // ALEXEY <-- actual data retreiving
int ntsrows = xpn_data->countOf( "scan_rows" );
-DbgLv(1) << "RDa: ntsrows" << ntsrows;
-DbgLv(1) << "RDa: knt(triple) " << xpn_data->countOf( "triple" );
+DbgLv(1) << "RDr: ntsrows" << ntsrows;
+DbgLv(1) << "RDr: knt(triple) " << xpn_data->countOf( "triple" );
qApp->processEvents();
if ( ntsrows < 1 )
@@ -2429,6 +2429,41 @@
.arg( fRunId ) );
in_reload_all_data = false;
+
+ //ALEXEY: rare case when no data but exp. aborted !!!!
+ if ( CheckExpComplete_auto( RunID_to_retrieve ) == 0 ) //ALEXEY should be == 3 as per documentation
+ {
+ if ( finishing_live_update )
+ {
+ timer_all_data_avail->stop();
+ disconnect(timer_all_data_avail, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
+ in_reload_all_data = false;
+ return;
+ }
+
+ qDebug() << "ABORTION IN EARLY STAGE...";
+
+ experimentAborted = true;
+
+ timer_all_data_avail->stop();
+ disconnect(timer_all_data_avail, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
+
+ if ( !timer_check_sysdata->isActive() ) // Check if sys_data Timer is stopped
+ {
+ //message on aborted run with no data
+ QMessageBox::warning( this,
+ tr( "Run Was Aborted" ),
+ tr( "No data were produced. The current run will be erased. The program will return to the list of Optima runs..." ));
+
+ delete_autoflow_record();
+ reset_auto();
+
+ in_reload_all_data = false;
+ emit aborted_back_to_initAutoflow( );
+ return;
+ }
+ }
+
return;
}
@@ -2474,80 +2509,65 @@
drtype2 = ( runType2 == "RI" ) ? "Absorbance" : drtype2;
drtype2 = ( runType2 == "FI" ) ? "Fluorescence" : drtype2;
drtype2 = ( runType2 == "WI" ) ? "Wavelength" : drtype2;
+ opsys << drtype1 << drtype2;
+
QString msg = tr( "Multiple scan data types are present:\n" )
+ "'" + drtype1 + "'\n or \n"
- + "'" + drtype2 + "' .\n";
-DbgLv(1) << "RDa: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
- << xpn_data->countOf( "iscn_rows" )
- << xpn_data->countOf( "fscn_rows" )
- << xpn_data->countOf( "wscn_rows" );
- if ( ( runType2 == "IP" && xpn_data->countOf( "iscn_rows" ) == 0 ) ||
- ( runType2 == "FI" && xpn_data->countOf( "fscn_rows" ) == 0 ) ||
- ( runType2 == "WI" && xpn_data->countOf( "wscn_rows" ) == 0 ) )
- {
- msg += tr( "\nScans are missing so only " ) + drtype1
- + tr( " scans are processed." );
- QMessageBox::warning( this,
- tr( "Multiple Types with Missing Scans" ),
- msg );
- }
+ + "'" + drtype2 + "' .\n\n"
+ + tr( "Choose one for initial display." );
+ QMessageBox mbox;
+ mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
+ mbox.setText( msg );
+ QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
+ QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
+ mbox.setEscapeButton ( pb_opt2 );
+ mbox.setDefaultButton( pb_opt1 );
- else
+ mbox.exec();
+ if ( mbox.clickedButton() == pb_opt2 )
{
- opsys << drtype1 << drtype2;
- msg += tr( "\nChoose one for initial display." );
- QMessageBox mbox;
- mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
- mbox.setText( msg );
- QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
- QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
- mbox.setEscapeButton ( pb_opt2 );
- mbox.setDefaultButton( pb_opt1 );
-
- mbox.exec();
- if ( mbox.clickedButton() == pb_opt2 )
- {
- runType = runType2;
- optndx = 1;
-DbgLv(1) << "RDa: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
- << xpn_data->countOf( "iscn_rows" )
- << xpn_data->countOf( "fscn_rows" )
- << xpn_data->countOf( "wscn_rows" );
- }
+ runType = runType2;
+ optndx = 1;
}
}
qApp->processEvents(); //ALEXEY: maybe this will help
-DbgLv(1) << "RDa: 1. Crashes HERE!!!!";
+
+ qDebug() << "1. Crashes HERE!!!!";
cb_optsys->disconnect();
cb_optsys->clear();
-DbgLv(1) << "RDa: 1a. Crashes HERE!!!!";
+
+ qDebug() << "1a. Crashes HERE!!!!";
cb_optsys->addItems( opsys ); // ALEXEY fill out Optics listbox
-DbgLv(1) << "RDa: 1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys";
+
+ qDebug() << "1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys";
cb_optsys->setCurrentIndex( optndx );
-DbgLv(1) << "RDa: 1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys";
+ qDebug() << "1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys";
connect( cb_optsys, SIGNAL( currentIndexChanged( int ) ),
this, SLOT ( changeOptics( ) ) );
-DbgLv(1) << "RDa: 1b. Crashes HERE!!!!";
+
+ qDebug() << "1b. Crashes HERE!!!!";
runID = new_runID;
-DbgLv(1) << "RDa: runID" << runID << "runType" << runType;
+DbgLv(1) << "RDr: runID" << runID << "runType" << runType;
xpn_data->set_run_values( runID, runType ); // ALEXEY
-DbgLv(1) << "RDa: 2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )";
+ qDebug() << "2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )";
+
// Build the AUC equivalent
//QApplication::setOverrideCursor( QCursor( Qt::WaitCursor) );
le_status->setText( tr( "Building AUC data ..." ) );
qApp->processEvents();
xpn_data->build_rawData( allData ); // ALEXEY Builds Raw Data
-DbgLv(1) << "RDa: 3. Crashes HERE!!!! (after xpn_data->build_rawData( allData ))";
+
+ qDebug() << "3. Crashes HERE!!!! (after xpn_data->build_rawData( allData ))";
double tm2=(double)sttime.msecsTo(QDateTime::currentDateTime())/1000.0;
-DbgLv(1) << "RDa: build-raw done: tm1 tm2" << tm1 << tm2;
+DbgLv(1) << "RDr: build-raw done: tm1 tm2" << tm1 << tm2;
QApplication::restoreOverrideCursor();
QApplication::restoreOverrideCursor();
@@ -2559,10 +2579,10 @@
nscan = allData[ 0 ].scanCount();
npoint = allData[ 0 ].pointCount();
-DbgLv(1) << "RDa: mwr ntriple" << ntriple;
-DbgLv(1) << "RDa: ncellch" << ncellch << cellchans.count();
-DbgLv(1) << "RDa: nscan" << nscan << "npoint" << npoint;
-DbgLv(1) << "RDa: rvS rvE" << r_radii[0] << r_radii[npoint-1];
+DbgLv(1) << "RDr: mwr ntriple" << ntriple;
+DbgLv(1) << "RDr: ncellch" << ncellch << cellchans.count();
+DbgLv(1) << "RDr: nscan" << nscan << "npoint" << npoint;
+DbgLv(1) << "RDr: rvS rvE" << r_radii[0] << r_radii[npoint-1];
cb_cellchn->disconnect();
cb_cellchn->clear();
cb_cellchn->addItems( cellchans ); // ALEXEY fill out Cells/Channels listbox
@@ -2575,7 +2595,7 @@
#if 0
ntriple = nlambda * ncellch; // Number triples
ntpoint = npoint * nscan; // Number radius points per triple
-DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
+DbgLv(1) << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
<< "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple;
triples.clear();
@@ -2589,18 +2609,18 @@
#endif
#if 1
ntriple = xpn_data->data_triples( triples ); // ALEXEY triples
-DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
+DbgLv(1) << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
<< "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple
<< triples.count();
- qDebug() << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
+ qDebug() << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
<< "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple
<< triples.count();
#endif
-DbgLv(1) << "RDa: allData size" << allData.size();
+DbgLv(1) << "RDr: allData size" << allData.size();
- qDebug() << "RDa: allData size" << allData.size();
+ qDebug() << "RDr: allData size" << allData.size();
//QApplication::restoreOverrideCursor();
QString tspath = currentDir + "/" + runID + ".time_state.tmst";
@@ -2764,12 +2784,12 @@
scanmask += QString( sMasks ).mid( 6, 1 ) == "1" ? 8 : 0;
DbgLv(1) << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
- xpn_data->import_data( iRunId, scanmask );
-
+ xpn_data->import_data( iRunId, scanmask );
int ntsrows = xpn_data->countOf( "scan_rows" );
DbgLv(1) << "RDr: ntsrows" << ntsrows;
DbgLv(1) << "RDr: knt(triple) " << xpn_data->countOf( "triple" );
+
if ( ntsrows < 1 )
{
le_status->setText( tr( "Run %1 has no associated data..." )
@@ -2788,7 +2808,7 @@
if ( scanmask == 1 || scanmask == 2 ||
scanmask == 4 || scanmask == 8 )
- { // Single type of data present
+ {
runType = ( scanmask == 2 ) ? "FI" : runType;
runType = ( scanmask == 4 ) ? "IP" : runType;
runType = ( scanmask == 8 ) ? "WI" : runType;
@@ -2803,7 +2823,7 @@
}
else if ( ( scanmask & 1 ) != 0 )
- { // Multiple data types present
+ {
QApplication::restoreOverrideCursor();
QApplication::restoreOverrideCursor();
QString runType2( "IP" );
@@ -2817,46 +2837,25 @@
drtype2 = ( runType2 == "RI" ) ? "Absorbance" : drtype2;
drtype2 = ( runType2 == "FI" ) ? "Fluorescence" : drtype2;
drtype2 = ( runType2 == "WI" ) ? "Wavelength" : drtype2;
+ opsys << drtype1 << drtype2;
+
QString msg = tr( "Multiple scan data types are present:\n" )
+ "'" + drtype1 + "'\n or \n"
- + "'" + drtype2 + "' .\n";
-DbgLv(1) << "RDr: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
- << xpn_data->countOf( "iscn_rows" )
- << xpn_data->countOf( "fscn_rows" )
- << xpn_data->countOf( "wscn_rows" );
- if ( ( runType2 == "IP" && xpn_data->countOf( "iscn_rows" ) == 0 ) ||
- ( runType2 == "FI" && xpn_data->countOf( "fscn_rows" ) == 0 ) ||
- ( runType2 == "WI" && xpn_data->countOf( "wscn_rows" ) == 0 ) )
- {
- msg += tr( "\nScans are missing so only " ) + drtype1
- + tr( " scans are processed." );
- QMessageBox::warning( this,
- tr( "Multiple Types with Missing Scans" ),
- msg );
- }
+ + "'" + drtype2 + "' .\n\n"
+ + tr( "Choose one for initial display." );
+ QMessageBox mbox;
+ mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
+ mbox.setText( msg );
+ QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
+ QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
+ mbox.setEscapeButton ( pb_opt2 );
+ mbox.setDefaultButton( pb_opt1 );
- else
+ mbox.exec();
+ if ( mbox.clickedButton() == pb_opt2 )
{
- opsys << drtype1 << drtype2;
- msg += tr( "\nChoose one for initial display." );
- QMessageBox mbox;
- mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
- mbox.setText( msg );
- QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
- QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
- mbox.setEscapeButton ( pb_opt2 );
- mbox.setDefaultButton( pb_opt1 );
-
- mbox.exec();
- if ( mbox.clickedButton() == pb_opt2 )
- {
- runType = runType2;
- optndx = 1;
-DbgLv(1) << "RDr: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
- << xpn_data->countOf( "iscn_rows" )
- << xpn_data->countOf( "fscn_rows" )
- << xpn_data->countOf( "wscn_rows" );
- }
+ runType = runType2;
+ optndx = 1;
}
}
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-09-22 14:56:01 UTC (rev 2833)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-09-25 07:35:36 UTC (rev 2834)
@@ -374,6 +374,7 @@
void return_to_experiment( QString & );
void close_program( void );
void liveupdate_processes_stopped( void );
+ void aborted_back_to_initAutoflow( void );
};
#endif
1
0
r2833 - in trunk: programs/us_convert programs/us_xpn_viewer utils
by svn@svn.aucsolutions.com Sept. 22, 2019
by svn@svn.aucsolutions.com Sept. 22, 2019
Sept. 22, 2019
Author: gegorbet
Date: 2019-09-22 14:56:01 +0000 (Sun, 22 Sep 2019)
New Revision: 2833
Modified:
trunk/programs/us_convert/us_convert_gui.cpp
trunk/programs/us_convert/us_convertio.cpp
trunk/programs/us_xpn_viewer/us_xpn_run_auc.cpp
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
trunk/utils/us_xpn_data.cpp
trunk/utils/us_xpn_data.h
Log:
convert--download timestate if needed + proper lambda range adjust, xpn_viewer--fix crash + warn with ScanMask,#scans discrepancy
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-09-20 02:22:20 UTC (rev 2832)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-09-22 14:56:01 UTC (rev 2833)
@@ -43,7 +43,7 @@
#endif
-US_ConvertGui::US_ConvertGui(QString auto_mode) : US_Widgets()
+US_ConvertGui::US_ConvertGui( QString auto_mode ) : US_Widgets()
{
ExpData.invID = US_Settings::us_inv_ID();
@@ -1520,6 +1520,7 @@
void US_ConvertGui::import()
{
impType = getImports();
+DbgLv(1) << "CGui:IMP: impType" << impType;
if ( impType == 1 )
{
@@ -1540,6 +1541,7 @@
le_status->setText( tr( "Importing experimental data ..." ) );
success = read(); // Read the legacy data
+DbgLv(1) << "CGui:IMP: read success" << success;
if ( ! success ) return;
@@ -1551,11 +1553,13 @@
// Figure out all the triple combinations and convert data
success = convert();
+DbgLv(1) << "CGui:IMP: convert success" << success;
if ( ! success ) return;
// Initialize export data pointers vector
success = init_output_data();
+DbgLv(1) << "CGui:IMP: initout success" << success;
if ( ! success ) return;
@@ -1589,9 +1593,9 @@
{
referenceDefined = false;
pb_reference->setEnabled( true );
-DbgLv(1) << "CGui: (2)referDef=" << referenceDefined;
+DbgLv(1) << "CGui:IMP: (2)referDef=" << referenceDefined;
}
-DbgLv(1) << "CGui: import: RTN";
+DbgLv(1) << "CGui:IMP: import: RTN";
le_status->setText( tr( "Legacy data has been imported." ) );
}
@@ -1782,7 +1786,7 @@
QString importDir = currentDir;
QDir readDir( importDir );
- qDebug() << "CURRENT DIR_1: " << importDir;
+DbgLv(1) << "CGui:iA: CURRENT DIR_1: " << importDir;
QApplication::setOverrideCursor( QCursor( Qt::WaitCursor ) );
le_status->setText( tr( "Loading AUC data ..." ) );
@@ -1805,7 +1809,7 @@
// Give it a new unique GUID, since we are making a copy
QString uuidst = US_Util::new_guid();
US_Util::uuid_parse( uuidst, (unsigned char*)&rdata.rawGUID );
-DbgLv(1) << "rIA: trx" << trx << "uuid" << uuidst << importDir;
+DbgLv(1) << "CGui:iA: trx" << trx << "uuid" << uuidst << importDir;
// Save the raw data for this triple
allData << rdata;
@@ -1832,9 +1836,9 @@
// //TEMP
//runID += QString("-test");
+
+DbgLv(1) << "CGui:iA: RUNID from files[0]: files[0]" << fname << ", runID: " << runID;
- qDebug() << "RUNID from files[0]: files[0]" << fname << ", runID: " << runID;
-
le_runID2->setText( runID );
le_runID ->setText( runID );
scanTolerance = 5.0;
@@ -1931,7 +1935,7 @@
// Point to any existing time state file
QDir ddir( currentDir );
- qDebug() << "CURRENT DIR_2: " << currentDir;
+DbgLv(1) << "CGui:iA: CURRENT DIR_2: " << currentDir;
QStringList tmsfs = ddir.entryList( QStringList( "*.time_state.*" ),
QDir::Files, QDir::Name );
QString defs_fnamei;
@@ -1971,11 +1975,11 @@
tmst_fnamei.clear();
}
- if (!us_convert_auto_mode)
- {
- //le_status->setText( tr( "AUC data import IS COMPLETE." ) );
- le_status->setText( tr( "Loading Data from Disk Successful." ) );
- }
+ if ( !us_convert_auto_mode )
+ {
+ //le_status->setText( tr( "AUC data import IS COMPLETE." ) );
+ le_status->setText( tr( "Loading Data from Disk Successful." ) );
+ }
pb_showTmst->setEnabled( ! tmst_fnamei.isEmpty() );
}
@@ -2766,24 +2770,22 @@
int cellnumber;
if ( isMwl )
- {
- qDebug() << "SOLUTION is READ in MWL mode !!! ";
- for (int i = 0; i < nchans; ++i )
- {
- //Solution
- solutionID = ProtInfo.ProtSolutions.chsols[ i ].sol_id.toInt();
- solution_auto.readFromDB(solutionID, &db);
+ {
+ qDebug() << "SOLUTION is READ in MWL mode !!! ";
+ for (int i = 0; i < nchans; ++i )
+ {
+ //Solution
+ solutionID = ProtInfo.ProtSolutions.chsols[ i ].sol_id.toInt();
+ solution_auto.readFromDB(solutionID, &db);
qDebug() << "SOLS 0";
-
+
out_chaninfo[ i ].solution = solution_auto;
qDebug() << "SOLS 0a";
-
qDebug() << "out_chandatx[ i ] + cb_lambplot->currentIndex() " << out_chandatx[ i ] << " + " << cb_lambplot->currentIndex() << out_chandatx[ i ] + cb_lambplot->currentIndex();
//out_tripinfo[ out_chandatx[ i ] + cb_lambplot->currentIndex() ].solution = solution_auto; // ALEXEY <-- BUG
-
qDebug() << "SOLS 1";
//DUPL
@@ -3376,10 +3378,12 @@
<< "centp sol" << cCenterpiece << cSolution.solutionGUID;
}
+DbgLv(1) << "CGui:ldDk:isMwl" << isMwl;
if ( isMwl )
{ // If need be, load MWL data object
mwl_data.load_mwl( allData );
+DbgLv(1) << "CGui:ldDk: mwlsetup";
mwl_setup();
}
@@ -4085,6 +4089,9 @@
mwl_connect( true );
}
+// slambdas_per_channel.resize( nchans );
+// elambdas_per_channel.resize( nchans );
+
for ( int ccx = 0; ccx < nchans; ccx++ )
{ // Reformat the triples entries
nlambda = mwl_data.lambdas( exp_lambdas, ccx );
@@ -4097,7 +4104,11 @@
lw_triple->addItem( out_channels[ ccx ]
+ QString( " / %1-%2 (%3)" )
.arg( slambda ).arg( elambda ).arg( nlambda ) );
+// slambdas_per_channel[ccx] = slambda;
+// elambdas_per_channel[ccx] = elambda;
}
+DbgLv(1) << " sTi: slams_ch:" << slambdas_per_channel;
+DbgLv(1) << " sTi: elams_ch:" << elambdas_per_channel;
// Get wavelengths for the currently selected cell/channel
tripListx = qMax( 0, qMin( trListSave, ( nchans - 1 ) ) );
@@ -6439,23 +6450,27 @@
// User changed the Lambda Start value
void US_ConvertGui::lambdaStartChanged( int value )
{
+ int slambda_lambplot;
DbgLv(1) << "lambdaStartChanged" << value;
//ALEXEY: compare slambda to the cb_lambplot->index(0).value: if <, setCurrentIndex() to index corresponding to this upper value
- tripListx = lw_triple->currentRow();
- int slambda_lambplot = slambdas_per_channel[tripListx];
-
- slambda = cb_lambstrt->itemText( value ).toInt();
- elambda = cb_lambstop->currentText() .toInt();
+ tripListx = lw_triple->currentRow();
+ slambda = cb_lambstrt->currentText().toInt();
+ elambda = cb_lambstop->currentText().toInt();
+ tripListx = lw_triple->currentRow();
+ if ( tripListx < slambdas_per_channel.size() )
+ slambda_lambplot = slambdas_per_channel[ tripListx ];
+ else
+ slambda_lambplot = slambda;
- qDebug() << "LAMBDA_STR_CHANGE: slambda_lambplot, slambda: " << slambda_lambplot << ", " << slambda;
+DbgLv(1) << "lStChg: LAMBDA_STR_CHANGE: slambda_lambplot, slambda: " << slambda_lambplot << ", " << slambda;
if ( slambda < slambda_lambplot )
//if ( slambda < 280 )
- {
+ {
int index_lambstrt = cb_lambstrt->findText( QString::number(slambda_lambplot) );
- qDebug() << "LAMBDA_STR_CHANGE: index_lambstrt " << index_lambstrt;
+DbgLv(1) << "lStChg: LAMBDA_STR_CHANGE: index_lambstrt " << index_lambstrt;
slambda = slambda_lambplot;
cb_lambstrt->disconnect();
@@ -6463,15 +6478,10 @@
connect( cb_lambstrt, SIGNAL( currentIndexChanged( int ) ),
this, SLOT ( lambdaStartChanged ( int ) ) );
- }
-
- //slambda = cb_lambstrt->itemText( value ).toInt();
- //elambda = cb_lambstop->currentText() .toInt();
- //tripListx = lw_triple->currentRow();
- /***************************************************************************************************/
+ }
int currChan = out_chaninfo[ tripListx ].channelID;
-DbgLv(1) << "lambdaStartChanged" << value << "sl el tLx cCh"
+DbgLv(1) << "lStChg: lambdaStartChanged" << value << "sl el tLx cCh"
<< slambda << elambda << tripListx << currChan;
for ( int trx = 0; trx < all_tripinfo.count(); trx++ )
@@ -6494,38 +6504,35 @@
// User changed the Lambda End value
void US_ConvertGui::lambdaEndChanged( int value )
{
-DbgLv(1) << "lambdaEndChanged" << value;
+ int elambda_lambplot;
+DbgLv(1) << "lEnChg: lambdaEndChanged" << value;
//ALEXEY: compare slambda to the cb_lambplot->index(0).value: if <, setCurrentIndex() to index corresponding to this upper value
- tripListx = lw_triple->currentRow();
- int elambda_lambplot = elambdas_per_channel[tripListx];
-
- elambda = cb_lambstop->itemText( value ).toInt();
- slambda = cb_lambstrt->currentText() .toInt();
+ slambda = cb_lambstrt->currentText().toInt();
+ elambda = cb_lambstop->currentText().toInt();
+ tripListx = lw_triple->currentRow();
+DbgLv(1) << "lEnChg: trLx" << tripListx << "elch size" << elambdas_per_channel.size();
+DbgLv(1) << "lEnChg: elams_ch:" << elambdas_per_channel;
+ if ( tripListx < elambdas_per_channel.size() )
+ elambda_lambplot = elambdas_per_channel[ tripListx ];
+ else
+ elambda_lambplot = elambda;
- qDebug() << "LAMBDA_STOP_CHANGE: elambda_lambplot, elambda: " << elambda_lambplot << ", " << elambda;
+DbgLv(1) << "lEnChg: LAMBDA_STOP_CHANGE: elambda_lambplot, elambda: " << elambda_lambplot << ", " << elambda;
if ( elambda > elambda_lambplot )
- {
- int index_lambstop = cb_lambstop->findText( QString::number(elambda_lambplot) );
+ {
+ int index_lambstop = cb_lambstop->findText( QString::number( elambda_lambplot ) );
- qDebug() << "LAMBDA_STOP_CHANGE: index_lambstrt " << index_lambstop;
+DbgLv(1) << "lEnChg: LAMBDA_STOP_CHANGE: index_lambstop " << index_lambstop;
elambda = elambda_lambplot;
cb_lambstop->disconnect();
cb_lambstop->setCurrentIndex( index_lambstop );
connect( cb_lambstop, SIGNAL( currentIndexChanged( int ) ),
this, SLOT ( lambdaEndChanged ( int ) ) );
-
- }
+ }
- //slambda = cb_lambstrt->itemText( value ).toInt();
- //elambda = cb_lambstop->currentText() .toInt();
- //tripListx = lw_triple->currentRow();
- /***************************************************************************************************/
-
-
-
int currChan = out_chaninfo[ tripListx ].channelID;
DbgLv(1) << "lEnChg: val" << value << "sl el tLx cCh"
<< slambda << elambda << tripListx << currChan;
@@ -6609,32 +6616,26 @@
int tripx1 = out_chandatx[ tripListx ];
int tripx2 = out_chandatx[ tripnext ];
tripDatax = tripx1 + cb_lambplot->currentIndex();
+DbgLv(1) << "TRIPLE_Index(): "
+ << "tripnext = " << tripnext
+ << ", tripx1 = " << tripx1
+ << ", tripx2 = " << tripx2
+ << ", tripDatax = tripx1 + cb_lambplot->currentIndex(): " << tripx1 << " + " << cb_lambplot->currentIndex();
- qDebug() << "TRIPLE_Index(): "
- << "tripnext = " << tripnext
- << ", tripx1 = " << tripx1
- << ", tripx2 = " << tripx2
- << ", tripDatax = tripx1 + cb_lambplot->currentIndex(): " << tripx1 << " + " << cb_lambplot->currentIndex();
-
-
//ALEXEY: the following part is buggy: commented out for now - seems to help with plotting/selecting triples for non-first channel for MWL case
//Ask Gary (if this section in place, it causes incorrect placement of cb_lambplot indexes, so no plots generated...)
- /*
+#if 0
if ( tripDatax >= tripx2 )
{ // Less wavelengths in this channel than in the previous one
tripDatax = ( tripx1 + tripx2 ) / 2;
mwl_connect( false );
+DbgLv(1) << "Inside triple_index(): cb_lambplot->currentIndex() = " << cb_lambplot->currentIndex();
cb_lambplot->setCurrentIndex( ( tripDatax - tripx1 ) );
-
-
- qDebug() << "Inside triple_index(): cb_lambplot->currentIndex() = " << cb_lambplot->currentIndex();
mwl_connect( true );
}
- */
-
- qDebug() << "Inside triple_index(): cb_lambplot->currentIndex() = " << cb_lambplot->currentIndex();
-
+#endif
+DbgLv(1) << "Inside triple_index(): cb_lambplot->currentIndex() = " << cb_lambplot->currentIndex();
}
else
@@ -6851,13 +6852,13 @@
cb_lambstop->setCurrentIndex( nlamb_i - 1 );
nlambda = mwl_data.lambdas( exp_lambdas );
cb_lambplot->clear();
+DbgLv(1) << "MwlSet: nlambda nlamb_i" << nlambda << nlamb_i;
for ( int ii = 0; ii < nlambda; ii++ )
{
QString clamb = QString::number( exp_lambdas[ ii ] );
cb_lambplot->addItem( clamb );
-
- qDebug() << "MWL_SETUP: exp_lambda " << ii << ", " << clamb;
+DbgLv(1) << "MwlSet: exp_lambda " << ii << ", " << clamb;
}
cb_lambplot->setCurrentIndex( nlambda / 2 );
@@ -6875,16 +6876,19 @@
for ( int ccx = 0; ccx < nchans_int; ccx++ )
- {
- int nlambda_per_channel = mwl_data.lambdas( exp_lambdas, ccx );
- if ( nlambda_per_channel < 1 )
- {
- break;
- }
- slambdas_per_channel[ccx] = exp_lambdas[ 0 ];
- elambdas_per_channel[ccx] = exp_lambdas[ nlambda_per_channel - 1 ];
- }
+ {
+ int nlambda_per_channel = mwl_data.lambdas( exp_lambdas, ccx );
+DbgLv(1) << "MwlSet: ccx" << ccx << "nlam/ch" << nlambda_per_channel;
+ if ( nlambda_per_channel < 1 )
+ {
+ break;
+ }
+ slambdas_per_channel[ccx] = exp_lambdas[ 0 ];
+ elambdas_per_channel[ccx] = exp_lambdas[ nlambda_per_channel - 1 ];
+ }
/****************************************************************************************************/
+DbgLv(1) << "MwlSet: slams_ch:" << slambdas_per_channel;
+DbgLv(1) << "MwlSet: elams_ch:" << elambdas_per_channel;
show_mwl_control( true );
@@ -7123,7 +7127,11 @@
{
US_Convert::TripleInfo* tripinfo = &all_tripinfo[ trx ];
- if ( tripinfo->excluded ) continue;
+ if ( tripinfo->excluded )
+ {
+DbgLv(1) << "CGui: BOD: trx" << trx << "EXCLUDED";
+ continue;
+ }
outData << &allData[ trx ];
Modified: trunk/programs/us_convert/us_convertio.cpp
===================================================================
--- trunk/programs/us_convert/us_convertio.cpp 2019-09-20 02:22:20 UTC (rev 2832)
+++ trunk/programs/us_convert/us_convertio.cpp 2019-09-22 14:56:01 UTC (rev 2833)
@@ -378,6 +378,54 @@
else if ( xmlStatus != US_Convert::OK )
return( "Unspecified error writing xml file." );
+ // Download time state if need be
+ bool needTmst = false;
+ int tmstID = 0;
+ int expID = ExpData.expID;
+ QString tfname = runID + ".time_state.tmst";
+ QString xdefs;
+ QString cksumd;
+ QDateTime datedt;
+ US_TimeState::dbExamine( db, &tmstID, &expID, &tfname,
+ &xdefs, &cksumd, &datedt );
+qDebug() << "rDBE: expID tmstID tfname cksumd datedt"
+ << expID << tmstID << tfname << cksumd << datedt;
+ if ( tmstID > 0 )
+ { // There is a time state in the database: look at local disk
+ QString tfpath = dir + "/" + tfname;
+qDebug() << "rDBE: HAVE tmst DB: tfpath" << tfpath;
+ if ( QFile( tfpath ).exists() )
+ { // File exists, so check if it matches DB
+ QString cksumf = US_Util::md5sum_file( tfpath );
+qDebug() << "rDBE: HAVE tmst Loc: cksumf" << cksumf;
+ if ( cksumf != cksumd )
+ { // DB/Local do not match, so overwrite local with download
+ needTmst = true;
+ }
+ }
+ else
+ { // No local tmst exists, do need to download it
+ needTmst = true;
+ }
+
+qDebug() << "rDBE: needTmst" << needTmst;
+ if ( needTmst )
+ { // Download the .tmst file
+ US_TimeState::dbDownload( db, tmstID, tfpath );
+ // And write the xdefs sibling file
+ QString xfpath = QString( tfpath ).replace( ".tmst", ".xml" );
+qDebug() << "rDBE: xfpath" << xfpath;
+ QFile fileo( xfpath );
+ if ( fileo.open( QIODevice::WriteOnly | QIODevice::Text ) )
+ {
+ QTextStream tso( &fileo );
+ tso << xdefs;
+ tso.flush();
+ fileo.close();
+qDebug() << "rDBE: xdefs WRITTEN";
+ }
+ }
+ }
return( QString( "" ) );
}
Modified: trunk/programs/us_xpn_viewer/us_xpn_run_auc.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_run_auc.cpp 2019-09-20 02:22:20 UTC (rev 2832)
+++ trunk/programs/us_xpn_viewer/us_xpn_run_auc.cpp 2019-09-22 14:56:01 UTC (rev 2833)
@@ -99,7 +99,10 @@
if ( ! dfile.exists() ||
! dfile.open( QIODevice::ReadOnly ) )
+ {
+qDebug() << "LdDk: dfname -- NOT exists/opened" << dpath;
continue; // Skip if TMST def file does not exist or can't be opened
+ }
qDebug() << "LdDk: dfname -- exists/opened";
QTextStream fsi( &dfile );
@@ -111,7 +114,10 @@
if ( ! xmli.contains( pmatch ) &&
! xmli.contains( pmatch2 ) )
+ {
continue; // Skip if TMST def has no import_type="Optima"
+qDebug() << "LdDk: *SKIP* non-Optima";
+ }
// Add an eligible run directory to the list
@@ -120,8 +126,8 @@
rr.runID = runID;
rr.date = date;
rr.ntriple = nfiles;
-//qDebug() << "LdDk: ii" << ii << " runID date count"
-// << rr.runID << rr.date << rr.nfiles;
+qDebug() << "LdDk: ii" << ii << " runID date count"
+ << rr.runID << rr.date << rr.ntriple;
runInfo << rr;
}
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-09-20 02:22:20 UTC (rev 2832)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-09-22 14:56:01 UTC (rev 2833)
@@ -2343,14 +2343,14 @@
// US_XpnRunRaw* lddiag = new US_XpnRunRaw( drDesc, runInfo );
// if ( lddiag->exec() == QDialog::Rejected ) //ALEXEY need drDesc but do NOT need dialog
// {
-// DbgLv(1) << "RDr: rtn fr XpnRunRaw dialog: CANCEL";
+// DbgLv(1) << "RDa: rtn fr XpnRunRaw dialog: CANCEL";
// return;
// }
// // Restore area beneath dialog
// qApp->processEvents();
-// DbgLv(1) << "RDr: rtn fr XpnRunRaw dialog";
-// DbgLv(1) << "RDr: drDesc" << drDesc;
+// DbgLv(1) << "RDa: rtn fr XpnRunRaw dialog";
+// DbgLv(1) << "RDa: drDesc" << drDesc;
// See if we need to fix the runID
@@ -2411,16 +2411,16 @@
scanmask += QString( sMasks ).mid( 2, 1 ) == "1" ? 2 : 0;
scanmask += QString( sMasks ).mid( 4, 1 ) == "1" ? 4 : 0;
scanmask += QString( sMasks ).mid( 6, 1 ) == "1" ? 8 : 0;
-DbgLv(1) << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
+DbgLv(1) << "RDa: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
- qDebug() << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
-
//ALEXEY: maybe put in_reload_check_sysdata = true; and then false (after xpn_data->import_data( iRunId, scanmask ); )
//in_reload_check_sysdata = true; //ALEXEY
- xpn_data->import_data( iRunId, scanmask ); // ALEXEY <-- actual data retreiving
+
+ xpn_data->import_data( iRunId, scanmask ); // ALEXEY <-- actual data retreiving
+
int ntsrows = xpn_data->countOf( "scan_rows" );
-DbgLv(1) << "RDr: ntsrows" << ntsrows;
-DbgLv(1) << "RDr: knt(triple) " << xpn_data->countOf( "triple" );
+DbgLv(1) << "RDa: ntsrows" << ntsrows;
+DbgLv(1) << "RDa: knt(triple) " << xpn_data->countOf( "triple" );
qApp->processEvents();
if ( ntsrows < 1 )
@@ -2474,65 +2474,80 @@
drtype2 = ( runType2 == "RI" ) ? "Absorbance" : drtype2;
drtype2 = ( runType2 == "FI" ) ? "Fluorescence" : drtype2;
drtype2 = ( runType2 == "WI" ) ? "Wavelength" : drtype2;
- opsys << drtype1 << drtype2;
-
QString msg = tr( "Multiple scan data types are present:\n" )
+ "'" + drtype1 + "'\n or \n"
- + "'" + drtype2 + "' .\n\n"
- + tr( "Choose one for initial display." );
- QMessageBox mbox;
- mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
- mbox.setText( msg );
- QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
- QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
- mbox.setEscapeButton ( pb_opt2 );
- mbox.setDefaultButton( pb_opt1 );
+ + "'" + drtype2 + "' .\n";
+DbgLv(1) << "RDa: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
+ << xpn_data->countOf( "iscn_rows" )
+ << xpn_data->countOf( "fscn_rows" )
+ << xpn_data->countOf( "wscn_rows" );
+ if ( ( runType2 == "IP" && xpn_data->countOf( "iscn_rows" ) == 0 ) ||
+ ( runType2 == "FI" && xpn_data->countOf( "fscn_rows" ) == 0 ) ||
+ ( runType2 == "WI" && xpn_data->countOf( "wscn_rows" ) == 0 ) )
+ {
+ msg += tr( "\nScans are missing so only " ) + drtype1
+ + tr( " scans are processed." );
+ QMessageBox::warning( this,
+ tr( "Multiple Types with Missing Scans" ),
+ msg );
+ }
- mbox.exec();
- if ( mbox.clickedButton() == pb_opt2 )
+ else
{
- runType = runType2;
- optndx = 1;
+ opsys << drtype1 << drtype2;
+ msg += tr( "\nChoose one for initial display." );
+ QMessageBox mbox;
+ mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
+ mbox.setText( msg );
+ QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
+ QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
+ mbox.setEscapeButton ( pb_opt2 );
+ mbox.setDefaultButton( pb_opt1 );
+
+ mbox.exec();
+ if ( mbox.clickedButton() == pb_opt2 )
+ {
+ runType = runType2;
+ optndx = 1;
+DbgLv(1) << "RDa: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
+ << xpn_data->countOf( "iscn_rows" )
+ << xpn_data->countOf( "fscn_rows" )
+ << xpn_data->countOf( "wscn_rows" );
+ }
}
}
qApp->processEvents(); //ALEXEY: maybe this will help
-
- qDebug() << "1. Crashes HERE!!!!";
+DbgLv(1) << "RDa: 1. Crashes HERE!!!!";
cb_optsys->disconnect();
cb_optsys->clear();
-
- qDebug() << "1a. Crashes HERE!!!!";
+DbgLv(1) << "RDa: 1a. Crashes HERE!!!!";
cb_optsys->addItems( opsys ); // ALEXEY fill out Optics listbox
-
- qDebug() << "1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys";
+DbgLv(1) << "RDa: 1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys";
cb_optsys->setCurrentIndex( optndx );
- qDebug() << "1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys";
+DbgLv(1) << "RDa: 1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys";
connect( cb_optsys, SIGNAL( currentIndexChanged( int ) ),
this, SLOT ( changeOptics( ) ) );
-
- qDebug() << "1b. Crashes HERE!!!!";
+DbgLv(1) << "RDa: 1b. Crashes HERE!!!!";
runID = new_runID;
-DbgLv(1) << "RDr: runID" << runID << "runType" << runType;
+DbgLv(1) << "RDa: runID" << runID << "runType" << runType;
xpn_data->set_run_values( runID, runType ); // ALEXEY
+DbgLv(1) << "RDa: 2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )";
- qDebug() << "2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )";
-
// Build the AUC equivalent
//QApplication::setOverrideCursor( QCursor( Qt::WaitCursor) );
le_status->setText( tr( "Building AUC data ..." ) );
qApp->processEvents();
xpn_data->build_rawData( allData ); // ALEXEY Builds Raw Data
-
- qDebug() << "3. Crashes HERE!!!! (after xpn_data->build_rawData( allData ))";
+DbgLv(1) << "RDa: 3. Crashes HERE!!!! (after xpn_data->build_rawData( allData ))";
double tm2=(double)sttime.msecsTo(QDateTime::currentDateTime())/1000.0;
-DbgLv(1) << "RDr: build-raw done: tm1 tm2" << tm1 << tm2;
+DbgLv(1) << "RDa: build-raw done: tm1 tm2" << tm1 << tm2;
QApplication::restoreOverrideCursor();
QApplication::restoreOverrideCursor();
@@ -2544,10 +2559,10 @@
nscan = allData[ 0 ].scanCount();
npoint = allData[ 0 ].pointCount();
-DbgLv(1) << "RDr: mwr ntriple" << ntriple;
-DbgLv(1) << "RDr: ncellch" << ncellch << cellchans.count();
-DbgLv(1) << "RDr: nscan" << nscan << "npoint" << npoint;
-DbgLv(1) << "RDr: rvS rvE" << r_radii[0] << r_radii[npoint-1];
+DbgLv(1) << "RDa: mwr ntriple" << ntriple;
+DbgLv(1) << "RDa: ncellch" << ncellch << cellchans.count();
+DbgLv(1) << "RDa: nscan" << nscan << "npoint" << npoint;
+DbgLv(1) << "RDa: rvS rvE" << r_radii[0] << r_radii[npoint-1];
cb_cellchn->disconnect();
cb_cellchn->clear();
cb_cellchn->addItems( cellchans ); // ALEXEY fill out Cells/Channels listbox
@@ -2560,7 +2575,7 @@
#if 0
ntriple = nlambda * ncellch; // Number triples
ntpoint = npoint * nscan; // Number radius points per triple
-DbgLv(1) << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
+DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
<< "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple;
triples.clear();
@@ -2574,18 +2589,18 @@
#endif
#if 1
ntriple = xpn_data->data_triples( triples ); // ALEXEY triples
-DbgLv(1) << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
+DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
<< "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple
<< triples.count();
- qDebug() << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
+ qDebug() << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
<< "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple
<< triples.count();
#endif
-DbgLv(1) << "RDr: allData size" << allData.size();
+DbgLv(1) << "RDa: allData size" << allData.size();
- qDebug() << "RDr: allData size" << allData.size();
+ qDebug() << "RDa: allData size" << allData.size();
//QApplication::restoreOverrideCursor();
QString tspath = currentDir + "/" + runID + ".time_state.tmst";
@@ -2749,12 +2764,12 @@
scanmask += QString( sMasks ).mid( 6, 1 ) == "1" ? 8 : 0;
DbgLv(1) << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
- xpn_data->import_data( iRunId, scanmask );
+ xpn_data->import_data( iRunId, scanmask );
+
int ntsrows = xpn_data->countOf( "scan_rows" );
DbgLv(1) << "RDr: ntsrows" << ntsrows;
DbgLv(1) << "RDr: knt(triple) " << xpn_data->countOf( "triple" );
-
if ( ntsrows < 1 )
{
le_status->setText( tr( "Run %1 has no associated data..." )
@@ -2773,7 +2788,7 @@
if ( scanmask == 1 || scanmask == 2 ||
scanmask == 4 || scanmask == 8 )
- {
+ { // Single type of data present
runType = ( scanmask == 2 ) ? "FI" : runType;
runType = ( scanmask == 4 ) ? "IP" : runType;
runType = ( scanmask == 8 ) ? "WI" : runType;
@@ -2788,7 +2803,7 @@
}
else if ( ( scanmask & 1 ) != 0 )
- {
+ { // Multiple data types present
QApplication::restoreOverrideCursor();
QApplication::restoreOverrideCursor();
QString runType2( "IP" );
@@ -2802,25 +2817,46 @@
drtype2 = ( runType2 == "RI" ) ? "Absorbance" : drtype2;
drtype2 = ( runType2 == "FI" ) ? "Fluorescence" : drtype2;
drtype2 = ( runType2 == "WI" ) ? "Wavelength" : drtype2;
- opsys << drtype1 << drtype2;
-
QString msg = tr( "Multiple scan data types are present:\n" )
+ "'" + drtype1 + "'\n or \n"
- + "'" + drtype2 + "' .\n\n"
- + tr( "Choose one for initial display." );
- QMessageBox mbox;
- mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
- mbox.setText( msg );
- QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
- QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
- mbox.setEscapeButton ( pb_opt2 );
- mbox.setDefaultButton( pb_opt1 );
+ + "'" + drtype2 + "' .\n";
+DbgLv(1) << "RDr: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
+ << xpn_data->countOf( "iscn_rows" )
+ << xpn_data->countOf( "fscn_rows" )
+ << xpn_data->countOf( "wscn_rows" );
+ if ( ( runType2 == "IP" && xpn_data->countOf( "iscn_rows" ) == 0 ) ||
+ ( runType2 == "FI" && xpn_data->countOf( "fscn_rows" ) == 0 ) ||
+ ( runType2 == "WI" && xpn_data->countOf( "wscn_rows" ) == 0 ) )
+ {
+ msg += tr( "\nScans are missing so only " ) + drtype1
+ + tr( " scans are processed." );
+ QMessageBox::warning( this,
+ tr( "Multiple Types with Missing Scans" ),
+ msg );
+ }
- mbox.exec();
- if ( mbox.clickedButton() == pb_opt2 )
+ else
{
- runType = runType2;
- optndx = 1;
+ opsys << drtype1 << drtype2;
+ msg += tr( "\nChoose one for initial display." );
+ QMessageBox mbox;
+ mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
+ mbox.setText( msg );
+ QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
+ QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
+ mbox.setEscapeButton ( pb_opt2 );
+ mbox.setDefaultButton( pb_opt1 );
+
+ mbox.exec();
+ if ( mbox.clickedButton() == pb_opt2 )
+ {
+ runType = runType2;
+ optndx = 1;
+DbgLv(1) << "RDr: runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
+ << xpn_data->countOf( "iscn_rows" )
+ << xpn_data->countOf( "fscn_rows" )
+ << xpn_data->countOf( "wscn_rows" );
+ }
}
}
Modified: trunk/utils/us_xpn_data.cpp
===================================================================
--- trunk/utils/us_xpn_data.cpp 2019-09-20 02:22:20 UTC (rev 2832)
+++ trunk/utils/us_xpn_data.cpp 2019-09-22 14:56:01 UTC (rev 2833)
@@ -553,10 +553,10 @@
bool iscnf = scanMask & 4;
bool wscnf = scanMask & 8;
- int arows = 0;
- int frows = 0;
- int irows = 0;
- int wrows = 0;
+ arows = 0;
+ frows = 0;
+ irows = 0;
+ wrows = 0;
// Scan and build data for System Status Data
int srows = scan_xpndata( runId, 'S' );
@@ -2306,6 +2306,10 @@
counts[ "elambda" ] = elambda;
counts[ "scan_all" ] = ntscan;
counts[ "scan_rows" ] = ntsrow;
+ counts[ "ascn_rows" ] = arows;
+ counts[ "fscn_rows" ] = frows;
+ counts[ "iscn_rows" ] = irows;
+ counts[ "wscn_rows" ] = wrows;
counts[ "last_rpm" ] = qRound( isyrec.speed );
counts[ "etim_off" ] = etimoff;
Modified: trunk/utils/us_xpn_data.h
===================================================================
--- trunk/utils/us_xpn_data.h 2019-09-20 02:22:20 UTC (rev 2832)
+++ trunk/utils/us_xpn_data.h 2019-09-22 14:56:01 UTC (rev 2833)
@@ -434,6 +434,10 @@
int mxscnn; //!< Maximum scan number
int ntscan; //!< Total scans for all triples
int ntsrow; //!< Total (A+F+I+W) scan rows
+ int arows; //!< A scan rows
+ int frows; //!< F scan rows
+ int irows; //!< I scan rows
+ int wrows; //!< W scan rows
int etimoff; //!< Experimental time offset
int fnzstx; //!< First non-zero-speed time index
1
0
Author: alexey
Date: 2019-09-20 02:22:20 +0000 (Fri, 20 Sep 2019)
New Revision: 2832
Modified:
trunk/programs/us_experiment/us_experiment_gui_optima.cpp
Log:
Corrected solution name for proper record into Optima'sCellParameters table
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.cpp
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-09-03 22:18:00 UTC (rev 2831)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-09-20 02:22:20 UTC (rev 2832)
@@ -5158,8 +5158,13 @@
for ( int ii = 0; ii < rpSolut->nschan; ii++ )
{
channel_cell = rpSolut->chsols[ ii ].channel;
- QStringList sol_split = (rpSolut->chsols[ ii ].ch_comment).split(',');
- if ( channel_cell.startsWith(QString::number(j+1)) )
+ //QStringList sol_split = (rpSolut->chsols[ ii ].ch_comment).split(',');
+
+ QString solution = rpSolut->chsols[ ii ].ch_comment;
+ solution.replace("'", "");
+ QStringList sol_split = solution.split(',');
+
+ if ( channel_cell.startsWith(QString::number(j+1)) )
{
if ( channel_cell.contains("sample") ) // <-- Channel A
solname += ": A: " + sol_split[0] + ", " // <-- solution name
@@ -5183,6 +5188,8 @@
.arg(qrytab_cell).arg(cell_pos)
.arg(cell_sector).arg(solname);
comment = "Dummy stage";
+
+ //qDebug() << "Dummy stage: QUERY: " << cell_query_str;
}
// <-- Active stages
else
@@ -5214,6 +5221,8 @@
// <-- Active Stage: BOTH AbsScan && InterferenceScan exist - RARE CASE
else if ( AbsScanIds[i][j] && InterScanIds[i][j] )
{
+ //qDebug() << "Writing HERE: Abs & Interfrence !!! ";
+ //qDebug() << "solname: " << solname;
cell_query_str = QString("INSERT INTO %1 (\"CellPosition\",\"CellSectors\",\"AbsorbanceScan\",\"AbsorbanceScanId\",\"InterferenceScan\",\"InterferenceScanId\",\"SampleName\") VALUES (%2, %3, %4, %5, %6, %7, %8) RETURNING \"CellParamId\"")
.arg(qrytab_cell)
.arg(cell_pos)
@@ -5224,6 +5233,8 @@
.arg(inter_scanid)
.arg(solname);
comment = "Active Stage --> AbsScan and InterferenceScan BOTH EXIST";
+
+ // qDebug() << "Query: " << cell_query_str;
}
// <-- Active Stage: No Scans exist
else
@@ -5239,7 +5250,7 @@
// Query
if(! query_cell.prepare(cell_query_str ) )
- qDebug() << query_cell.lastError().text();
+ qDebug() << query_cell.lastError().text();
if (query_cell.exec())
{
1
0
Author: gegorbet
Date: 2019-09-03 22:18:00 +0000 (Tue, 03 Sep 2019)
New Revision: 2831
Modified:
trunk/sql/us3_procedures.sql
Log:
minor fix to us3_procedures.sql
Modified: trunk/sql/us3_procedures.sql
===================================================================
--- trunk/sql/us3_procedures.sql 2019-09-03 18:55:53 UTC (rev 2830)
+++ trunk/sql/us3_procedures.sql 2019-09-03 22:18:00 UTC (rev 2831)
@@ -72,9 +72,6 @@
SET @PROTOCOL_IN_USE = 554;
SET @NO_AUTOFLOW_RECORD = 555;
- -- Some user levels
- SET @US3_USER = 0;
-
-- Some user levels
SET @US3_USER = 0;
SET @US3_PRIV = 1;
1
0
Author: gegorbet
Date: 2019-09-03 18:55:53 +0000 (Tue, 03 Sep 2019)
New Revision: 2830
Added:
trunk/sql/us3_aprofile_procs.sql
Log:
new us3_aprofile_procs.sql
Added: trunk/sql/us3_aprofile_procs.sql
===================================================================
--- trunk/sql/us3_aprofile_procs.sql (rev 0)
+++ trunk/sql/us3_aprofile_procs.sql 2019-09-03 18:55:53 UTC (rev 2830)
@@ -0,0 +1,231 @@
+--
+-- us3_aprofile_procs.sql
+--
+-- Script to set up the MySQL stored procedures for the US3 system
+-- These are procedures related to the analysisprofile data
+-- Run as us3admin
+--
+
+DELIMITER $$
+
+-- Routines that deal with an analysis profile
+
+-- Returns the count of all analysis profiles
+DROP FUNCTION IF EXISTS count_aprofiles$$
+CREATE FUNCTION count_aprofiles( p_personGUID CHAR(36),
+ p_password VARCHAR(80) )
+ RETURNS INT
+ READS SQL DATA
+
+BEGIN
+
+ DECLARE count_aprofiles INT;
+
+ CALL config();
+ SET count_aprofiles = 0;
+
+ SELECT COUNT(*)
+ INTO count_aprofiles
+ FROM analysisprofile;
+
+ RETURN( count_aprofiles );
+
+END$$
+
+-- INSERTs new analysis profile information
+DROP PROCEDURE IF EXISTS new_aprofile$$
+CREATE PROCEDURE new_aprofile ( p_personGUID CHAR(36),
+ p_password VARCHAR(80),
+ p_aprofileGUID CHAR(36),
+ p_name VARCHAR(160),
+ p_xml LONGTEXT )
+ MODIFIES SQL DATA
+
+BEGIN
+
+ DECLARE l_aprofileID INT;
+
+ DECLARE duplicate_key TINYINT DEFAULT 0;
+ DECLARE null_field TINYINT DEFAULT 0;
+
+ DECLARE CONTINUE HANDLER FOR 1062
+ SET duplicate_key = 1;
+
+ DECLARE CONTINUE HANDLER FOR 1048
+ SET null_field = 1;
+
+ CALL config();
+ SET @US3_LAST_ERRNO = @OK;
+ SET @US3_LAST_ERROR = '';
+ SET @LAST_INSERT_ID = -1;
+
+ IF ( ( verify_user( p_personGUID, p_password ) = @OK ) &&
+ ( check_GUID ( p_personGUID, p_password, p_aprofileGUID ) = @OK ) ) THEN
+
+ INSERT INTO analysisprofile SET
+ aprofileGUID = p_aprofileGUID,
+ name = p_name,
+ xml = p_xml,
+ dateUpdated = NOW();
+
+ IF ( duplicate_key = 1 ) THEN
+ SET @US3_LAST_ERRNO = @INSERTDUP;
+ SET @US3_LAST_ERROR = "MySQL: Duplicate entry for aprofileGUID/name field(s)";
+
+ ELSEIF ( null_field = 1 ) THEN
+ SET @US3_LAST_ERRNO = @INSERTNULL;
+ SET @US3_LAST_ERROR = "MySQL: Attempt to insert NULL value in the analysisprofile table";
+
+ ELSE
+ SET @LAST_INSERT_ID = LAST_INSERT_ID();
+
+ END IF;
+
+ END IF;
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+END$$
+
+-- Returns the aprofileID and base information for all analysis profiles
+DROP PROCEDURE IF EXISTS get_aprofile_desc$$
+CREATE PROCEDURE get_aprofile_desc ( p_personGUID CHAR(36),
+ p_password VARCHAR(80) )
+ READS SQL DATA
+
+BEGIN
+
+ CALL config();
+ SET @US3_LAST_ERRNO = @OK;
+ SET @US3_LAST_ERROR = '';
+
+ IF ( count_aprofiles( p_personGUID, p_password ) < 1 ) THEN
+ SET @US3_LAST_ERRNO = @NOROWS;
+ SET @US3_LAST_ERROR = 'MySQL: no rows returned';
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+ ELSE
+ SELECT @OK AS status;
+
+ SELECT aprofileID, aprofileGUID, name, xml,
+ timestamp2UTC( dateUpdated ) AS UTC_lastUpdated
+ FROM analysisprofile
+ ORDER BY aprofileID DESC;
+
+ END IF;
+
+END$$
+
+-- Returns the aprofileID and base information for one analysis profile
+-- as identified by GUID
+DROP PROCEDURE IF EXISTS get_aprofile_info$$
+CREATE PROCEDURE get_aprofile_info ( p_personGUID CHAR(36),
+ p_password VARCHAR(80),
+ p_aprofileGUID CHAR(36) )
+ READS SQL DATA
+
+BEGIN
+ DECLARE count_aprofiles INT;
+
+ CALL config();
+ SET @US3_LAST_ERRNO = @OK;
+ SET @US3_LAST_ERROR = '';
+
+ SELECT COUNT(*)
+ INTO count_aprofiles
+ FROM analysisprofile
+ WHERE aprofileGUID = p_aprofileGUID;
+
+ IF ( count_aprofiles = 0 ) THEN
+ SET @US3_LAST_ERRNO = @NOROWS;
+ SET @US3_LAST_ERROR = 'MySQL: no rows returned';
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+ ELSEIF ( count_aprofiles > 1 ) THEN
+ SET @US3_LAST_ERRNO = @MORE_THAN_SINGLE_ROW;
+ SET @US3_LAST_ERROR = 'MySQL: more than a single row for an analysis profile';
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+ ELSE
+ SELECT @OK AS status;
+
+ SELECT aprofileID, name, xml,
+ timestamp2UTC( dateUpdated ) AS UTC_lastUpdated
+ FROM analysisprofile
+ WHERE aprofileGUID = p_aprofileGUID;
+ END IF;
+
+END$$
+
+-- Returns the aprofileID and base information for one analysis profile
+-- as identified by database ID
+DROP PROCEDURE IF EXISTS get_aprofile_info_byID$$
+CREATE PROCEDURE get_aprofile_info_byID ( p_personGUID CHAR(36),
+ p_password VARCHAR(80),
+ p_aprofileID INT(11) )
+ READS SQL DATA
+
+BEGIN
+ DECLARE count_aprofiles INT;
+
+ CALL config();
+ SET @US3_LAST_ERRNO = @OK;
+ SET @US3_LAST_ERROR = '';
+
+ SELECT COUNT(*)
+ INTO count_aprofiles
+ FROM analysisprofile
+ WHERE aprofileID = p_aprofileID;
+
+ IF ( count_aprofiles = 0 ) THEN
+ SET @US3_LAST_ERRNO = @NOROWS;
+ SET @US3_LAST_ERROR = 'MySQL: no rows returned';
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+ ELSEIF ( count_aprofiles > 1 ) THEN
+ SET @US3_LAST_ERRNO = @MORE_THAN_SINGLE_ROW;
+ SET @US3_LAST_ERROR = 'MySQL: more than a single row for an analysis profile';
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+ ELSE
+ SELECT @OK AS status;
+
+ SELECT aprofileGUID, name, xml,
+ timestamp2UTC( dateUpdated ) AS UTC_lastUpdated
+ FROM analysisprofile
+ WHERE aprofileID = p_aprofileID;
+ END IF;
+
+END$$
+
+-- DELETEs an aprofile, plus information in related tables
+DROP PROCEDURE IF EXISTS delete_aprofile$$
+CREATE PROCEDURE delete_aprofile ( p_personGUID CHAR(36),
+ p_password VARCHAR(80),
+ p_aprofileID INT )
+ MODIFIES SQL DATA
+
+BEGIN
+ DECLARE count_aprofiles INT;
+
+ CALL config();
+ SET @US3_LAST_ERRNO = @OK;
+ SET @US3_LAST_ERROR = '';
+
+ IF ( verify_aprofile_permission( p_personGUID, p_password, p_aprofileID ) = @OK ) THEN
+
+ -- Make sure records match if they have related tables or not
+ -- Have to do it in a couple of stages because of the constraints
+ DELETE FROM aprofile
+ WHERE aprofileID = p_aprofileID;
+
+ END IF;
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+END$$
1
0
Author: gegorbet
Date: 2019-09-03 18:53:01 +0000 (Tue, 03 Sep 2019)
New Revision: 2829
Modified:
trunk/sql/us3_procedures.sql
Log:
sql procs adds: NO_AUTOFLOW_RECORD, us3_aprofile_procs.sql, us3_autoflow_procs.sql
Modified: trunk/sql/us3_procedures.sql
===================================================================
--- trunk/sql/us3_procedures.sql 2019-08-30 03:20:14 UTC (rev 2828)
+++ trunk/sql/us3_procedures.sql 2019-09-03 18:53:01 UTC (rev 2829)
@@ -71,6 +71,9 @@
SET @INSTRUMENT_IN_USE = 553;
SET @PROTOCOL_IN_USE = 554;
SET @NO_AUTOFLOW_RECORD = 555;
+
+ -- Some user levels
+ SET @US3_USER = 0;
-- Some user levels
SET @US3_USER = 0;
@@ -533,5 +536,7 @@
SOURCE us3_timestate_procs.sql
SOURCE us3_eprofile_procs.sql
SOURCE us3_protocol_procs.sql
+SOURCE us3_aprofile_procs.sql
+SOURCE us3_autoflow_procs.sql
DELIMITER ;
1
0