- Timestamp:
- Feb 23, 2017 8:49:45 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:
- 6ee82dd
- Parents:
- 84be77e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
rb9c4c1e1 r3f4c12f 31 31 self._poly_model = QtGui.QStandardItemModel() 32 32 self.tableView.setModel(self._model_model) 33 34 33 self._readCategoryInfo() 34 self.model_parameters = None 35 35 36 36 structure_factor_list = self.master_category_dict.pop('Structure Factor') … … 62 62 self.setPolyModel() 63 63 self.setTableProperties(self.tableView_2) 64 65 for row in range(2):66 c = QtGui.QComboBox()67 c.addItems(['rectangle','array','lognormal','gaussian','schulz',])68 i = self.tableView_2.model().index(row,6)69 self.tableView_2.setIndexWidget(i,c)70 64 71 65 def selectCategory(self): … … 141 135 model_name = str(model_name) 142 136 kernel_module = generate.load_kernel_module(model_name) 143 parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', []))137 self.model_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', [])) 144 138 145 139 #TODO: scaale and background are implicit in sasmodels and needs to be added … … 162 156 #TODO: iq_parameters are used here. If orientation paramateres or magnetic are needed kernel_paramters should be used instead 163 157 #For orientation and magentic parameters param.type needs to be checked 164 for param in parameters.iq_parameters:158 for param in self.model_parameters.iq_parameters: 165 159 item1 = QtGui.QStandardItem(param.name) 166 160 item1.setCheckable(True) … … 176 170 self._model_model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Max")) 177 171 self._model_model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("[Units]")) 172 173 self.setPolyModel() 178 174 179 175 def setTableProperties(self, table): … … 200 196 :return: 201 197 """ 202 item1 = QtGui.QStandardItem("Distribution of radius") 203 item1.setCheckable(True) 204 item2 = QtGui.QStandardItem("0") 205 item3 = QtGui.QStandardItem("") 206 item4 = QtGui.QStandardItem("") 207 item5 = QtGui.QStandardItem("35") 208 item6 = QtGui.QStandardItem("3") 209 item7 = QtGui.QStandardItem("") 210 self._poly_model.appendRow([item1, item2, item3, item4, item5, item6, item7]) 211 item1 = QtGui.QStandardItem("Distribution of thickness") 212 item1.setCheckable(True) 213 item2 = QtGui.QStandardItem("0") 214 item3 = QtGui.QStandardItem("") 215 item4 = QtGui.QStandardItem("") 216 item5 = QtGui.QStandardItem("35") 217 item6 = QtGui.QStandardItem("3") 218 item7 = QtGui.QStandardItem("") 219 self._poly_model.appendRow([item1, item2, item3, item4, item5, item6, item7]) 198 199 if self.model_parameters: 200 for row, param in enumerate(self.model_parameters.form_volume_parameters): 201 item1 = QtGui.QStandardItem("Distribution of "+param.name) 202 item1.setCheckable(True) 203 item2 = QtGui.QStandardItem("0") 204 item3 = QtGui.QStandardItem("") 205 item4 = QtGui.QStandardItem("") 206 item5 = QtGui.QStandardItem("35") 207 item6 = QtGui.QStandardItem("3") 208 item7 = QtGui.QStandardItem("") 209 210 self._poly_model.appendRow([item1, item2, item3, item4, item5, item6, item7]) 211 212 #TODO: Need to find cleaner way to input functions 213 func = QtGui.QComboBox() 214 func.addItems(['rectangle','array','lognormal','gaussian','schulz',]) 215 func_index = self.tableView_2.model().index(row,6) 216 self.tableView_2.setIndexWidget(func_index,func) 220 217 221 218 self._poly_model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter")) … … 232 229 header.setStretchLastSection(True) 233 230 234 235 231 if __name__ == "__main__": 236 232 app = QtGui.QApplication([])
Note: See TracChangeset
for help on using the changeset viewer.