Changes in / [f7d39c9:b7f7d3f] in sasview
- Location:
- src/sas/qtgui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rb4d05bd r0fe7e5b 977 977 if category == CATEGORY_STRUCTURE: 978 978 model = None 979 980 # Reset parameters to fit 981 self.parameters_to_fit = None 982 self.has_error_column = False 983 self.has_poly_error_column = False 984 979 985 self.respondToModelStructure(model=model, structure_factor=structure) 980 986 … … 1650 1656 Take func and throw it inside the magnet model row loop 1651 1657 """ 1652 for row_i in range(self._m odel_model.rowCount()):1658 for row_i in range(self._magnet_model.rowCount()): 1653 1659 func(row_i) 1654 1660 … … 1662 1668 if self._magnet_model.rowCount() == 0: 1663 1669 return 1664 1665 def iterateOverMagnetModel(func):1666 """1667 Take func and throw it inside the magnet model row loop1668 """1669 for row_i in range(self._magnet_model.rowCount()):1670 func(row_i)1671 1670 1672 1671 def updateFittedValues(row): … … 2228 2227 """ 2229 2228 fitted_data = self.logic.new1DPlot(return_data, self.tab_id) 2230 self.calculateResiduals(fitted_data)2229 residuals = self.calculateResiduals(fitted_data) 2231 2230 self.model_data = fitted_data 2231 2232 new_plots = [fitted_data, residuals] 2232 2233 2233 2234 # Create plots for intermediate product data … … 2236 2237 pq_data.symbol = "Line" 2237 2238 self.createNewIndex(pq_data) 2239 new_plots.append(pq_data) 2238 2240 if sq_data is not None: 2239 2241 sq_data.symbol = "Line" 2240 2242 self.createNewIndex(sq_data) 2243 new_plots.append(sq_data) 2244 2245 if self.data_is_loaded: 2246 GuiUtils.deleteRedundantPlots(self.all_data[self.data_index], new_plots) 2241 2247 2242 2248 def complete2D(self, return_data): … … 2274 2280 residuals_plot.id = "Residual " + residuals_plot.id 2275 2281 self.createNewIndex(residuals_plot) 2282 return residuals_plot 2276 2283 2277 2284 def onCategoriesChanged(self): -
src/sas/qtgui/Utilities/GuiUtils.py
r3933ee9 r0fe7e5b 292 292 # Append the new row to the main item 293 293 item.appendRow(checkbox_item) 294 295 def deleteRedundantPlots(item, new_plots): 296 """ 297 Checks all plots that are children of the given item; if any have an ID or name not included in new_plots, 298 it is deleted. Useful for e.g. switching from P(Q)S(Q) to P(Q); this would remove the old S(Q) plot. 299 300 Ensure that new_plots contains ALL the relevant plots(!!!) 301 """ 302 assert isinstance(item, QtGui.QStandardItem) 303 304 names = [p.name for p in new_plots if p.name is not None] 305 ids = [p.id for p in new_plots if p.id is not None] 306 307 items_to_delete = [] 308 309 for index in range(item.rowCount()): 310 plot_item = item.child(index) 311 if plot_item.isCheckable(): 312 plot_data = plot_item.child(0).data() 313 if (plot_data.id is not None) and (plot_data.id not in ids) and (plot_data.name not in names): 314 items_to_delete.append(plot_item) 315 316 for plot_item in items_to_delete: 317 item.removeRow(plot_item.row()) 294 318 295 319 class HashableStandardItem(QtGui.QStandardItem):
Note: See TracChangeset
for help on using the changeset viewer.