Changeset 2809


Ignore:
Timestamp:
Aug 13, 2019 8:56:22 PM (3 months ago)
Author:
alexey
Message:

Autoflow: proper closing/resetting lvie_update stage processes when clicking Manage Optima Runs; needs testing

Location:
trunk/programs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/programs/us_com_project/us_com_project_gui.cpp

    r2801 r2809  
    385385          1. Avaiting for run to be launched ("Back to Managing Optima Runs") -- SET
    386386    2. More complex: Back to Managing runs from active LIVE_UPDATE stage -- stop all timers and other processes...
    387     */
     387    */
     388
    388389    qDebug() << "Jumping from LIVE UPDATE.";
    389390   
    390391    //2. Stop all timers/threads, reset GUI - when stopping fully working LIVE UPDATE
    391392    if ( !xpn_viewer_closed_soft )
    392       emit reset_live_update();
     393      {
     394        //emit reset_live_update();
     395        epanObserv->sdiag->reset_liveupdate_panel_public();
     396      }
    393397  }
    394398
  • trunk/programs/us_com_project/us_com_project_gui.h

    r2799 r2809  
    173173      ~US_ObservGui() {};
    174174
     175      US_XpnDataViewer*     sdiag;
     176
    175177 private:
    176178      US_ComProjectMain*    mainw;      // Parent to all panels
    177       US_XpnDataViewer*    sdiag;
     179      //US_XpnDataViewer*     sdiag;
    178180      int offset;
    179181
  • trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp

    r2800 r2809  
    245245   in_reload_data_init = false;
    246246   in_reload_check_sysdata  = false;
    247 
     247   in_reload_end_processes  = false;
     248   
    248249   ElapsedTimeOffset = 0;
    249250
     
    21422143}
    21432144
     2145
     2146// Reset LIVE UPDATE panel && stop timers && quit threads
     2147void US_XpnDataViewer::reset_liveupdate_panel_public ( void )
     2148{
     2149  reset_liveupdate_panel();
     2150}
     2151
     2152
    21442153// Reset LIVE UPDATE panel && stop timers && quit threads
    21452154void US_XpnDataViewer::reset_liveupdate_panel ( void )
     
    21962205    qDebug() << "QTimer timer_data_reload STOPPED by clickig Manage Optima runs !!! ";
    21972206  /*************************************/
     2207
     2208  qDebug() << "BEFORE: " << in_reload_auto << ", " << in_reload_all_data << ", " << in_reload_data_init << ", " << in_reload_check_sysdata;
    21982209 
    2199   reset_auto();
    2200 
    2201   qDebug() << in_reload_auto << ", " << in_reload_all_data << ", " << in_reload_data_init << ", " << in_reload_check_sysdata;
     2210  //ALEXEY: should wait for execution of all below variables to be false (end of all timer functions) BEFORE reset_all();
     2211  // Introduce QTimer which checks for all abpve vartibales to be false (check all related functions to always reset them to false on completion)
     2212  // Put reset_auto() into the timer && and stop/disconnect timer from within connected SLOT.
     2213  timer_end_processes = new QTimer;
     2214  connect(timer_end_processes, SIGNAL(timeout()), this, SLOT( end_processes ( ) ));
     2215  timer_end_processes->start(2000);     // 5 sec
    22022216 
    2203   in_reload_auto    = false;
    2204   in_reload_all_data  = false;
    2205   in_reload_data_init = false;
    2206   in_reload_check_sysdata  = false;
     2217  //reset_auto();
     2218  //qApp->processEvents();
     2219}
     2220
     2221//to end all existing update processes
     2222void US_XpnDataViewer::end_processes( void )
     2223{
     2224  if ( in_reload_end_processes )            // If already doing a reload,
     2225    return;                              //  skip starting a new one
    22072226 
    2208   qApp->processEvents();
     2227  in_reload_end_processes   = true;          // Flag in the midst of a reload
     2228 
     2229  if ( !in_reload_auto && !in_reload_all_data &&  !in_reload_data_init && !in_reload_check_sysdata )
     2230    {
     2231     
     2232      timer_end_processes->stop();
     2233      disconnect(timer_end_processes, SIGNAL(timeout()), 0, 0);   //Disconnect timer from anything
     2234     
     2235      reset_auto();
     2236      qDebug() << "LIVE UPDATE panel has been reset!";
     2237      qDebug() << "AFTER: " << in_reload_auto << ", " << in_reload_all_data << ", " << in_reload_data_init << ", " << in_reload_check_sysdata;
     2238     
     2239      qApp->processEvents();
     2240       
     2241      //in_reload_end_processes   = false;
     2242    }
     2243  else
     2244    in_reload_end_processes   = false;
    22092245}
    22102246
     
    39293965        updateautoflow_record_atLiveUpdate();
    39303966        reset_auto();
     3967
     3968        in_reload_auto   = false;
    39313969       
    39323970        //emit experiment_complete_auto( currentDir, ProtocolName, invID_passed, correctRadii  );  // Updtade later: what should be passed with signal ??
  • trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.h

    r2799 r2809  
    9696     US_XpnDataViewer(QString auto_mode);
    9797
     98     void   reset_liveupdate_panel_public ( void );
     99     
    98100  private:
    99101     bool auto_mode_bool;
     
    254256     bool           in_reload_all_data;
    255257     bool           in_reload_check_sysdata;
     258     bool           in_reload_end_processes;
    256259
    257260     
     
    267270     QTimer*        timer_all_data_avail;
    268271     QTimer*        timer_check_sysdata;
     272
     273     QTimer*        timer_end_processes;
    269274
    270275     QElapsedTimer*  elapsed_timer;
     
    309314     //void   retrieve_xpn_raw_auto ( QString & );
    310315     void   retrieve_xpn_raw_auto ( void );
     316     void   end_processes ( void );
    311317     void   reloadData_auto     ( void );
    312318     int    CheckExpComplete_auto( QString & );
Note: See TracChangeset for help on using the changeset viewer.