Skip to content

Commit

Permalink
Re #10803 fixing merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Jan 8, 2015
1 parent 943d22a commit 7bd361a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Code/Mantid/scripts/Inelastic/Direct/PropertyManager.py
Expand Up @@ -345,6 +345,18 @@ def update_defaults_from_instrument(self,pInstrument,ignore_changes=False):
old_changes = self.getChangedProperties()
self.setChangedProperties(set())

# find all changes, present in the old changes list
existing_changes = old_changes.copy()
for change in old_changes:
dependencies = None
try:
prop = self.__class__.__dict__[change]
dependencies = prop.dependencies()
except:
pass
if dependencies:
existing_changes.update(dependencies)

param_list = prop_helpers.get_default_idf_param_list(pInstrument)
param_list = self._convert_params_to_properties(param_list,False)

Expand Down Expand Up @@ -377,12 +389,12 @@ def update_defaults_from_instrument(self,pInstrument,ignore_changes=False):
# is complex property changed through its dependent properties?
dependent_prop = val.dependencies()
replace_old_value = True
if public_name in old_changes:
if public_name in existing_changes:
replace_old_value = False

if replace_old_value: # may be property have changed through its dependencies
for prop_name in dependent_prop:
if prop_name in old_changes:
if prop_name in existing_changes:
replace_old_value =False
break
#
Expand All @@ -399,7 +411,7 @@ def update_defaults_from_instrument(self,pInstrument,ignore_changes=False):
pass
# simple property
else:
if public_name in old_changes:
if public_name in existing_changes:
continue
else:
old_val = getattr(self,name);
Expand Down

0 comments on commit 7bd361a

Please sign in to comment.