Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config file corruption #109

Closed
csatt opened this issue Jul 15, 2020 · 0 comments
Closed

Config file corruption #109

csatt opened this issue Jul 15, 2020 · 0 comments
Assignees
Labels

Comments

@csatt
Copy link
Owner

csatt commented Jul 15, 2020

There are some cases where the config file gets corrupted. They occur when the Results Wizard is used to view a run and then the Wizard is closed with that run still displayed.

Case 1:
- Open Wizard and select old run
- Click "Done" to exit Wizard
- Check (or uncheck) "Lock"
Result: config file of old run is corrupted

Case 2:
- Open Wizard and select old run
- Click "Done" to exit Wizard
- Check "Plot Power"
Result: current config file is corrupted

Depending on the config file of the old run, there are also cases where the config is not corrupted per se but is reordered such that a "diff" shows differences. That should be fixed too.

@csatt csatt added the bug label Jul 15, 2020
@csatt csatt self-assigned this Jul 15, 2020
csatt added a commit that referenced this issue Jul 15, 2020
The change to the Configuration class get() method in IV_Swinger2.py fixes the reordering problem. Instead of merging the file contents with current config, it blows away the old config and creates a new one.

There are several changes to IV_Swinger2_gui.py to fix the other issues. The main change is to not apply config changes to the old result that is still displayed after the Results Wizard is exited. For example, if the Plot Power checkbutton is checked immediately after exiting the Wizard, the plot that was being viewed is not updated to plot its power. This makes sense; if the user wants to add the power plot to an old run, that should be done while still in the Wizard. Checking plot power after the Wizard is exited changes the current config, not the config of the old run. There are other changes that were needed to fix the failing cases listed in Issue #109. The swap_config() and restore_config() methods were added to reduce code duplication in the GraphicalUserInterface.apply_new_ranges() and the
PlotPower.update_plot_power() methods.
@csatt csatt closed this as completed Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant