Changeset 304e42f in sasview for src/sas/qtgui
- Timestamp:
- Mar 22, 2018 9:40:43 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:
- 8289ae3
- Parents:
- e51e078
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
re51e078 r304e42f 30 30 MAX_DIST = 140.0 31 31 DICT_KEYS = ["Calculator", "PrPlot", "DataPlot", "DMaxWindow", 32 "Logic", "NFunc", "NFuncEst", "BackgroundEst"] 33 34 32 "Logic", "NFuncEst"] 33 34 35 # TODO: Remove not working 36 # TODO: Explore window not working 35 37 # TODO: Update help with batch capabilities 36 38 # TODO: Method to export results in some meaningful way … … 68 70 # p(r) calculator for self._data 69 71 self._calculator = Invertor() 72 # Default to background estimate 73 self._calculator.set_est_bck(True) 70 74 # plots of self._data 71 75 self.pr_plot = None … … 151 155 152 156 self.backgroundInput.editingFinished.connect( 153 lambda: self._calculator.set_ est_bck(is_float(self.backgroundInput.text())))157 lambda: self._calculator.set_background(is_float(self.backgroundInput.text()))) 154 158 self.minQInput.editingFinished.connect( 155 159 lambda: self._calculator.set_qmin(is_float(self.minQInput.text()))) … … 305 309 self.updateDataList(ref_item) 306 310 self.setCurrentData(ref_item) 311 self.updateGuiValues() 307 312 308 313 ###################################################################### … … 355 360 if sender is self.estimateBgd: 356 361 self.backgroundInput.setEnabled(False) 362 self._calculator.set_est_bck = True 357 363 else: 358 364 self.backgroundInput.setEnabled(True) 365 self._calculator.set_est_bck = False 359 366 360 367 def openExplorerWindow(self): … … 398 405 self.performEstimate() 399 406 self.enableButtons() 407 self.updateGuiValues() 400 408 401 409 def updateDataList(self, dataRef): … … 409 417 DICT_KEYS[3]: self.dmaxWindow, 410 418 DICT_KEYS[4]: self.logic, 411 DICT_KEYS[5]: self.getNFunc(), 412 DICT_KEYS[6]: self.nTermsSuggested, 413 DICT_KEYS[7]: self.backgroundInput.text() 419 DICT_KEYS[5]: self.nTermsSuggested 414 420 } 415 421 … … 426 432 def setCurrentData(self, data_ref): 427 433 """Get the data by reference and display as necessary""" 434 if data_ref is None: 435 return 428 436 if not isinstance(data_ref, QtGui.QStandardItem): 429 437 msg = "Incorrect type passed to the P(r) Perspective" … … 437 445 self.dmaxWindow = self._data_list[data_ref].get(DICT_KEYS[3]) 438 446 self.logic = self._data_list[data_ref].get(DICT_KEYS[4]) 447 self.nTermsSuggested = self._data_list[data_ref].get(DICT_KEYS[5]) 439 448 self.updateGuiValues() 440 449 … … 451 460 QtGui.QStandardItem("{:.4g}".format(pr.get_qmax()))) 452 461 self.model.setItem(WIDGETS.W_BACKGROUND_INPUT, 453 QtGui.QStandardItem("{:.3f}".format(pr. est_bck)))462 QtGui.QStandardItem("{:.3f}".format(pr.background))) 454 463 self.model.setItem(WIDGETS.W_BACKGROUND_OUTPUT, 455 464 QtGui.QStandardItem("{:.3g}".format(pr.background))) … … 458 467 if alpha != 0: 459 468 self.regConstantSuggestionButton.setText("{:-3.2g}".format(alpha)) 460 self.regConstantSuggestionButton.setEnabled(alpha != 0)469 self.regConstantSuggestionButton.setEnabled(alpha != self._calculator.alpha) 461 470 if nterms != self.nTermsSuggested: 462 471 self.noOfTermsSuggestionButton.setText( … … 466 475 QtGui.QStandardItem("{:.2g}".format(elapsed))) 467 476 468 if isinstance(pr.chi2, list):477 if isinstance(pr.chi2, np.ndarray): 469 478 self.model.setItem(WIDGETS.W_CHI_SQUARED, 470 479 QtGui.QStandardItem("{:.3g}".format(pr.chi2[0]))) … … 500 509 self.enableButtons() 501 510 self.dataList.setCurrentIndex(0) 511 self.updateGuiValues() 502 512 503 513 ###################################################################### … … 590 600 """ 591 601 alpha, message, elapsed = output_tuple 592 # Save useful info593 602 self.updateGuiValues() 594 603 if message: … … 644 653 if self.pr_plot is None: 645 654 self.pr_plot = self.logic.newPRPlot(out, self._calculator, cov) 646 else:647 title = self.pr_plot.name648 GuiUtils.updateModelItemWithPlot(self._data, self.pr_plot, title)649 655 if self.data_plot is None: 650 656 self.data_plot = self.logic.new1DPlot(out, self._calculator) 651 else:652 title = self.data_plot.name653 GuiUtils.updateModelItemWithPlot(self._data, self.data_plot, title)654 657 self.updateDataList(self._data) 655 658 self.updateGuiValues()
Note: See TracChangeset
for help on using the changeset viewer.