[us-commits] r2777 - in trunk: programs/us_com_project programs/us_convert programs/us_experiment programs/us_xpn_viewer sql utils

svn at svn.aucsolutions.com svn at svn.aucsolutions.com
Tue May 28 22:26:16 MDT 2019


Author: alexey
Date: 2019-05-29 04:26:14 +0000 (Wed, 29 May 2019)
New Revision: 2777

Modified:
   trunk/programs/us_com_project/us_com_project_gui.cpp
   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_experiment/us_experiment_gui_optima.cpp
   trunk/programs/us_experiment/us_experiment_gui_optima.h
   trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
   trunk/sql/us3.sql
   trunk/sql/us3_autoflow_procs.sql
   trunk/utils/us_run_protocol.cpp
   trunk/utils/us_run_protocol.h
Log:
autoflow: handling exp. label && comments



Modified: trunk/programs/us_com_project/us_com_project_gui.cpp
===================================================================
--- trunk/programs/us_com_project/us_com_project_gui.cpp	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/programs/us_com_project/us_com_project_gui.cpp	2019-05-29 04:26:14 UTC (rev 2777)
@@ -501,6 +501,7 @@
   QString correctRadii = protocol_details[ "correctRadii" ];
   QString expAborted   = protocol_details[ "expAborted" ];
   QString runID        = protocol_details[ "runID" ];
+  QString exp_label    = protocol_details[ "label" ];
   
   QDir directory( currDir );
   
@@ -508,6 +509,7 @@
   qDebug() << "1.ExpAborted: "      << protocol_details[ "expAborted" ];
   qDebug() << "1.CorrectRadii: "    << protocol_details[ "correctRadii" ];
 
