webots icon indicating copy to clipboard operation
webots copied to clipboard

Add declaration to session after modifying a default PROTO parameter

Open stefaniapedrazzi opened this issue 3 years ago • 0 comments

Fixes #5026:

  • [x] when modifying a PROTO parameter the PROTO declaration is added to the world EXTERNPROTO declarations
  • [x] when displaying the PROTO URL (Add Node dialog and Node editor), use the node URL directly if the node is not found in the world declarations
  • [x] remove declaration when resetting PROTO to default value

Tests:

  • [x] open world with local PROTO not declared and select it
  • [x] open world with a not declared PROTO node as default PROTO node parameter (not written in WBT file), and select it
  • [x] modify default parameter, save world -> PROTO is added to the WBT file
  • [x] reset default parameter, save world -> PROTO is removed from the WBT file
  • [ ] use different URL in world and PROTO file for default parameter:
    • [ ] in case of default parameter -> PROTO declaration should be used
    • [ ] in case of modified parameter -> world declaration should be used
  • [ ] ...

stefaniapedrazzi avatar Aug 09 '22 10:08 stefaniapedrazzi

Currently, if the world has a different EXTERNPROTO URL than the PROTO the behavior is correct but only after saving and reverting the world. However the conflicting message is printed in the console:

Conflicting declarations for '%1' are provided: %2 and %3, the first one will be used after saving and reverting the world.
To use the other instead you will need to change it manually in the world file."

stefaniapedrazzi avatar Aug 10 '22 10:08 stefaniapedrazzi

Test suite is broken on the master branch, this PR fixes one of the current assertion failure but not the other one (see #5059) I tested locally after commenting out the other assertion that fails and all the tests passed successfully.

stefaniapedrazzi avatar Aug 11 '22 09:08 stefaniapedrazzi

All the tests are now passing and this PR is ready for review.

stefaniapedrazzi avatar Aug 17 '22 08:08 stefaniapedrazzi