Changeset 180bd54 in sasview for src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
- Timestamp:
- Apr 27, 2017 6:39:35 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:
- 0215e0a
- Parents:
- 98b13f72
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
- Property mode changed from 100755 to 100644
r98b13f72 r180bd54 42 42 43 43 # Have we loaded data yet? If so, what kind 44 self. is_data = None44 self.have_data = None 45 45 # Local model for holding data 46 46 self.model = None … … 96 96 elif isinstance(data, Data1D): 97 97 self.cbSmearing.addItems(SMEARING_1D) 98 self. is_data = Data1D98 self.have_data = Data1D 99 99 else: 100 100 self.cbSmearing.addItems(SMEARING_2D) 101 self. is_data = Data2D101 self.have_data = Data2D 102 102 self.cbSmearing.setCurrentIndex(0) 103 103 … … 120 120 Respond to model change by updating 121 121 """ 122 print "MODEL CHANGED for property: %s. The value is now: %s" % \123 (MODEL[top.row()], str(self.model.item(top.row()).text()))122 #print "MODEL CHANGED for property: %s. The value is now: %s" % \ 123 # (MODEL[top.row()], str(self.model.item(top.row()).text())) 124 124 pass 125 125 … … 140 140 Accuracy combobox visibility 141 141 """ 142 if self. is_data == Data2D and self.cbSmearing.currentIndex() == 1:142 if self.have_data == Data2D and self.cbSmearing.currentIndex() == 1: 143 143 self.cbAccuracy.setVisible(True) 144 144 else: … … 165 165 # or model-held values 166 166 smearing = str(self.model.item(MODEL.index('SMEARING')).text()) 167 accuracy = str(self.model.item(MODEL.index('ACCURACY')).text()) 168 d_down = float(self.model.item(MODEL.index('PINHOLE_MIN')).text()) 169 d_up = float(self.model.item(MODEL.index('PINHOLE_MAX')).text()) 167 accuracy = "" 168 d_down = None 169 d_up = None 170 if smearing != "None": 171 accuracy = str(self.model.item(MODEL.index('ACCURACY')).text()) 172 try: 173 d_down = float(self.model.item(MODEL.index('PINHOLE_MIN')).text()) 174 except ValueError: 175 d_down = None 176 try: 177 d_up = float(self.model.item(MODEL.index('PINHOLE_MAX')).text()) 178 except ValueError: 179 d_up = None 170 180 171 181 return (smearing, accuracy, d_down, d_up)
Note: See TracChangeset
for help on using the changeset viewer.