Closed amitantony closed 4 months ago
Ah I know now what the issue is! The behavior of the function itself is actually as intended. The problem is that the recursive field assignment is used in two different contexts:
In the first context, it does what it should, but in the second it does the wrong thing (overwrite with default values).
What I suggest is to add an additional, required bool argument "overwrite" in third position such that the function looks like assigned = matRad_recursiveFieldAssignment(assignTo,reference,overwrite,fieldChangedWarningMessage,fieldname)
, which tells us if we overwrite existing values on the lowest level or not.
Should fix the overwriting of existing pln fields' value and assign the existing value
but if the existing value is empty then assign reference value