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
- 6666 discussions
r2765 - in trunk: gui programs/us_com_project programs/us_convert programs/us_experiment programs/us_xpn_viewer sql
by svn@svn.aucsolutions.com May 16, 2019
by svn@svn.aucsolutions.com May 16, 2019
May 16, 2019
Author: alexey
Date: 2019-05-17 05:09:32 +0000 (Fri, 17 May 2019)
New Revision: 2765
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_experiment/us_experiment_gui_optima.cpp
trunk/programs/us_experiment/us_experiment_gui_optima.h
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h
trunk/sql/us3.sql
trunk/sql/us3_autoflow_procs.sql
Log:
Automatic flow: first shot at the automation of the stransition from LIBE UPDATE to EDTING
* no user input required
* case of NO chromatic abberation for instrument considered:
-- commercial soft - abort at EDITING stage
-- Data Aqcution/academoc - choice
-- no manual stop of the run from Optima panel covered yet... (still requires user input)
Modified: trunk/gui/us_select_item.cpp
===================================================================
--- trunk/gui/us_select_item.cpp 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/gui/us_select_item.cpp 2019-05-17 05:09:32 UTC (rev 2765)
@@ -113,7 +113,7 @@
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 new experiment method. </ul></li>" ));
+ "Alternatively, you can define and submit a new experiment method to the availabale Optima instrument(s). </ul></li>" ));
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-05-15 20:19:58 UTC (rev 2764)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-05-17 05:09:32 UTC (rev 2765)
@@ -27,7 +27,7 @@
#endif
-//// Constructor: build the main layout with tab widget panels
+//// Constructor: ACADEMIC: 'Data Acquision' / us_comproject_academic programs
US_ComProjectMain::US_ComProjectMain(QString us_mode) : US_Widgets()
{
// dbg_level = US_Settings::us_debug();
@@ -143,9 +143,10 @@
connect( epanExp, SIGNAL( switch_to_live_update( QMap < QString, QString > &) ), this, SLOT( switch_to_live_update( QMap < QString, QString > & ) ) );
connect( this , SIGNAL( pass_to_live_update( QMap < QString, QString > &) ), epanObserv, SLOT( process_protocol_details( QMap < QString, QString > & ) ) );
-
- connect( epanObserv, SIGNAL( switch_to_post_processing( QString &, QString &, QString &) ), this, SLOT( switch_to_post_processing( QString &, QString &, QString &) ) );
- connect( this, SIGNAL( import_data_us_convert( QString &, QString &, QString & ) ), epanPostProd, SLOT( import_data_us_convert( QString &, 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_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() ));
@@ -165,7 +166,7 @@
-//// Constructor: build the main layout with tab widget panels
+//// Constructor: COMMERCIAL: us_comproject
US_ComProjectMain::US_ComProjectMain() : US_Widgets()
{
// dbg_level = US_Settings::us_debug();
@@ -275,9 +276,10 @@
connect( epanExp, SIGNAL( switch_to_live_update( QMap < QString, QString > &) ), this, SLOT( switch_to_live_update( QMap < QString, QString > & ) ) );
connect( this , SIGNAL( pass_to_live_update( QMap < QString, QString > &) ), epanObserv, SLOT( process_protocol_details( QMap < QString, QString > & ) ) );
-
- connect( epanObserv, SIGNAL( switch_to_post_processing( QString &, QString &, QString & ) ), this, SLOT( switch_to_post_processing( QString &, QString &, QString & )));
- connect( this, SIGNAL( import_data_us_convert( QString &, QString &, QString & ) ), epanPostProd, SLOT( import_data_us_convert( QString &, 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_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() ));
@@ -300,6 +302,12 @@
event->accept();
}
+void US_ComProjectMain::to_autoflow_records( void )
+{
+ check_current_stage();
+}
+
+
// Function that checks for current program stage based on US-lims DB entry
void US_ComProjectMain::check_current_stage( void )
{
@@ -386,10 +394,20 @@
if ( autoflow_records < 1 )
return;
+ //ALEXEY:
+ /*
+ -- Read (and count) Optima Instruments;
+ -- If the number of 'autoflow' records with the status LIVE_UPDATE && RUNNING is the same as # instruments, disable 'Def. New Exp.' buttion
+ -- Identify free Optima(s) & pass the list to the us_experiment (Lab/Rotors tab -> instruments)
+ --
+ */
+
// Dialog of existing autoflow records
US_Passwd pw;
US_DB2* dbP = new US_DB2( pw.getPasswd() );
+
+ //read_optima_machines
list_all_autoflow_records( autoflowdata, dbP );
QString pdtitle( tr( "Select Optima Run to Follow" ) );
@@ -433,7 +451,7 @@
QString currDir = protocol_details[ "dataPath" ];
QString invID_passed = protocol_details[ "invID_passed" ];
QString ProtName = protocol_details[ "protocolName" ];
-
+ QString correctRadii = protocol_details[ "correctRadii" ];
//ALEXEY: if stage=="EDITING" && curDir.isEmpty() (NULL)
/*
@@ -452,7 +470,7 @@
if ( stage == "EDITING" )
{
//do something
- switch_to_post_processing( currDir, ProtName, invID_passed );
+ switch_to_post_processing( currDir, ProtName, invID_passed, correctRadii );
//ALEXEY: should pass investigator as well: should be saved in 'autoflow'
/*
@@ -474,6 +492,66 @@
}
+// Slot to read all Optima machines <------------------------------- // New
+void US_ComProjectMain::read_optima_machines( US_DB2* db )
+{
+ QStringList q( "" );
+ q.clear();
+ q << QString( "get_instrument_names" )
+ << QString::number( 1 );
+ db->query( q );
+
+ if ( db->lastErrno() == US_DB2::OK ) // If not, no instruments defined
+ {
+ QList< int > instrumentIDs;
+
+ // Grab all the IDs so we can reuse the db connection
+ while ( db->next() )
+ {
+ int ID = db->value( 0 ).toString().toInt();
+ instrumentIDs << ID;
+
+ qDebug() << "InstID: " << ID;
+ }
+
+ // Instrument information
+ foreach ( int ID, instrumentIDs )
+ {
+ QMap<QString,QString> instrument;
+
+ q.clear();
+ q << QString( "get_instrument_info_new" )
+ << QString::number( ID );
+ db->query( q );
+ db->next();
+
+ instrument[ "ID" ] = QString::number( ID );
+ instrument[ "name" ] = db->value( 0 ).toString();
+ instrument[ "serial" ] = db->value( 1 ).toString();
+ instrument[ "optimaHost" ] = db->value( 5 ).toString();
+ instrument[ "optimaPort" ] = db->value( 6 ).toString();
+ instrument[ "optimaDBname" ] = db->value( 7 ).toString();
+ instrument[ "optimaDBusername" ] = db->value( 8 ).toString();
+ instrument[ "optimaDBpassw" ] = db->value( 9 ).toString();
+ instrument[ "selected" ] = db->value( 10 ).toString();
+
+ instrument[ "opsys1" ] = db->value( 11 ).toString();
+ instrument[ "opsys2" ] = db->value( 12 ).toString();
+ instrument[ "opsys3" ] = db->value( 13 ).toString();
+
+ instrument[ "radcalwvl" ] = db->value( 14 ).toString();
+ instrument[ "chromoab" ] = db->value( 15 ).toString();
+
+
+ if ( instrument[ "name" ].contains("Optima") || instrument[ "optimaHost" ].contains("AUC_DATA_DB") )
+ this->instruments << instrument;
+ }
+ }
+ qDebug() << "Reading Instrument: FINISH";
+}
+
+
+
// Query autoflow for # records
int US_ComProjectMain::list_all_autoflow_records( QList< QStringList >& autoflowdata, US_DB2* dbP )
{
@@ -504,7 +582,8 @@
if ( time_started.toString().isEmpty() )
autoflowentry << QString( tr( "NOT STARTED" ) );
else
- autoflowentry << time_started.toString();
+ autoflowentry << QString( tr( "STARTED" ) );
+ //autoflowentry << time_started.toString();
autoflowdata << autoflowentry;
nrecs++;
@@ -578,7 +657,8 @@
protocol_details[ "dataPath" ] = db->value( 8 ).toString();
protocol_details[ "OptimaName" ] = db->value( 9 ).toString();
protocol_details[ "runStarted" ] = db->value( 10 ).toString();
- protocol_details[ "invID_passed" ] = db->value( 11 ).toString();
+ protocol_details[ "invID_passed" ] = db->value( 11 ).toString();
+ protocol_details[ "correctRadii" ] = db->value( 12 ).toString();
}
}
@@ -636,13 +716,13 @@
}
// Slot to switch from the Live Update to Editing tab
-void US_ComProjectMain::switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed )
+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 );
+ emit import_data_us_convert( currDir, protocolName, invID_passed, correctRadii );
}
// Slot to switch back from the Live Update to Experiment tab
@@ -756,6 +836,8 @@
connect( this, SIGNAL( reset_experiment( QString & ) ), sdiag, SLOT( us_exp_clear( QString & ) ) );
+ connect( sdiag, SIGNAL( exp_cleared( ) ), this, SLOT( exp_cleared( ) ) );
+
sdiag->pb_close->setEnabled(false); // Disable Close button
offset = 0;
sdiag->move(offset, 2*offset);
@@ -824,7 +906,13 @@
emit reset_experiment( protocolName );
}
+//Upon clearing Experiment ..
+void US_ExperGui::exp_cleared( void )
+{
+ emit to_autoflow_records();
+}
+
// On click to open US_Experiment <-- NOT USED, us_experimnet is loaded immediately
void US_ExperGui::manageExperiment()
{
@@ -922,7 +1010,7 @@
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 & ) ), this, SLOT( to_post_processing ( QString &, QString &, QString &) ) );
+ connect( sdiag, SIGNAL( experiment_complete_auto( QString &, QString &, QString &, QString & ) ), this, SLOT( to_post_processing ( QString &, QString &, 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 &) ) );
@@ -984,9 +1072,9 @@
emit to_xpn_viewer( protocol_details );
}
-void US_ObservGui::to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed )
+void US_ObservGui::to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii )
{
- emit switch_to_post_processing( currDir, protocolName, invID_passed );
+ emit switch_to_post_processing( currDir, protocolName, invID_passed, correctRadii );
}
void US_ObservGui::to_experiment( QString & protocolName )
@@ -1043,7 +1131,7 @@
sdiag = new US_ConvertGui("AUTO");
sdiag->setParent(this, Qt::Widget);
- connect( this, SIGNAL( to_post_prod( QString &, QString &, QString & ) ), sdiag, SLOT( import_data_auto ( QString &, QString &, QString & ) ) );
+ connect( this, SIGNAL( to_post_prod( QString &, QString &, QString &, QString & ) ), sdiag, SLOT( import_data_auto ( QString &, QString &, QString &, QString & ) ) );
//ALEXEY: switch to Analysis
connect( sdiag, SIGNAL( saving_complete_auto( QString &, QString & ) ), this, SLOT( to_analysis ( QString &, QString &) ) );
//ALEXEY: for academic ver. switch back to experiment
@@ -1054,13 +1142,16 @@
sdiag->setFrameShape( QFrame::Box);
sdiag->setLineWidth(2);
+ if ( mainw->us_mode_bool )
+ sdiag->us_mode_passed();
+
sdiag->show();
}
-void US_PostProdGui::import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed )
+void US_PostProdGui::import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii )
{
- emit to_post_prod( currDir, protocolName, invID_passed );
+ emit to_post_prod( currDir, protocolName, invID_passed, correctRadii );
}
void US_PostProdGui::to_analysis( QString & currDir, QString & protocolName )
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-05-17 05:09:32 UTC (rev 2765)
@@ -89,11 +89,13 @@
void us_exp_is_closed_set_button( void );
void to_live_update( QMap < QString, QString > & protocol_details );
void clear_experiment( QString & protocolName);
-
+ void exp_cleared( void );
+
signals:
void switch_to_live_update( QMap < QString, QString > & protocol_details );
void set_auto_mode( void );
void reset_experiment( QString & protocolName);
+ void to_autoflow_records( void );
};
@@ -116,12 +118,12 @@
private slots:
void process_protocol_details( QMap < QString, QString > & protocol_details );
- void to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed );
+ void to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
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 );
+ void switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void switch_to_experiment( QString & protocolName );
void close_everything( void );
};
@@ -146,12 +148,12 @@
void resizeEvent(QResizeEvent *event) override;
private slots:
- void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed );
+ void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void to_analysis( QString & currDir, QString & protocolName );
void to_experiment( QString & protocolName );
signals:
- void to_post_prod( QString & currDir, QString & protocolName, QString & invID_passed );
+ void to_post_prod( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void switch_to_analysis( QString & currDir, QString & protocolName );
void switch_to_exp( QString & protocolName );
};
@@ -246,8 +248,11 @@
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 );
+ QMap<QString, QString> currentInstrument;
+ QList< QMap<QString, QString> > instruments;
-
private slots:
//void reset ( void );
//void newPanel ( int ); // Move to a new panel
@@ -259,16 +264,18 @@
//void unable_tabs_buttons( void); // Slot to unable Tabs and Buttons when user level is low
//void enable_tabs_buttons( void); // Slot to enable Tabs and Buttons after protocol is loaded
void switch_to_live_update( QMap < QString, QString > & protocol_details );
- void switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed );
+ void switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void switch_to_analysis( QString & currDir, QString & protocolName );
void switch_to_experiment( QString & protocolName );
//void check_current_stage( void );
void close_all( void );
void closeEvent ( QCloseEvent* );
+
+ void to_autoflow_records( void );
signals:
void pass_to_live_update( QMap < QString, QString > & protocol_details );
- void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed );
+ void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void pass_to_analysis( QString & currDir, QString & protocolName );
void clear_experiment( QString & protocolName);
void us_comproject_closed( void );
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-05-17 05:09:32 UTC (rev 2765)
@@ -47,6 +47,8 @@
{
ExpData.invID = US_Settings::us_inv_ID();
+ usmode = false;
+
// Ensure data directories are there
QDir dir;
dir.mkpath( US_Settings::workBaseDir() );
@@ -545,6 +547,8 @@
{
ExpData.invID = US_Settings::us_inv_ID();
+ usmode = false;
+
// Ensure data directories are there
QDir dir;
dir.mkpath( US_Settings::workBaseDir() );
@@ -1112,8 +1116,15 @@
reimport();
}
-void US_ConvertGui::import_data_auto( QString &currDir, QString &protocolName, QString &invID_passed )
+void US_ConvertGui::us_mode_passed( void )
{
+ qDebug() << "US_Convert: US_MODE SIGNAL: ";
+ usmode = true;
+}
+
+
+void US_ConvertGui::import_data_auto( QString &currDir, QString &protocolName, QString &invID_passed, QString &correctRadii )
+{
// ALEXEY TO BE ADDED...
/*
assign investigator HERE passed in (QString &currDir, QString &protocolName, QString &invID_passed) as 3rd parameter; saved in 'autoflow' table
@@ -1127,8 +1138,60 @@
qDebug() << "US_CONVERT: ExpData.invID, invID_passed: " << ExpData.invID << ", " << invID_passed;
int impType = getImports_auto( currDir );
- ProtocolName_auto = protocolName;
+ ProtocolName_auto = protocolName;
+ //ALEXEY: if there is no radii_correction data found, return for commercial, and present dialogue for academic:
+ if ( correctRadii == "NO" )
+ {
+ if ( !usmode ) // us_comprojetc
+ {
+ //return because in commercial ver. ther must be radii corrections for instrument!!!
+ QMessageBox::information( this,
+ tr( "No Chromatic Aberration Correction Found: " ),
+ tr( "NO wavelength correction data for currently used \n"
+ "Optima machine found in DB! \n"
+ "Data will NOT be imported; Program will be reset.") );
+
+ //ALEXY: need to delete autoflow record here
+ delete_autoflow_record();
+ emit saving_complete_back_to_exp( ProtocolName_auto );
+ return;
+
+ }
+ else // us_comproject_academoc / Data Acquisition
+ {
+ //dialog
+
+ QMessageBox msgBox;
+ msgBox.setText(tr("No Chromatic Aberration Correction Found!"));
+ msgBox.setInformativeText( tr("NO wavelength correction data for currently used \n"
+ "Optima machine found in DB! \n"
+ "Data were NOT modified ! \n\n"
+ "You may proceed with importing data by clicking <b>Continue</b> \n"
+ "OR disregard data and reset the program by clicking <b>Ignore Data</b> ") );
+
+ msgBox.setWindowTitle(tr("Data Not Modified"));
+ QPushButton *Continue = msgBox.addButton(tr("Continue"), QMessageBox::YesRole);
+ QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
+
+ msgBox.setIcon(QMessageBox::Question);
+ msgBox.exec();
+
+ if (msgBox.clickedButton() == Continue)
+ {
+ msgBox.accept();
+ }
+ else if ( msgBox.clickedButton() == Ignore )
+ {
+ delete_autoflow_record();
+ emit saving_complete_back_to_exp( ProtocolName_auto );
+ return;
+ }
+ }
+ }
+
+
+
if ( impType == 1 )
{
qDebug() << "IMPORT MWL auto...";
@@ -1536,55 +1599,84 @@
le_runID ->setText( runID );
scanTolerance = 5.0;
- // //ALEXEY: Remove Duplicates in Channel's description
- // for (int i = 0; i < allData.size(); i++)
- // {
- // qDebug() << "Description BEFORE: " << i << ", " << allData[ i ].description;
+ // //ALEXEY: Remove Duplicates in Channel's description: Simpler solution
+ // for (int i = 0; i < allData.size(); i++)
+ // {
+ // qDebug() << "Description BEFORE: " << i << ", " << allData[ i ].description;
+
+ // QString desc = allData[ i ].description;
+ // desc.replace(",", "");
+ // desc.replace(";", "");
- // QString desc = allData[ i ].description;
- // desc.replace(",", "");
- // QString desc_a = desc.split(QRegExp(";"))[0];
- // QString desc_b = desc.split(QRegExp(";"))[1];
+ // QStringList desc_list = desc.split(QRegExp("\\s+"));
+ // desc_list.removeDuplicates();
+
+ // QString final_desc("");
+ // for ( int i=0; i<desc_list.size(); i++ )
+ // {
+ // if ( desc_list[i].isEmpty() )
+ // continue;
+ // final_desc += desc_list[i];
- // //list of channel A desc
- // QStringList desc_list_a = desc_a.split(QRegExp("\\s+"));
- // desc_list_a.removeDuplicates();
+ // if ( i != desc_list.size() - 1)
+ // final_desc += QString(" ");
+ // }
- // //list of channel B desc
- // QStringList desc_list_b = desc_b.split(QRegExp("\\s+"));
- // desc_list_b.removeDuplicates();
+ // allData[ i ].description = final_desc;
+ // qDebug() << "Description AFTER: " << i << ", " << allData[ i ].description;
+ // }
+
- // QString final_desc("");
-
- // for ( int i=0; i<desc_list_a.size(); i++ )
- // {
- // if ( desc_list_a[i].isEmpty() )
- // continue;
- // final_desc += desc_list_a[i];
+
+ // //ALEXEY: Remove Duplicates in Channel's description
+ // for (int i = 0; i < allData.size(); i++)
+ // {
+ // qDebug() << "Description BEFORE: " << i << ", " << allData[ i ].description;
- // if ( i != desc_list_a.size() - 1)
- // final_desc += QString(" ");
- // else
- // final_desc += QString("; ");
+ // QString desc = allData[ i ].description;
+ // desc.replace(",", "");
+ // QString desc_a = desc.split(QRegExp(";"))[0];
+ // QString desc_b = desc.split(QRegExp(";"))[1];
- // }
- // for ( int i=0; i<desc_list_b.size(); i++ )
- // {
- // if ( desc_list_b[i].isEmpty() )
- // continue;
- // final_desc += desc_list_b[i];
+ // //list of channel A desc
+ // QStringList desc_list_a = desc_a.split(QRegExp("\\s+"));
+ // desc_list_a.removeDuplicates();
- // if ( i != desc_list_b.size() - 1)
- // final_desc += QString(" ");
- // // else
- // // final_desc += QString("; ");
-
- // }
+ // //list of channel B desc
+ // QStringList desc_list_b = desc_b.split(QRegExp("\\s+"));
+ // desc_list_b.removeDuplicates();
+
+ // QString final_desc("");
+
+ // for ( int i=0; i<desc_list_a.size(); i++ )
+ // {
+ // if ( desc_list_a[i].isEmpty() )
+ // continue;
+ // final_desc += desc_list_a[i];
+
+ // if ( i != desc_list_a.size() - 1)
+ // final_desc += QString(" ");
+ // else
+ // final_desc += QString("; ");
+
+ // }
+ // for ( int i=0; i<desc_list_b.size(); i++ )
+ // {
+ // if ( desc_list_b[i].isEmpty() )
+ // continue;
+ // final_desc += desc_list_b[i];
+
+ // if ( i != desc_list_b.size() - 1)
+ // final_desc += QString(" ");
+ // // else
+ // // final_desc += QString("; ");
+
+ // }
+
+ // allData[ i ].description = final_desc;
+ // qDebug() << "Description AFTER: " << i << ", " << allData[ i ].description;
+ // }
- // allData[ i ].description = final_desc;
- // qDebug() << "Description AFTER: " << i << ", " << allData[ i ].description;
- // }
-
if ( ! init_output_data() )
return;
@@ -4715,28 +4807,31 @@
} // End of 'else' loop for multispeed case
// x x x x x
- if ( !us_convert_auto_mode )
+ if ( us_convert_auto_mode ) // if us_comproject OR us_comproject_academic
{
- QMessageBox::information( this,
- tr( "Save is Complete" ),
- tr( "The save of all data and reports is complete." ) );
-
- //ALEXY: need to delete autoflow record here
- delete_autoflow_record();
- emit saving_complete_back_to_exp( ProtocolName_auto );
- return;
+ if ( usmode ) // us_comproject_academic
+ {
+ QMessageBox::information( this,
+ tr( "Save is Complete" ),
+ tr( "The save of all data and reports is complete." ) );
+
+ //ALEXY: need to delete autoflow record here
+ delete_autoflow_record();
+ emit saving_complete_back_to_exp( ProtocolName_auto );
+ return;
+ }
+ else // us_comproject
+ {
+ // ALEXEY: // If "AUTO" - emit signal to pass to stage 4. Analysis
+ QMessageBox::information( this,
+ tr( "Save is Complete" ),
+ tr( "The save of all data and reports is complete.\n\n"
+ "The program will switch to Analysis stage." ) );
+
+ // Either emit ONLY if not US_MODE, or do NOT connect with slot on us_comproject...
+ emit saving_complete_auto( currentDir, ProtocolName_auto );
+ }
}
- else
- {
- // ALEXEY: // If "AUTO" - emit signal to pass to stage 4. Analysis
- QMessageBox::information( this,
- tr( "Save is Complete" ),
- tr( "The save of all data and reports is complete.\n\n"
- "The program will switch to Analysis stage." ) );
-
- // Either emit ONLY if not US_MODE, or do NOT connect with slot on us_comproject...
- emit saving_complete_auto( currentDir, ProtocolName_auto );
- }
}
//Delete autoflow record upon Run abortion
Modified: trunk/programs/us_convert/us_convert_gui.h
===================================================================
--- trunk/programs/us_convert/us_convert_gui.h 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/programs/us_convert/us_convert_gui.h 2019-05-17 05:09:32 UTC (rev 2765)
@@ -46,6 +46,9 @@
US_SimulationParameters simparams; //!< Simulation parameters
QList< double > subsets; //!< A list of subset boundaries
+ void us_mode_passed ( void );
+ bool usmode;
+
signals:
void saving_complete_auto( QString &, QString & );
void saving_complete_back_to_exp( QString & );
@@ -299,7 +302,7 @@
*/
void assign_investigator( int );
- void import_data_auto (QString &, QString &, QString &);
+ void import_data_auto (QString &, QString &, QString &, QString &);
void import ( void );
void reimport ( void );
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.cpp
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-05-17 05:09:32 UTC (rev 2765)
@@ -221,7 +221,8 @@
// ALEXEY: do proper reset of everything
reset();
- //emit to_live_update( protocol_details );
+
+ emit exp_cleared();
}
// When run submitted to Optima
@@ -5304,6 +5305,7 @@
protocol_details[ "CellChNumber" ] = QString::number(rpSolut->nschan); // this can be read from protocol in US-lims DB
protocol_details[ "duration" ] = QString::number(Total_duration);
protocol_details[ "invID_passed" ] = QString::number(US_Settings::us_inv_ID());
+ protocol_details[ "correctRadii" ] = QString("YES");
int nwavl_tot = 0;
for ( int kk = 0; kk < rpRange->nranges; kk++ )
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.h
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-05-17 05:09:32 UTC (rev 2765)
@@ -958,6 +958,7 @@
signals:
void us_exp_is_closed( void );
void to_live_update( QMap < QString, QString > &protocol_details );
+ void exp_cleared ( void );
};
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-05-17 05:09:32 UTC (rev 2765)
@@ -220,6 +220,8 @@
QGridLayout* settings = new QGridLayout;
QGridLayout* live_params = new QGridLayout;
QGridLayout* time_params = new QGridLayout;
+
+ auto_mode_bool = true;
navgrec = 10;
dbg_level = US_Settings::us_debug();
@@ -741,6 +743,8 @@
setPalette( US_GuiSettings::frameColor() );
QGridLayout* settings = new QGridLayout;
+
+ auto_mode_bool = false;
navgrec = 10;
dbg_level = US_Settings::us_debug();
@@ -1659,21 +1663,31 @@
<< RunID_to_retrieve
<< currentDir;
- //db->query( qry );
+ db->query( qry );
- // OR
+ //ALEXEY: if there is NO chromatic Abber. data, set corrRadii in autoflow record to 'NO'
+ if ( correctRadii == "NO" )
+ {
+ qry.clear();
+ qry << "update_autoflow_at_live_update_radiicorr"
+ << RunID_to_retrieve;
- qDebug() << "Trying to Update Autoflow table AT LIVE_UPDATE!!";
- int status = db->statusQuery( qry );
+ db->query( qry );
+ }
- if ( status == US_DB2::NO_AUTOFLOW_RECORD )
- {
- QMessageBox::warning( this,
- tr( "Autoflow Record Not Updated" ),
- tr( "No autoflow record\n"
- "associated with RunID %1 exists!" ).arg( RunID_to_retrieve ) );
- return;
- }
+ // // OR
+
+ // qDebug() << "Trying to Update Autoflow table AT LIVE_UPDATE!!";
+ // int status = db->statusQuery( qry );
+
+ // if ( status == US_DB2::NO_AUTOFLOW_RECORD )
+ // {
+ // QMessageBox::warning( this,
+ // tr( "Autoflow Record Not Updated" ),
+ // tr( "No autoflow record\n"
+ // "associated with RunID %1 exists!" ).arg( RunID_to_retrieve ) );
+ // return;
+ // }
}
@@ -1819,17 +1833,16 @@
{
if ( !timer_data_reload->isActive() )
{
-
qDebug() << "TRY PROCEED INTO ==5 from check_for_sys_data()....";
// ALEXEY Export AUC data: devise export_auc_auto() function which would return directory name with saved data - to pass to emit signal below...
export_auc_auto();
- QString mtitle_complete = tr( "Complete!" );
- QString message_done = tr( "Experiment was completed. Optima data saved..." );
- QMessageBox::information( this, mtitle_complete, message_done );
+ // QString mtitle_complete = tr( "Complete!" );
+ // QString message_done = tr( "Experiment was completed. Optima data saved..." );
+ // QMessageBox::information( this, mtitle_complete, message_done );
updateautoflow_record_atLiveUpdate();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed ); // Updtade later: what should be passed with signal ??
+ emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
return;
}
@@ -1855,7 +1868,7 @@
QMessageBox msgBox;
msgBox.setText(tr("Experiment was aborted!"));
- msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment).");
+ msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
msgBox.setWindowTitle(tr("Experiment Abortion"));
QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
@@ -1872,7 +1885,7 @@
QMessageBox::information( this, mtitle_complete, message_done );
updateautoflow_record_atLiveUpdate();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed ); // Updtade later: what should be passed with signal ??
+ emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
return;
}
@@ -1933,8 +1946,8 @@
TripleNumber = protocol_details[ "TripleNumber" ];
OptimaName = protocol_details[ "OptimaName" ]; //New
TotalDuration = protocol_details[ "duration" ];
-
invID_passed = protocol_details[ "invID_passed" ];
+ correctRadii = protocol_details[ "correctRadii" ];
selectOptimaByName_auto( OptimaName ); //New
@@ -2269,7 +2282,7 @@
QMessageBox msgBox;
msgBox.setText(tr("Experiment was aborted!"));
- msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment).");
+ msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
msgBox.setWindowTitle(tr("Experiment Abortion"));
QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
@@ -2286,7 +2299,7 @@
QMessageBox::information( this, mtitle_complete, message_done );
updateautoflow_record_atLiveUpdate();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed ); // Updtade later: what should be passed with signal ??
+ emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
return;
}
@@ -3635,13 +3648,13 @@
// 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();
- QString mtitle_complete = tr( "Complete!" );
- QString message_done = tr( "Experiment was completed. Optima data saved..." );
- QMessageBox::information( this, mtitle_complete, message_done );
+ // QString mtitle_complete = tr( "Complete!" );
+ // QString message_done = tr( "Experiment was completed. Optima data saved..." );
+ // QMessageBox::information( this, mtitle_complete, message_done );
updateautoflow_record_atLiveUpdate();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed ); // Updtade later: what should be passed with signal ??
+ emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
//QString temp_protname("DemchukA_exosomes40K_111418");
//emit experiment_complete_auto( currentDir, temp_protname );
@@ -3663,7 +3676,7 @@
QMessageBox msgBox;
msgBox.setText(tr("Experiment was aborted!"));
- msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment).");
+ msgBox.setInformativeText("The data retrieved so far can be saved or disregarded. If saved, the program will proceed to the next stage (Editing). Otherwise, it will return to the initial stage (Experiment), all data will be lost.");
msgBox.setWindowTitle(tr("Experiment Abortion"));
QPushButton *Save = msgBox.addButton(tr("Save Data"), QMessageBox::YesRole);
QPushButton *Ignore = msgBox.addButton(tr("Ignore Data"), QMessageBox::RejectRole);
@@ -3680,7 +3693,7 @@
QMessageBox::information( this, mtitle_complete, message_done );
updateautoflow_record_atLiveUpdate();
- emit experiment_complete_auto( currentDir, ProtocolName, invID_passed ); // Updtade later: what should be passed with signal ??
+ emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii ); // Updtade later: what should be passed with signal ??
return;
}
@@ -3868,12 +3881,15 @@
// a correction was found
if (correction.size() > 0)
{
- QMessageBox::warning( this,
- tr( "Chromatic Aberration Correction:" ),
- tr( "Wavelength correction data for currently used Optima machine\n"
- "are found in DB and will be used to correct your data for\n"
- "chromatic aberration between 190 nm and 800 nm.\n\n"
- "Exported data will be modified!\n") );
+ if ( !auto_mode_bool )
+ {
+ QMessageBox::warning( this,
+ tr( "Chromatic Aberration Correction:" ),
+ tr( "Wavelength correction data for currently used Optima machine\n"
+ "are found in DB and will be used to correct your data for\n"
+ "chromatic aberration between 190 nm and 800 nm.\n\n"
+ "Exported data will be modified!\n") );
+ }
// For each triple, get the wavelength; then compute and apply a correction
for ( int jd = 0; jd < ntripl; jd++ )
@@ -3893,13 +3909,21 @@
}
}
}
-if (jd<3 || (jd+4)>ntripl )
-DbgLv(1) << "c_r: ri0 ro0" << r_radii[0] << allData[jd].xvalues[0]
- << "rin ron" << r_radii[npoint-1] << allData[jd].xvalues[npoint-1];
+ if (jd<3 || (jd+4)>ntripl )
+ DbgLv(1) << "c_r: ri0 ro0" << r_radii[0] << allData[jd].xvalues[0]
+ << "rin ron" << r_radii[npoint-1] << allData[jd].xvalues[npoint-1];
}
}
+ else // No chromatic abberation in instrument's table
+ {
+ if ( auto_mode_bool )
+ {
+ correctRadii = QString("NO");
+ }
+ }
}
+
/*
// Apply a chromatic aberration correction to auc data radius values <--- OLD function
void US_XpnDataViewer::correct_radii()
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-05-17 05:09:32 UTC (rev 2765)
@@ -96,6 +96,8 @@
US_XpnDataViewer(QString auto_mode);
private:
+ bool auto_mode_bool;
+
QVector< US_DataIO::RawData > allData; //!< All AUC raw data
QVector< double > r_radii; //!< Loaded radii
@@ -280,6 +282,8 @@
QString OptimaName; //New
QString TotalDuration; //New
QString invID_passed;
+ QString correctRadii;
+
int ElapsedTimeOffset;
void timeToList( int&, QList< int >& );
@@ -347,7 +351,7 @@
void test_optima_connection( void ); //New
signals:
- void experiment_complete_auto( QString &, QString &, QString & );
+ void experiment_complete_auto( QString &, QString &, QString &, QString & );
void return_to_experiment( QString & );
void close_program( void );
};
Modified: trunk/sql/us3.sql
===================================================================
--- trunk/sql/us3.sql 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/sql/us3.sql 2019-05-17 05:09:32 UTC (rev 2765)
@@ -101,6 +101,7 @@
runStarted TIMESTAMP NULL,
invID INT NULL,
created TIMESTAMP NULL,
+ corrRadii enum('YES', 'NO') NOT NULL,
PRIMARY KEY (ID) )
ENGINE = InnoDB;
Modified: trunk/sql/us3_autoflow_procs.sql
===================================================================
--- trunk/sql/us3_autoflow_procs.sql 2019-05-15 20:19:58 UTC (rev 2764)
+++ trunk/sql/us3_autoflow_procs.sql 2019-05-17 05:09:32 UTC (rev 2765)
@@ -151,7 +151,7 @@
SELECT @OK AS status;
SELECT protName, cellChNum, tripleNum, duration, runName, expID,
- runID, status, dataPath, optimaName, runStarted, invID, created
+ runID, status, dataPath, optimaName, runStarted, invID, created, corrRadii
FROM autoflow
WHERE ID = p_autoflowID;
@@ -283,6 +283,46 @@
END$$
+
+-- Update autoflow record with corrRadii value at LIVE_UPDATE
+DROP PROCEDURE IF EXISTS update_autoflow_at_live_update_radiicorr$$
+CREATE PROCEDURE update_autoflow_at_live_update_radiicorr ( p_personGUID CHAR(36),
+ p_password VARCHAR(80),
+ p_runID INT )
+
+ MODIFIES SQL DATA
+
+BEGIN
+ DECLARE count_records INT;
+
+ CALL config();
+ SET @US3_LAST_ERRNO = @OK;
+ SET @US3_LAST_ERROR = '';
+
+ SELECT COUNT(*)
+ INTO count_records
+ FROM autoflow
+ WHERE runID = p_runID;
+
+ IF ( verify_user( p_personGUID, p_password ) = @OK ) THEN
+ IF ( count_records = 0 ) THEN
+ SET @US3_LAST_ERRNO = @NO_AUTOFLOW_RECORD;
+ SET @US3_LAST_ERROR = 'MySQL: no rows returned';
+
+ ELSE
+ UPDATE autoflow
+ SET corrRadii = 'NO'
+ WHERE runID = p_runID;
+
+ END IF;
+
+ END IF;
+
+ SELECT @US3_LAST_ERRNO AS status;
+
+END$$
+
+
---- get initial elapsed time upon reattachment -----------------------------
DROP FUNCTION IF EXISTS read_autoflow_times$$
CREATE FUNCTION read_autoflow_times ( p_personGUID CHAR(36),
1
0
May 15, 2019
Author: alexey
Date: 2019-05-15 20:19:58 +0000 (Wed, 15 May 2019)
New Revision: 2764
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_convert/us_convert_gui.cpp
Log:
remove treating duplicates in channel description for now...
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-05-13 22:25:23 UTC (rev 2763)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-05-15 20:19:58 UTC (rev 2764)
@@ -387,7 +387,7 @@
return;
- // Dialog of aexisting autoflow records
+ // Dialog of existing autoflow records
US_Passwd pw;
US_DB2* dbP = new US_DB2( pw.getPasswd() );
list_all_autoflow_records( autoflowdata, dbP );
@@ -397,7 +397,7 @@
int prx;
hdrs << "ID"
<< "Run Name"
- << "Optima"
+ << "Optima Name"
<< "Created"
<< "Started";
@@ -415,8 +415,12 @@
if ( pdiag->exec() == QDialog::Accepted )
autoflow_id_selected = autoflowdata[ prx ][ 0 ];
else
- return;
-
+ {
+ //ALEXEY: define what to do if Optima is occupied, OR if there is another Optima (occupied or not)
+ // autoflowdata[ i ][ 2 ]; // <-- gives Optima Name
+ // autoflowdata[ i ][ 4 ]; // <-- STARTED / NOT STARTED
+ return;
+ }
// -------------------------------------------------------------------------------------------------
// Get detailed info on the autoflow record
@@ -430,8 +434,7 @@
QString invID_passed = protocol_details[ "invID_passed" ];
QString ProtName = protocol_details[ "protocolName" ];
-
-
+
//ALEXEY: if stage=="EDITING" && curDir.isEmpty() (NULL)
/*
-- that means that Run Completed but Directory was created on different computer
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-05-13 22:25:23 UTC (rev 2763)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-05-15 20:19:58 UTC (rev 2764)
@@ -1536,54 +1536,54 @@
le_runID ->setText( runID );
scanTolerance = 5.0;
- //ALEXEY: Remove Duplicates in Channel's description
- for (int i = 0; i < allData.size(); i++)
- {
- qDebug() << "Description BEFORE: " << i << ", " << allData[ i ].description;
+ // //ALEXEY: Remove Duplicates in Channel's description
+ // for (int i = 0; i < allData.size(); i++)
+ // {
+ // qDebug() << "Description BEFORE: " << i << ", " << allData[ i ].description;
- QString desc = allData[ i ].description;
- desc.replace(",", "");
- QString desc_a = desc.split(QRegExp(";"))[0];
- QString desc_b = desc.split(QRegExp(";"))[1];
+ // QString desc = allData[ i ].description;
+ // desc.replace(",", "");
+ // QString desc_a = desc.split(QRegExp(";"))[0];
+ // QString desc_b = desc.split(QRegExp(";"))[1];
- //list of channel A desc
- QStringList desc_list_a = desc_a.split(QRegExp("\\s+"));
- desc_list_a.removeDuplicates();
+ // //list of channel A desc
+ // QStringList desc_list_a = desc_a.split(QRegExp("\\s+"));
+ // desc_list_a.removeDuplicates();
- //list of channel B desc
- QStringList desc_list_b = desc_b.split(QRegExp("\\s+"));
- desc_list_b.removeDuplicates();
+ // //list of channel B desc
+ // QStringList desc_list_b = desc_b.split(QRegExp("\\s+"));
+ // desc_list_b.removeDuplicates();
- QString final_desc("");
+ // QString final_desc("");
- for ( int i=0; i<desc_list_a.size(); i++ )
- {
- if ( desc_list_a[i].isEmpty() )
- continue;
- final_desc += desc_list_a[i];
+ // for ( int i=0; i<desc_list_a.size(); i++ )
+ // {
+ // if ( desc_list_a[i].isEmpty() )
+ // continue;
+ // final_desc += desc_list_a[i];
- if ( i != desc_list_a.size() - 1)
- final_desc += QString(" ");
- else
- final_desc += QString("; ");
+ // if ( i != desc_list_a.size() - 1)
+ // final_desc += QString(" ");
+ // else
+ // final_desc += QString("; ");
- }
- for ( int i=0; i<desc_list_b.size(); i++ )
- {
- if ( desc_list_b[i].isEmpty() )
- continue;
- final_desc += desc_list_b[i];
+ // }
+ // for ( int i=0; i<desc_list_b.size(); i++ )
+ // {
+ // if ( desc_list_b[i].isEmpty() )
+ // continue;
+ // final_desc += desc_list_b[i];
- if ( i != desc_list_b.size() - 1)
- final_desc += QString(" ");
- // else
- // final_desc += QString("; ");
+ // if ( i != desc_list_b.size() - 1)
+ // final_desc += QString(" ");
+ // // else
+ // // final_desc += QString("; ");
- }
+ // }
- allData[ i ].description = final_desc;
- qDebug() << "Description AFTER: " << i << ", " << allData[ i ].description;
- }
+ // allData[ i ].description = final_desc;
+ // qDebug() << "Description AFTER: " << i << ", " << allData[ i ].description;
+ // }
if ( ! init_output_data() )
return;
1
0
Author: gegorbet
Date: 2019-05-13 22:25:23 +0000 (Mon, 13 May 2019)
New Revision: 2763
Modified:
trunk/programs/us_convert/us_convert_gui.cpp
Log:
fix us_convert to not crash when choosing MWL channel with less wavelengths than in the previously selected channel
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-05-12 22:05:47 UTC (rev 2762)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-05-13 22:25:23 UTC (rev 2763)
@@ -5822,7 +5822,7 @@
void US_ConvertGui::plot_all( void )
{
US_DataIO::RawData* currentData = outData[ tripDatax ];
-DbgLv(1) << " PlAll: outData count" << outData.count();
+DbgLv(1) << " PlAll: outData count" << outData.count() << "tripDatax" << tripDatax;
QList< QColor > mcolors;
int nmcols = usplot->map_colors( mcolors );
@@ -6076,18 +6076,29 @@
void US_ConvertGui::triple_index()
{
tripListx = lw_triple->currentRow();
- tripDatax = isMwl
- ? out_chandatx[ tripListx ] + cb_lambplot->currentIndex()
- : tripListx;
+
+ if ( isMwl )
+ { // Compute data index of MWL data
+ int tripnext = qMin( ( tripListx + 1 ), ( out_chandatx.size() - 1 ) );
+ int tripx1 = out_chandatx[ tripListx ];
+ int tripx2 = out_chandatx[ tripnext ];
+ tripDatax = tripx1 + cb_lambplot->currentIndex();
+
+ if ( tripDatax >= tripx2 )
+ { // Less wavelengths in this channel than in the previous one
+ tripDatax = ( tripx1 + tripx2 ) / 2;
+ mwl_connect( false );
+ cb_lambplot->setCurrentIndex( ( tripDatax - tripx1 ) );
+ mwl_connect( true );
+ }
+ }
+
+ else
+ { // Non-MWL data index is triple index
+ tripDatax = tripListx;
+ }
DbgLv(1) << " triple_index trLx trDx" << tripListx << tripDatax
<< " triple" << lw_triple->currentItem()->text();
-
- if (isMwl)
- qDebug() << "CHANGING TRIPLE: out_chandatx[ tripListx ] + cb_lambplot->currentIndex(): " << out_chandatx[ tripListx ] << " + " << cb_lambplot->currentIndex();
- else
- qDebug() << "CHANGING TRIPLE: tripDatax, tripListx : " << tripDatax << ", " << tripListx;
-
- qDebug() << "Size of out_chandatx: " << out_chandatx.size();
}
// Turn MWL connections on or off
1
0
Author: alexey
Date: 2019-05-12 22:05:47 +0000 (Sun, 12 May 2019)
New Revision: 2762
Modified:
trunk/programs/us_convert/us_convert_gui.cpp
trunk/utils/us_xpn_data.cpp
Log:
For importing data, remove dplicates in channel description..
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-05-11 06:54:32 UTC (rev 2761)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-05-12 22:05:47 UTC (rev 2762)
@@ -1536,11 +1536,62 @@
le_runID ->setText( runID );
scanTolerance = 5.0;
+ //ALEXEY: Remove Duplicates in Channel's description
+ for (int i = 0; i < allData.size(); i++)
+ {
+ qDebug() << "Description BEFORE: " << i << ", " << allData[ i ].description;
+
+ QString desc = allData[ i ].description;
+ desc.replace(",", "");
+ QString desc_a = desc.split(QRegExp(";"))[0];
+ QString desc_b = desc.split(QRegExp(";"))[1];
+
+ //list of channel A desc
+ QStringList desc_list_a = desc_a.split(QRegExp("\\s+"));
+ desc_list_a.removeDuplicates();
+
+ //list of channel B desc
+ QStringList desc_list_b = desc_b.split(QRegExp("\\s+"));
+ desc_list_b.removeDuplicates();
+
+ QString final_desc("");
+
+ for ( int i=0; i<desc_list_a.size(); i++ )
+ {
+ if ( desc_list_a[i].isEmpty() )
+ continue;
+ final_desc += desc_list_a[i];
+
+ if ( i != desc_list_a.size() - 1)
+ final_desc += QString(" ");
+ else
+ final_desc += QString("; ");
+
+ }
+ for ( int i=0; i<desc_list_b.size(); i++ )
+ {
+ if ( desc_list_b[i].isEmpty() )
+ continue;
+ final_desc += desc_list_b[i];
+
+ if ( i != desc_list_b.size() - 1)
+ final_desc += QString(" ");
+ // else
+ // final_desc += QString("; ");
+
+ }
+
+ allData[ i ].description = final_desc;
+ qDebug() << "Description AFTER: " << i << ", " << allData[ i ].description;
+ }
+
if ( ! init_output_data() )
return;
setTripleInfo();
le_description -> setText( allData[ 0 ].description );
+
+
init_excludes();
plot_current();
saveStatus = NOT_SAVED;
@@ -2216,6 +2267,8 @@
void US_ConvertGui::getLabInstrumentOperatorInfo_auto( void )
{
+ le_status->setText( tr( "Uploading Protocol Details..." ) );
+ qApp->processEvents();
// Check DB connection
US_Passwd pw;
Modified: trunk/utils/us_xpn_data.cpp
===================================================================
--- trunk/utils/us_xpn_data.cpp 2019-05-11 06:54:32 UTC (rev 2761)
+++ trunk/utils/us_xpn_data.cpp 2019-05-12 22:05:47 UTC (rev 2762)
@@ -1423,6 +1423,9 @@
DbgLv(1) << "BldRawD trip" << trnode << "descr" << rdata.description
<< "celchn" << celchn;
+ qDebug() << "BUILD_RAW_DATA trip: descr: " << trnode << "descr" << rdata.description
+ << "celchn" << celchn;
+
QDateTime time10=QDateTime::currentDateTime();
for ( int sgx = 0; sgx < nstgn; sgx++ )
{ // Set scan values
1
0
r2761 - in trunk/programs: us_com_project us_convert us_xpn_viewer
by svn@svn.aucsolutions.com May 11, 2019
by svn@svn.aucsolutions.com May 11, 2019
May 11, 2019
Author: alexey
Date: 2019-05-11 06:54:32 +0000 (Sat, 11 May 2019)
New Revision: 2761
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_convert/us_convert_gui.cpp
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h
Log:
Updates on autoflow:
* some bug fixed
* when troples/entire channels are dropped at stage 3, solutions and other passed protocol details are properly updated and Saving to DB proceeds without errors...
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-05-10 12:26:51 UTC (rev 2760)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-05-11 06:54:32 UTC (rev 2761)
@@ -355,9 +355,29 @@
// QString ProtName = protocol_details[ "protocolName" ];
// QString invID_passed = protocol_details[ "invID_passed" ];
+
+ // // --------------------------------------------------------------------------------------------
+
+ // // 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" ];
+
// --------------------------------------------------------------------------------------------
-
+
// Query 'autoflow': get count of records
int autoflow_records = get_autoflow_records();
@@ -411,7 +431,7 @@
QString ProtName = protocol_details[ "protocolName" ];
-
+
//ALEXEY: if stage=="EDITING" && curDir.isEmpty() (NULL)
/*
-- that means that Run Completed but Directory was created on different computer
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-05-10 12:26:51 UTC (rev 2760)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-05-11 06:54:32 UTC (rev 2761)
@@ -485,12 +485,20 @@
// QString curdir = "/home/alexey/ultrascan/imports/KentonR_coprohenQ-comproject-013119-run221"; // Kenton
// QString protname = "KentonR_coprohenQ-comproject-013119";
- // QString curdir = "/home/alexey/ultrascan/imports/test-comproject-2wavelength-2cell-2-run227"; // Amy
- // QString protname = "test-comproject-2wavelength-2cell-2";
+ // QString curdir = "/home/alexey/ultrascan/imports/RxRPPARhet-PPRE-MWL_180419-run352"; //Nemetchek
+ // QString protname = "RxRPPARhet-PPRE-MWL_180419";
+ // QString invid = "41";
- // import_data_auto(curdir, protname);
+ // QString curdir = "/home/alexey/ultrascan/imports/data-aquisition-test29-run364"; //Amy's
+ // QString protname = "data-aquisition-test29";
+ // QString invid = "6"; //Amy ID
+
+ // import_data_auto(curdir, protname, invid);
+
+
+
// qDebug() << "ExpData: ";
// qDebug() << "ExpData.invID " << ExpData.invID;
@@ -1518,6 +1526,10 @@
runType = QString( fname ).section( ".", -5, -5 );
runID = QString( fname ).section( ".", 0, -6 );
+
+ // //TEMP
+ // runID += QString("-test");
+
qDebug() << "RUNID from files[0]: files[0]" << fname << ", runID: " << runID;
le_runID2->setText( runID );
@@ -1576,7 +1588,9 @@
tmst_fnamei.clear();
}
- le_status->setText( tr( "AUC data import IS COMPLETE." ) );
+ if (!us_convert_auto_mode)
+ le_status->setText( tr( "AUC data import IS COMPLETE." ) );
+
pb_showTmst->setEnabled( ! tmst_fnamei.isEmpty() );
}
@@ -2372,6 +2386,9 @@
out_chaninfo[ i ].solution = solution_auto;
out_tripinfo[ out_chandatx[ i ] + cb_lambplot->currentIndex() ].solution = solution_auto;
+ //DUPL
+ all_tripinfo[ i ].solution = solution_auto;
+ //all_tripinfo[ out_chandatx[ i ] + cb_lambplot->currentIndex() ].solution = solution_auto;
//Centerpiece
// if ( i < nchans-1 && i%2 == 0 ) //every second channel, or other # ?
@@ -2399,14 +2416,21 @@
//ALEXEY abstractCenterpieceIDs inferred from cent. name passed from protocol
out_chaninfo[ i ] .centerpiece = cpID;
out_chaninfo[ i ] .centerpieceName = cpName;
+
+ //DUPL
+ all_tripinfo[ i ] .centerpiece = cpID;
+ all_tripinfo[ i ] .centerpieceName = cpName;
// For MWL, duplicate solution & centerpices to all triples of the channel
int idax = out_chandatx[ i ];
int ldax = i + 1;
+
ldax = ldax < out_chandatx.size()
? out_chandatx[ ldax ]
: out_tripinfo.size();
-
+
+ int diff_ldax_idax = ldax - idax;
+
while ( idax < ldax )
{
int jj = idax++;
@@ -2417,22 +2441,39 @@
//Centerpiece
out_tripinfo[ jj ].centerpiece = cpID; //ALEXEY abstractCenterpieceIDs passed from protocol
//qDebug() << "Centerpiece: " << i << ", " << jj << ", " << out_tripinfo[ jj ].centerpiece;
+
+ //Centerpiece Name
+ out_tripinfo[ jj ].centerpieceName = cpName;
+
+ //DUPL
+ all_tripinfo[ jj ].solution = solution_auto;
+ all_tripinfo[ jj ].centerpiece = cpID;
+ all_tripinfo[ jj ].centerpieceName = cpName;
}
// Description
triple_desc = ProtInfo.ProtSolutions.chsols[ i ].ch_comment; //channel's comment from protocol
- outData[ out_chandatx[ i ] + cb_lambplot->currentIndex() ]->description = triple_desc;
+ outData[ out_chandatx[ i ] + cb_lambplot->currentIndex() ]->description = triple_desc; // ALEXEY : REplicate for all triple in the same channel
//Propagate description to all triples of channel
out_chaninfo[ i ].description = triple_desc;
- int trxs = out_chandatx[ i ];
- int trxe = trxs + nlambda;
- qDebug() << "Channel " << i << ": ldax, trxe: " << ldax << ", " << trxe;
+ //DUPL
+ allData[ out_chandatx[ i ] + cb_lambplot->currentIndex() ].description = triple_desc;
+ all_tripinfo[ i ].description = triple_desc;
+ int trxs = out_chandatx[ i ];
+ //int trxe = trxs + nlambda; //ALEXEY: here was a problem!!
+ int trxe = trxs + diff_ldax_idax;
+
+ qDebug() << "Channel " << i << ": diff_ldax_idax, trxs, trxe: " << diff_ldax_idax << ", " << trxs << ", " << trxe;
+
for ( int trx = trxs; trx < trxe; trx++ )
{
outData[ trx ]->description = triple_desc;
- //qDebug() << "Triple Description: " << trx << ", " << triple_desc;
+ qDebug() << "Triple Description for channel #: " << i << ", " << trx << ", " << triple_desc;
+
+ //DUPL
+ allData[ trx ].description = triple_desc;
}
}
}
@@ -2441,6 +2482,7 @@
qDebug() << "SOLUTION is READ in NON MWL mode !!! ntrips: " << ntrips;
qDebug() << "SIZE of out_chaninfo.size(): " << out_chaninfo.size() ;
qDebug() << "SIZE of out_tripinfo.size(): " << out_tripinfo.size() ;
+ qDebug() << "nchans, ntrips: " << nchans << ", " << ntrips;
if (ntrips == nchans)
{
@@ -2451,10 +2493,16 @@
solution_auto.readFromDB(solutionID, &db);
out_chaninfo[ i ].solution = solution_auto;
out_tripinfo[ i ].solution = solution_auto;
+
+ //DUPL
+ all_tripinfo[ i ].solution = solution_auto;
//Description
triple_desc = ProtInfo.ProtSolutions.chsols[ i ].ch_comment; //channel's comment from protocol
outData[ i ]->description = triple_desc;
+
+ //DUPL
+ allData[ i ].description = triple_desc;
//Centerpiece
// if ( i < ntrips-1 && i%2 == 0 ) //every second channel
@@ -2481,7 +2529,11 @@
out_chaninfo[ i ].centerpiece = cpID; //ALEXEY abstractCenterpieceIDs passed from protocol
out_tripinfo[ i ].centerpiece = cpID; //ALEXEY abstractCenterpieceIDs passed from protocol
- out_chaninfo[ i ].centerpieceName = cpName;
+ out_chaninfo[ i ].centerpieceName = cpName;
+
+ //DUPL
+ all_tripinfo[ i ].centerpiece = cpID;
+ all_tripinfo[ i ].centerpieceName = cpName;
}
}
else
@@ -2521,7 +2573,11 @@
out_chaninfo[ j ].centerpiece = cpID;
out_tripinfo[ j ].centerpiece = cpID;
- out_chaninfo[ j ].centerpieceName = cpName;
+ out_chaninfo[ j ].centerpieceName = cpName;
+
+ //DUPL
+ all_tripinfo[ j ].centerpiece = cpID;
+ all_tripinfo[ j ].centerpieceName = cpName;
}
if ( out_triples[ j ].section( "/", 0, 1 ).simplified() == out_channels[ i ] )
@@ -2530,6 +2586,12 @@
out_chaninfo[ j ].solution = solution_auto;
out_tripinfo[ j ].solution = solution_auto;
outData[ j ]->description = triple_desc;
+
+ //DUPL
+ all_tripinfo[ j ].solution = solution_auto;
+ allData[ j ].description = triple_desc;
+
+
}
}
}
@@ -2547,6 +2609,8 @@
//le_centerpieceDesc ->setText( QString::number(out_chaninfo[ tripListx ].centerpiece) );
le_centerpieceDesc ->setText( out_chaninfo[ tripListx ].centerpieceName );
+ le_status->setText( tr( "AUC data import IS COMPLETE." ) );
+
enableSaveBtn_auto();
}
@@ -3511,18 +3575,23 @@
.section( "/", 1, 1 ).simplified();
pb_dropChan ->setText( tr( "Drop All Channel '%1's" ).arg( chann ) );
+ for ( int i=0; i < outData.size(); ++i)
+ qDebug() << "i, outData[ i ]->description" << i << ", " << outData[ i ]->description;
+
triple_index( );
DbgLv(1) << "chgTrp: trDx trLx" << tripDatax << tripListx
<< "outDsz chinfsz" << outData.size() << out_chaninfo.size();
le_dir ->setText( currentDir );
- le_description ->setText( outData[ tripDatax ]->description );
- le_solutionDesc->setText( out_chaninfo[ tripListx ].solution.solutionDesc );
- le_centerpieceDesc ->setText( out_chaninfo[ tripListx ].centerpieceName );
- qDebug() << "Cent. INFO : " << out_chaninfo[ tripListx ].centerpieceName ;
-
+ // le_description ->setText( outData[ tripDatax ]->description );
+ // le_solutionDesc->setText( out_chaninfo[ tripListx ].solution.solutionDesc );
+ // le_centerpieceDesc ->setText( out_chaninfo[ tripListx ].centerpieceName );
+ // qDebug() << "DESCRIPTION : tripDatax, outData[ tripDatax ]->description:: " << tripDatax << ", " << outData[ tripDatax ]->description;
+ // qDebug() << "CENTERPIECE INFO : tripListx, out_chaninfo[ tripListx ].centerpieceName:: " << tripListx << ", " << out_chaninfo[ tripListx ].centerpieceName;
+ // qDebug() << "SOLUTION : tripListx, out_chaninfo[ tripListx ].solution.solutionDesc:: " << tripListx << ", " << out_chaninfo[ tripListx ].solution.solutionDesc;
+
// If MWL, set the cell/channel index and get the lambda range
if ( isMwl )
{
@@ -3537,6 +3606,15 @@
// Reset maximum scan control values
enableScanControls();
+ le_description ->setText( outData[ tripDatax ]->description );
+ le_solutionDesc->setText( out_chaninfo[ tripListx ].solution.solutionDesc );
+ le_centerpieceDesc ->setText( out_chaninfo[ tripListx ].centerpieceName );
+
+ qDebug() << "DESCRIPTION : tripDatax, outData[ tripDatax ]->description:: " << tripDatax << ", " << outData[ tripDatax ]->description;
+ qDebug() << "CENTERPIECE INFO : tripListx, out_chaninfo[ tripListx ].centerpieceName:: " << tripListx << ", " << out_chaninfo[ tripListx ].centerpieceName;
+ qDebug() << "SOLUTION : tripListx, out_chaninfo[ tripListx ].solution.solutionDesc:: " << tripListx << ", " << out_chaninfo[ tripListx ].solution.solutionDesc;
+
+
// The centerpiece combo box
cb_centerpiece->setLogicalIndex( out_chaninfo[ tripListx ].centerpiece );
@@ -5950,6 +6028,13 @@
: tripListx;
DbgLv(1) << " triple_index trLx trDx" << tripListx << tripDatax
<< " triple" << lw_triple->currentItem()->text();
+
+ if (isMwl)
+ qDebug() << "CHANGING TRIPLE: out_chandatx[ tripListx ] + cb_lambplot->currentIndex(): " << out_chandatx[ tripListx ] << " + " << cb_lambplot->currentIndex();
+ else
+ qDebug() << "CHANGING TRIPLE: tripDatax, tripListx : " << tripDatax << ", " << tripListx;
+
+ qDebug() << "Size of out_chandatx: " << out_chandatx.size();
}
// Turn MWL connections on or off
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-05-10 12:26:51 UTC (rev 2760)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-05-11 06:54:32 UTC (rev 2761)
@@ -1524,14 +1524,16 @@
// OR
//Alternativly: put it in separate thread:
- QThread* sys_thread = new QThread(this);
+ //QThread* sys_thread = new QThread(this);
+ sys_thread = new QThread(this);
timer_check_sysdata = new QTimer(0); // parent to 0 !
timer_check_sysdata->setInterval(2000);
timer_check_sysdata->moveToThread(sys_thread);
//connect( timer_check_sysdata, SIGNAL(timeout()), this, SLOT( check_for_sysdata( ) ), Qt::QueuedConnection ) ; //Qt::DirectConnection );
connect( timer_check_sysdata, SIGNAL(timeout()), this, SLOT( check_for_sysdata( ) ) );//, Qt::QueuedConnection );
//QThread's started() SIGNAL: before the run()/exec() function is called!!! Is this a potential issue, timer is started from a thread???
- connect( sys_thread, SIGNAL( started() ), timer_check_sysdata, SLOT( start() ));
+ connect( sys_thread, SIGNAL( started() ), timer_check_sysdata, SLOT( start() ));
+ connect( sys_thread, SIGNAL( finished() ), timer_check_sysdata, SLOT( stop() ));
sys_thread->start();
// How to stop sys_thread?
@@ -1798,13 +1800,17 @@
if ( exp_status == 5 )
{
- timer_check_sysdata->stop();
+ //timer_check_sysdata->stop();
//ALEXEY: This timer cannot be stopped from another thread, but can be dealt with signal/slot upon Qthread termination..
// disconnection maybe enough...
disconnect(timer_check_sysdata, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
+ sys_thread->quit(); // ALEXEY: does this emit Qthread's finished() signal??
qDebug() << "ExpStat: 5 - sys_timer STOPPED here: ";
-
+
+ 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();
@@ -1833,9 +1839,9 @@
if ( exp_status == 0 ) //ALEXEY should be == 3 as per documentation
{
- timer_check_sysdata->stop();
+ //timer_check_sysdata->stop();
disconnect(timer_check_sysdata, SIGNAL(timeout()), 0, 0); //Disconnect timer from anything
-
+ sys_thread->quit(); // ALEXEY: does this emit Qthread's finished() signal??
qDebug() << "ExpStat: 3 - sys_timer STOPPED here: ";
rpm_box->setSpeed( 0 );
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-05-10 12:26:51 UTC (rev 2760)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h 2019-05-11 06:54:32 UTC (rev 2761)
@@ -268,7 +268,7 @@
QElapsedTimer* elapsed_timer;
QTimer* timer_sys_thread;
- //QThread* sys_thread;
+ QThread* sys_thread;
QMessageBox* msg_data_avail;
QString RunID_to_retrieve;
1
0
Author: alexey
Date: 2019-05-10 18:36:15 +0000 (Fri, 10 May 2019)
New Revision: 289
Modified:
trunk/queue_viewer.php
Log:
include demeler3-local
Modified: trunk/queue_viewer.php
===================================================================
--- trunk/queue_viewer.php 2019-05-10 13:51:46 UTC (rev 288)
+++ trunk/queue_viewer.php 2019-05-10 18:36:15 UTC (rev 289)
@@ -143,6 +143,7 @@
{
case 'jetstream-local' :
case 'taito-local' :
+ case 'demeler3-local':
case 'us3iab-node0' :
case 'us3iab-node1' :
case 'us3iab-devel' :
1
0
Author: gegorbet
Date: 2019-05-10 13:51:46 +0000 (Fri, 10 May 2019)
New Revision: 288
Modified:
trunk/2DSA-CG_2.php
trunk/2DSA_2.php
trunk/GA_3.php
trunk/PCSA_2.php
trunk/lib/file_writer.php
trunk/lib/utility.php
Log:
uslims3 and uslims3_inst mods for Lethbridge server
Modified: trunk/2DSA-CG_2.php
===================================================================
--- trunk/2DSA-CG_2.php 2019-05-05 12:13:59 UTC (rev 287)
+++ trunk/2DSA-CG_2.php 2019-05-10 13:51:46 UTC (rev 288)
@@ -162,6 +162,7 @@
{
case 'jetstream-local' :
case 'taito-local' :
+ case 'demeler3-local' :
case 'us3iab-node0' :
case 'us3iab-node1' :
case 'us3iab-devel' :
Modified: trunk/2DSA_2.php
===================================================================
--- trunk/2DSA_2.php 2019-05-05 12:13:59 UTC (rev 287)
+++ trunk/2DSA_2.php 2019-05-10 13:51:46 UTC (rev 288)
@@ -170,7 +170,8 @@
switch ( $cluster )
{
case 'jetstream-local' :
- case 'taito-local' :
+ case 'taito-local' :
+ case 'demeler3-local' :
case 'us3iab-node0' :
case 'us3iab-node1' :
case 'us3iab-devel' :
Modified: trunk/GA_3.php
===================================================================
--- trunk/GA_3.php 2019-05-05 12:13:59 UTC (rev 287)
+++ trunk/GA_3.php 2019-05-10 13:51:46 UTC (rev 288)
@@ -145,6 +145,7 @@
{
case 'jetstream-local' :
case 'taito-local' :
+ case 'demeler3-local' :
case 'us3iab-node0' :
case 'us3iab-node1' :
case 'us3iab-devel' :
Modified: trunk/PCSA_2.php
===================================================================
--- trunk/PCSA_2.php 2019-05-05 12:13:59 UTC (rev 287)
+++ trunk/PCSA_2.php 2019-05-10 13:51:46 UTC (rev 288)
@@ -163,6 +163,7 @@
{
case 'jetstream-local' :
case 'taito-local' :
+ case 'demeler3-local' :
case 'us3iab-node0' :
case 'us3iab-node1' :
case 'us3iab-devel' :
Modified: trunk/lib/file_writer.php
===================================================================
--- trunk/lib/file_writer.php 2019-05-05 12:13:59 UTC (rev 287)
+++ trunk/lib/file_writer.php 2019-05-10 13:51:46 UTC (rev 288)
@@ -632,6 +632,9 @@
$xml->startElement( 'tinoise_option' );
$xml->writeAttribute( 'value', $parameters['tinoise_option'] );
$xml->endElement(); // tinoise_option
+ $xml->startElement( 'rinoise_option' );
+ $xml->writeAttribute( 'value', $parameters['rinoise_option'] );
+ $xml->endElement(); // rinoise_option
$xml->startElement( 'fit_mb_select' );
$xml->writeAttribute( 'value', $parameters['fit_mb_select'] );
$xml->endElement(); // fit_mb_select
@@ -646,9 +649,6 @@
$xml->startElement( 'max_iterations' );
$xml->writeAttribute( 'value', $parameters['max_iterations'] );
$xml->endElement(); // max_iterations
- $xml->startElement( 'rinoise_option' );
- $xml->writeAttribute( 'value', $parameters['rinoise_option'] );
- $xml->endElement(); // rinoise_option
$xml->startElement( 'debug_timings' );
$xml->writeAttribute( 'value', $parameters['debug_timings'] );
$xml->endElement(); // debug_timings
@@ -698,6 +698,9 @@
$xml->startElement( 'tinoise_option' );
$xml->writeAttribute( 'value', $parameters['tinoise_option'] );
$xml->endElement(); // tinoise_option
+ $xml->startElement( 'rinoise_option' );
+ $xml->writeAttribute( 'value', $parameters['rinoise_option'] );
+ $xml->endElement(); // rinoise_option
$xml->startElement( 'fit_mb_select' );
$xml->writeAttribute( 'value', $parameters['fit_mb_select'] );
$xml->endElement(); // fit_mb_select
@@ -710,9 +713,6 @@
$xml->startElement( 'max_iterations' );
$xml->writeAttribute( 'value', $parameters['max_iterations'] );
$xml->endElement(); // max_iterations
- $xml->startElement( 'rinoise_option' );
- $xml->writeAttribute( 'value', $parameters['rinoise_option'] );
- $xml->endElement(); // rinoise_option
$xml->startElement( 'debug_timings' );
$xml->writeAttribute( 'value', $parameters['debug_timings'] );
$xml->endElement(); // debug_timings
Modified: trunk/lib/utility.php
===================================================================
--- trunk/lib/utility.php 2019-05-05 12:13:59 UTC (rev 287)
+++ trunk/lib/utility.php 2019-05-10 13:51:46 UTC (rev 288)
@@ -78,7 +78,8 @@
new cluster_info( "js-169-137.jetstream-cloud.org", "jetstream", "batch" ),
new cluster_info( "js-169-137.jetstream-cloud.org", "jetstream-local", "batch" ),
new cluster_info( "taito.csc.fi", "taito-local", "serial" ),
- new cluster_info( "us3iab-node1.localhost", "us3iab-node1", "normal" )
+ new cluster_info( "us3iab-node1.localhost", "us3iab-node1", "normal" ),
+ new cluster_info( "demeler3.uleth.ca", "demeler3-local", "batch" )
);
global $svcport;
1
0
May 10, 2019
Author: gegorbet
Date: 2019-05-10 12:26:51 +0000 (Fri, 10 May 2019)
New Revision: 2760
Modified:
trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp
trunk/programs/us_vhw_enhanced/us_distrib_plot.cpp
Log:
restore true amplitude with exponent for total concentration in vHW
Modified: trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp
===================================================================
--- trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp 2019-05-08 14:09:31 UTC (rev 2759)
+++ trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp 2019-05-10 12:26:51 UTC (rev 2760)
@@ -890,7 +890,7 @@
int ixblin = 0; // Bottom line start index
int ixbval = 0; // Bottom value start index
int ncbval = 0; // Bottom value number characters
- int ncblin = 0; // Botton line number characters
+ int ncblin = 0; // Bottom line number characters
int ixllin = 0; // Left-data line start index
int ixlval = 0; // Left-data value start index
int nclval = 0; // Left-data value number characters
@@ -988,11 +988,12 @@
if ( ! all_wvl || nedtfs == 1 )
{ // Apply to a single triple
- QTextStream ts( &filei );
+ QTextStream ts( &filei ); // Build up XML Edit text
while ( !ts.atEnd() )
edtext += ts.readLine() + "\n";
filei.close();
+ // Compute indecies,lengths of meniscus,bottom,data lines,values
ixmlin = edtext.indexOf( "<meniscus radius=" );
if ( ixmlin < 0 ) return;
ixmval = edtext.indexOf( "=\"", ixmlin ) + 2;
@@ -1022,7 +1023,7 @@
return;
}
- demval = s_meni.length() - ncmval;
+ demval = s_meni.length() - ncmval; // Deltas old,new values
debval = s_bott.length() - ncbval;
if ( have3val )
@@ -1031,7 +1032,7 @@
ncmval += demval;
ncmlin += demval;
if ( ixbval > 0 )
- {
+ { // Replace existing bottom value
ixbval += demval;
edtext.replace( ixbval, ncbval, s_bott );
ixblin += demval;
@@ -1055,9 +1056,9 @@
ncmlin += demval;
}
else
- { // Replace bottom value in edit
+ { // Replace/insert bottom value in edit
if ( ixbval > 0 )
- {
+ { // Replace existing bottom value
edtext.replace( ixbval, ncbval, s_bott );
ncbval += debval;
ncblin += debval;
@@ -1073,6 +1074,7 @@
}
}
+ // Write out the modified Edit XML text
QFile fileo( fn );
if ( ! fileo.open( QIODevice::WriteOnly | QIODevice::Text ) )
@@ -1087,18 +1089,18 @@
mmsg = tr( "In file directory\n " ) + filedir + " ,\n" +
tr( "file\n " ) + fname_edit + "\n";
if ( have3val )
- {
+ { // Report on Meniscus,Bottom mods
mmsg = mmsg + tr( "has been modified with the lines:" )
+ "\n " + edtext.mid( ixmlin, ncmlin )
+ "\n " + edtext.mid( ixblin, ncblin );
}
else if ( !bott_fit )
- {
+ { // Report on Meniscus mods
mmsg = mmsg + tr( "has been modified with the line:" )
+ "\n " + edtext.mid( ixmlin, ncmlin );
}
else
- {
+ { // Report on Bottom mods
mmsg = mmsg + tr( "has been modified with the line:" )
+ "\n " + edtext.mid( ixblin, ncblin );
}
@@ -1140,18 +1142,19 @@
QApplication::setOverrideCursor( QCursor( Qt::WaitCursor ) );
for ( int jj = 0; jj < nedtfs; jj++ )
- {
+ { // Modify each Edit file corresponding to a wavelength
QString fn = filedir + "/" + edtfiles.at( jj );
DbgLv(1) << " eupd: jj" << jj << "fn" << fn;
QFile filei( fn );
if ( ! filei.open( QIODevice::ReadOnly | QIODevice::Text ) )
- {
+ { // Skip any file we cannot read
DbgLv(1) << " eupd: *OPEN ERROR*";
continue;
}
DbgLv(1) << " eupd: edtext read";
+ // Read in the Edit XML text
QTextStream ts( &filei );
edtext = "";
while ( !ts.atEnd() )
@@ -1159,6 +1162,7 @@
filei.close();
DbgLv(1) << " eupd: edtext len" << edtext.length();
+ // Compute locations and lengths of meniscus,bottom,data lines,values
ixmlin = edtext.indexOf( "<meniscus radius=" );
if ( ixmlin < 0 ) continue;
ixmval = edtext.indexOf( "=\"", ixmlin ) + 2;
@@ -1187,7 +1191,7 @@
continue;
}
- demval = s_meni.length() - ncmval;
+ demval = s_meni.length() - ncmval; // Deltas in old,new value strings
debval = s_bott.length() - ncbval;
if ( have3val )
@@ -1196,7 +1200,7 @@
ncmval += demval;
ncmlin += demval;
if ( ixbval > 0 )
- {
+ { // Replace an existing bottom line
ixbval += demval;
edtext.replace( ixbval, ncbval, s_bott );
ixblin += demval;
@@ -1242,6 +1246,7 @@
}
DbgLv(1) << " eupd: write: fn" << fn;
+ // Write out the modified Edit XML file
QFile fileo( fn );
if ( ! fileo.open( QIODevice::WriteOnly | QIODevice::Text ) )
@@ -1276,18 +1281,18 @@
tr( "file\n " ) + fname_edit + "\n";
if ( have3val )
- {
+ { // Report on Meniscus+Bottom mods
mmsg = mmsg + tr( "has been modified with the lines:" )
+ "\n " + edtext.mid( ixmlin, ncmlin )
+ "\n " + edtext.mid( ixblin, ncblin );
}
else if ( !bott_fit )
- {
+ { // Report on Meniscus mods
mmsg = mmsg + tr( "has been modified with the line:" )
+ "\n " + edtext.mid( ixmlin, ncmlin );
}
else
- {
+ { // Report on Bottom mods
mmsg = mmsg + tr( "has been modified with the line:" )
+ "\n " + edtext.mid( ixblin, ncblin );
}
Modified: trunk/programs/us_vhw_enhanced/us_distrib_plot.cpp
===================================================================
--- trunk/programs/us_vhw_enhanced/us_distrib_plot.cpp 2019-05-08 14:09:31 UTC (rev 2759)
+++ trunk/programs/us_vhw_enhanced/us_distrib_plot.cpp 2019-05-10 12:26:51 UTC (rev 2760)
@@ -665,6 +665,7 @@
int nepts = envel_data( eseds, efrqs );
double tconc = tot_conc;
+#if 0
if ( tconc < 0.01 )
{ // If concentration too small, bump it to 1.0e0 range
double tcpwr = qFloor( log10( tconc ) );
@@ -672,6 +673,7 @@
DbgLv(1) << "SaveDat: tot_conc tconc" << tot_conc << tconc
<< "tcpwr" << tcpwr;
}
+#endif
DbgLv(1) << "SaveDat: file" << data2File << "nhpts nepts" << nhpts << nepts;
QFile datf( data2File );
1
0
Author: gegorbet
Date: 2019-05-08 14:09:31 +0000 (Wed, 08 May 2019)
New Revision: 2759
Modified:
trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp
Log:
us_fit_meniscus fix for 2DSA-FB-IT noises and refinement of indecies,counts when replacing meniscus,bottom values in the Edit XML where old,new fields are different lengths
Modified: trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp
===================================================================
--- trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp 2019-05-07 12:59:04 UTC (rev 2758)
+++ trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp 2019-05-08 14:09:31 UTC (rev 2759)
@@ -883,20 +883,19 @@
//*DEBUG*
//db_upd=false;
//*DEBUG*
- int mlsx = 0;
- int meqx = 0;
- int mvsx = 0;
- int mvcn = 0;
- int mlnn = 0;
- int blsx = 0;
- int beqx = 0;
- int bvsx = 0;
- int bvcn = 0;
- int blnn = 0;
- int llsx = 0;
- int leqx = 0;
- int lvsx = 0;
- int lvcn = 0;
+ int ixmlin = 0; // Meniscus line start index
+ int ixmval = 0; // Meniscus value start index
+ int ncmval = 0; // Meniscus value number characters
+ int ncmlin = 0; // Meniscus line number characters
+ int ixblin = 0; // Bottom line start index
+ int ixbval = 0; // Bottom value start index
+ int ncbval = 0; // Bottom value number characters
+ int ncblin = 0; // Botton line number characters
+ int ixllin = 0; // Left-data line start index
+ int ixlval = 0; // Left-data value start index
+ int nclval = 0; // Left-data value number characters
+ int demval = 0; // Delta old/new meniscus value
+ int debval = 0; // Delta old/new bottom value
// New meniscus and bottom values
double mennew = 0.0;
@@ -994,28 +993,25 @@
edtext += ts.readLine() + "\n";
filei.close();
- mlsx = edtext.indexOf( "<meniscus radius=" );
- if ( mlsx < 0 ) return;
- meqx = edtext.indexOf( "=\"", mlsx );
- mvsx = meqx + 2;
- mvcn = edtext.indexOf( "\"", mvsx + 1 ) - mvsx;
- mlnn = edtext.indexOf( ">", mlsx ) - mlsx + 1;
- llsx = edtext.indexOf( "<data_range left=" );
- if ( llsx < 0 ) return;
- leqx = edtext.indexOf( "=\"", llsx );
- lvsx = leqx + 2;
- lvcn = edtext.indexOf( "\"", lvsx + 1 ) - lvsx;
- lefval = edtext.mid( lvsx, lvcn ).toDouble();
- blsx = edtext.indexOf( "<bottom radius=" );
- if ( blsx > 0 )
+ ixmlin = edtext.indexOf( "<meniscus radius=" );
+ if ( ixmlin < 0 ) return;
+ ixmval = edtext.indexOf( "=\"", ixmlin ) + 2;
+ ncmval = edtext.indexOf( "\"", ixmval + 1 ) - ixmval;
+ ncmlin = edtext.indexOf( ">", ixmlin ) - ixmlin + 1;
+ ixllin = edtext.indexOf( "<data_range left=" );
+ if ( ixllin < 0 ) return;
+ ixlval = edtext.indexOf( "=\"", ixllin ) + 2;
+ nclval = edtext.indexOf( "\"", ixlval + 1 ) - ixlval;
+ lefval = edtext.mid( ixlval, nclval ).toDouble();
+ ixblin = edtext.indexOf( "<bottom radius=" );
+ if ( ixblin > 0 )
{
- beqx = edtext.indexOf( "=\"", blsx );
- bvsx = beqx + 2;
- bvcn = edtext.indexOf( "\"", bvsx + 1 ) - bvsx;
- blnn = edtext.indexOf( ">", blsx ) - blsx + 1;
+ ixbval = edtext.indexOf( "=\"", ixblin ) + 2;
+ ncbval = edtext.indexOf( "\"", ixbval + 1 ) - ixbval;
+ ncblin = edtext.indexOf( ">", ixblin ) - ixblin + 1;
}
DbgLv(1) << " eupd: mennew" << mennew << "lefval" << lefval << "botnew" << botnew;
-DbgLv(1) << " eupd: mlsx blsx" << mlsx << blsx << "mlnn blnn" << mlnn << blnn;
+DbgLv(1) << " eupd: ixmlin ixblin" << ixmlin << ixblin << "ncmlin ncblin" << ncmlin << ncblin;
if ( mennew >= lefval )
{
@@ -1026,31 +1022,54 @@
return;
}
+ demval = s_meni.length() - ncmval;
+ debval = s_bott.length() - ncbval;
+
if ( have3val )
{ // Replace meniscus and bottom values in edit
- edtext.replace( mvsx, mvcn, s_meni );
- if ( bvsx > 0 )
- edtext.replace( bvsx, bvcn, s_bott );
+ edtext.replace( ixmval, ncmval, s_meni );
+ ncmval += demval;
+ ncmlin += demval;
+ if ( ixbval > 0 )
+ {
+ ixbval += demval;
+ edtext.replace( ixbval, ncbval, s_bott );
+ ixblin += demval;
+ ncbval += debval;
+ ncblin += debval;
+ }
else
{ // Must insert an entirely new line for bottom
QString bline = QString( "\n <bottom radius=\"" )
+ s_bott + QString( "\"/>" );
- edtext.insert( mlsx + mlnn, bline );
+ ixblin = ixmlin + ncmlin;
+ edtext.insert( ixblin, bline );
+ ncblin = bline .length();
+ ncbval = s_bott.length();
}
}
else if ( !bott_fit )
{ // Replace meniscus value in edit
- edtext.replace( mvsx, mvcn, s_meni );
+ edtext.replace( ixmval, ncmval, s_meni );
+ ncmval += demval;
+ ncmlin += demval;
}
else
{ // Replace bottom value in edit
- if ( bvsx > 0 )
- edtext.replace( bvsx, bvcn, s_bott );
+ if ( ixbval > 0 )
+ {
+ edtext.replace( ixbval, ncbval, s_bott );
+ ncbval += debval;
+ ncblin += debval;
+ }
else
{ // Must insert an entirely new line for bottom
QString bline = QString( "\n <bottom radius=\"" )
+ s_bott + QString( "\"/>" );
- edtext.insert( mlsx + mlnn, bline );
+ ixblin = ixmlin + ncmlin;
+ edtext.insert( ixblin, bline );
+ ncblin = bline .length();
+ ncbval = s_bott.length();
}
}
@@ -1070,18 +1089,18 @@
if ( have3val )
{
mmsg = mmsg + tr( "has been modified with the lines:" )
- + "\n " + edtext.mid( mlsx, mlnn )
- + "\n " + edtext.mid( blsx, blnn );
+ + "\n " + edtext.mid( ixmlin, ncmlin )
+ + "\n " + edtext.mid( ixblin, ncblin );
}
else if ( !bott_fit )
{
mmsg = mmsg + tr( "has been modified with the line:" )
- + "\n " + edtext.mid( mlsx, mlnn );
+ + "\n " + edtext.mid( ixmlin, ncmlin );
}
else
{
mmsg = mmsg + tr( "has been modified with the line:" )
- + "\n " + edtext.mid( blsx, blnn );
+ + "\n " + edtext.mid( ixblin, ncblin );
}
// If using DB, update the edit record there
@@ -1140,27 +1159,24 @@
filei.close();
DbgLv(1) << " eupd: edtext len" << edtext.length();
- mlsx = edtext.indexOf( "<meniscus radius=" );
- if ( mlsx < 0 ) continue;
- meqx = edtext.indexOf( "=\"", mlsx );
- mvsx = meqx + 2;
- mvcn = edtext.indexOf( "\"", mvsx + 1 ) - mvsx;
- mlnn = edtext.indexOf( ">", mlsx ) - mlsx + 1;
- llsx = edtext.indexOf( "<data_range left=" );
- if ( llsx < 0 ) continue;
- leqx = edtext.indexOf( "=\"", llsx );
- lvsx = leqx + 2;
- lvcn = edtext.indexOf( "\"", lvsx + 1 ) - lvsx;
- lefval = edtext.mid( lvsx, lvcn ).toDouble();
- blsx = edtext.indexOf( "<bottom radius=" );
- if ( blsx > 0 )
+ ixmlin = edtext.indexOf( "<meniscus radius=" );
+ if ( ixmlin < 0 ) continue;
+ ixmval = edtext.indexOf( "=\"", ixmlin ) + 2;
+ ncmval = edtext.indexOf( "\"", ixmval + 1 ) - ixmval;
+ ncmlin = edtext.indexOf( ">", ixmlin ) - ixmlin + 1;
+ ixllin = edtext.indexOf( "<data_range left=" );
+ if ( ixllin < 0 ) continue;
+ ixlval = edtext.indexOf( "=\"", ixllin ) + 2;
+ nclval = edtext.indexOf( "\"", ixlval + 1 ) - ixlval;
+ lefval = edtext.mid( ixlval, nclval ).toDouble();
+ ixblin = edtext.indexOf( "<bottom radius=" );
+ if ( ixblin > 0 )
{
- beqx = edtext.indexOf( "=\"", blsx );
- bvsx = beqx + 2;
- bvcn = edtext.indexOf( "\"", bvsx + 1 ) - bvsx;
- blnn = edtext.indexOf( ">", blsx ) - blsx + 1;
+ ixbval = edtext.indexOf( "=\"", ixblin ) + 2;
+ ncbval = edtext.indexOf( "\"", ixbval + 1 ) - ixbval;
+ ncblin = edtext.indexOf( ">", ixblin ) - ixblin + 1;
}
-DbgLv(1) << " eupd: mlsx blsx llsx" << mlsx << blsx << llsx;
+DbgLv(1) << " eupd: ixmlin ixblin ixllin" << ixmlin << ixblin << ixllin;
if ( mennew >= lefval )
{
@@ -1171,33 +1187,56 @@
continue;
}
+ demval = s_meni.length() - ncmval;
+ debval = s_bott.length() - ncbval;
+
if ( have3val )
{ // Replace meniscus and bottom values in edit
- edtext.replace( mvsx, mvcn, s_meni );
- if ( bvsx > 0 )
- edtext.replace( bvsx, bvcn, s_bott );
+ edtext.replace( ixmval, ncmval, s_meni );
+ ncmval += demval;
+ ncmlin += demval;
+ if ( ixbval > 0 )
+ {
+ ixbval += demval;
+ edtext.replace( ixbval, ncbval, s_bott );
+ ixblin += demval;
+ ncbval += debval;
+ ncblin += debval;
+ }
else
{ // Must insert an entirely new line for bottom
QString bline = QString( "\n <bottom radius=\"" )
+ s_bott + QString( "\"/>" );
- edtext.insert( mlsx + mlnn, bline );
+ ixblin = ixmlin + ncmlin;
+ edtext.insert( ixblin, bline );
+ ncblin = bline .length();
+ ncbval = s_bott.length();
}
DbgLv(1) << " eupd: 3DVL replace";
}
else if ( !bott_fit )
{ // Replace meniscus value in edit
- edtext.replace( mvsx, mvcn, s_meni );
+ edtext.replace( ixmval, ncmval, s_meni );
+ ncmval += demval;
+ ncmlin += demval;
DbgLv(1) << " eupd: MENI replace";
}
else
{ // Replace bottom value in edit
- if ( bvsx > 0 )
- edtext.replace( bvsx, bvcn, s_bott );
+ if ( ixbval > 0 )
+ {
+ edtext.replace( ixbval, ncbval, s_bott );
+ ncbval += debval;
+ ncblin += debval;
+ }
else
{ // Must insert an entirely new line for bottom
QString bline = QString( "\n <bottom radius=\"" )
+ s_bott + QString( "\"/>" );
- edtext.insert( mlsx + mlnn, bline );
+ ixblin = ixmlin + ncmlin;
+ edtext.insert( ixblin, bline );
+ ncblin = bline .length();
+ ncbval = s_bott.length();
}
DbgLv(1) << " eupd: BOTT replace";
}
@@ -1239,18 +1278,18 @@
if ( have3val )
{
mmsg = mmsg + tr( "has been modified with the lines:" )
- + "\n " + edtext.mid( mlsx, mlnn )
- + "\n " + edtext.mid( blsx, blnn );
+ + "\n " + edtext.mid( ixmlin, ncmlin )
+ + "\n " + edtext.mid( ixblin, ncblin );
}
else if ( !bott_fit )
{
mmsg = mmsg + tr( "has been modified with the line:" )
- + "\n " + edtext.mid( mlsx, mlnn );
+ + "\n " + edtext.mid( ixmlin, ncmlin );
}
else
{
mmsg = mmsg + tr( "has been modified with the line:" )
- + "\n " + edtext.mid( blsx, blnn );
+ + "\n " + edtext.mid( ixblin, ncblin );
}
mmsg += tr( "\n\n%1 other cell/channel files were"
@@ -2277,12 +2316,15 @@
}
tiDesc = QString( mDesc ).replace( ".model", ".ti_noise" )
- .replace( "2DSA-FM-IT", "2DSA-FM" );
+ .replace( "2DSA-FM-IT", "2DSA-FM" )
+ .replace( "2DSA-FB-IT", "2DSA-FB" );
riDesc = QString( mDesc ).replace( ".model", ".ri_noise" )
- .replace( "2DSA-FM-IT", "2DSA-FM" );
+ .replace( "2DSA-FM-IT", "2DSA-FM" )
+ .replace( "2DSA-FB-IT", "2DSA-FB" );
itix = nieDescs.indexOf( tiDesc );
irix = nieDescs.indexOf( riDesc );
-//DbgLv(1) << "RmvMod: itix irix" << itix << irix;
+DbgLv(1) << "RmvMod: itix irix" << itix << irix
+ << "tiDesc" << tiDesc << "riDesc" << riDesc;
if ( itix >= 0 )
{ // There is a TI noise to remove
@@ -2442,6 +2484,11 @@
msetBase = msetBase.replace( "2DSA-FM-IT", "2DSA-FM" );
DbgLv(1) << "NIE: msetBase" << msetBase;
}
+ if ( msetBase.contains( "2DSA-FB-IT" ) )
+ {
+ msetBase = msetBase.replace( "2DSA-FB-IT", "2DSA-FB" );
+DbgLv(1) << "NIE: msetBase" << msetBase;
+ }
QStringList query;
QString fname;
QString noiID;
1
0
Author: gegorbet
Date: 2019-05-07 12:59:04 +0000 (Tue, 07 May 2019)
New Revision: 2758
Modified:
trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp
Log:
fit-meniscus check of meniscus,bottom values before Update Edit allowed
Modified: trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp
===================================================================
--- trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp 2019-05-07 02:22:39 UTC (rev 2757)
+++ trunk/programs/us_fit_meniscus/us_fit_meniscus.cpp 2019-05-07 12:59:04 UTC (rev 2758)
@@ -861,6 +861,8 @@
// Update an edit file with a new meniscus and/or bottom radius value
void US_FitMeniscus::edit_update( void )
{
+#define MENI_HIGHVAL 7.0
+#define BOTT_LOWVAL 7.0
QString fn = filedir + "/" + fname_edit;
DbgLv(1) << " eupd: fname_edit" << fname_edit;
DbgLv(1) << " eupd: fn" << fn;
@@ -919,7 +921,72 @@
QString s_bott = QString().sprintf( "%.5f", botnew );
DbgLv(1) << " eupd: s_meni s_bott" << s_meni << s_bott;
QString mmsg = "";
+ QString mhdr = "";
+ bool bad_vals = false;
+ // Check meniscus and bottom values for reasonableness
+ if ( mennew > MENI_HIGHVAL )
+ {
+ bad_vals = true;
+
+ if ( botnew != 0.0 && botnew < BOTT_LOWVAL )
+ {
+ mhdr = tr( "Unreasonable Meniscus and Bottom" );
+ mmsg = tr( "Both the currently selected Mensicus and\n"
+ "Bottom values" ) + " ( " + s_meni + ", "
+ + s_bott + " )\n"
+ + tr( "are unreasonable !\n\nIt is recommended"
+ " that you \"Cancel\" the \"Update Edit\"\n"
+ "and retry after setting reasonable values." );
+ }
+ else
+ {
+ mhdr = tr( "Unreasonable Meniscus" );
+ mmsg = tr( "The currently selected Mensicus value" )
+ + " ( " + s_meni + " )\n"
+ + tr( "is unreasonable !\n\nIt is recommended"
+ " that you \"Cancel\" the \"Update Edit\"\n"
+ "and retry after setting a reasonable value." );
+ }
+ }
+ else if ( botnew != 0.0 && botnew < BOTT_LOWVAL )
+ {
+ bad_vals = true;
+ mhdr = tr( "Unreasonable Bottom" );
+ mmsg = tr( "The currently selected Bottom value" )
+ + " ( " + s_bott + " )\n"
+ + tr( "is unreasonable !\n\nIt is recommended"
+ " that you \"Cancel\" the \"Update Edit\"\n"
+ "and retry after setting a reasonable value." );
+ }
+
+ if ( bad_vals )
+ {
+ int response = QMessageBox::critical( (QWidget*)this,
+ mhdr,
+ mmsg,
+ QMessageBox::Save,
+ QMessageBox::Cancel );
+
+ if ( response == QMessageBox::Cancel )
+ {
+ QMessageBox::information( (QWidget*)this,
+ tr( "Canceled" ),
+ tr( "\"Update Edit\" has been canceled!" ) );
+ return;
+ }
+ else
+ {
+ QMessageBox::information( (QWidget*)this,
+ tr( "Saving" ),
+ tr( "\"Update Edit\" will proceed!" ) );
+ }
+ }
+
+ mmsg = "";
+
+ // Proceed with updating the Edit data
+
if ( ! all_wvl || nedtfs == 1 )
{ // Apply to a single triple
QTextStream ts( &filei );
1
0