- Timestamp:
- Dec 14, 2016 2:29:00 AM (8 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:
- abc5e70
- Parents:
- debf5c3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/SlitSizeCalculator.py
rdebf5c3 rab9984e 1 """ 2 Slit Size Calculator Panel 3 """ 4 import os 5 import sys 6 1 7 from PyQt4 import QtGui 2 8 from PyQt4 import QtCore … … 5 11 from sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator 6 12 7 import os8 import sys9 13 10 14 class SlitSizeCalculator(QtGui.QDialog, Ui_SlitSizeCalculator): … … 68 72 # But only with Qt built-in dialog (non-platform native) 69 73 path = QtGui.QFileDialog.getOpenFileName(self, "Choose a file", "", 70 "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", None,71 QtGui.QFileDialog.DontUseNativeDialog)74 "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", None, 75 QtGui.QFileDialog.DontUseNativeDialog) 72 76 73 77 if path is None: … … 100 104 #compute the slit size 101 105 try: 102 x= data.x103 y= data.y104 if x == [] or x is None or y == [] or yis None:105 106 107 108 slit_length_calculator.set_data(x=x, y=y)109 106 xdata = data.x 107 ydata = data.y 108 if xdata == [] or xdata is None or ydata == [] or ydata is None: 109 msg = "The current data is empty please check x and y" 110 raise ValueError, msg 111 slit_length_calculator = SlitlengthCalculator() 112 slit_length_calculator.set_data(x=xdata, y=ydata) 113 slit_length = slit_length_calculator.calculate_slit_length() 110 114 except: 111 112 115 msg = "Slit Size Calculator: %s" % (sys.exc_value) 116 raise RuntimeError, msg 113 117 114 118 slit_length_str = "{:.5f}".format(slit_length)
Note: See TracChangeset
for help on using the changeset viewer.