Changes in / [8198e63:d24e41d] in sasview
- Location:
- src/sas/sasgui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py
r2d9526d r235f514 14 14 import wx 15 15 import sys 16 from copy import deepcopy17 16 from sas.sasgui.guiframe.events import EVT_NEW_PLOT 18 17 from sas.sasgui.guiframe.events import EVT_PLOT_QRANGE … … 276 275 action_check = True 277 276 else: 278 if action_string == 'update':279 # Update all existing plots of data with this ID280 for data in event.plots:281 for panel in self.plot_panels.values():282 if data.id in panel.plots.keys():283 plot_exists = True284 # Pass each panel it's own copy of the data285 # that's being updated, otherwise things like286 # colour and line thickness are unintentionally287 # synced across panels288 self.update_panel(deepcopy(data), panel)289 return290 291 277 group_id = event.group_id 292 if group_id in self.plot_panels :278 if group_id in self.plot_panels.keys(): 293 279 #remove data from panel 294 280 if action_string == 'remove': -
src/sas/sasgui/perspectives/fitting/fitting.py
r2d9526d r489f53a 1747 1747 data_description=model.name, 1748 1748 data_id=str(page_id) + " " + data.name) 1749 plots_to_update = [] # List of plottables that have changed since last calculation1750 # Create the new theories1751 1749 if unsmeared_model is not None: 1752 unsmeared_model_plot = self.create_theory_1D(x, unsmeared_model, 1753 page_id, model, data, state, 1750 self.create_theory_1D(x, unsmeared_model, page_id, model, data, state, 1754 1751 data_description=model.name + " unsmeared", 1755 1752 data_id=str(page_id) + " " + data.name + " unsmeared") 1756 plots_to_update.append(unsmeared_model_plot)1757 1753 1758 1754 if unsmeared_data is not None and unsmeared_error is not None: 1759 unsmeared_data_plot = self.create_theory_1D(x, unsmeared_data, 1760 page_id, model, data, state, 1755 self.create_theory_1D(x, unsmeared_data, page_id, model, data, state, 1761 1756 data_description="Data unsmeared", 1762 1757 data_id="Data " + data.name + " unsmeared", 1763 1758 dy=unsmeared_error) 1764 plots_to_update.append(unsmeared_data_plot)1759 # Comment this out until we can get P*S models with correctly populated parameters 1765 1760 if sq_model is not None and pq_model is not None: 1766 sq_id = str(page_id) + " " + data.name + " S(q)" 1767 sq_plot = self.create_theory_1D(x, sq_model, page_id, model, data, state, 1761 self.create_theory_1D(x, sq_model, page_id, model, data, state, 1768 1762 data_description=model.name + " S(q)", 1769 data_id=sq_id) 1770 plots_to_update.append(sq_plot) 1771 pq_id = str(page_id) + " " + data.name + " P(q)" 1772 pq_plot = self.create_theory_1D(x, pq_model, page_id, model, data, state, 1763 data_id=str(page_id) + " " + data.name + " S(q)") 1764 self.create_theory_1D(x, pq_model, page_id, model, data, state, 1773 1765 data_description=model.name + " P(q)", 1774 data_id=pq_id) 1775 plots_to_update.append(pq_plot) 1776 # Update the P(Q), S(Q) and unsmeared theory plots if they exist 1777 wx.PostEvent(self.parent, NewPlotEvent(plots=plots_to_update, 1778 action='update')) 1766 data_id=str(page_id) + " " + data.name + " P(q)") 1779 1767 1780 1768 current_pg = self.fit_panel.get_page_by_id(page_id) -
src/sas/sasgui/perspectives/fitting/model_thread.py
r0f9ea1c r426df2e 211 211 results = self.model.calc_composition_models(x) 212 212 if results is not None: 213 pq_values, sq_values = results 213 sq_values = results[0] 214 pq_values = results[1] 214 215 215 216 -
src/sas/sasgui/plottools/plottables.py
r2d9526d r45dffa69 239 239 def replace(self, plottable): 240 240 """Replace an existing plottable from the graph""" 241 # If the user has set a custom color, ensure the new plot is the same color 242 selected_color = plottable.custom_color 241 selected_color = None 243 242 selected_plottable = None 244 243 for p in self.plottables.keys(): 245 244 if plottable.id == p.id: 246 245 selected_plottable = p 247 if selected_color is None: 248 selected_color = self.plottables[p] 246 selected_color = self.plottables[p] 249 247 break 250 if selected_plottable is not None and selected_color is not None:248 if selected_plottable is not None and selected_color is not None: 251 249 del self.plottables[selected_plottable] 252 plottable.custom_color = selected_color253 250 self.plottables[plottable] = selected_color 254 251
Note: See TracChangeset
for help on using the changeset viewer.