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
July 15, 2019
Author: alexey
Date: 2019-07-16 01:50:11 +0000 (Tue, 16 Jul 2019)
New Revision: 2790
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_experiment/us_exp_utils.cpp
trunk/programs/us_experiment/us_experiment_gui_optima.cpp
trunk/programs/us_experiment/us_experiment_gui_optima.h
Log:
Autoflow:
* Bug fix: when trying to submit another run while some Optima machine(s) occupied and the protocol loaded presumes use of the occupied instrument, reset instrument in use to the first available instrument and inform user of the change...
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-06 04:52:30 UTC (rev 2789)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-16 01:50:11 UTC (rev 2790)
@@ -524,13 +524,18 @@
else
{
QString list_instruments_in_use = occupied_instruments.join(", ");
- QMessageBox::warning( this, tr( "Occupied Instruments" ),
- tr( "The following Optima instrument(s) \n"
- "are currently in use: \n\n"
- "%1 \n\n"
- "You will not be able to submit another run \n"
- "to these instruments at the moment.").arg( list_instruments_in_use ) );
+ QMessageBox * msg_instr_use = new QMessageBox;
+ msg_instr_use->setIcon(QMessageBox::Information);
+ msg_instr_use->setText(tr( "The following Optima instrument(s)<br>"
+ "are currently in use: <br><br>"
+ "<b>%1</b> <br><br>"
+ "You will not be able to submit another run<br>"
+ "to these instruments at the moment." )
+ .arg( list_instruments_in_use ) );
+
+ msg_instr_use->exec();
+
define_new_experiment( occupied_instruments );
return;
}
@@ -985,6 +990,9 @@
+
+
+
// US_ExperGUI
US_ExperGui::US_ExperGui( QWidget* topw )
: US_WidgetsDialog( topw, 0 )
Modified: trunk/programs/us_experiment/us_exp_utils.cpp
===================================================================
--- trunk/programs/us_experiment/us_exp_utils.cpp 2019-07-06 04:52:30 UTC (rev 2789)
+++ trunk/programs/us_experiment/us_exp_utils.cpp 2019-07-16 01:50:11 UTC (rev 2790)
@@ -726,8 +726,31 @@
QString optima_name = QString::number( rpRotor->instID ) + ": "
+ rpRotor->instrname;
- //optima machine
- changeOptima( cb_optima->findText( optima_name ) ); //<-- Do actual connection test in changeLab();
+ qDebug() << "OPTIMA NAME in initPANEL() :" << optima_name;
+ qDebug() << "OPTIMA INDEX in initPANEL() :" << cb_optima->findText( optima_name ) ;
+
+ // optima machine
+ // IF optima_name is NOT present in the list of the available instruments (from autoflow),
+ // then use 1st available instr. with informimng user that Optima was changed
+ if( cb_optima->findText( optima_name ) < 0 )
+ {
+ changeOptima( 0 ); //<-- Do actual connection test in changeLab();
+ //Message
+ QMessageBox * msg_instr_avail = new QMessageBox;
+ msg_instr_avail->setIcon(QMessageBox::Information);
+ msg_instr_avail->setText(tr( "Loaded protocol specified <b>%1</b> as the instrument in use.<br><br>"
+ "However, due to its current unavailability, the instrument in use will be changed to the first available intrument, <b>%2</b>." )
+ .arg( rpRotor->instrname ).arg( mainw->currentInstrument[ "name" ] ));
+
+ if ( !message_instr_shown )
+ {
+ msg_instr_avail->show();
+ message_instr_shown = true;
+ }
+ }
+ else
+ changeOptima( cb_optima->findText( optima_name ) ); //<-- Do actual connection test in changeLab();
+
//setCbCurrentText( cb_optima, optima_name ); // <-- NOT ENOUGH, no connection check
//operator
@@ -2592,8 +2615,12 @@
<< have_run << have_proj << have_cells << have_solus << have_range;
proto_ena = ( have_cells && have_solus && have_optic &&
have_range );
+ // subm_enab = ( have_run && have_proj && proto_ena &&
+ // connected );
+
subm_enab = ( have_run && have_proj && proto_ena &&
- connected );
+ mainw->connection_status && // ALEXEY: use top-level connection boolean!
+ !currProto->exp_label.isEmpty() ); // ALEXEY: and label is present
ck_run ->setChecked( have_run );
ck_project ->setChecked( have_proj );
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.cpp
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-07-06 04:52:30 UTC (rev 2789)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.cpp 2019-07-16 01:50:11 UTC (rev 2790)
@@ -840,6 +840,7 @@
changeLab( curr_rotor );
savePanel();
changed = false;
+ message_instr_shown = false;
initPanel();
@@ -1012,8 +1013,10 @@
changeOperator(0);
- if ( !mainw->connection_for_instrument.contains( mainw->currentInstrument[ "name" ] ) )
- test_optima_connection();
+ // if ( !mainw->connection_for_instrument.contains( mainw->currentInstrument[ "name" ] ) )
+ // test_optima_connection();
+
+ test_optima_connection();
}
// Slot for change in ExpType selection
Modified: trunk/programs/us_experiment/us_experiment_gui_optima.h
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-07-06 04:52:30 UTC (rev 2789)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.h 2019-07-16 01:50:11 UTC (rev 2790)
@@ -138,6 +138,8 @@
void help ( void )
{ showHelp.show_help( "manual/experiment_rotor.html" ); };
+ bool message_instr_shown;
+
private:
US_ExperimentMain* mainw;
US_RunProtocol::RunProtoRotor* rpRotor; // Rotor protocol
1
0
r2789 - in trunk: gui gui/images programs/us_com_project programs/us_convert
by svn@svn.aucsolutions.com July 5, 2019
by svn@svn.aucsolutions.com July 5, 2019
July 5, 2019
Author: alexey
Date: 2019-07-06 04:52:30 +0000 (Sat, 06 Jul 2019)
New Revision: 2789
Added:
trunk/gui/images/editing.png
trunk/gui/images/import_1.png
trunk/gui/images/import_2.png
Modified:
trunk/gui/images.qrc
trunk/gui/us_images.cpp
trunk/gui/us_images.h
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_com_project/us_com_project_gui.h
trunk/programs/us_convert/us_convert_gui.cpp
Log:
Autoflow GUI: extra stage Editing added...
Added: trunk/gui/images/editing.png
===================================================================
(Binary files differ)
Index: trunk/gui/images/editing.png
===================================================================
--- trunk/gui/images/editing.png 2019-07-05 14:13:28 UTC (rev 2788)
+++ trunk/gui/images/editing.png 2019-07-06 04:52:30 UTC (rev 2789)
Property changes on: trunk/gui/images/editing.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/gui/images/import_1.png
===================================================================
(Binary files differ)
Index: trunk/gui/images/import_1.png
===================================================================
--- trunk/gui/images/import_1.png 2019-07-05 14:13:28 UTC (rev 2788)
+++ trunk/gui/images/import_1.png 2019-07-06 04:52:30 UTC (rev 2789)
Property changes on: trunk/gui/images/import_1.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/gui/images/import_2.png
===================================================================
(Binary files differ)
Index: trunk/gui/images/import_2.png
===================================================================
--- trunk/gui/images/import_2.png 2019-07-05 14:13:28 UTC (rev 2788)
+++ trunk/gui/images/import_2.png 2019-07-06 04:52:30 UTC (rev 2789)
Property changes on: trunk/gui/images/import_2.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: trunk/gui/images.qrc
===================================================================
--- trunk/gui/images.qrc 2019-07-05 14:13:28 UTC (rev 2788)
+++ trunk/gui/images.qrc 2019-07-06 04:52:30 UTC (rev 2789)
@@ -35,7 +35,10 @@
<file>images/us3-icon-48x48.png</file>
<file>images/arrow_left.png</file>
<file>images/arrow_right.png</file>
- <file>images/analysis.png</file>
+ <file>images/analysis.png</file>
+ <file>images/editing.png</file>
+ <file>images/import_1.png</file>
+ <file>images/import_2.png</file>
<file>images/analysis_2.png</file>
<file>images/report.png</file>
<file>images/live_update.png</file>
Modified: trunk/gui/us_images.cpp
===================================================================
--- trunk/gui/us_images.cpp 2019-07-05 14:13:28 UTC (rev 2788)
+++ trunk/gui/us_images.cpp 2019-07-06 04:52:30 UTC (rev 2789)
@@ -74,8 +74,11 @@
{ ARROW_RIGHT, "arrow_right" },
{ SETUP_COM, "setup" },
{ ANALYSIS_COM, "analysis" },
+ { EDITING_COM, "editing" },
{ ANALYSIS_COM_2, "analysis_2" },
{ LIVE_UPDATE_COM, "live_update" },
+ { IMPORT_COM_1, "import_1" },
+ { IMPORT_COM_2, "import_2" },
{ REPORT_COM, "report" },
{ NEW_ITEM_COM, "new_item2" }
};
Modified: trunk/gui/us_images.h
===================================================================
--- trunk/gui/us_images.h 2019-07-05 14:13:28 UTC (rev 2788)
+++ trunk/gui/us_images.h 2019-07-06 04:52:30 UTC (rev 2789)
@@ -57,7 +57,8 @@
MESH_POLYGON, MESH_SCATTERED, MESH_WIRE,
MOVIE, SAVE_CONTENT, ICON_PROP,
QWTPLOT, US3_ICON, ARROW_LEFT, ARROW_RIGHT,
- SETUP_COM, ANALYSIS_COM, ANALYSIS_COM_2, LIVE_UPDATE_COM, NEW_ITEM_COM, REPORT_COM
+ SETUP_COM, ANALYSIS_COM, EDITING_COM, ANALYSIS_COM_2,
+ IMPORT_COM_1, IMPORT_COM_2, LIVE_UPDATE_COM, NEW_ITEM_COM, REPORT_COM
};
//! \brief Get image (embedded or from file) as a pixmap
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-05 14:13:28 UTC (rev 2788)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-07-06 04:52:30 UTC (rev 2789)
@@ -94,7 +94,7 @@
// Add panels to the tab widget
tabWidget->addTab( epanExp, tr( "1: Experiment" ) );
tabWidget->addTab( epanObserv, tr( "2: Live Update" ) );
- tabWidget->addTab( epanPostProd, tr( "3: Editing" ) );
+ tabWidget->addTab( epanPostProd, tr( "3: LIMS Import" ) );
// tabWidget->addTab( epanAnalysis, tr( "4: Analysis" ) );
// tabWidget->addTab( epanReport, tr( "5: Report" ) );
@@ -110,7 +110,7 @@
tabWidget->setTabIcon( 0, US_Images::getIcon( US_Images::SETUP_COM ) );
tabWidget->setTabIcon( 1, US_Images::getIcon( US_Images::LIVE_UPDATE_COM ) );
- tabWidget->setTabIcon( 2, US_Images::getIcon( US_Images::ANALYSIS_COM ) );
+ tabWidget->setTabIcon( 2, US_Images::getIcon( US_Images::IMPORT_COM_1 ) );
// tabWidget->setTabIcon( 3, US_Images::getIcon( US_Images::ANALYSIS_COM_2 ) );
// tabWidget->setTabIcon( 4, US_Images::getIcon( US_Images::REPORT_COM ) );
@@ -230,6 +230,7 @@
epanExp = new US_ExperGui ( this );
epanObserv = new US_ObservGui ( this );
epanPostProd = new US_PostProdGui( this );
+ epanEditing = new US_EditingGui ( this );
epanAnalysis = new US_AnalysisGui( this );
epanReport = new US_ReportGui ( this );
@@ -238,9 +239,10 @@
// Add panels to the tab widget
tabWidget->addTab( epanExp, tr( "1: Experiment" ) );
tabWidget->addTab( epanObserv, tr( "2: Live Update" ) );
- tabWidget->addTab( epanPostProd, tr( "3: Editing" ) );
- tabWidget->addTab( epanAnalysis, tr( "4: Analysis" ) );
- tabWidget->addTab( epanReport, tr( "5: Report" ) );
+ tabWidget->addTab( epanPostProd, tr( "3: LIMS Import" ) );
+ tabWidget->addTab( epanEditing, tr( "4: Editing" ) );
+ tabWidget->addTab( epanAnalysis, tr( "5: Analysis" ) );
+ tabWidget->addTab( epanReport, tr( "6: Report" ) );
tabWidget->setCurrentIndex( curr_panx );
tabWidget->tabBar()->setFixedHeight(500);
@@ -254,9 +256,10 @@
tabWidget->setTabIcon( 0, US_Images::getIcon( US_Images::SETUP_COM ) );
tabWidget->setTabIcon( 1, US_Images::getIcon( US_Images::LIVE_UPDATE_COM ) );
- tabWidget->setTabIcon( 2, US_Images::getIcon( US_Images::ANALYSIS_COM ) );
- tabWidget->setTabIcon( 3, US_Images::getIcon( US_Images::ANALYSIS_COM_2 ) );
- tabWidget->setTabIcon( 4, US_Images::getIcon( US_Images::REPORT_COM ) );
+ tabWidget->setTabIcon( 2, US_Images::getIcon( US_Images::IMPORT_COM_1 ) );
+ tabWidget->setTabIcon( 3, US_Images::getIcon( US_Images::EDITING_COM ) );
+ tabWidget->setTabIcon( 4, US_Images::getIcon( US_Images::ANALYSIS_COM_2 ) );
+ tabWidget->setTabIcon( 5, US_Images::getIcon( US_Images::REPORT_COM ) );
tabWidget->tabBar()->setIconSize(QSize(50,50));
@@ -294,8 +297,8 @@
connect( this, SIGNAL( clear_experiment( QString & ) ), epanExp, SLOT( clear_experiment( QString & ) ) );
connect( epanObserv, SIGNAL( close_everything() ), this, SLOT( close_all() ));
- connect( epanPostProd, SIGNAL( switch_to_analysis( QString &, QString &) ), this, SLOT( switch_to_analysis( QString &, QString & ) ) );
- connect( this, SIGNAL( pass_to_analysis( QString &, QString & ) ), epanAnalysis, SLOT( do_analysis( QString &, QString & ) ) );
+ connect( epanPostProd, SIGNAL( switch_to_editing( QString &, QString &) ), this, SLOT( switch_to_editing( QString &, QString & ) ) );
+ connect( this, SIGNAL( pass_to_editing( QString &, QString & ) ), epanEditing, SLOT( do_editing( QString &, QString & ) ) );
connect( epanPostProd, SIGNAL( switch_to_exp( QString & ) ), this, SLOT( switch_to_experiment( QString & ) ) );
setMinimumSize( QSize( 1350, 800 ) );
@@ -970,14 +973,14 @@
}
-// Slot to switch from the Editing to Analysis tab
-void US_ComProjectMain::switch_to_analysis( QString & currDir, QString & protocolName)
+// Slot to switch from the Import to Editing tab
+void US_ComProjectMain::switch_to_editing( QString & currDir, QString & protocolName)
{
tabWidget->setCurrentIndex( 3 ); // Maybe lock this panel from now on? i.e. tabWidget->tabBar()-setEnabled(false) ??
// ALEXEY: Make a record to 'autoflow' table: stage# = 3;
- emit pass_to_analysis( currDir, protocolName );
+ emit pass_to_editing( currDir, protocolName );
}
@@ -1384,8 +1387,8 @@
//connect( this, SIGNAL( to_post_prod( QString &, QString &, QString &, QString & ) ), sdiag, SLOT( import_data_auto ( QString &, QString &, QString &, QString & ) ) );
connect( this, SIGNAL( to_post_prod( QMap < QString, QString > & ) ), sdiag, SLOT( import_data_auto ( QMap < QString, QString > & ) ) );
- //ALEXEY: switch to Analysis
- connect( sdiag, SIGNAL( saving_complete_auto( QString &, QString & ) ), this, SLOT( to_analysis ( QString &, QString &) ) );
+ //ALEXEY: switch to Editing
+ connect( sdiag, SIGNAL( saving_complete_auto( QString &, QString & ) ), this, SLOT( to_editing ( QString &, QString &) ) );
//ALEXEY: for academic ver. switch back to experiment
connect( sdiag, SIGNAL( saving_complete_back_to_exp( QString & ) ), this, SLOT( to_experiment ( QString & ) ) );
@@ -1411,9 +1414,9 @@
emit to_post_prod( protocol_details );
}
-void US_PostProdGui::to_analysis( QString & currDir, QString & protocolName )
+void US_PostProdGui::to_editing( QString & currDir, QString & protocolName )
{
- emit switch_to_analysis( currDir, protocolName );
+ emit switch_to_editing( currDir, protocolName );
}
void US_PostProdGui::to_experiment( QString & protocolName )
@@ -1453,9 +1456,55 @@
+// US_Editing
+US_EditingGui::US_EditingGui( QWidget* topw )
+ : US_WidgetsDialog( topw, 0 )
+{
+ mainw = (US_ComProjectMain*)topw;
+ setPalette( US_GuiSettings::frameColor() );
+ QFont sfont( US_GuiSettings::fontFamily(), US_GuiSettings::fontSize() - 1 );
+ QFontMetrics fmet( sfont );
+ //int fwid = fmet.maxWidth();
+ //int lwid = fwid * 4;
+ //int swid = lwid + fwid;
+
+ // Main VBox
+ QVBoxLayout* main = new QVBoxLayout (this);
+ main->setSpacing ( 2 );
+ main->setContentsMargins( 2, 2, 2, 2 );
+
+ QGridLayout* genL = new QGridLayout();
+ // //QPlainTextEdit* panel_desc = new QPlainTextEdit(this);
+ QTextEdit* panel_desc = new QTextEdit(this);
+ panel_desc->viewport()->setAutoFillBackground(false);
+ panel_desc->setFrameStyle(QFrame::NoFrame);
+ panel_desc->setPlainText(" Tab to Edit Experimental Data... ---UNDER CONSTRUCTION--- ");
+ panel_desc->setReadOnly(true);
+ //panel_desc->setMaximumHeight(30);
+ QFontMetrics m (panel_desc -> font()) ;
+ int RowHeight = m.lineSpacing() ;
+ panel_desc -> setFixedHeight (2* RowHeight) ;
+ int row = 0;
+ genL->addWidget( panel_desc, row++, 0, 1, 12);
+
+ // assemble main
+ main->addLayout(genL);
+ main->addStretch();
+
+ // //Later - do actual editing form sdiag - whatever it will be: (us_edit.cpp)
+ // connect( this, SIGNAL( start_editing( QString &, QString & ) ), sdiag, SLOT( edit_auto ( QString &, QString & ) ) );
+
+}
+
+void US_EditingGui::do_editing( QString & currDir, QString & protocolName )
+{
+ emit start_editing( currDir, protocolName );
+}
+
+
// US_Analysis
US_AnalysisGui::US_AnalysisGui( QWidget* topw )
: US_WidgetsDialog( topw, 0 )
@@ -1508,7 +1557,6 @@
-
// US_Report
US_ReportGui::US_ReportGui( QWidget* topw )
: US_WidgetsDialog( topw, 0 )
Modified: trunk/programs/us_com_project/us_com_project_gui.h
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.h 2019-07-05 14:13:28 UTC (rev 2788)
+++ trunk/programs/us_com_project/us_com_project_gui.h 2019-07-06 04:52:30 UTC (rev 2789)
@@ -157,17 +157,43 @@
//void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void import_data_us_convert( QMap < QString, QString > &);
- void to_analysis( QString & currDir, QString & protocolName );
+ void to_editing( QString & currDir, QString & protocolName );
void to_experiment( QString & protocolName );
signals:
//void to_post_prod( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void to_post_prod( QMap < QString, QString > & );
- void switch_to_analysis( QString & currDir, QString & protocolName );
+ void switch_to_editing( QString & currDir, QString & protocolName );
void switch_to_exp( QString & protocolName );
};
+
+//! \brief Editing panel
+class US_EditingGui : public US_WidgetsDialog
+{
+ Q_OBJECT
+
+ public:
+ US_EditingGui( QWidget* );
+ ~US_EditingGui() {};
+
+
+ private:
+ US_ComProjectMain* mainw; // Parent to all panels
+ int offset;
+
+ protected:
+ //void resizeEvent(QResizeEvent *event) override;
+
+ private slots:
+ void do_editing( QString & currDir, QString & protocolName );
+
+ signals:
+ void start_editing( QString & currDir, QString & protocolName );
+
+};
+
//! \brief Analysis panel
class US_AnalysisGui : public US_WidgetsDialog
{
@@ -249,6 +275,7 @@
US_ExperGui* epanExp; // US_Exp panel
US_ObservGui* epanObserv; // US_Observ panel
US_PostProdGui* epanPostProd; // US_PostProd panel
+ US_EditingGui* epanEditing; // US_Editing panel
US_AnalysisGui* epanAnalysis; // US_Analysis panel
US_ReportGui* epanReport; // US_Report panel
@@ -278,7 +305,7 @@
//void switch_to_post_processing( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void switch_to_post_processing( QMap < QString, QString > & );
- void switch_to_analysis( QString & currDir, QString & protocolName );
+ void switch_to_editing( QString & currDir, QString & protocolName );
void switch_to_experiment( QString & protocolName );
//void check_current_stage( void );
void close_all( void );
@@ -295,7 +322,7 @@
//void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed, QString & correctRadii );
void import_data_us_convert( QMap < QString, QString > & );
- void pass_to_analysis( QString & currDir, QString & protocolName );
+ void pass_to_editing( QString & currDir, QString & protocolName );
void clear_experiment( QString & protocolName);
void us_comproject_closed( void );
void pass_used_instruments( QStringList & );
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-07-05 14:13:28 UTC (rev 2788)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-07-06 04:52:30 UTC (rev 2789)
@@ -5093,7 +5093,7 @@
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." ) );
+ "The program will switch to Editing stage." ) );
// Either emit ONLY if not US_MODE, or do NOT connect with slot on us_comproject...
resetAll_auto();
1
0
r2788 - in trunk: gui programs/us_2dsa programs/us_convert programs/us_experiment programs/us_fematch utils
by svn@svn.aucsolutions.com July 5, 2019
by svn@svn.aucsolutions.com July 5, 2019
July 5, 2019
Author: gegorbet
Date: 2019-07-05 14:13:28 +0000 (Fri, 05 Jul 2019)
New Revision: 2788
Modified:
trunk/gui/us_solution_gui.cpp
trunk/programs/us_2dsa/us_2dsa.cpp
trunk/programs/us_convert/us_convert.cpp
trunk/programs/us_convert/us_convert.h
trunk/programs/us_convert/us_convert_gui.cpp
trunk/programs/us_convert/us_convert_gui.h
trunk/programs/us_experiment/us_exp_utils.cpp
trunk/programs/us_fematch/us_fematch.cpp
trunk/utils/us_astfem_math.cpp
trunk/utils/us_astfem_math.h
trunk/utils/us_simparms.cpp
Log:
import (convert) option w low accel rate to adjust speed step, plus general accel-adjust options, including for 3krpm leak test cases
Modified: trunk/gui/us_solution_gui.cpp
===================================================================
--- trunk/gui/us_solution_gui.cpp 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/gui/us_solution_gui.cpp 2019-07-05 14:13:28 UTC (rev 2788)
@@ -816,7 +816,7 @@
// Let's calculate if we're eligible to save this solution
//pb_save -> setEnabled( false );
-DbgLv(1) << "We are at RESET_1: ";
+DbgLv(1) << "We are at RESET_1: aInf count" << solution->analyteInfo.count();
if ( ! bufferDesc.isEmpty() ) //we can have a solution with buffer only
{
@@ -840,6 +840,7 @@
lw_analytes->addItem( item );
}
+DbgLv(1) << "We are at RESET_2: aInf count" << solution->analyteInfo.count() << ai.size();
// Turn the red label back
//QPalette p = lb_amount->palette();
@@ -872,14 +873,21 @@
// : "";
// le_investigator->setText( number + US_Settings::us_inv_name() );
+DbgLv(1) << "We are at RESET_9: aInf count" << solution->analyteInfo.count() << ai.size();
}
// Function to handle when solution listwidget item is selected
void US_SolutionMgrSelect::selectAnalyte( QListWidgetItem* item )
{
+qDebug() << "Sol:SselAna: IN";
// Get the right index in the sorted list, and load the amount
+qDebug() << "Sol:SselAna: aMap count" << analyteMap.size();
int ndx = analyteMap[ item ];
+qDebug() << "Sol:SselAna: ndx" << ndx;
+qDebug() << "Sol:SselAna: aInf count" << solution->analyteInfo.size();
+qDebug() << "Sol:SselAna: amt" << solution->analyteInfo[ ndx ].amount;
le_amount ->setText( QString::number( solution->analyteInfo[ ndx ].amount ) );
+qDebug() << "Sol:SselAna: amt" << le_amount->text();
QPalette p = lb_amount->palette();
p.setColor( QPalette::WindowText, Qt::red );
@@ -1290,8 +1298,11 @@
// Function to handle when solution listwidget item is selected
void US_SolutionMgrNew::selectAnalyte( QListWidgetItem* item )
{
+qDebug() << "Sol:NselAna: IN";
// Get the right index in the sorted list, and load the amount
+qDebug() << "Sol:NselAna: aMap count" << analyteMap.size();
int ndx = analyteMap[ item ];
+qDebug() << "Sol:NselAna: ndx" << ndx;
ct_amount ->setValue( solution->analyteInfo[ ndx ].amount );
// Now turn the label red to catch attention
Modified: trunk/programs/us_2dsa/us_2dsa.cpp
===================================================================
--- trunk/programs/us_2dsa/us_2dsa.cpp 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/programs/us_2dsa/us_2dsa.cpp 2019-07-05 14:13:28 UTC (rev 2788)
@@ -1125,7 +1125,7 @@
<< rspeed << accel1 << tf_aend << tf_scan
<< "accel2" << accel2 << "lo_ss_acc" << lo_ss_acc;
//x0 1 2 3 4 5
- if ( accel1 < lo_ss_acc || tf_aend > ( tf_scan - 6 ) )
+ if ( accel1 < lo_ss_acc || tf_aend > ( tf_scan - 3 ) )
{
QString wmsg = tr( "The TimeState used is likely bad:<br/>"
"The acceleration implied is %1 rpm/sec.<br/>"
Modified: trunk/programs/us_convert/us_convert.cpp
===================================================================
--- trunk/programs/us_convert/us_convert.cpp 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/programs/us_convert/us_convert.cpp 2019-07-05 14:13:28 UTC (rev 2788)
@@ -1062,3 +1062,103 @@
if ( excluded ) qDebug() << "excluded";
}
+
+// Adjusts times and omegas in AUCs and speedsteps so that
+// the first speed step acceleration is 400 rpm/second.
+int US_Convert::adjustSpeedstep( QVector< US_DataIO::RawData >& allData,
+ QVector< US_SimulationParameters::SpeedProfile >& speedsteps )
+{
+ int stat = 0;
+
+ // Re-check that there is a problem with low acceleration.
+ // [ See comments for US_AstfemMath::low_acceleration() ]
+ const double tfac = ( 4.0 / 3.0 );
+ double t2 = speedsteps[ 0 ].time_first;
+ double w2t = speedsteps[ 0 ].w2t_first;
+ double om1t = speedsteps[ 0 ].rotorspeed * M_PI / 30.0;
+ double w2 = sq( om1t );
+ double t1w = w2t / w2;
+ double t1 = tfac * ( t2 - t1w );
+
+ if ( t1 >= t2 )
+ { // Something wrong! set t1 to a few seconds before t2
+ t1 = t2 - 5.0;
+ }
+
+ int t_acc = (int)qRound( t1 );
+ t1 = (double)t_acc;
+ double rate = (double)( speedsteps[ 0 ].rotorspeed ) / t1;
+qDebug() << "CVT:Adj: t_acc rate" << t_acc << rate;
+
+ if ( rate >= 250.0 )
+ { // No adjustment will be done, since acceleration is large enough.
+ return 1;
+ }
+
+ // Determine time and omega offsets. A "t0" value is initially time-zero,
+ // the beginning of the first acceleration zone. Using an acceleration
+ // of 400.0 rpm/second, a new zone start is determined and that becomes
+ // the time offset to subtract from all AUC and speedstep times. The
+ // omega^2t offset is based on the value at the new zone start.
+ double azdur = (double)qRound( speedsteps[ 0 ].rotorspeed / 400.0 );
+ double t_offs = t1 - azdur;
+ double azwrate = sq( rate * M_PI / 30.0 );
+ double w_offs = w2t - ( w2 * ( t2 - t1 ) ) - ( azwrate * azdur );
+qDebug() << "CVT:Adj: azdur azwrate" << azdur << azwrate << "t_offs w_offs"
+ << t_offs << w_offs;
+
+ for ( int ii = 0; ii < allData.count(); ii++ )
+ { // Adjust scan times,omegas so t0 is zero
+ US_DataIO::RawData* rdata = &allData[ ii ];
+ for ( int jj = 0; jj < rdata->scanCount(); jj++ )
+ {
+qDebug() << "CVT:Adj: t w" << rdata->scanData[ jj ].seconds
+ << rdata->scanData[ jj ].omega2t << "ii jj" << ii << jj;
+ rdata->scanData[ jj ].seconds -= t_offs;
+ rdata->scanData[ jj ].omega2t -= w_offs;
+qDebug() << "CVT:Adj: new t w" << rdata->scanData[ jj ].seconds
+ << rdata->scanData[ jj ].omega2t;
+ }
+ }
+
+ for ( int ii = 0; ii < speedsteps.count(); ii++ )
+ { // Adjust speed step times,omegas
+qDebug() << "CVT:Adj: tf tl" << speedsteps[ii].time_first
+ << speedsteps[ii].time_last << "wf wl" << speedsteps[ii].w2t_first
+ << speedsteps[ii].w2t_last;
+ speedsteps[ ii ].time_first -= t_offs;
+ speedsteps[ ii ].w2t_first -= w_offs;
+ speedsteps[ ii ].time_last -= t_offs;
+ speedsteps[ ii ].w2t_last -= w_offs;
+ speedsteps[ ii ].acceleration = 400;
+qDebug() << "CVT:Adj: new tf tl" << speedsteps[ii].time_first
+ << speedsteps[ii].time_last << "wf wl" << speedsteps[ii].w2t_first
+ << speedsteps[ii].w2t_last;
+
+ if ( ii == 0 )
+ { // For 1st step, adjust duration and delay-to-1st-scan
+ double dur_sec = speedsteps[ ii ].duration_hours * 3600
+ + speedsteps[ ii ].duration_minutes * 60.0
+ - t_offs;
+ double dur_min = dur_sec / 60.0;
+ int dur_hrs = (int)( dur_min / 60.0 );
+ dur_min = dur_min - ( dur_hrs * 60 );
+ speedsteps[ ii ].duration_hours = dur_hrs;
+ speedsteps[ ii ].duration_minutes = dur_min;
+ double dly_sec = speedsteps[ ii ].delay_hours * 3600
+ + speedsteps[ ii ].delay_minutes * 60.0
+ - t_offs;
+ double dly_min = dly_sec / 60.0;
+ int dly_hrs = (int)( dly_min / 60.0 );
+ dly_min = dly_min - ( dly_hrs * 60 );
+ speedsteps[ ii ].delay_hours = dly_hrs;
+ speedsteps[ ii ].delay_minutes = dly_min;
+qDebug() << "CVT:Adj: new dur" << speedsteps[ii].duration_hours
+ << speedsteps[ii].duration_minutes << "new dly" << speedsteps[ii].delay_hours
+ << speedsteps[ii].delay_minutes;
+ }
+ }
+
+ return stat;
+}
+
Modified: trunk/programs/us_convert/us_convert.h
===================================================================
--- trunk/programs/us_convert/us_convert.h 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/programs/us_convert/us_convert.h 2019-07-05 14:13:28 UTC (rev 2788)
@@ -5,6 +5,7 @@
#include "us_extern.h"
#include "us_dataIO.h"
#include "us_solution.h"
+#include "us_simparms.h"
//! \class US_Convert
//! This class provides the ability to convert raw data in the
@@ -173,6 +174,14 @@
int ,
QList< double >& );
+ //! \brief Adjusts times and omegas in AUC and speedstep so that
+ //! the first speed step acceleration is 400 rpm/second.
+ //! \param allData Input/Output raw AUC data
+ //! \param speedsteps Input/Output speed step profile
+ //! \returns A status code (0=OK)
+ static int adjustSpeedstep( QVector< US_DataIO::RawData >& ,
+ QVector< US_SimulationParameters::SpeedProfile >& );
+
private:
static void convert( QList< US_DataIO::BeckmanRawScan >& rawLegacyData,
US_DataIO::RawData& newRawData,
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-07-05 14:13:28 UTC (rev 2788)
@@ -1309,7 +1309,7 @@
gmpRun_bool = true;
- int impType = getImports_auto( details_at_live_update[ "dataPath" ] );
+ impType = getImports_auto( details_at_live_update[ "dataPath" ] );
/* -------------------------------------------------------------------------------------------------------------------*/
@@ -1486,7 +1486,7 @@
// User pressed the import data button
void US_ConvertGui::import()
{
- int impType = getImports();
+ impType = getImports();
if ( impType == 1 )
{
@@ -2325,7 +2325,6 @@
}
-
// This can go on the todo list, but should not prevent user from saving
if ( ( runType == "RI" ) && ( ! referenceDefined ) )
{
@@ -2334,13 +2333,12 @@
tr( ": Define reference scans" ) );
if ( count == 1 )
- {
- pb_reference->setEnabled( true );
- //ALEXEY <--- Save btn is disabled when Reference scan is NOT defined (for Absorbance)
-
- if ( ! ExpData.expType.contains( "calibrat", Qt::CaseInsensitive ) )
- completed = false;
- }
+ {
+ pb_reference->setEnabled( true );
+ //ALEXEY <--- Save btn is disabled when Reference scan is NOT defined (for Absorbance)
+ if ( ! ExpData.expType.contains( "calibrat", Qt::CaseInsensitive ) )
+ completed = false;
+ }
}
// If we made it here, user can save
@@ -5772,7 +5770,7 @@
int US_ConvertGui::getImports_auto( QString & CurrDir) // ALEXEY TO BE EDITED...
{
QString dir;
- int impType = 0;
+ int jmpType = 0;
// dir = QFileDialog::getExistingDirectory( this,
// tr( "Raw Data Directory" ),
@@ -5864,16 +5862,16 @@
<< nmwrs << nauc << ntxml << ntmst << nother;
if ( nmwrs > 0 )
- impType = 1; // Flag import of MWL data
+ jmpType = 1; // Flag import of MWL data
else if ( nauc > 0 )
- impType = 2; // Flag import of AUC data
+ jmpType = 2; // Flag import of AUC data
else
- impType = 0; // Flag import of Beckman Raw
+ jmpType = 0; // Flag import of Beckman Raw
-DbgLv(1) << "CGui:gI: RTN impType" << impType;
- return impType;
+DbgLv(1) << "CGui:gI: RTN jmpType" << jmpType;
+ return jmpType;
}
@@ -5881,7 +5879,7 @@
int US_ConvertGui::getImports()
{
QString dir;
- int impType = 0;
+ int jmpType = 0;
dir = QFileDialog::getExistingDirectory( this,
tr( "Raw Data Directory" ),
@@ -5971,16 +5969,16 @@
<< nmwrs << nauc << ntxml << ntmst << nother;
if ( nmwrs > 0 )
- impType = 1; // Flag import of MWL data
+ jmpType = 1; // Flag import of MWL data
else if ( nauc > 0 )
- impType = 2; // Flag import of AUC data
+ jmpType = 2; // Flag import of AUC data
else
- impType = 0; // Flag import of Beckman Raw
+ jmpType = 0; // Flag import of Beckman Raw
-DbgLv(1) << "CGui:gI: RTN impType" << impType;
- return impType;
+DbgLv(1) << "CGui:gI: RTN jmpType" << jmpType;
+ return jmpType;
}
bool US_ConvertGui::read( void )
@@ -6826,6 +6824,8 @@
int nspeed = US_SimulationParameters::readSpeedSteps( runID, dataType,
speedsteps );
int nspeedc = 0;
+ bool low_accel = false;
+ double rate = 400.0;
DbgLv(1) << "CGui:IOD: rSS nspeed" << nspeed;
if ( nspeed == 0 )
@@ -6833,9 +6833,58 @@
US_SimulationParameters::computeSpeedSteps( allData, speedsteps );
nspeedc = speedsteps.size();
nspeed = nspeedc;
- }
DbgLv(1) << "CGui:IOD: cSS nspeed" << speedsteps.size();
+ // Check to see if implied 1st acceleration is too low
+#define DSS_LO_ACC 250.0 // default SetSpeedLowAccel
+ if ( impType != 2 ) // Check if not imported AUC
+ {
+ QString dbgval = US_Settings::debug_value( "SetSpeedLowAcc" );
+ double ss_lo_acc = dbgval.isEmpty() ? DSS_LO_ACC : dbgval.toDouble();
+ low_accel = US_AstfemMath::low_acceleration( speedsteps, ss_lo_acc, rate );
+ }
+ }
+
+ // Report problematic 1st speed step
+ if ( low_accel )
+ {
+ int tf_scan = speedsteps[ 0 ].time_first;
+ int accel1 = (int)qRound( rate );
+ int rspeed = speedsteps[ 0 ].rotorspeed;
+ int tf_aend = ( rspeed + accel1 - 1 ) / accel1;
+
+ QString wmsg = tr( "The SpeedStep computed/used is likely bad:<br/>"
+ "The acceleration implied is %1 rpm/sec.<br/>"
+ "The acceleration zone ends at %2 seconds,<br/>"
+ "with a first scan time of %3 seconds.<br/><br/>"
+ "<b>You should rerun the experiment without<br/>"
+ "any interim constant speed, and then<br/>"
+ "you should reimport the data.</b>" )
+ .arg( accel1 ).arg( tf_aend ).arg( tf_scan );
+
+ QMessageBox msgBox( this );
+ msgBox.setWindowTitle( tr( "Bad TimeState Implied!" ) );
+ msgBox.setTextFormat( Qt::RichText );
+ msgBox.setText( wmsg );
+ msgBox.addButton( tr( "Continue" ), QMessageBox::RejectRole );
+ QPushButton* bAbort = msgBox.addButton( tr( "Abort" ),
+ QMessageBox::YesRole );
+ msgBox.setDefaultButton( bAbort );
+ msgBox.exec();
+ if ( msgBox.clickedButton() == bAbort )
+ { // Abort the import of this data
+ QApplication::restoreOverrideCursor();
+ qApp->processEvents();
+ reset();
+ return false;
+ }
+ else
+ { // Modify times and omegas of this data, then proceed to import
+ int status = US_Convert::adjustSpeedstep( allData, speedsteps );
+DbgLv(1) << "CGui:IOD: adjSS stat" << status;
+ }
+ }
+
// MultiWaveLength if channels and triples counts differ
isMwl = ( all_chaninfo.count() != all_tripinfo.count() );
if ( isMwl && ( all_tripinfo.count() / all_chaninfo.count() ) < 4 )
@@ -7219,3 +7268,4 @@
reset_lambdas(); // Make sure internal MWL lambdas are right
}
+
Modified: trunk/programs/us_convert/us_convert_gui.h
===================================================================
--- trunk/programs/us_convert/us_convert_gui.h 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/programs/us_convert/us_convert_gui.h 2019-07-05 14:13:28 UTC (rev 2788)
@@ -243,6 +243,7 @@
int elambda; // End Lambda on output
int nlamb_i; // Lambda count for raw input
int dbg_level; // Debug level
+ int impType; // Import type flag: 0,1,2 == Beck,MWL,AUC
QString currentDir; // Current data file directory
QString saveDescription; // Saved channel description
Modified: trunk/programs/us_experiment/us_exp_utils.cpp
===================================================================
--- trunk/programs/us_experiment/us_exp_utils.cpp 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/programs/us_experiment/us_exp_utils.cpp 2019-07-05 14:13:28 UTC (rev 2788)
@@ -905,14 +905,14 @@
{
US_Rotor::AbstractRotor* arotor = abstractRotor( rpRotor->rotor );
value = ( arotor != NULL ) ? arotor->numHoles : 0;
-DbgLv(1) << "EGRo:gIV: arotor" << arotor->name << "value" << value;
+DbgLv(1) << "EGRo:gIV: arotor" << getSValue("arotor") << "value" << value;
}
else if ( type == "maxrpm" )
{
US_Rotor::AbstractRotor* arotor = abstractRotor( rpRotor->rotor );
DbgLv(1) << "EGRo:gIV: arotor" << arotor << "rotor" << rpRotor->rotor;
value = ( arotor != NULL ) ? arotor->maxRPM : 50000;
-DbgLv(1) << "EGRo:gIV: arotor" << arotor->name << "value" << value;
+DbgLv(1) << "EGRo:gIV: arotor" << getSValue("arotor") << "value" << value;
}
else if ( type == "labID" ) { value = rpRotor->labID; }
else if ( type == "rotID" ) { value = rpRotor->rotID; }
Modified: trunk/programs/us_fematch/us_fematch.cpp
===================================================================
--- trunk/programs/us_fematch/us_fematch.cpp 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/programs/us_fematch/us_fematch.cpp 2019-07-05 14:13:28 UTC (rev 2788)
@@ -1856,6 +1856,7 @@
solution.manual = manual;
solution.vbar20 = vbar20;
solution.vbar = US_Math2::calcCommonVbar( solution_rec, avgTemp );
+// solution.vbar = US_Math2::adjust_vbar20( solution.vbar20, avgTemp );
US_Math2::data_correction( avgTemp, solution );
@@ -1872,6 +1873,7 @@
sd.vbar20 = solution.vbar20;
sd.vbar = solution.vbar;
sd.manual = solution.manual;
+DbgLv(1) << "Fem:Adj: avgT" << avgTemp << "scorr dcorr" << scorrec << dcorrec;
if ( cnstvb && mc_vbar != sd.vbar20 && mc_vbar != 0.0 )
{ // Use vbar from the model component, instead of from the solution
@@ -1880,6 +1882,7 @@
US_Math2::data_correction( avgTemp, sd );
scorrec = sd.s20w_correction;
dcorrec = sd.D20w_correction;
+DbgLv(1) << "Fem:Adj: cnstvb" << cnstvb << " scorr dcorr" << scorrec << dcorrec;
}
DbgLv(1) << "Fem:Adj: avgT" << avgTemp << "vb20 vb" << sd.vbar20 << sd.vbar;
@@ -1905,7 +1908,7 @@
sc->s /= scorrec;
sc->D /= dcorrec;
DbgLv(1) << "Fem:Adj: s20w D20w" << s20w << d20w
- << "s D" << sc->s << sc->D << " jj" << jj;
+ << "s D" << sc->s << sc->D << " jj" << jj << "vb20 vb" << sc->vbar20 << sd.vbar;
if ( sc->extinction > 0.0 )
sc->molar_concentration = sc->signal_concentration / sc->extinction;
@@ -2209,7 +2212,7 @@
<< rspeed << accel1 << lo_ss_acc << "tf_aend tf_scan"
<< tf_aend << tf_scan;
//x0 1 2 3 4 5
- if ( accel1 < lo_ss_acc || tf_aend > ( tf_scan - 6 ) )
+ if ( accel1 < lo_ss_acc || tf_aend > ( tf_scan - 3 ) )
{
QString wmsg = tr( "The TimeState computed/used is likely bad:<br/>"
"The acceleration implied is %1 rpm/sec.<br/>"
Modified: trunk/utils/us_astfem_math.cpp
===================================================================
--- trunk/utils/us_astfem_math.cpp 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/utils/us_astfem_math.cpp 2019-07-05 14:13:28 UTC (rev 2788)
@@ -6,8 +6,8 @@
#ifndef DbgLv
#define DbgLv(a) if(dbg_level>=a)qDebug() //!< debug-level-conditioned qDebug()
#endif
+#define DSS_LO_ACC 250.0 // default SetSpeedLowAccel
-
#if 0
#ifdef NO_DB
#include <mpi.h>
@@ -52,8 +52,9 @@
int step_nbr = 0;
double temperature = sim_data.scanData[ 0 ].temperature;
int nscans = sim_data.scanData.size(); // Used for number of scans
- int t_acc; // Used for time when accelerated up to the specified rotor speed
- double rate, speed;
+ int t_acc = 1; // Used for time when accelerated up to the specified rotor speed
+ double rate = 1.0;
+ double speed = 1000.0;
int ss_reso = 100;
// If debug_text so directs, change set_speed_resolution
QStringList dbgtxt = US_Settings::debug_text();
@@ -79,53 +80,15 @@
if ( simparams.sim == false )
{ // Handle 1st acceleration zone for real data (compute acceleration rate)
- const double tfac = ( 4.0 / 3.0 );
- double t2 = simparams.speed_step[ 0 ].time_first;
- double w2t = simparams.speed_step[ 0 ].w2t_first;
- double om1t = simparams.speed_step[ 0 ].rotorspeed * M_PI / 30.0;
- double w2 = sq( om1t );
- // For the first speed step, we compute "t1", the end of the initial
- // acceleration zone, using
- // "t2" , the time in seconds for the first scan;
- // "w2t" , the omega^2_t integral for the first scan time;
- // "w2" , the omega^2 value for the constant zone speed;
- // "tfac" , a factor (==(4/3)==1.333333) derived from the following.
- // The acceleration zone begins at t0=0.0.
- // It ends at time "t1".
- // The time between t1 and t2 is at constant speed.
- // The time between 0 and t1 is at changing speeds averaging (rpm/2).
- // For I1 and I2, the omega^2t integrals at t1 and t2,
- // ( I2 - I1 ) = ( t2 - t1 ) * w2 (equ.1)
- // I1 = ( (rpm/2) * PI / 30 )^2 * t1 (equ.2)
- // I1 = ( ( rpm * PI / 30 )^2 / 4 ) * t1
- // w2 = ( rpm * PI / 30 )^2
- // I1 = ( w2 / 4 ) * t1
- // I2 = w2t
- // Substituting into equ.1, we get:
- // ( w2t - ( ( w2 / 4 ) * t1 ) ) = ( t2 - t1 ) * w2
- // t1 * ( w2 - ( w2 / 4 ) ) = t2 * w2 - w2t
- // t1 * ( 3 / 4 ) * w2 = t2 * w2 - w2t
- // t1 = ( 4 / 3 ) * ( t2 - ( w2t / w2 ) )
- double t1 = tfac * ( t2 - ( w2t / w2 ) );
-double t1w=(w2t/w2);
-DbgLv(1) << "AMATH:wrts: om1t w2 w2t" << om1t << w2 << w2t
- << "t1w" << t1w << "tfac" << tfac;
- if ( t1 >= t2 )
- { // Something wrong! set t1 to a few seconds before t2
- t1 = t2 - 5.0;
- }
-// t_acc = qCeil( t1 );
- t_acc = (int)qRound( t1 );
- rate = (double)( simparams.speed_step[ 0 ].rotorspeed )
- / (double)t_acc;
-DbgLv(1) << "AMATH:wrts:t1 t2" << t1 << t2 << "t_acc rate" << t_acc << rate;
-//DbgLv(1)<< "from speed profile"
-// << "t_acc=" << t_acc << "rate=" << rate << "first_time:" << simparams.speed_step[0].time_first
-// << "first_w2t" << simparams.speed_step[0].w2t_first
-// << "rpm=" << simparams.speed_step[0].rotorspeed;
-//DbgLv(1) << " from sim_data"
-// << "t_acc=" << t_acc1 << "rate= " << rate1 << "first_time: " << sim_data.scanData[0].seconds
-// << "first_w2t" << sim_data.scanData[0].omega2t << "rpm=" << sim_data.scanData[0].rpm;
+ // If debug_text so directs, change set_speed_low_accel
+ QString dbgval = US_Settings::debug_value( "SetSpeedLowAcc" );
+ double low_accel = dbgval.isEmpty() ? DSS_LO_ACC : dbgval.toDouble();
+
+ // Get the 1st acceleration zone's rate and end-time
+ low_acceleration( simparams.speed_step, low_accel, rate );
+ t_acc = (int)qRound( (double)( simparams.speed_step[ 0 ].rotorspeed )
+ / rate );
+DbgLv(1)<< "AMATH:wrts: computed rate:" << rate;
}
else
{ // Handle 1st acceleration zone for simulation (astfem_sim) data
@@ -258,9 +221,63 @@
return timestate.time_count();
}
+// Determine if first time step's acceleration is too low
+bool US_AstfemMath::low_acceleration(
+ const QVector< US_SimulationParameters::SpeedProfile >& speedsteps,
+ const double min_accel, double& rate )
+{
+ int dbg_level = US_Settings::us_debug();
+ const double tfac = ( 4.0 / 3.0 );
+ double t2 = speedsteps[ 0 ].time_first;
+ double w2t = speedsteps[ 0 ].w2t_first;
+ double om1t = speedsteps[ 0 ].rotorspeed * M_PI / 30.0;
+ double w2 = sq( om1t );
+ double t1w = w2t / w2;
+
+ // =====================================================================
+ // For the first speed step, we compute "t1", the end of the initial
+ // acceleration zone, using
+ // "t2" , the time in seconds for the first scan;
+ // "w2t" , the omega^2_t integral for the first scan time;
+ // "w2" , the omega^2 value for the constant zone speed;
+ // "tfac" , a factor (==(4/3)==1.333333) derived from the following.
+ // The acceleration zone begins at t0=0.0.
+ // It ends at time "t1".
+ // The time between t1 and t2 is at constant speed.
+ // The time between 0 and t1 is at changing speeds averaging (rpm/2).
+ // For I1 and I2, the omega^2t integrals at t1 and t2,
+ // ( I2 - I1 ) = ( t2 - t1 ) * w2 (equ.1)
+ // I1 = ( (rpm/2) * PI / 30 )^2 * t1 (equ.2)
+ // I1 = ( ( rpm * PI / 30 )^2 / 4 ) * t1
+ // w2 = ( rpm * PI / 30 )^2
+ // I1 = ( w2 / 4 ) * t1
+ // I2 = w2t
+ // Substituting into equ.1, we get:
+ // ( w2t - ( ( w2 / 4 ) * t1 ) ) = ( t2 - t1 ) * w2
+ // t1 * ( w2 - ( w2 / 4 ) ) = t2 * w2 - w2t
+ // t1 * ( 3 / 4 ) * w2 = t2 * w2 - w2t
+ // t1 = ( 4 / 3 ) * ( t2 - ( w2t / w2 ) )
+ // =====================================================================
+
+ double t1 = tfac * ( t2 - t1w );
+DbgLv(1) << "AMATH:loac: om1t w2 w2t" << om1t << w2 << w2t
+ << "t1w" << t1w << "tfac" << tfac;
+
+ if ( t1 >= t2 )
+ { // Something wrong! set t1 to a few seconds before t2
+ t1 = t2 - 5.0;
+ }
+
+ int t_acc = (int)qRound( t1 );
+ rate = (double)( speedsteps[ 0 ].rotorspeed ) / (double)t_acc;
+DbgLv(1) << "AMATH:loac:t1 t2" << t1 << t2 << "t_acc rate" << t_acc << rate;
+
+ return ( rate < min_accel );
+}
+
// Determine if a timestate file holds one-second-interval records
bool US_AstfemMath::timestate_onesec( const QString& tmst_fpath,
- US_DataIO::RawData& sim_data )
+ US_DataIO::RawData& sim_data )
{
bool onesec_intv = false;
bool constti = false;
Modified: trunk/utils/us_astfem_math.h
===================================================================
--- trunk/utils/us_astfem_math.h 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/utils/us_astfem_math.h 2019-07-05 14:13:28 UTC (rev 2788)
@@ -37,6 +37,14 @@
static int writetimestate( const QString&, US_SimulationParameters&,
US_DataIO::RawData& );
+ //! \brief Determine if first time step's acceleration is too low
+ //! \param speedsteps Vector of speed steps
+ //! \param min_accel Minimum reasonable acceleration value
+ //! \param rate Returned computed first-step acceleration rate
+ //! \returns Flag: True iff acceleration rate is too low
+ static bool low_acceleration( const QVector< US_SimulationParameters::SpeedProfile >&,
+ const double, double& );
+
//! \brief Determine if a timestate file holds one-second-interval records
//! \param tmst_fpath Full path to timestate file to examine
//! \param sim_data Raw data with scans to examine
Modified: trunk/utils/us_simparms.cpp
===================================================================
--- trunk/utils/us_simparms.cpp 2019-06-29 01:00:53 UTC (rev 2787)
+++ trunk/utils/us_simparms.cpp 2019-07-05 14:13:28 UTC (rev 2788)
@@ -9,6 +9,9 @@
//!< level-conditioned debug print
#define DbgLv(a) if(dbg_level>=a)qDebug()
+#define DSS_RESO 100 // default SetSpeedResolution
+#define DSS_LO_RPM 1500 // default SetSpeedLowRpm
+#define DSS_LO_SEC 20 // default SpeedStepLowSec
US_SimulationParameters::US_SimulationParameters()
{
@@ -1182,11 +1185,13 @@
return -1; // Do not have needed keys
// If debug_text so directs, change set_speed_resolution
- // and/or set_speed_low_rpm
+ // and/or set_speed_low_rpm and/or speed_step_low_secs
QString dbgval = US_Settings::debug_value( "SetSpeedReso" );
- int ss_reso = dbgval.isEmpty() ? 100 : dbgval.toInt();
+ int ss_reso = dbgval.isEmpty() ? DSS_RESO : dbgval.toInt();
dbgval = US_Settings::debug_value( "SetSpeedLowR" );
- int ss_lo_rpm = dbgval.isEmpty() ? 1500 : dbgval.toInt();
+ int ss_lo_rpm = dbgval.isEmpty() ? DSS_LO_RPM : dbgval.toInt();
+ dbgval = US_Settings::debug_value( "SpeedStepLowSec" );
+ int ss_lo_sec = dbgval.isEmpty() ? DSS_LO_SEC : dbgval.toInt();
int nrec = tsobj->time_count(); // Total time record count
QList< int > cspeeds; // Constant speeds list
@@ -1354,10 +1359,10 @@
<< "rs_p rs_c" << rs_p << rs_c << "ss_c_ts" << ss_c_ts;
// But, wait a minute! If the "constant zone" just ending is less than
- // 5 minutes long or contains no scans, then add it to the current
+ // 20 seconds long or contains no scans, then add it to the current
// speed step's acceleration zone and resume looking for an end
// to the acceleration zone
- if ( ndtimes < 300 || ssp.time_f_scan < 1 )
+ if ( ndtimes < ss_lo_sec || ssp.time_f_scan < 1 )
{
in_accel = true;
naintvs += ndtimes;
1
0
Author: alexey
Date: 2019-06-29 01:00:53 +0000 (Sat, 29 Jun 2019)
New Revision: 2787
Modified:
trunk/programs/us_convert/us_convert_gui.cpp
trunk/utils/us_xpn_data.cpp
Log:
Exp. type Calibration - enable saving without definin greference scan;
A (possible) fix for live_update of multi-speed experiments - needs testing...
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-06-20 08:18:17 UTC (rev 2786)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-06-29 01:00:53 UTC (rev 2787)
@@ -2325,6 +2325,7 @@
}
+
// This can go on the todo list, but should not prevent user from saving
if ( ( runType == "RI" ) && ( ! referenceDefined ) )
{
@@ -2336,7 +2337,9 @@
{
pb_reference->setEnabled( true );
//ALEXEY <--- Save btn is disabled when Reference scan is NOT defined (for Absorbance)
- completed = false;
+
+ if ( ! ExpData.expType.contains( "calibrat", Qt::CaseInsensitive ) )
+ completed = false;
}
}
Modified: trunk/utils/us_xpn_data.cpp
===================================================================
--- trunk/utils/us_xpn_data.cpp 2019-06-20 08:18:17 UTC (rev 2786)
+++ trunk/utils/us_xpn_data.cpp 2019-06-29 01:00:53 UTC (rev 2787)
@@ -1385,7 +1385,7 @@
int ccx = 0;
int wvx = 0;
int scnnbr = 0;
- nscnn = scnnbrs.count();
+ nscnn = scnnbrs.count(); // ALEXEY: is nscnn, the #scans, is the same for all stages ? NO!
int stgnbr = 0;
nstgn = stgnbrs.count();
ntscan = 0;
@@ -1572,7 +1572,7 @@
int ccx = 0;
int wvx = 0;
int scnnbr = 0;
- nscnn = scnnbrs.count();
+ nscnn = scnnbrs.count(); //ALEXEY: is nscnn (# scan) is the same for all stages ? NO!
int stgnbr = 0;
nstgn = stgnbrs.count();
DbgLv(1) << "rBldRawD ntriple nstgn nscnn" << ntriple << nstgn << nscnn
@@ -1599,7 +1599,7 @@
for ( int sgx = 0; sgx < nstgn; sgx++ )
{ // Set stage values
stgnbr = stgnbrs[ sgx ];
- for ( int scx = 0; scx < nscnn; scx++ )
+ for ( int scx = 0; scx < nscnn; scx++ ) //ALEXEY: is nscnn (# scan) is the same for all stages ? NO!
{ // Set scan values
time10=QDateTime::currentDateTime();
scnnbr = scnnbrs[ scx ];
@@ -1646,9 +1646,14 @@
time10=QDateTime::currentDateTime();
int kpoint = get_readings( scan.rvalues, trx, sgx, scx );
+ qDebug() << "INSIDE xpn_data: AFTER get_readings() 0";
+
if ( kpoint < 0 )
continue; // Skip output if no stage,scan match
+
+ qDebug() << "INSIDE xpn_data: AFTER get_readings() 1";
+
if(scx<3 || (scx+4)>nscnn)
DbgLv(1) << "rBldRawD scx" << scx << "rvalues size" << scan.rvalues.size()
<< "rvalues[mid]" << scan.rvalues[scan.rvalues.size()/2];
@@ -1656,7 +1661,16 @@
//if ( ( scx + 1 ) == oscknt )
if ( ndscan == oscknt )
{ // If last of old scans, update in case readings were added
- int ksc = sgx * nscnn + scx;
+
+
+ //int ksc = sgx * nscnn + scx; //ALEXEY: crashes after this line: is this correct for ksc at multi-speed ?
+ //ALEXEY: is nscnn (# scan) is the same for all stages ? NO!
+
+ int ksc = oscknt - 1;
+
+ qDebug() << "INSIDE xpn_data: AFTER get_readings() 2a: ksc = sgx * nscnn + scx: " << sgx << " * " << nscnn << " + " << scx;
+ qDebug() << "INSIDE xpn_data: AFTER get_readings() 2: ksc: " << ksc << ", rdata->scanData.size(): " << rdata->scanData.size();
+
rdata->scanData[ ksc ] = scan;
DbgLv(1) << "rBldRawD ksc" << ksc << "++Scan Replace";
}
@@ -1667,7 +1681,12 @@
DbgLv(1) << "rBldRawD ndscan oscknt" << ndscan << oscknt << "++Scan Add nscknt" << nscknt;
}
time20=QDateTime::currentDateTime();
+
+ qDebug() << "INSIDE xpn_Data 1";
+
timi4+=time10.msecsTo(time20);
+
+ qDebug() << "INSIDE xpn_Data 2";
} // END: scan loop
} // END: stage loop
QDateTime time07b=QDateTime::currentDateTime();
1
0
Author: gegorbet
Date: 2019-06-25 20:41:38 +0000 (Tue, 25 Jun 2019)
New Revision: 77
Modified:
trunk/class/jobsubmit_aira.php
Log:
fix maxwall estimate as a function of total grid points
Modified: trunk/class/jobsubmit_aira.php
===================================================================
--- trunk/class/jobsubmit_aira.php 2019-06-07 16:27:00 UTC (rev 76)
+++ trunk/class/jobsubmit_aira.php 2019-06-25 20:41:38 UTC (rev 77)
@@ -596,12 +596,8 @@
$gpts_s = $parameters[ 's_grid_points' ];
$gpts_k = $parameters[ 'ff0_grid_points' ];
$gpts_t = $gpts_s * $gpts_k;
- if ( $gpts_t > 200000 )
- $time *= 8;
- else if ( $gpts_t > 100000 )
- $time *= 4;
- else if ( $gpts_t > 50000 )
- $time *= 2;
+ $gp_fac = (int)( ( $gpts_t + 4096 ) / 8192 );
+ $time *= $gp_fac;
}
if ( isset( $dsparams[ 'simpoints' ] ) )
1
0
r2786 - in trunk: programs/us_com_project programs/us_convert utils
by svn@svn.aucsolutions.com June 20, 2019
by svn@svn.aucsolutions.com June 20, 2019
June 20, 2019
Author: alexey
Date: 2019-06-20 08:18:17 +0000 (Thu, 20 Jun 2019)
New Revision: 2786
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_convert/us_convert_gui.cpp
trunk/utils/us_report.cpp
trunk/utils/us_report.h
Log:
Problem with saving reports/images to DB in the autoflow addressed...
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-06-14 00:42:33 UTC (rev 2785)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-06-20 08:18:17 UTC (rev 2786)
@@ -421,8 +421,30 @@
// // --------------------------------------------------------------------------------------------
+ // // --------------------------------------------------------------------------------------------
+ // // H Steele exp. Optima 1 !!!
+ // QMap < QString, QString > protocol_details;
+ // protocol_details["experimentId"] = QString("581");
+ // protocol_details["protocolName"] = QString("SteeleH_Cytc-ND-titrations_061719");
+ // protocol_details[ "experimentName" ] = QString("some_name");
+ // protocol_details[ "CellChNumber" ] = QString("8");
+ // protocol_details[ "TripleNumber" ] = QString("16");
+ // protocol_details[ "OptimaName" ] = QString("Optima 1"); // <-- Optima 1
+ // protocol_details[ "duration" ] = QString("45000");
+ // protocol_details[ "dataPath" ] = QString("/home/alexey/ultrascan/imports/SteeleH_Cytc-ND-titrations_061719-run872");
+ // protocol_details[ "invID_passed" ] = QString("22"); //Harmen's
+ // protocol_details[ "label" ] = QString("SteeleH_Cytc-ND-titrations_061719");
+ // QString stage = "EDITING";
+ // QString currDir = protocol_details[ "dataPath" ];
+ // QString ProtName = protocol_details[ "protocolName" ];
+ // QString invID_passed = protocol_details[ "invID_passed" ];
+ // QDir directory( currDir );
+
+ // // --------------------------------------------------------------------------------------------
+
+
// Query 'autoflow': get count of records
int autoflow_records = get_autoflow_records();
@@ -537,9 +559,9 @@
qDebug() << "Exp. Label: " << protocol_details[ "label" ];
qDebug() << "GMP Run ? " << protocol_details[ "gmpRun" ];
-
+
if ( stage == "LIVE_UPDATE" )
{
//do something
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-06-14 00:42:33 UTC (rev 2785)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-06-20 08:18:17 UTC (rev 2786)
@@ -5666,6 +5666,8 @@
saveStatus = BOTH;
enableRunIDControl( false );
+ //ALEXEY <- Proceeds here OK! Problem below with saveReportsToDB()
+
saveReportsToDB();
QApplication::restoreOverrideCursor();
QApplication::restoreOverrideCursor();
@@ -5734,8 +5736,17 @@
// Edit data ID is not known yet, so use 1. It goes in the report document
// table itself, so we're not overwriting anything.
- US_Report::Status status = myReport.saveDocumentFromFile(
- dir, file, &db, 1, description );
+
+ US_Report::Status status;
+ if ( us_convert_auto_mode )
+ {
+ qDebug() << "SAVING Reports in AUTO mode !!";
+ status = myReport.saveDocumentFromFile_auto( ExpData.invID, dir, file, &db, 1, description );
+ }
+ else
+ status = myReport.saveDocumentFromFile( dir, file, &db, 1, description );
+
+
if ( status != US_Report::REPORT_OK )
{
errorMsg += file + " was not saved to report database; error code: "
Modified: trunk/utils/us_report.cpp
===================================================================
--- trunk/utils/us_report.cpp 2019-06-14 00:42:33 UTC (rev 2785)
+++ trunk/utils/us_report.cpp 2019-06-20 08:18:17 UTC (rev 2786)
@@ -557,6 +557,9 @@
return REPORT_OK;
}
+
+
+
// Saves the global report information to DB
US_Report::Status US_Report::saveDB( US_DB2* db )
{
@@ -570,6 +573,7 @@
// Find out if the runID is in the DB already
QString invID = QString::number( US_Settings::us_inv_ID() );
+
QStringList q( "get_reportID_by_runID" );
q << invID
<< this->runID;
@@ -650,6 +654,102 @@
return REPORT_OK;
}
+
+// COPY for autoflow - with invID passed
+US_Report::Status US_Report::saveDB_auto( int invID_passed, US_DB2* db )
+{
+ QRegExp rx( "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" );
+ int status;
+ QString now = QDateTime::currentDateTime().toString();
+
+ // First let's be sure we have a valid GUID
+ if ( ! rx.exactMatch( this->GUID ) )
+ this->GUID = US_Util::new_guid();
+
+ // Find out if the runID is in the DB already
+ QString invID = QString::number( invID_passed );
+
+ QStringList q( "get_reportID_by_runID" );
+ q << invID
+ << this->runID;
+ db->query( q );
+
+ this->title = this->title.isEmpty()
+ ? this->runID + " Report"
+ : this->title;
+
+ status = db->lastErrno();
+
+ if ( status == US_DB2::OK )
+ {
+ // Update existing global report structure in the DB
+ db->next();
+ this->ID = db->value( 0 ).toInt();
+ this->html = "<p>Report updated " + now + "</p>";
+
+ q.clear();
+ q << "update_report"
+ << QString::number( this->ID )
+ << this->title
+ << this->html;
+ db->query( q );
+
+ int updateStatus = db->lastErrno();
+
+ if ( updateStatus != US_DB2::OK )
+ {
+ qDebug() << "update_report error"
+ << updateStatus;
+ return DB_ERROR;
+ }
+ }
+
+ else if ( status == US_DB2::NOROWS )
+ {
+ // Create a new global report structure in the DB
+ this->html = "<p>Report created " + now + "</p>";
+
+ q.clear();
+ q << "new_report"
+ << this->GUID
+ << this->runID
+ << this->title
+ << this->html
+ << invID;
+ db->query( q );
+
+ int newStatus = db->lastErrno();
+
+ if ( newStatus != US_DB2::OK )
+ {
+ qDebug() << "new_report error"
+ << newStatus;
+ return DB_ERROR;
+ }
+
+ this->ID = db->lastInsertID();
+ }
+
+ else // some other database error
+ {
+ qDebug() << "get_reportID error"
+ << status;
+ return DB_ERROR;
+ }
+
+ // Ensure that we have the experimentID
+ q.clear();
+ q << "get_report_info"
+ << QString::number( this->ID );
+ db->query( q );
+
+ db->next();
+ this->experimentID = db->value(2).toInt();
+
+ return REPORT_OK;
+}
+
+
// Function to add a new, empty triple record, both in the object and the DB
US_Report::Status US_Report::addTriple(
QString triple,
@@ -754,7 +854,7 @@
if ( status == US_Report::NOT_FOUND )
{
- US_Report::Status saveStatus = this->saveDB( db );
+ US_Report::Status saveStatus = this->saveDB( db );
if ( saveStatus != US_Report::REPORT_OK )
{
qDebug() << "report.saveDB error"
@@ -848,6 +948,138 @@
return US_Report::REPORT_OK;
}
+
+// COPY for autoflow - with invID passed
+US_Report::Status US_Report::saveDocumentFromFile_auto( int invID, const QString& dir,
+ const QString& filename, US_DB2* db, int idEdit,
+ const QString dataDescription )
+{
+ // Parse the directory for the runID
+ QStringList parts = dir.split( "/" );
+ if ( parts.size() < 2 )
+ return US_Report::MISC_ERROR;
+
+ QString new_runID = parts.last();
+ if ( new_runID.isEmpty() )
+ new_runID = parts[ parts.size() - 2 ];
+
+ // Now parse the filename for the other information
+ parts.clear();
+ parts = filename.split( '.' );
+ if ( parts.size() != 4 )
+ return US_Report::MISC_ERROR;
+
+ QString newAnal = parts[0];
+ QString newTriple = US_Util::expanded_triple( parts[1], false );
+ QString newSubanal = parts[2];
+ QString newDoctype = parts[3];
+
+ // Create a label
+ QString newLabel = this->rTypes.appLabels[newAnal] + ":" +
+ this->rTypes.rptLabels[newSubanal] + ":" +
+ this->rTypes.extLabels[newDoctype] ;
+
+ // Start by reading any DB info we have, or create new report
+ QString now = QDateTime::currentDateTime().toString();
+ US_Report::Status status = this->readDB( new_runID, db );
+
+ if ( status == US_Report::NOT_FOUND )
+ {
+ US_Report::Status saveStatus = this->saveDB_auto( invID, db ); //ALEXEY <-- for autoflow, pass invID to saveDB( db, invID )
+ if ( saveStatus != US_Report::REPORT_OK )
+ {
+ qDebug() << "report.saveDB error"
+ << saveStatus;
+ qDebug() << db->lastError() << db->lastErrno();
+ this->show();
+ }
+ }
+
+ // Read an existing triple, or create a new one
+ int tripNdx = this->findTriple( newTriple );
+ if ( tripNdx < 0 )
+ {
+ // Not found
+ status = this->addTriple( newTriple, dataDescription, db );
+ if ( status != US_Report::REPORT_OK )
+ {
+ qDebug() << "saveDocumentFromFile.addTriple error"
+ << status;
+ qDebug() << db->lastError() << db->lastErrno();
+ return US_Report::DB_ERROR;
+ }
+
+ }
+
+ else if ( this->triples[tripNdx].dataDescription != dataDescription )
+ {
+ // Then the data description field has changed and needs to be updated
+ this->triples[tripNdx].dataDescription = dataDescription;
+ this->triples[tripNdx].saveDB( this->ID, db );
+ }
+
+ // Refresh tripNdx
+ tripNdx = this->findTriple( newTriple );
+ US_Report::ReportTriple t = this->triples[tripNdx];
+
+ // Now find this document if it already exists
+ int docNdx = t.findDocument( newAnal, newSubanal, newDoctype );
+
+if(docNdx<0)
+DbgLv(1) << "Doc::saveDB: NOT FOUND newDoctype" << newDoctype;
+ if ( docNdx < 0 && newDoctype.endsWith( "svgz" ) )
+ { // If SVGZ not found, test for SVG
+ docNdx = t.findDocument( newAnal, newSubanal, QString( "svg" ) );
+DbgLv(1) << "Doc::saveDB: NOT FOUND svg docNdx" << docNdx;
+ }
+
+ if ( docNdx < 0 )
+ {
+ // Not found
+ status = t.addDocument( idEdit,
+ newLabel,
+ dir,
+ filename,
+ newAnal,
+ newSubanal,
+ newDoctype,
+ db );
+ }
+
+ else
+ {
+DbgLv(1) << "Doc::saveDB: Replace ndx label" << docNdx << newLabel;
+ t.docs[ docNdx ].editedDataID = idEdit;
+ t.docs[ docNdx ].label = newLabel;
+ t.docs[ docNdx ].filename = filename;
+ t.docs[ docNdx ].documentType = newDoctype;
+
+ status = t.docs[ docNdx ].saveDB( t.tripleID, dir, db );
+ if ( status != US_Report::REPORT_OK )
+ {
+ qDebug() << "saveDocumentFromFile.docs.saveDB error"
+ << status;
+ qDebug() << db->lastError() << db->lastErrno();
+ return US_Report::DB_ERROR;
+ }
+
+ }
+
+ // Refresh docNdx
+ docNdx = t.findDocument( newAnal, newSubanal, newDoctype );
+
+ // Finally, update the triple
+ status = t.saveDB( this->ID, db );
+ this->triples[tripNdx] = t;
+
+ //status = this->saveAllToDB( dir, db );
+ if ( status != US_Report::REPORT_OK )
+ return status;
+
+ return US_Report::REPORT_OK;
+}
+
+
// Saves a list of report document records to DB
US_Report::Status US_Report::saveFileDocuments( const QString& dir,
const QStringList& filepaths, US_DB2* db, int idEdit,
@@ -875,11 +1107,11 @@
// Get any existing report for this run
// Start by reading any DB info we have, or create new report
QString now = QDateTime::currentDateTime().toString();
- US_Report::Status status = this->readDB( new_runID, db, newTriple );
+ US_Report::Status status = this->readDB( new_runID, db, newTriple ); //ALEXEY <-- pass invID if autoflow; will be needed for us_edit
if ( status == US_Report::NOT_FOUND )
{ // For a new report, save what we have
- US_Report::Status saveStatus = this->saveDB( db );
+ US_Report::Status saveStatus = this->saveDB( db ); //ALEXEY <-- pass invID if autoflow; will be needed for us_edit
if ( saveStatus != US_Report::REPORT_OK )
{
qDebug() << "report.saveDB error"
@@ -1050,8 +1282,8 @@
// Saves an entire report structure to DB
US_Report::Status US_Report::saveAllToDB( QString dir, US_DB2* db )
{
- US_Report::Status status = this->saveDB( db );
- if ( status != US_Report::REPORT_OK )
+ US_Report::Status status = this->saveDB( db ); // ALEXEY <- pass invID when autoflow; this func. not used anywhere...
+ if ( status != US_Report::REPORT_OK )
{
qDebug() << "report.saveDB error"
<< status;
Modified: trunk/utils/us_report.h
===================================================================
--- trunk/utils/us_report.h 2019-06-14 00:42:33 UTC (rev 2785)
+++ trunk/utils/us_report.h 2019-06-20 08:18:17 UTC (rev 2786)
@@ -223,6 +223,8 @@
// \param db For database access, an open database connection
// \returns One of the US_Report error codes
Status saveDB( US_DB2* = 0 );
+ Status saveDB_auto( int, US_DB2* = 0 );
+
//! \brief Function to add a new empty triple record to the report
//! \param triple The triple identifying which channel
@@ -274,6 +276,9 @@
Status saveDocumentFromFile( const QString&, const QString&,
US_DB2*, int = 1, const QString = "" );
+ Status saveDocumentFromFile_auto( int, const QString&, const QString&,
+ US_DB2*, int = 1, const QString = "" );
+
//! \brief Store multiple reportDocument records from the same triple.
//! \param dir The directory where the report file is located.
//! The is required to end with the runID, e.g.,
1
0
June 13, 2019
Author: alexey
Date: 2019-06-14 00:42:33 +0000 (Fri, 14 Jun 2019)
New Revision: 2785
Modified:
trunk/programs/us_com_project/us_com_project_gui.cpp
trunk/programs/us_convert/us_convert_gui.cpp
trunk/programs/us_convert/us_convertio.cpp
trunk/programs/us_convert/us_convertio.h
Log:
AUtoflow:
saving experiment under correct (passed from the very beginning) investigator. finally..
Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-06-13 17:07:20 UTC (rev 2784)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-06-14 00:42:33 UTC (rev 2785)
@@ -353,6 +353,7 @@
// protocol_details[ "OptimaName" ] = QString("Optima 1"); // <-- Optima 1
// protocol_details[ "duration" ] = QString("27000");
// protocol_details[ "invID_passed" ] = QString("34"); //Ling's ID
+ // QDir directory( currDir );
// -------------------------------------------------------------------------------------------
@@ -373,8 +374,8 @@
// QString currDir = protocol_details[ "dataPath" ];
// QString ProtName = protocol_details[ "protocolName" ];
// QString invID_passed = protocol_details[ "invID_passed" ];
+ // QDir directory( currDir );
-
// // --------------------------------------------------------------------------------------------
// // Amy's exp. Optima 2 !!!
@@ -393,10 +394,35 @@
// QString currDir = protocol_details[ "dataPath" ];
// QString ProtName = protocol_details[ "protocolName" ];
// QString invID_passed = protocol_details[ "invID_passed" ];
+ // QDir directory( currDir );
// --------------------------------------------------------------------------------------------
+
+ // // --------------------------------------------------------------------------------------------
+ // // D Souza exp. Optima 1 !!!
+ // QMap < QString, QString > protocol_details;
+ // protocol_details["experimentId"] = QString("577");
+ // protocol_details["protocolName"] = QString("DsouzaS_RVFV1-DDX17-MWL1_060819");
+ // protocol_details[ "experimentName" ] = QString("some_name");
+ // protocol_details[ "CellChNumber" ] = QString("4");
+ // protocol_details[ "TripleNumber" ] = QString("80");
+ // protocol_details[ "OptimaName" ] = QString("Optima 1"); // <-- Optima 1
+ // protocol_details[ "duration" ] = QString("61320");
+ // protocol_details[ "dataPath" ] = QString("/home/alexey/ultrascan/imports/DsouzaS_RVFV1-DDX17-MWL1_060819-run865");
+ // protocol_details[ "invID_passed" ] = QString("20"); //D'Souza ID
+ // protocol_details[ "label" ] = QString("DsouzaS_RVFV1-DDX17-MWL1_060819");
+ // QString stage = "EDITING";
+ // QString currDir = protocol_details[ "dataPath" ];
+ // QString ProtName = protocol_details[ "protocolName" ];
+ // QString invID_passed = protocol_details[ "invID_passed" ];
+ // QDir directory( currDir );
+
+ // // --------------------------------------------------------------------------------------------
+
+
+
// Query 'autoflow': get count of records
int autoflow_records = get_autoflow_records();
@@ -409,15 +435,7 @@
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() );
@@ -519,13 +537,8 @@
qDebug() << "Exp. Label: " << protocol_details[ "label" ];
qDebug() << "GMP Run ? " << protocol_details[ "gmpRun" ];
+
- //ALEXEY: if stage=="EDITING" && curDir.isEmpty() (NULL)
- /*
- -- that means that Run Completed but Directory was created on different computer
- -- possible solution: return (set) to stage == "LIVE_UPDATE" & re-save to local directory on current computer
-
- */
if ( stage == "LIVE_UPDATE" )
{
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-06-13 17:07:20 UTC (rev 2784)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-06-14 00:42:33 UTC (rev 2785)
@@ -1301,6 +1301,8 @@
Exp_label = details_at_live_update[ "label" ];
+ qDebug() << "Exp_label: " << Exp_label;
+
gmpRun_bool = false;
if ( details_at_live_update[ "gmpRun" ] == "YES" )
@@ -1796,7 +1798,7 @@
// //TEMP
- // runID += QString("-test");
+ //runID += QString("-test");
qDebug() << "RUNID from files[0]: files[0]" << fname << ", runID: " << runID;
@@ -4896,8 +4898,8 @@
// qDebug() << "ExpData: ";
- // qDebug() << "ExpData.invID " << ExpData.invID;
- // qDebug() << "ExpData.invGUI" << ExpData.invGUID;
+ qDebug() << "ExpData.invID " << ExpData.invID;
+ qDebug() << "ExpData.invGUI" << ExpData.invGUID;
// qDebug() << "ExpData.name" << ExpData.name;
// qDebug() << "ExpData.expID" << ExpData.expID;
@@ -4921,7 +4923,7 @@
// qDebug() << "ExpData.opticalSystem" << ExpData.opticalSystem;
// //qDebug() << ExpData.rpms;
// qDebug() << "ExpData.runTemp" << ExpData.runTemp;
- // qDebug() << "ExpData.label" << ExpData.label;
+ qDebug() << "ExpData.label" << ExpData.label;
// qDebug() << "ExpData.comments" << ExpData.comments;
// qDebug() << "ExpData.centrifugeProtocol" << ExpData.centrifugeProtocol;
// qDebug() << "ExpData.date" << ExpData.date;
@@ -4939,7 +4941,8 @@
qDebug() << "Save: Comments: " << this->te_comment ->toPlainText();
ExpData.comments = this->te_comment ->toPlainText();
}
-
+ qDebug() << "ExpData.comments" << ExpData.comments;
+
qDebug() << "Save INIT 2:";
// Test to see if this is multi-speed data
@@ -4959,6 +4962,7 @@
// and also save single run if Buoyancy or Calibration experiment type
if ( disk_controls->db() )
{
+ qDebug() << "SINGLE_SPEED DATA SAVE: ExpData.invID = " << ExpData.invID;
saveUS3DB(); // Save AUCs to disk then DB
writeTimeStateDisk(); // Get TimeState in results
writeTimeStateDB(); // Save TimeState to database
@@ -5036,6 +5040,7 @@
// Save the triples of the current speed-run
if ( disk_controls->db() )
{
+ qDebug() << "MULTI_SPEED DATA SAVE: ExpData.invID = " << ExpData.invID;
saveUS3DB(); // Save AUCs to disk then DB
writeTimeStateDisk(); // Get TimeState in results
writeTimeStateDB(); // Save TimeState to database
@@ -5070,6 +5075,8 @@
if ( !gmpRun_bool ) // us_comproject BUT the run is NOT GMP, so complete here
{
+ qDebug() << " Saving COMPLETE: NO GMP RUN !!!";
+
QMessageBox::information( this,
tr( "Save is Complete" ),
tr( "The save of all data and reports is complete." ) );
@@ -5093,6 +5100,12 @@
}
}
}
+ else
+ {
+ QMessageBox::information( this,
+ tr( "Save is Complete" ),
+ tr( "The save of all data and reports is complete." ) );
+ }
}
//Delete autoflow record upon Run abortion
@@ -5427,7 +5440,17 @@
le_status->setText( tr( "Preparing Save with DB check ..." ) );
qApp->processEvents();
- int status = US_ConvertIO::checkDiskData( ExpData, out_tripinfo, &db );
+ qDebug() << "BEFORE checkDiskData(): ExpData.invID = " << ExpData.invID;
+
+ int status;
+
+ if ( us_convert_auto_mode )
+ status = US_ConvertIO::checkDiskData_auto( ExpData, out_tripinfo, &db );
+ else
+ status = US_ConvertIO::checkDiskData( ExpData, out_tripinfo, &db );
+
+ qDebug() << "AFTER checkDiskData(): ExpData.invID = " << ExpData.invID;
+
DbgLv(1) << "Status from SaveUs3DB" << status;
// Save a flag for need to repeat the disk write later
bool repeat_disk = ( status == US_DB2::NO_RAWDATA );
@@ -5491,9 +5514,14 @@
qApp->processEvents();
DbgLv(1) << "DBSv: (2)dset tripleID " << out_tripinfo[0].tripleID;
+
+ qDebug() << "BEFORE saveUS3Disk(): ExpData.invID = " << ExpData.invID;
+
status = saveUS3Disk();
DbgLv(1) << "DBSv: Status after saveUS3Disk()" << status;
+ qDebug() << "AFTER saveUS3Disk(): ExpData.invID = " << ExpData.invID;
+
if ( status != US_Convert::OK )
return;
DbgLv(1) << "DBSv: local files saved";
@@ -5546,11 +5574,17 @@
le_status->setText( tr( "Saving Experiment to DB ..." ) );
qApp->processEvents();
+ qDebug() << "SAVE to DB - Initiation!! us_convert_auto_mode = " << us_convert_auto_mode;
if ( us_convert_auto_mode ) //ALEXEY: copy of the method with the ExpData.invID set as the owner (not US_Settings::us_inv_ID() )...
- status = ExpData.saveToDB_auto( ( saveStatus == BOTH ), &db, speedsteps, ExpData.invID );
+ {
+ qDebug() << "SAVE to DB - CALLING AUTO method!!! ExpData.invID = " << ExpData.invID;
+ status = ExpData.saveToDB_auto( ( saveStatus == BOTH ), &db, speedsteps, ExpData.invID );
+ }
else
- status = ExpData.saveToDB( ( saveStatus == BOTH ), &db, speedsteps );
-
+ {
+ qDebug() << "SAVE to DB - CALLING DEFAULT method!!!";;
+ status = ExpData.saveToDB( ( saveStatus == BOTH ), &db, speedsteps );
+ }
QApplication::restoreOverrideCursor();
if ( status == US_DB2::NO_PROJECT )
Modified: trunk/programs/us_convert/us_convertio.cpp
===================================================================
--- trunk/programs/us_convert/us_convertio.cpp 2019-06-13 17:07:20 UTC (rev 2784)
+++ trunk/programs/us_convert/us_convertio.cpp 2019-06-14 00:42:33 UTC (rev 2785)
@@ -723,3 +723,179 @@
return US_DB2::OK ;
}
+
+//Copy for use in Autoflow
+int US_ConvertIO::checkDiskData_auto( US_Experiment& ExpData,
+ QList< US_Convert::TripleInfo >& triples,
+ US_DB2* db )
+{
+ if ( US_Settings::us_inv_ID() == -1 )
+ return US_DB2::NO_PERSON;
+
+ //ExpData.invID = US_Settings::us_inv_ID();
+
+ // Get investigator GUID
+ QStringList q( "get_person_info" );
+ q << QString::number( ExpData.invID );
+ db->query( q );
+
+ if ( db->lastErrno() != US_DB2::OK )
+ {
+ ExpData.invID = 0;
+ ExpData.invGUID = QString( "" );
+ ExpData.name = QString( "" );
+ return US_DB2::NO_PERSON;
+ }
+
+ // Save updated investigator GUID
+ if ( db->next() )
+ {
+ ExpData.invGUID = db->value( 9 ).toString();
+ ExpData.name = db->value( 1 ).toString() + ", " + db->value( 0 ).toString();
+ }
+
+ // Check all the other GUID's for format
+ QRegExp rx( "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" );
+
+ // operator GUID
+ if ( ! rx.exactMatch( ExpData.operatorGUID ) )
+ return US_DB2::BADGUID;
+
+ // triple GUID's
+ for ( int trx = 0; trx < triples.size(); trx++ )
+ {
+ if ( triples[ trx ].excluded ) continue;
+
+ QString uuidc = US_Util::uuid_unparse(
+ (unsigned char*) triples[ trx ].tripleGUID );
+ if ( ! rx.exactMatch( uuidc ) )
+ return US_DB2::BADGUID;
+ }
+
+ // rotor GUID
+ if ( ! rx.exactMatch( ExpData.rotorGUID ) )
+ return US_DB2::BADGUID;
+
+ // Ok, GUID's are ok
+
+ // Check if operator exists
+ q.clear();
+ q << QString( "get_personID_from_GUID" )
+ << QString( ExpData.operatorGUID );
+ db->query( q );
+
+ if ( db->lastErrno() != US_DB2::OK )
+ {
+ ExpData.operatorID = 0;
+ ExpData.operatorGUID = QString( "" );
+ return US_DB2::NO_PERSON;
+ }
+
+ // Save updated investigator ID
+ if ( db->next() )
+ ExpData.operatorID = db->value( 0 ).toInt();
+
+ // Check rotor
+ q.clear();
+ q << QString( "get_rotorID_from_GUID" )
+ << QString( ExpData.rotorGUID );
+ db->query( q );
+
+ if ( db->lastErrno() != US_DB2::OK )
+ {
+ ExpData.rotorID = 0;
+ ExpData.calibrationID = 0;
+ ExpData.rotorCoeff1 = 0.0;
+ ExpData.rotorCoeff2 = 0.0;
+ ExpData.rotorGUID = QString( "" );
+ ExpData.rotorSerial = QString( "" );
+ ExpData.rotorName = QString( "" );
+ return US_DB2::NO_ROTOR;
+ }
+
+ // Save updated rotor info
+ if ( db->next() )
+ ExpData.rotorID = db->value( 0 ).toInt();
+ q.clear();
+ q << QString( "get_rotor_info" )
+ << QString::number( ExpData.rotorID );
+ db->query( q );
+ if ( db->next() )
+ {
+ ExpData.rotorGUID = db->value( 0 ).toString();
+ ExpData.rotorName = db->value( 1 ).toString();
+ ExpData.rotorSerial = db->value( 2 ).toString();
+ }
+
+ // Save calibration info
+ if ( ExpData.calibrationID == 0 ) // In this case, get the first one
+ {
+ q.clear();
+ q << QString( "get_rotor_calibration_profiles" )
+ << QString::number( ExpData.rotorID );
+ db->query( q );
+ if ( db->next() )
+ ExpData.calibrationID = db->value( 0 ).toInt();
+ }
+
+ // Now get more calibration info
+ ExpData.rotorCoeff1 = 0.0;
+ ExpData.rotorCoeff2 = 0.0;
+ ExpData.rotorUpdated = QDate::currentDate();
+ q.clear();
+ q << QString( "get_rotor_calibration_info" )
+ << QString::number( ExpData.calibrationID );
+ db->query( q );
+ if ( db->next() )
+ {
+ ExpData.rotorCoeff1 = db->value( 4 ).toString().toFloat();
+ ExpData.rotorCoeff2 = db->value( 5 ).toString().toFloat();
+ QStringList dateParts = db->value( 7 ).toString().split( " " );
+ ExpData.rotorUpdated = QDate::fromString( dateParts[ 0 ], "yyyy-MM-dd" );
+ }
+
+ // Initialize triple GUID's
+ int found = true; // Let's assume we'll find them all
+ for ( int i = 0; i < triples.size(); i++ )
+ {
+ if ( triples[ i ].excluded ) continue;
+
+ QString uuidc = US_Util::uuid_unparse(
+ (unsigned char*) triples[ i ].tripleGUID );
+ q.clear();
+ q << QString( "get_rawDataID_from_GUID" )
+ << uuidc;
+ db->query( q );
+
+ int status = db->lastErrno();
+qDebug() << "iSv: trip" << i << "tGUID" << uuidc
+ << "stat,ok,norow" << status << US_DB2::OK << US_DB2::NOROWS;
+ if ( status == US_DB2::OK )
+ {
+ // Save updated triple ID
+ if ( db->next() )
+ triples[ i ].tripleID = db->value( 0 ).toString().toInt();
+qDebug() << "iSv: tID" << triples[i].tripleID;
+ }
+
+ else if ( status == US_DB2::NOROWS )
+ {
+ triples[ i ].tripleID = 0;
+ memset( triples[ i ].tripleGUID, 0, 16 );
+ found = false; // At least one wasn't found in the DB
+ }
+
+ else // more unlikely errors
+ {
+ qDebug() << "get_rawDataID_from_GUID error: " << db->lastErrno();
+ qDebug() << "triple GUID = " << uuidc;
+ return status;
+ }
+
+ }
+
+ if ( ! found ) // Probably we just haven't saved it yet
+ return US_DB2::NO_RAWDATA;
+
+ return US_DB2::OK ;
+}
Modified: trunk/programs/us_convert/us_convertio.h
===================================================================
--- trunk/programs/us_convert/us_convertio.h 2019-06-13 17:07:20 UTC (rev 2784)
+++ trunk/programs/us_convert/us_convertio.h 2019-06-14 00:42:33 UTC (rev 2785)
@@ -69,6 +69,10 @@
US_Experiment&,
QList< US_Convert::TripleInfo >& ,
US_DB2* = 0 );
+ static int checkDiskData_auto(
+ US_Experiment&,
+ QList< US_Convert::TripleInfo >& ,
+ US_DB2* = 0 );
private:
static QString readRawDataFromDB(
1
0
Author: alexey
Date: 2019-06-13 17:07:20 +0000 (Thu, 13 Jun 2019)
New Revision: 2784
Modified:
trunk/programs/us_convert/us_convert_gui.cpp
Log:
A quick fix (though incomplete) for segfault in EDITING stage, when MWL data are uploaded, protocol details read.
The problem arose when different channels had different #triples..
However, display of the wvls ranges and strat/end ranges for such cases is still incorrect.
Bug came from us_convert...
Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp 2019-06-08 16:11:17 UTC (rev 2783)
+++ trunk/programs/us_convert/us_convert_gui.cpp 2019-06-13 17:07:20 UTC (rev 2784)
@@ -2736,10 +2736,20 @@
{
//Solution
solutionID = ProtInfo.ProtSolutions.chsols[ i ].sol_id.toInt();
- solution_auto.readFromDB(solutionID, &db);
+ solution_auto.readFromDB(solutionID, &db);
+
+ qDebug() << "SOLS 0";
+
out_chaninfo[ i ].solution = solution_auto;
- out_tripinfo[ out_chandatx[ i ] + cb_lambplot->currentIndex() ].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
all_tripinfo[ i ].solution = solution_auto;
//all_tripinfo[ out_chandatx[ i ] + cb_lambplot->currentIndex() ].solution = solution_auto;
@@ -2756,6 +2766,8 @@
// }
// }
+ qDebug() << "SOLS 2";
+
cellnumber = i / num_cent_holes;
for ( int aa = 0; aa < cent_options.size(); ++aa )
{
@@ -2766,7 +2778,8 @@
}
}
-
+ qDebug() << "SOLS 3";
+
//ALEXEY abstractCenterpieceIDs inferred from cent. name passed from protocol
out_chaninfo[ i ] .centerpiece = cpID;
out_chaninfo[ i ] .centerpieceName = cpName;
@@ -2805,14 +2818,22 @@
all_tripinfo[ jj ].centerpieceName = cpName;
}
+ qDebug() << "SOLS 4";
+
// Description
triple_desc = ProtInfo.ProtSolutions.chsols[ i ].ch_comment; //channel's comment from protocol
- outData[ out_chandatx[ i ] + cb_lambplot->currentIndex() ]->description = triple_desc; // ALEXEY : REplicate for all triple in the same channel
+
+ //ALEXEY: a problem here
+ //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;
//DUPL
- allData[ out_chandatx[ i ] + cb_lambplot->currentIndex() ].description = triple_desc;
+ //allData[ out_chandatx[ i ] + cb_lambplot->currentIndex() ].description = triple_desc;
+ //ALEXEY: Cause a problem when out_chandatx[ i ] + cb_lambplot->currentIndex() > allData.size(), or out_triples .count()
+
all_tripinfo[ i ].description = triple_desc;
int trxs = out_chandatx[ i ];
@@ -2829,6 +2850,8 @@
//DUPL
allData[ trx ].description = triple_desc;
}
+
+ qDebug() << "Triples Replicated !!";
}
}
else
1
0
Author: gegorbet
Date: 2019-06-08 16:11:17 +0000 (Sat, 08 Jun 2019)
New Revision: 2783
Modified:
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
Log:
limit View Optima Data runID length to 60 characters
Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-06-03 17:45:41 UTC (rev 2782)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp 2019-06-08 16:11:17 UTC (rev 2783)
@@ -2169,12 +2169,19 @@
QRegExp rx( "[^A-Za-z0-9_-]" );
int pos = 0;
+ bool runID_changed = false;
- bool runID_changed = false;
+ if ( new_runID.length() > 60 )
+ {
+ int kchar = 60 - 4 - fRunId.length();
+ new_runID = fExpNm.left( kchar ) + "-run" + fRunId;
+ runID_changed = true;
+ }
+
while ( ( pos = rx.indexIn( new_runID ) ) != -1 )
{
new_runID.replace( pos, 1, "_" ); // Replace 1 char at pos
- runID_changed = true;
+ runID_changed = true;
}
// Let the user know if the runID name has changed
@@ -2184,7 +2191,8 @@
tr( "RunId Name Changed" ),
tr( "The runId name has been changed.\nIt may consist only "
"of alphanumeric characters,\nthe underscore, and the "
- "hyphen.\nNew runId:\n " ) + new_runID );
+ "hyphen;\nand may be at most 60 characters in length."
+ "\nNew runId:\n " ) + new_runID );
}
// Set the runID and directory
@@ -2525,12 +2533,19 @@
QRegExp rx( "[^A-Za-z0-9_-]" );
int pos = 0;
+ bool runID_changed = false;
- bool runID_changed = false;
+ if ( new_runID.length() > 60 )
+ {
+ int kchar = 60 - 4 - fRunId.length();
+ new_runID = fExpNm.left( kchar ) + "-run" + fRunId;
+ runID_changed = true;
+ }
+
while ( ( pos = rx.indexIn( new_runID ) ) != -1 )
{
new_runID.replace( pos, 1, "_" ); // Replace 1 char at pos
- runID_changed = true;
+ runID_changed = true;
}
// Let the user know if the runID name has changed
@@ -2540,7 +2555,8 @@
tr( "RunId Name Changed" ),
tr( "The runId name has been changed.\nIt may consist only "
"of alphanumeric characters,\nthe underscore, and the "
- "hyphen.\nNew runId:\n " ) + new_runID );
+ "hyphen;\nand may be at most 60 characters in length."
+ "\nNew runId:\n " ) + new_runID );
}
// Set the runID and directory
@@ -3444,6 +3460,8 @@
if ( status != 0 ) return;
}
QString runIDt = le_runID->text(); // User given run ID text
+DbgLv(1) << "ExpAuc: runIDt" << runIDt;
+DbgLv(1) << "ExpAuc: runID" << runID;
if ( runIDt != runID )
{ // Set runID to new entry given by user
@@ -3456,6 +3474,15 @@
new_runID.replace( pos, 1, "_" ); // Replace 1 char at pos
}
+DbgLv(1) << "ExpAuc: new_runID len" << new_runID.length();
+ if ( new_runID.length() > 60 )
+ {
+ new_runID = QString( new_runID ).left( 52 )
+ + QString( new_runID ).right( 8 );
+DbgLv(1) << "ExpAuc: corr new_runID len" << new_runID.length();
+DbgLv(1) << "ExpAuc: new_runID" << new_runID;
+ }
+
// Let the user know that the runID name has changed
QMessageBox::warning( this,
tr( "RunId Name Changed" ),
1
0
Author: alexey
Date: 2019-06-07 16:27:00 +0000 (Fri, 07 Jun 2019)
New Revision: 76
Modified:
trunk/contacts.php
Log:
don't show "Office/Fax" laine in lab's info of each instance
Modified: trunk/contacts.php
===================================================================
--- trunk/contacts.php 2019-05-13 13:30:46 UTC (rev 75)
+++ trunk/contacts.php 2019-06-07 16:27:00 UTC (rev 76)
@@ -11,7 +11,7 @@
<td><b>Facility Administrator:</b></td>
<td><a href='mailto:<?php echo $admin_email; ?>'><?php echo $admin; ?></a><br/>
<a href='mailto:<?php echo $admin_email; ?>'><?php echo $admin_email; ?></a><br/>
- Office/Telephone: <?php echo $admin_phone; ?><br/>
+ <?php echo $admin_phone; ?><br/>
</td>
</tr>
</table>
1
0