Changeset 0532d7c1 in sasview
- 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
- Location:
- src/sas/qtgui
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/GuiManager.py
ra8ec5b1 r0532d7c1 141 141 #self.KIESSIGCalculator = DensityPanel(self)#KiessigPanel(self) 142 142 self.KIESSIGCalculator = KiessigPanel(self) 143 self.SlitSizeCalculator = SlitSizeCalculator(self._parent , self, manager=self._data_manager)143 self.SlitSizeCalculator = SlitSizeCalculator(self._parent) 144 144 def statusBarSetup(self): 145 145 """ -
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 -
src/sas/qtgui/UI/SlitSizeCalculator.ui
r6b9d41d r0532d7c1 22 22 </property> 23 23 <layout class="QGridLayout" name="gridLayout_3"> 24 <item row="2" column="0">25 <spacer name="verticalSpacer_2">26 <property name="orientation">27 <enum>Qt::Vertical</enum>28 </property>29 <property name="sizeHint" stdset="0">30 <size>31 <width>20</width>32 <height>40</height>33 </size>34 </property>35 </spacer>36 </item>37 24 <item row="0" column="0"> 38 25 <widget class="QGroupBox" name="groupBox"> … … 51 38 </item> 52 39 <item> 53 <widget class="QLineEdit" name="d eltaq_in">40 <widget class="QLineEdit" name="data_file"> 54 41 <property name="minimumSize"> 55 42 <size> 56 <width> 300</width>43 <width>200</width> 57 44 <height>21</height> 58 45 </size> … … 68 55 </widget> 69 56 </item> 70 <item row=" 3" column="0">71 < widget class="QPushButton" name="closeButton">72 <property name=" toolTip">73 < string><html><head/><body><p>Close this window.</p></body></html></string>57 <item row="2" column="0"> 58 <spacer name="verticalSpacer_2"> 59 <property name="orientation"> 60 <enum>Qt::Vertical</enum> 74 61 </property> 75 <property name="text"> 76 <string>Close</string> 62 <property name="sizeHint" stdset="0"> 63 <size> 64 <width>20</width> 65 <height>40</height> 66 </size> 77 67 </property> 78 </ widget>68 </spacer> 79 69 </item> 80 <item row="1" column="0" colspan=" 2">70 <item row="1" column="0" colspan="3"> 81 71 <widget class="QGroupBox" name="groupBox_2"> 82 72 <property name="title"> … … 94 84 </item> 95 85 <item> 96 <widget class="QLineEdit" name=" lengthscale_out">86 <widget class="QLineEdit" name="slit_length_out"> 97 87 <property name="minimumSize"> 98 88 <size> 99 <width>1 25</width>89 <width>110</width> 100 90 <height>21</height> 101 91 </size> … … 118 108 </item> 119 109 <item> 120 <widget class="QLineEdit" name=" lineEdit">110 <widget class="QLineEdit" name="unit_out"> 121 111 <property name="minimumSize"> 122 112 <size> 123 <width>1 20</width>113 <width>100</width> 124 114 <height>21</height> 125 115 </size> 116 </property> 117 <property name="readOnly"> 118 <bool>true</bool> 126 119 </property> 127 120 </widget> … … 132 125 </widget> 133 126 </item> 134 <item row="0" column=" 1">127 <item row="0" column="2"> 135 128 <widget class="QPushButton" name="browseButton"> 136 129 <property name="toolTip"> … … 142 135 </widget> 143 136 </item> 144 <item row=" 3" column="1">137 <item row="4" column="2"> 145 138 <widget class="QPushButton" name="helpButton"> 146 139 <property name="toolTip"> … … 152 145 </widget> 153 146 </item> 147 <item row="4" column="0"> 148 <spacer name="horizontalSpacer"> 149 <property name="orientation"> 150 <enum>Qt::Horizontal</enum> 151 </property> 152 <property name="sizeHint" stdset="0"> 153 <size> 154 <width>40</width> 155 <height>20</height> 156 </size> 157 </property> 158 </spacer> 159 </item> 160 <item row="4" column="1"> 161 <widget class="QPushButton" name="closeButton"> 162 <property name="toolTip"> 163 <string><html><head/><body><p>Close this window.</p></body></html></string> 164 </property> 165 <property name="text"> 166 <string>Close</string> 167 </property> 168 </widget> 169 </item> 170 <item row="0" column="1"> 171 <spacer name="horizontalSpacer_2"> 172 <property name="orientation"> 173 <enum>Qt::Horizontal</enum> 174 </property> 175 <property name="sizeHint" stdset="0"> 176 <size> 177 <width>40</width> 178 <height>20</height> 179 </size> 180 </property> 181 </spacer> 182 </item> 154 183 </layout> 155 184 </widget>
Note: See TracChangeset
for help on using the changeset viewer.