+  qDebug() << "Exp. Label: "    << protocol_details[ "label" ];
  
   //ALEXEY: if stage=="EDITING" && curDir.isEmpty() (NULL)
   /*
@@ -822,6 +824,7 @@
 
 	   protocol_details[ "correctRadii" ]   = db->value( 13 ).toString();
 	   protocol_details[ "expAborted" ]     = db->value( 14 ).toString();
+	   protocol_details[ "label" ]          = db->value( 15 ).toString();
 	 }
      }
 

Modified: trunk/programs/us_convert/us_convert_gui.cpp
===================================================================
--- trunk/programs/us_convert/us_convert_gui.cpp	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/programs/us_convert/us_convert_gui.cpp	2019-05-29 04:26:14 UTC (rev 2777)
@@ -214,6 +214,14 @@
    pb_dropTrips        = us_pushbutton( tr( "Drop Selected Triples"  ), false );
    pb_dropCelch        = us_pushbutton( tr( "Drop Selected Data"     ), false );
    pb_dropChan         = us_pushbutton( tr( "Drop All Channel 'A's"  ), false );
+
+   //Comments section:
+   QLabel*    lb_comment = us_label( tr( "Comments:" ) );
+   te_comment = us_textedit();
+   te_comment->setMaximumHeight( 60 );
+   te_comment->setReadOnly( false );
+   
+   
    // Document solutio
    QLabel* lb_solution = us_label(      tr( "Solution:" ) );
    le_solutionDesc     = us_lineedit(   "", 1, true );
@@ -271,7 +279,7 @@
    ccw      ->addWidget( lb_triple,       row++, 0, 1, 12 );
    ccw      ->addWidget( lb_description,  row,   0, 1,  3 );
    ccw      ->addWidget( le_description,  row++, 3, 1,  9 );
-   ccw      ->addWidget( lw_triple,       row,   0, 4,  4 );
+   ccw      ->addWidget( lw_triple,       row,   0, 4,  4 ); // maybe ccw      ->addWidget( lw_triple,  row,   0, 3,  4 );
    //ccw      ->addWidget( lb_ccwinfo,      row++, 4, 1,  8 );
    //ccw      ->addWidget( cb_centerpiece,  row++, 4, 1,  8 );
    //ccw      ->addWidget( pb_solution,     row,   4, 1,  4 );
@@ -289,6 +297,10 @@
    ccw      ->addWidget( pb_dropChan,     row++, 8, 1,  4 );
 
    ++row;
+   //ALEXEY: insert comment for exp. here
+   ccw      ->addWidget( lb_comment,     row,   0, 1,  3 );
+   ccw      ->addWidget( te_comment,     row++, 3, 1,  9 );
+   
    ccw      ->addWidget( lb_ccwinfo,          row,   0, 1,  3 );
    ccw      ->addWidget( le_centerpieceDesc,  row++, 3, 1,  9 );
    //ccw      ->addWidget( cb_centerpiece,  row++, 3, 1,  9 );
@@ -1187,6 +1199,8 @@
   ExpData.invID     = details_at_live_update[ "invID_passed" ].toInt();
   ProtocolName_auto = details_at_live_update[ "protocolName" ];
   runID_numeric     = details_at_live_update[ "runID" ];
+
+  Exp_label         = details_at_live_update[ "label" ];
   
   int impType = getImports_auto( details_at_live_update[ "dataPath" ] );
 
@@ -2574,8 +2588,9 @@
    ExpData.expType = ProtInfo.ProtRotor.exptype; //"velocity";  //ALEXEY change to what is passed from protocol
 
    //Experiment Label
-   ExpData.label = "some label";
-
+   //ExpData.label = "some label";
+   ExpData.label = Exp_label;
+   
    // ReadCenterpieces
    QStringList q( "get_abstractCenterpiece_names" );
    db.query( q );
@@ -4787,7 +4802,10 @@
   // qDebug() << "ExpData.RI_nscans" <<  ExpData.RI_nscans;        
   // qDebug() << "ExpData.RI_nwvlns" <<  ExpData.RI_nwvlns;        
   
-    
+
+  // Comments
+  ExpData.comments = this->te_comment ->toPlainText();
+  
   // Test to see if this is multi-speed data
    QVector< int > speeds;
    int notrips  = 0;

Modified: trunk/programs/us_convert/us_convert_gui.h
===================================================================
--- trunk/programs/us_convert/us_convert_gui.h	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/programs/us_convert/us_convert_gui.h	2019-05-29 04:26:14 UTC (rev 2777)
@@ -165,6 +165,8 @@
 
       QwtCounter*   ct_tolerance;
 
+      QTextEdit*    te_comment;
+      
       QLabel*       lb_mwlctrl;
       QLabel*       lb_mwlctre;
       QLabel*       lb_lambstrt;
@@ -261,6 +263,7 @@
       bool readProtocolSolutions_auto ( QXmlStreamReader& );
 
       QString ProtocolName_auto;
+      QString Exp_label;
       
       void getExpInfo_auto ( void );
       void getLabInstrumentOperatorInfo_auto   ( void );

Modified: trunk/programs/us_experiment/us_exp_utils.cpp
===================================================================
--- trunk/programs/us_experiment/us_exp_utils.cpp	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/programs/us_experiment/us_exp_utils.cpp	2019-05-29 04:26:14 UTC (rev 2777)
@@ -438,6 +438,8 @@
    ct_tempera     ->setValue( currProto->temperature );
    ct_tedelay     ->setValue( currProto->temeq_delay );
 
+   le_label       ->setText ( currProto->exp_label ); 
+
    check_user_level();
 
 }
@@ -610,6 +612,8 @@
    currProto->temperature  = ct_tempera     ->value();
    currProto->temeq_delay  = ct_tedelay     ->value();
 
+   currProto->exp_label    = le_label       ->text();
+
 }
 
 // Get a specific panel string value

Modified: trunk/programs/us_experiment/us_experiment_gui_optima.cpp
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.cpp	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.cpp	2019-05-29 04:26:14 UTC (rev 2777)
@@ -214,7 +214,9 @@
   epanUpload->genL->addWidget( epanUpload->pb_details, 1,   0, 1, 4 );
   epanUpload->genL->addWidget( epanUpload->pb_submit,  1,   4, 1, 8 );
 
-
+  epanGeneral->lb_label->setVisible(true);
+  epanGeneral->le_label->setVisible(true);
+  
   this->pb_close->hide();
 
 }
@@ -277,7 +279,11 @@
    QSpacerItem* spacer1         = new QSpacerItem( 20, ihgt );
    QSpacerItem* spacer2         = new QSpacerItem( 20, ihgt );
 
+   //ALEXEY: if autoflow mode, add label field
+   lb_label          = us_label( tr( "Label:" ) );
+   le_label          = us_lineedit( "", 0, false );
 
+
    le_runid->setPlaceholderText("Enter Run ID to continue");
    le_project->setPlaceholderText("Select Project to continue");
 
@@ -319,6 +325,7 @@
    currProto->project      = "";
    currProto->temperature  = 20.0;
    currProto->temeq_delay  = 10.0;
+   currProto->exp_label    = "";
 
    // Build main layout
    int row         = 0;
@@ -326,6 +333,10 @@
    genL->addWidget( le_investigator, row++, 2, 1, 6 );
    genL->addWidget( lb_runid,        row,   0, 1, 2 );
    genL->addWidget( le_runid,        row++, 2, 1, 6 );
+
+   genL->addWidget( lb_label,        row,   0, 1, 2 );
+   genL->addWidget( le_label,        row++, 2, 1, 6 );
+   
    genL->addWidget( pb_protocol,     row,   0, 1, 2 );
    genL->addWidget( le_protocol,     row++, 2, 1, 6 );
    genL->addWidget( pb_project,      row,   0, 1, 2 );
@@ -342,6 +353,10 @@
    panel->addLayout( genL );
    panel->addStretch();
 
+   //ALEXEY: hide in regular us_experiment, show in auto_mode (later)
+   lb_label->hide();
+   le_label->hide();  
+
    // Set up signal and slot connections
    connect( le_runid,        SIGNAL( textEdited(const QString &)  ),
             this,            SLOT(   check_empty_runname(const QString &) ) );
@@ -538,6 +553,8 @@
       le_protocol->setText( "" );
       le_project ->setText( "" );
 
+      currProto->exp_label    = "";
+
       /////mainw->reset();  //testing
    }
 #endif
@@ -5347,6 +5364,8 @@
 	 protocol_details[ "invID_passed" ]   = QString::number(US_Settings::us_inv_ID());
 	 protocol_details[ "correctRadii" ]   = QString("YES");
 	 protocol_details[ "expAborted" ]     = QString("NO");
+
+	 protocol_details[ "label" ]          = currProto->exp_label;
 	 
          int nwavl_tot = 0;
          for ( int kk = 0; kk < rpRange->nranges; kk++ )
@@ -5421,7 +5440,8 @@
 	    << protocol_details[ "experimentName" ]
 	    << protocol_details[ "experimentId" ]
 	    << protocol_details[ "OptimaName" ]
-	    << protocol_details[ "invID_passed" ];
+	    << protocol_details[ "invID_passed" ]
+	    << protocol_details[ "label" ];
 
 	db->query( qry );
       }

Modified: trunk/programs/us_experiment/us_experiment_gui_optima.h
===================================================================
--- trunk/programs/us_experiment/us_experiment_gui_optima.h	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/programs/us_experiment/us_experiment_gui_optima.h	2019-05-29 04:26:14 UTC (rev 2777)
@@ -62,6 +62,9 @@
       void update_inv( void );
       void check_runname( void );
       int loaded_proto;
+
+      QLabel*      lb_label;
+      QLineEdit*   le_label;            // Run name line edit
             
    private:
       US_ExperimentMain*    mainw;      // Parent to all panels
@@ -79,6 +82,8 @@
       QwtCounter*  ct_tempera;          // Temperature counter
       QwtCounter*  ct_tedelay;          // Temp-equil-delay counter
 
+
+
       int          dbg_level;
       bool         use_db;              // Using the LIMS database?
       bool         usr_enab;            // Overrideable user level

Modified: trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
===================================================================
--- trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp	2019-05-29 04:26:14 UTC (rev 2777)
@@ -2050,6 +2050,7 @@
 {
   xpn_data->setEtimOffZero(); //ALEXEY: intialize etimoff to zero for the first time
 
+  experimentAborted  = false;
   counter_mins = 0;
   ElapsedTimeOffset = 0;
   
@@ -2064,7 +2065,7 @@
   correctRadii = protocol_details[ "correctRadii" ];
   expAborted   = protocol_details[ "expAborted" ];
   runID_passed = protocol_details[ "runID" ];
-
+  
   qDebug() << "RUNID_PASSED !!! " << runID_passed;
 
   details_at_live_update = protocol_details;

Modified: trunk/sql/us3.sql
===================================================================
--- trunk/sql/us3.sql	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/sql/us3.sql	2019-05-29 04:26:14 UTC (rev 2777)
@@ -103,6 +103,7 @@
   created TIMESTAMP NULL,
   corrRadii enum('YES', 'NO') NOT NULL,
   expAborted enum('NO', 'YES') NOT NULL,
+  label varchar(80) NULL,
   PRIMARY KEY (ID) )
 ENGINE = InnoDB;
 

Modified: trunk/sql/us3_autoflow_procs.sql
===================================================================
--- trunk/sql/us3_autoflow_procs.sql	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/sql/us3_autoflow_procs.sql	2019-05-29 04:26:14 UTC (rev 2777)
@@ -51,7 +51,8 @@
 				     p_runname       VARCHAR(80),
 				     p_expid         INT,
 				     p_optimaname    VARCHAR(80),
-				     p_invID         INT )
+				     p_invID         INT,
+				     p_label         VARCHAR(80) )
                                     
   MODIFIES SQL DATA
 
@@ -71,6 +72,7 @@
       expID             = p_expid,
       optimaName        = p_optimaname,
       invID             = p_invID,
+      label		= p_label,
       created           = NOW();
 
     SET @LAST_INSERT_ID = LAST_INSERT_ID();
@@ -151,7 +153,7 @@
       SELECT @OK AS status;
 
       SELECT   protName, cellChNum, tripleNum, duration, runName, expID, 
-      	       runID, status, dataPath, optimaName, runStarted, invID, created, corrRadii, expAborted 
+      	       runID, status, dataPath, optimaName, runStarted, invID, created, corrRadii, expAborted, label 
       FROM     autoflow 
       WHERE    ID = p_autoflowID;
 
@@ -195,7 +197,7 @@
       SELECT @OK AS status;
 
       SELECT   ID, protName, cellChNum, tripleNum, duration, runName, expID, 
-      	       runID, status, dataPath, optimaName, runStarted, invID, created  
+      	       runID, status, dataPath, optimaName, runStarted, invID, created, label  
       FROM     autoflow;
      
     END IF;

Modified: trunk/utils/us_run_protocol.cpp
===================================================================
--- trunk/utils/us_run_protocol.cpp	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/utils/us_run_protocol.cpp	2019-05-29 04:26:14 UTC (rev 2777)
@@ -18,6 +18,7 @@
    investigator    = "";
    temperature     = 20.0;
    temeq_delay     = 10.0;
+   exp_label       = "";
 }
 
 // RunProtocol Equality operator

Modified: trunk/utils/us_run_protocol.h
===================================================================
--- trunk/utils/us_run_protocol.h	2019-05-27 23:58:24 UTC (rev 2776)
+++ trunk/utils/us_run_protocol.h	2019-05-29 04:26:14 UTC (rev 2777)
@@ -393,6 +393,8 @@
       QString      project;        //!< Project description
       QString      optimahost;     //!< Optima host (numeric IP address)
 
+      QString      exp_label;      // Exp. label, not presetn in standalone us_experiment
+
       int          projectID; 
       double       temperature;    //!< Run temperature in degrees centigrade
       double       temeq_delay;    //!< Temperature-equilibration delay minutes



More information about the us-commits mailing list