Repository navigation
Conversation
There are some use cases where the parent macros should not be used for the screen being opened and so this option has been added. Default behavior remains the same - i.e. inherit parent macros. An example case where this is needed: if one child screen is opened from one parent and the same child screen is opened from another parent then you end up with 2 of the same screen being opened as the parent screens have different macros hence the URI is different so Phoebus doesn't recognise that the screen is already open.
Specifically tests backwards compatibility for the new option for inheriting parent macros or not.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



History: CS-Studio used to have an option on the Open Display action to inherit parent macros. However, this was not ported to Phoebus as it was deemed unnecessary as no-one could think of a use case where you wouldn't want the parent's macros (see https://github.com/ControlSystemStudio/phoebus/wiki/Display-Builder-Compatibility#macros).
We have found a use case for when you might not want to inherit macros from the parent. Take the example where you have 2 separate parent screens (with different macros defined) and a single child screen (which could represent a motor or something) that both parent1 and parent2 can open:
Expected behavior: Child1 is already open and so you might expect the child1 window to be raised to the top.
Actual behavior: Because both parents have different macros that have been inherited, the URI to open child1 looks different depending on which parent it is open from. In this example the action from parent2 checks if the screen is already open, which returns false as the URI is different.
In this case we need an option to not inherit the parent's macros so that the URI looks the same from both parent1 and parent2
In this PR I have added a check box option 'inherit parent macros' to the Open Display action. The default behavior will remain the same, that is to say that 'inherit parent macros' will be true by default.
I've also added a unit test to check backwards compatibility.
Checklist
Testing:
Documentation: