Changeset dfd8233 in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Oct 28, 2017 1:17:49 PM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- c00a28ff
- Parents:
- 26f42b1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
r26f42b1 rdfd8233 120 120 self.enableButtons() 121 121 self.dataList.currentIndexChanged.connect(self.displayChange) 122 self.calculateButton.clicked.connect(self. _calculation)122 self.calculateButton.clicked.connect(self.startThread) 123 123 self.helpButton.clicked.connect(self.help) 124 124 self.estimateBgd.toggled.connect(self.toggleBgd) … … 272 272 273 273 def displayChange(self): 274 variant_ref = self. currentWidget()275 self.setCurrentData(variant_ref.toPyObject() [0])274 variant_ref = self.dataList.itemData(self.dataList.currentIndex()) 275 self.setCurrentData(variant_ref.toPyObject()) 276 276 277 277 ###################################################################### … … 283 283 self._calculator.set_y(self._data_set.y) 284 284 self._calculator.set_err(self._data_set.dy) 285 286 def _calculation(self):287 """288 Calculate the P(r) for every data set in the data list289 """290 for data_ref, pr in self._data_list.items():291 self._data_set = GuiUtils.dataFromItem(data_ref)292 self._calculator = pr293 # Set data before running the calculations294 self.update_calculator()295 # Run296 self.startThread()297 285 298 286 def model_changed(self): … … 358 346 for data in data_item: 359 347 self.setCurrentData(data) 348 ref_var = QtCore.QVariant(data) 349 self.populateDataComboBox(self._data_set.filename, ref_var) 360 350 361 351 def setCurrentData(self, data_ref): … … 369 359 self._data = data_ref 370 360 self._data_set = GuiUtils.dataFromItem(data_ref) 371 ref = QtCore.QVariant(self._data)372 self.populateDataComboBox(self._data_set.filename, ref)373 361 self._data_list[self._data] = self._calculator 374 362 … … 395 383 from Thread import CalcPr 396 384 397 # If a thread is already started, stop it 398 if self.calc_thread is not None and self.calc_thread.isrunning(): 399 self.calc_thread.stop() 400 pr = self._calculator.clone() 401 nfunc = int(UI.TabbedInversionUI._fromUtf8( 402 self.noOfTermsInput.text())) 403 self.calc_thread = CalcPr(pr, nfunc, 404 error_func=self._threadError, 405 completefn=self._completed, updatefn=None) 406 self.calc_thread.queue() 407 self.calc_thread.ready(2.5) 385 for data_ref, pr in self._data_list.items(): 386 self._data_set = GuiUtils.dataFromItem(data_ref) 387 self._calculator = pr 388 # Set data before running the calculations 389 self.update_calculator() 390 391 # If a thread is already started, stop it 392 if self.calc_thread is not None and self.calc_thread.isrunning(): 393 self.calc_thread.stop() 394 pr = self._calculator.clone() 395 nfunc = int(UI.TabbedInversionUI._fromUtf8( 396 self.noOfTermsInput.text())) 397 self.calc_thread = CalcPr(pr, nfunc, 398 error_func=self._threadError, 399 completefn=self._completed, updatefn=None) 400 self.calc_thread.queue() 401 self.calc_thread.ready(2.5) 408 402 409 403 def performEstimateNT(self): … … 437 431 from Thread import EstimatePr 438 432 439 self. _calculation()433 self.startThread() 440 434 441 435 # If a thread is already started, stop it
Note: See TracChangeset
for help on using the changeset viewer.