Changeset debf5c3 in sasview for src/sas/qtgui/SlitSizeCalculator.py
- Timestamp:
- Dec 14, 2016 12:19:57 AM (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:
- ab9984e
- Parents:
- 3a0ce4f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/SlitSizeCalculator.py
r3a0ce4f rdebf5c3 3 3 from UI.SlitSizeCalculator import Ui_SlitSizeCalculator 4 4 from sas.sascalc.dataloader.loader import Loader 5 from sas.sasgui.guiframe.dataFitting import Data1D6 from sas.sasgui.guiframe.dataFitting import Data2D7 5 from sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator 8 6 … … 11 9 12 10 class SlitSizeCalculator(QtGui.QDialog, Ui_SlitSizeCalculator): 11 """ 12 Provides the slit length calculator GUI. 13 """ 13 14 def __init__(self, parent=None): 14 15 super(SlitSizeCalculator, self).__init__() … … 31 32 def onHelp(self): 32 33 """ 33 Bring up the Kiessig fringecalculator Documentation whenever34 Bring up the Slit Size Calculator calculator Documentation whenever 34 35 the HELP button is clicked. 35 36 Calls DocumentationWindow with the path of the location within the … … 48 49 def onBrowse(self): 49 50 """ 50 Execute the computation of thickness51 Browse the file and calculate slit lenght upon loading 51 52 """ 52 53 path_str = self.chooseFile() … … 57 58 58 59 self.data_file.setText(os.path.basename(path_str)) 59 #We are loading data for one model only therefor index 060 60 self.calculateSlitSize(data) 61 61 … … 70 70 "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", None, 71 71 QtGui.QFileDialog.DontUseNativeDialog) 72 72 73 if path is None: 73 74 return … … 86 87 def calculateSlitSize(self, data=None): 87 88 """ 88 Complete the loading and compute the slit size89 Computes slit lenght from given 1D data 89 90 """ 90 91 … … 93 94 raise RuntimeError, msg 94 95 95 if isinstance(data, Data2D) ordata.__class__.__name__ == 'Data2D':96 if data.__class__.__name__ == 'Data2D': 96 97 msg = "Slit Length cannot be computed for 2D Data" 97 98 raise Exception, msg … … 101 102 x = data.x 102 103 y = data.y 103 if x == [] or 104 if x == [] or x is None or y == [] or y is None: 104 105 msg = "The current data is empty please check x and y" 105 106 raise ValueError, msg … … 113 114 slit_length_str = "{:.5f}".format(slit_length) 114 115 self.slit_length_out.setText(slit_length_str) 115 #Display unit 116 117 #Display unit, which most likely needs to be 1/Ang but needs to be confirmed 116 118 self.unit_out.setText("[Unknown]") 117 119
Note: See TracChangeset
for help on using the changeset viewer.