Changeset 3626 in ntrip
- Timestamp:
- Jan 22, 2012, 6:16:57 PM (13 years ago)
- Location:
- trunk/BNC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/bncpostprocess.cpp ¶
r3625 r3626 27 27 * ------------------------------------------------------------------------- 28 28 * 29 * Function:postProcessing29 * Class: t_postProcessing 30 30 * 31 31 * Purpose: Precise Point Positioning in Post-Processing Mode … … 45 45 using namespace std; 46 46 47 // 47 // Constructor 48 48 //////////////////////////////////////////////////////////////////////////// 49 t_irc postProcessingInit(t_postInput& input) { 49 t_postProcessing::t_postProcessing(QObject* parent) : QThread(parent) { 50 50 51 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(); 54 55 55 return success; 56 _isToBeDeleted = false; 57 } 58 59 // Destructor 60 //////////////////////////////////////////////////////////////////////////// 61 t_postProcessing::~t_postProcessing() { 62 if (isRunning()) { 63 wait(); 64 } 56 65 } 57 66 58 67 // 59 68 //////////////////////////////////////////////////////////////////////////// 60 t_irc postProcessingRun(const t_postInput& input) { 69 void t_postProcessing::terminate() { 70 _isToBeDeleted = true; 71 if (!isRunning()) { 72 delete this; 73 } 74 } 61 75 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 //////////////////////////////////////////////////////////////////////////// 78 void t_postProcessing::run() { 65 79 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 } 67 89 } -
TabularUnified trunk/BNC/bncpostprocess.h ¶
r3625 r3626 31 31 class t_postInput { 32 32 public: 33 QString obsFileName; 34 QString navFileName; 35 QString corrFileName; 33 QString obsFileName; 34 QString navFileName; 35 QString corrFileName; 36 36 }; 37 37 38 t_irc postProcessingInit(t_postInput& input); 39 t_irc postProcessingRun(const t_postInput& input); 38 class t_postProcessing : public QThread { 39 Q_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 }; 40 58 41 59 #endif -
TabularUnified trunk/BNC/bncwindow.cpp ¶
r3625 r3626 1144 1144 slotGetData(); 1145 1145 } 1146 1147 // Post-Processing Watcher1148 // -----------------------1149 _postWatcher = 0;1150 1146 } 1151 1147 … … 2250 2246 void bncWindow::slotStartPostProcessing() { 2251 2247 2248 _actPostProcessing->setEnabled(false); 2249 2252 2250 slotSaveOptions(); 2253 2251 2254 _actPostProcessing->setEnabled(false);2255 2252 _postProgressBar->reset(); 2256 2253 _postProgressBar->show(); 2257 2254 enableWidget(true, _postProgressLabel); 2258 2255 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(); 2267 2260 } 2268 2261 … … 2271 2264 void bncWindow::slotFinishedPostProcessing() { 2272 2265 cout << "slotFinishedPostProcessing" << endl; 2273 delete _postWatcher; 2274 _postWatcher = 0; 2266 2275 2267 enableWidget(false, _postProgressLabel); 2276 2268 _postProgressBar->hide(); 2277 2269 _actPostProcessing->setEnabled(true); 2278 2270 } 2271 2272 // Progress Bar Change 2273 //////////////////////////////////////////////////////////////////////////// 2274 void bncWindow::postProgress(float progress) { 2275 if (_postProgressBar) { 2276 _postProgressBar->setValue(int(progress*100.0)); 2277 } 2278 } -
TabularUnified trunk/BNC/bncwindow.h ¶
r3625 r3626 62 62 void CreateMenu(); 63 63 void AddToolbar(); 64 void postProgress(float progress); 64 65 65 66 public slots: … … 164 165 QLabel* _postProgressLabel; 165 166 QLineEdit* _postOutLineEdit; 166 QFutureWatcher<t_irc>* _postWatcher;167 QFuture<t_irc> _postFuture;168 167 169 168 QCheckBox* _rnxV3CheckBox;
Note:
See TracChangeset
for help on using the changeset viewer.