Change request #2513

Avoid exception if parameter file structure was changed

Added by Knödlseder Jürgen almost 6 years ago. Updated almost 6 years ago.

Status:ClosedStart date:06/14/2018
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.6.0
Duration:

Description

One of the most frequent problems reported by end-users is related to changes in the parameter file structure. If parameters are added or removed to the parameter file, the file becomes incompatible to a copy that may exist in the users pfiles directory, leading to exceptions.

This issue should be solved to improve the user-experience. One possibility would be to always read the parameter file from the syspfiles folder, and update this parameter files with all available parameter that have the l attribute in the pfiles folder.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen almost 6 years ago

  • Status changed from New to Pull request
  • % Done changed from 0 to 100

I added a m_syspfiles member to GApplicationPars to handle a client specific system parameter file folder. The logic of the GApplicationPars::load() method was changed so that if a client specific system parameter file folder is set, the method loads the parameter file from that folder, and then searches for a parameter file in the user’s pfiles folder, and synchronises any values that differ in the user’s file from the values in the system file. In that way, values that were learned by the user are kept, but if the parameter file structure changed, no exception is thrown anymore.

The ctool::init_members() method now sets the m_syspfiles member of a tools GApplicationPars. However, since the parameter file is already loaded, a re-loading of the parameter file is required. This implies that a parameter file is now loaded 3 times:
  1. The user’s parameter file is loaded by GApplication
  2. The system parameter file is loaded by ctool::init_members() which calls the GApplicationPars::load() method
  3. The GApplicationPars::load() method loads the user’s parameter file again to check which parameters were changed

In principle, step 1. can be avoided by not automatically loaded the parameter file in GApplication. But since the speed penalty is negligible, I decided to keep the step for generality.

Finally, I removed the information about parameter file exceptions from the ctools FAQ since such problems should not occur any longer.

#2 Updated by Knödlseder Jürgen almost 6 years ago

  • Status changed from Pull request to Closed

Merged into devel.

Also available in: Atom PDF