Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#275 closed defect (fixed)

Save Analysis in File Menu greyed out after fitting a model!

Reported by: smk78 Owned by:
Priority: major Milestone: SasView 3.1.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description

Hello!
When trying to “Save Analysis” after fitting a model, the option is grayed out and disappears. I’ve attached a screen shot just to confirm.

If I start with a new model, and before pressing “Fit”, I can “Save Analysis”. Afterwards, I can fit the model and then save the fitted analysis. After that if I change models again, AGAIN I need to “Save Analysis” first, or I can’t save anything if I try to Fit the model first.

Opening the analyses gave no issues.

Not a major issue, but without finding the loophole, would be annoying. Hope the phrasing wasn’t too confusing.

Thanks!
Happy Thoughts,
Jes

jessie.sun@…

Attachments (3)

JS-ScreenShot-SASview-UnableToSaveAnalysisError-03Dec14.png (147.2 KB) - added by smk78 9 years ago.
Screen shot illustrating bug
a_22487_rear.xml (22.6 KB) - added by krzywon 9 years ago.
Data set with no resolution
113217.xml (124.9 KB) - added by krzywon 9 years ago.
*Real* Data set with no resolution - Ignore the previous file.

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by smk78

Screen shot illustrating bug

comment:1 Changed 9 years ago by krzywon

The root cause of this issue seems to be fitting data without no resolution data, that is to say, resolutions all set to 0. I've replicated the issue with the attached data set and will try to figure out the underlying issue soon.

Changed 9 years ago by krzywon

Data set with no resolution

Changed 9 years ago by krzywon

*Real* Data set with no resolution - Ignore the previous file.

comment:2 Changed 9 years ago by krzywon

I've been looking at this and think I found the underlying cause. This effects *all* data sets, regardless of the error values of the data. The issue seems to be a boolean in the PanelBase? class called _save_flag. If this flag is false for the window in focus, the "Save Analysis" option is disabled. For plot windows, this flag is false because individual plots cannot be saved. This includes plots displaying fits. When performing a fit, a new window appears, and the _save_flag is enabled, but when focusing on another plot window (e.g. the residuals), the _save_flag is set to the default value for plottables, which is false, disabling the Save Analysis function. Switching focus to the main fit panel does not change the active panel, which might be a bug.

The Save Analysis button is still enabled on the graphical toolbar, so users can still save the analyses, but not without a bit of pain.

I see a few ways to fix this:
(1) Make each plot savable as an analysis item. This would allow for each plot window to be saved as a separate file.
(2) Allow focus on the main fitting window. The fact that this isn't possible might just be a bug.
(3) Change how the Save Analysis feature is enabled. Add a 'persist_save_flag' or something similar to keep the "Save Analysis" function enabled until all analyses are deleted.
(4) Change how "Save Analysis" works by keeping a registry of fits/p(r)/etc. in memory and select which analysis is desired when saving. If the registry is empty, then disable the menu and toolbar items.

My suggestion is (4), but that might require a complete rewrite of the Save Project and Save Analysis concepts.

comment:3 Changed 9 years ago by smk78

Would (2) be an easy interim fix?

comment:4 Changed 9 years ago by krzywon

  • Resolution set to fixed
  • Status changed from new to closed

After some digging, I found the FitPage? class (class for each fitting window) had no way to catch a focus event. I added a wx event handler for focus and created a method to handle enabling and disabling the Save Analysis menu item. This now seems to work so long as the fitting window is the window in focus.

comment:5 Changed 8 years ago by butler

  • Milestone changed from SasView Next Release +1 to SasView 3.1.0
Note: See TracTickets for help on using tickets.