File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
main/java/org/csstudio/display/builder/model/macros
test/java/org/csstudio/display/builder/model/macros Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -28,20 +28,20 @@ public class DisplayMacroExpander
2828 */
2929 public static void expandDisplayMacros (final DisplayModel model ) throws Exception
3030 {
31- expand (model .runtimeChildren (), model . getMacrosOrProperties () );
31+ expand (model .runtimeChildren ());
3232 }
3333
34- private static void expand (final ChildrenProperty widgets , MacroValueProvider input ) throws Exception
34+ private static void expand (final ChildrenProperty widgets ) throws Exception
3535 {
3636 for (Widget widget : widgets .getValue ())
3737 {
3838 final Optional <WidgetProperty <Macros >> macros = widget .checkProperty (CommonWidgetProperties .propMacros );
3939 if (macros .isPresent ())
40- macros .get ().getValue ().expandValues (input );
40+ macros .get ().getValue ().expandValues (widget . getMacrosOrProperties () );
4141 // Recurse
4242 final ChildrenProperty children = ChildrenProperty .getChildren (widget );
4343 if (children != null )
44- expand (children , widget . getMacrosOrProperties () );
44+ expand (children );
4545 }
4646 }
4747}
Original file line number Diff line number Diff line change @@ -166,10 +166,12 @@ public void testTimeOfExpansion() throws Exception
166166 // When macros are expanded as the runtime starts..
167167 DisplayMacroExpander .expandDisplayMacros (model );
168168
169- // ..you get $(P)="display"
169+ // ..you get $(P)="group", since 'subgroup' defines 'P' as
170+ // '$(SAVE)', and 'group' defines 'SAVE' as '$(P)' and
171+ // 'P' as 'group'.
170172 macros = label .getEffectiveMacros ();
171173 System .out .println (macros );
172- assertThat (macros .getValue ("P" ), equalTo ("display " ));
173- assertThat (MacroHandler .replace (macros , "$(P)" ), equalTo ("display " ));
174+ assertThat (macros .getValue ("P" ), equalTo ("group " ));
175+ assertThat (MacroHandler .replace (macros , "$(P)" ), equalTo ("group " ));
174176 }
175177}
You can’t perform that action at this time.
0 commit comments