Changeset 3626 in ntrip


Ignore:
Timestamp:
Jan 22, 2012, 6:16:57 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncpostprocess.cpp

    r3625 r3626  
    2727 * -------------------------------------------------------------------------
    2828 *
    29  * Function:   postProcessing
     29 * Class:      t_postProcessing
    3030 *
    3131 * Purpose:    Precise Point Positioning in Post-Processing Mode
     
    4545using namespace std;
    4646
    47 //
     47// Constructor
    4848////////////////////////////////////////////////////////////////////////////
    49 t_irc postProcessingInit(t_postInput& input) {
     49t_postProcessing::t_postProcessing(QObject* parent) : QThread(parent) {
     50
    5051  bncSettings settings;
    51   input.obsFileName  = settings.value("postObsFile").toString();
    52   input.navFileName  = settings.value("postNavFile").toString();
    53   input.corrFileName = settings.value("postcorrFile").toString();
     52  _input.obsFileName  = settings.value("postObsFile").toString();
     53  _input.navFileName  = settings.value("postNavFile").toString();
     54  _input.corrFileName = settings.value("postcorrFile").toString();
    5455
    55   return success;
     56  _isToBeDeleted = false;
     57}
     58
     59// Destructor
     60////////////////////////////////////////////////////////////////////////////
     61t_postProcessing::~t_postProcessing() {
     62  if (isRunning()) {
     63    wait();
     64  }
    5665}
    5766
    5867//
    5968////////////////////////////////////////////////////////////////////////////
    60 t_irc postProcessingRun(const t_postInput& input) {
     69void t_postProcessing::terminate() {
     70  _isToBeDeleted = true;
     71  if (!isRunning()) {
     72    delete this;
     73  }
     74}
    6175
    62   cout << "obsFile: "  << input.obsFileName.toAscii().data()  << endl;
    63   cout << "navFile: "  << input.navFileName.toAscii().data()  << endl;
    64   cout << "corrFile: " << input.corrFileName.toAscii().data() << endl;
     76// 
     77////////////////////////////////////////////////////////////////////////////
     78void t_postProcessing::run() {
    6579
    66   return success;
     80  cout << "obsFile: "  << _input.obsFileName.toAscii().data()  << endl;
     81  cout << "navFile: "  << _input.navFileName.toAscii().data()  << endl;
     82  cout << "corrFile: " << _input.corrFileName.toAscii().data() << endl;
     83
     84  int MAXI = 10;
     85  for (int ii = 1; ii < MAXI; ii++) {
     86    cout << "ii = " << ii << endl;
     87    sleep(1);
     88  }
    6789}
  • trunk/BNC/bncpostprocess.h

    r3625 r3626  
    3131class t_postInput {
    3232 public:
    33   QString obsFileName;
    34   QString navFileName;
    35   QString corrFileName;
     33  QString    obsFileName;
     34  QString    navFileName;
     35  QString    corrFileName;
    3636};
    3737
    38 t_irc postProcessingInit(t_postInput& input);
    39 t_irc postProcessingRun(const t_postInput& input);
     38class t_postProcessing : public QThread {
     39Q_OBJECT
     40 
     41 public:
     42  t_postProcessing(QObject* parent);
     43
     44 protected:
     45  ~t_postProcessing();
     46
     47 signals:
     48  void finished();
     49   
     50 public:
     51  void terminate();
     52  virtual void run();
     53 
     54 private:
     55  t_postInput _input;
     56  bool        _isToBeDeleted;
     57};
    4058
    4159#endif
  • trunk/BNC/bncwindow.cpp

    r3625 r3626  
    11441144    slotGetData();
    11451145  }
    1146 
    1147   // Post-Processing Watcher
    1148   // -----------------------
    1149   _postWatcher = 0;
    11501146}
    11511147
     
    22502246void bncWindow::slotStartPostProcessing() {
    22512247
     2248  _actPostProcessing->setEnabled(false);
     2249
    22522250  slotSaveOptions();
    22532251
    2254   _actPostProcessing->setEnabled(false);
    22552252  _postProgressBar->reset();
    22562253  _postProgressBar->show();
    22572254  enableWidget(true, _postProgressLabel);
    22582255
    2259   t_postInput input;
    2260   postProcessingInit(input);
    2261 
    2262   _postWatcher = new QFutureWatcher<t_irc>;
    2263   connect(_postWatcher, SIGNAL(finished()), this, SLOT(slotFinishedPostProcessing()));
    2264 
    2265   _postFuture = QtConcurrent::run(postProcessingRun, input);
    2266   _postWatcher->setFuture(_postFuture);
     2256  t_postProcessing* postProcessing = new t_postProcessing(this);
     2257  connect(postProcessing, SLOT(finished()), this, SIGNAL(slotFinishedPostProcessing));
     2258
     2259  postProcessing->start();
    22672260}
    22682261
     
    22712264void bncWindow::slotFinishedPostProcessing() {
    22722265  cout << "slotFinishedPostProcessing" << endl;
    2273   delete _postWatcher;
    2274   _postWatcher = 0;
     2266
    22752267  enableWidget(false, _postProgressLabel);
    22762268  _postProgressBar->hide();
    22772269  _actPostProcessing->setEnabled(true);
    22782270}
     2271
     2272// Progress Bar Change
     2273////////////////////////////////////////////////////////////////////////////
     2274void bncWindow::postProgress(float progress) {
     2275  if (_postProgressBar) {
     2276    _postProgressBar->setValue(int(progress*100.0));
     2277  }
     2278}
  • trunk/BNC/bncwindow.h

    r3625 r3626  
    6262    void CreateMenu();
    6363    void AddToolbar();
     64    void postProgress(float progress);
    6465
    6566  public slots: 
     
    164165    QLabel*        _postProgressLabel;
    165166    QLineEdit*     _postOutLineEdit;
    166     QFutureWatcher<t_irc>* _postWatcher;
    167     QFuture<t_irc>         _postFuture;
    168167
    169168    QCheckBox* _rnxV3CheckBox;
Note: See TracChangeset for help on using the changeset viewer.