Skip to content

Alarm tree copy+cut+paste - #4029

Draft
LordIdra wants to merge 7 commits into
ControlSystemStudio:masterfrom
LordIdra:alarm-tree-copy-cut-paste
Draft

LordIdra wants to merge 7 commits into
ControlSystemStudio:masterfrom
LordIdra:alarm-tree-copy-cut-paste

Conversation

@LordIdra

Copy link
Copy Markdown

Part of #3995

Depends on #3987

Headline change: adds 3 new context menu buttons
image

2026-11-17.16-42-30.mp4

Implementation details

  • Pasting a node prompts you to if a deep copy should be created
  • You can only copy/cut 1 item at a time for now as I wanted to keep this PR small, but can look into this in future
  • The clipboard is stored as a field, separate from your device's clipboard
    • This is mostly to avoid having to serialize/deserialize nodes just to copy/cut/paste when it can be easily held in memory (especially if copying a very deep tree...)
  • If the clipboard is empty, the paste button is disabled
  • If you try to paste an item to a parent which already has an item with the same name, you're prompted to rename it

Other changes

  • Added overload of AlarmClientLeaf#createDetachedCopy to allow passing a new name
  • Added AlarmClientNdode#createDetachedCopy (copied from the alarm tree property editor branch)
  • Added AlarmTreeHelper#moveItem to abstract out some common code and refactored associated methods to call it
  • Refactored DuplicatePVAction to remove code duplication (ironically)
  • Added RenameDialog (used by the new paste action) and refactored RenameTreeItemAction and DuplicatePVAction to use it
  • Refactored RenameTreeItemAction to collapse a lot of duplicate code

(Sorry for the inflated diff because of refactors - figured if I was touching these classes anyway I may as well do some small cleanups)

Checklist

  • Testing:

    • The feature has automated tests
    • Tests were run
    • If not, explain how you tested your changes: Manually tested
  • Documentation:

    • The feature is documented
    • The documentation is up to date
    • Release notes:
      • Added an entry if the change is breaking or significant
      • Added an entry when adding a new feature

@georgweiss

georgweiss commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

@LordIdra, not sure about the copy scenario... Currently PVs can only occur once per alarm configuration. Or is it about copying between different configurations?

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants