Author: alexey Date: 2019-05-01 21:36:51 +0000 (Wed, 01 May 2019) New Revision: 2750 Modified: trunk/programs/us_com_project/us_com_project_gui.cpp trunk/programs/us_com_project/us_com_project_gui.h trunk/programs/us_convert/us_convert_gui.cpp trunk/programs/us_convert/us_convert_gui.h Log: updates for autoflow, reattachement Modified: trunk/programs/us_com_project/us_com_project_gui.cpp =================================================================== --- trunk/programs/us_com_project/us_com_project_gui.cpp 2019-05-01 15:40:14 UTC (rev 2749) +++ trunk/programs/us_com_project/us_com_project_gui.cpp 2019-05-01 21:36:51 UTC (rev 2750) @@ -152,8 +152,8 @@ //connect( epanPostProd, SIGNAL( switch_to_analysis( QString &, QString &) ), this, SLOT( switch_to_analysis( QString &, QString & ) ) ); //connect( this, SIGNAL( pass_to_analysis( QString &, QString & ) ), epanAnalysis, SLOT( do_analysis( QString &, QString & ) ) ); + connect( epanPostProd, SIGNAL( switch_to_exp( QString & ) ), this, SLOT( switch_to_experiment( QString & ) ) ); - setMinimumSize( QSize( 1350, 800 ) ); adjustSize(); @@ -408,7 +408,13 @@ 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 + -- possible solution: return (set) to stage == "LIVE_UPDATE" & re-save to local directory on current computer + */ + if ( stage == "LIVE_UPDATE" ) { //do something @@ -1013,8 +1019,9 @@ connect( this, SIGNAL( to_post_prod( QString &, QString &, QString & ) ), sdiag, SLOT( import_data_auto ( 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 + connect( sdiag, SIGNAL( saving_complete_back_to_exp( QString & ) ), this, SLOT( to_experiment ( QString & ) ) ); - offset = 0; sdiag->move(offset, 2*offset); sdiag->setFrameShape( QFrame::Box); @@ -1034,6 +1041,11 @@ emit switch_to_analysis( currDir, protocolName ); } +void US_PostProdGui::to_experiment( QString & protocolName ) +{ + emit switch_to_exp( protocolName ); +} + void US_PostProdGui::resizeEvent(QResizeEvent *event) { int tab_width = mainw->tabWidget->tabBar()->width(); Modified: trunk/programs/us_com_project/us_com_project_gui.h =================================================================== --- trunk/programs/us_com_project/us_com_project_gui.h 2019-05-01 15:40:14 UTC (rev 2749) +++ trunk/programs/us_com_project/us_com_project_gui.h 2019-05-01 21:36:51 UTC (rev 2750) @@ -148,10 +148,12 @@ private slots: void import_data_us_convert( QString & currDir, QString & protocolName, QString & invID_passed ); 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 switch_to_analysis( QString & currDir, QString & protocolName ); + void switch_to_exp( QString & protocolName ); }; //! \brief Analysis panel Modified: trunk/programs/us_convert/us_convert_gui.cpp =================================================================== --- trunk/programs/us_convert/us_convert_gui.cpp 2019-05-01 15:40:14 UTC (rev 2749) +++ trunk/programs/us_convert/us_convert_gui.cpp 2019-05-01 21:36:51 UTC (rev 2750) @@ -4589,6 +4589,11 @@ 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 { @@ -4603,6 +4608,42 @@ } } +//Delete autoflow record upon Run abortion +void US_ConvertGui::delete_autoflow_record( void ) +{ + // Check DB connection + US_Passwd pw; + QString masterpw = pw.getPasswd(); + US_DB2* db = new US_DB2( masterpw ); + + if ( db->lastErrno() != US_DB2::OK ) + { + QMessageBox::warning( this, tr( "Connection Problem" ), + tr( "Read protocol: Could not connect to database \n" ) + db->lastError() ); + return; + } + + QStringList qry; + qry << "delete_autoflow_record" + << runID; + + //db->query( qry ); + + // OR + + int status = db->statusQuery( qry ); + + if ( status == US_DB2::NO_AUTOFLOW_RECORD ) + { + QMessageBox::warning( this, + tr( "Autoflow Record Not Deleted" ), + tr( "No autoflow record\n" + "associated with this experiment." ) ); + return; + } +} + + // Save to disk (default directory) int US_ConvertGui::saveUS3Disk( void ) { Modified: trunk/programs/us_convert/us_convert_gui.h =================================================================== --- trunk/programs/us_convert/us_convert_gui.h 2019-05-01 15:40:14 UTC (rev 2749) +++ trunk/programs/us_convert/us_convert_gui.h 2019-05-01 21:36:51 UTC (rev 2750) @@ -48,7 +48,8 @@ signals: void saving_complete_auto( QString &, QString & ); - + void saving_complete_back_to_exp( QString & ); + public slots: private: @@ -259,6 +260,8 @@ void getExpInfo_auto ( void ); void getLabInstrumentOperatorInfo_auto ( void ); + void delete_autoflow_record ( void ); + void setTripleInfo ( void ); void checkTemperature( void );
participants (1)
-
svn@svn.aucsolutions.com