[us-commits] r2790 - in trunk/programs: us_com_project us_experiment

svn at svn.aucsolutions.com svn at svn.aucsolutions.com
Mon Jul 15 19:50:17 MDT 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



More information about the us-commits mailing list