Changeset 0532d7c1 in sasview for src/sas/qtgui/SlitSizeCalculator.py
- Timestamp:
- Dec 13, 2016 9:32:03 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:
- 3a0ce4f
- Parents:
- 8696721
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/SlitSizeCalculator.py
r253e7170 r0532d7c1 7 7 from sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator 8 8 9 import sys9 import os 10 10 11 11 class SlitSizeCalculator(QtGui.QDialog, Ui_SlitSizeCalculator): 12 def __init__(self, parent=None , guimanager=None, manager=None):12 def __init__(self, parent=None): 13 13 super(SlitSizeCalculator, self).__init__() 14 14 self.setupUi(self) … … 16 16 self.setWindowTitle("Slit Size Calculator") 17 17 self._parent = parent 18 self._guimanager = guimanager19 self._manager = manager20 18 21 19 self.thickness = SlitlengthCalculator() … … 28 26 # no reason to have this widget resizable 29 27 self.setFixedSize(self.minimumSizeHint()) 28 30 29 31 30 def onHelp(self): … … 56 55 data = loader.load(path_str) 57 56 58 self.d eltaq_in.setText(path_str)57 self.data_file.setText(os.path.basename(path_str)) 59 58 #We are loading data for one model only therefor index 0 60 self.complete_loading(data) 61 #Complete loading here 59 self.calculateSlitSize(data) 62 60 63 61 def chooseFile(self): … … 69 67 # But only with Qt built-in dialog (non-platform native) 70 68 path = QtGui.QFileDialog.getOpenFileName(self, "Choose a file", "", 71 "SA S data 1D(*.txt *.TXT *.dat *.DAT)", None,69 "SAXSess 1D data (*.txt *.TXT *.dat *.DAT)", None, 72 70 QtGui.QFileDialog.DontUseNativeDialog) 73 71 if path is None: … … 85 83 self.close() 86 84 87 def c omplete_loading(self, data=None):85 def calculateSlitSize(self, data=None): 88 86 """ 89 87 Complete the loading and compute the slit size … … 112 110 raise RuntimeError, msg 113 111 114 print("Slit lenght",slit_length)115 self. lengthscale_out.setText(str(slit_length))112 slit_length_str = "{:.5f}".format(slit_length) 113 self.slit_length_out.setText(slit_length_str) 116 114 #Display unit 117 self. lineEdit.setText("[UNKNOWN]")115 self.unit_out.setText("[Unknown]") 118 116
Note: See TracChangeset
for help on using the changeset viewer.