Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement merging of codeplugs #426

Closed
hmatuschek opened this issue Apr 22, 2024 · 10 comments
Closed

Implement merging of codeplugs #426

hmatuschek opened this issue Apr 22, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@hmatuschek
Copy link
Owner

This is needed to implement the import of CHIRP CSV files. The simple CHRIP format does not contain a proper codeplug for FM capable DMR radios. Consequently, the CHIRP FM channels must be imported into an existing codeplug. Hence, an import/merge function is needed anyway.

This, however, is highly non-trivial, as the elements of codeplugs are linked. So, I cannot simply copy channels, zones, etc from another codeplug. Also, how to handle duplicates? My suggestion would be: Allow the user to select a merge strategy for items (atomic element like channel, contact) and sets (groups/lists of elements like zones, group lists, ...). I.e.,

  1. Items: ignore/override/duplicate
  2. Sets: ignore/override/duplicate/merge
  • Ignore: Duplicate (same name) elements are not imported.
  • override: Duplicate elements are overriden.
  • duplicate: Duplicate elements are added to the codeplug with modified name.
  • merge: Duplicate sets are merged.
@hmatuschek hmatuschek added the enhancement New feature or request label Apr 22, 2024
@allesand
Copy link

allesand commented Apr 28, 2024

The import dialog presents the option to import *.yaml, but the file picker dialog does not show any of the .yaml files in the directory. Should importing another QDMR codeplug (aka "codeplug merging") work already?
Filtering for .csv seems to work, but I do not habe any chirp-configs to test. Merging DMR codeplug would be pretty cool, though!

@hmatuschek
Copy link
Owner Author

The import dialog presents the option to import *.yaml, but the file picker dialog does not show any of the .yaml files in the directory. Should importing another QDMR codeplug (aka "codeplug merging") work already? Filtering for .csv seems to work, but I do not habe any chirp-configs to test. Merging DMR codeplug would be pretty cool, though!

Should be fixed now.

@allesand
Copy link

allesand commented Apr 29, 2024

Yes, selecting .yaml files works now!

Note: the description below "Items" in the "Merge Codeplugs" window does change with the selected option, the one below "Sets" does not.

I tried to import the following .yaml into an empty codeplug:

---
version: 0.12.0
settings:
  introLine1: ""
  introLine2: ""
  micLevel: 3
  speech: false
  power: High
  squelch: 1
  vox: 0
  tot: 0
radioIDs:
  []
contacts:
  - dmr: {id: cont1, name: AB1CDE, ring: false, type: PrivateCall, number: 1234567}
groupLists:
  []
channels:
  []
zones:
  []
commercial:
  encryptionKeys:
    []
...

I expected that one contact to be added to the empty codeplug, but it does not seem to work?

@hmatuschek
Copy link
Owner Author

Which strategy did you select? The result would be correct, if you selected Ignore for items.

@allesand
Copy link

  • Started qdmr, empty codeplug, selected "Import", above file and "Duplicate / Duplicate" in the "Merge" window
  • Contact from above file is not showing up in the "Contacts" tab
  • Should it not be imported in the empty codeplug with this workflow?

@hmatuschek
Copy link
Owner Author

  • Started qdmr, empty codeplug, selected "Import", above file and "Duplicate / Duplicate" in the "Merge" window

    • Contact from above file is not showing up in the "Contacts" tab

    • Should it not be imported in the empty codeplug with this workflow?

Ok, I can reproduce it. Unfortunately, not in the unit tests. This is weird.

@hmatuschek
Copy link
Owner Author

Fixed it. Was a stupid typo.

@allesand
Copy link

allesand commented Apr 30, 2024

Fixed it. Was a stupid typo.

Works! Will try some more with different options and report. Thanks!

Side note: since merged items get added to the end: how much work would implementing #259 be, for example "move by 10"?

@hmatuschek
Copy link
Owner Author

Does the merge itself work so far? If so, I would merge it into devel. Concerning the "move by 10" feature request, I would rather prefer a drag-and-drop implementation.

@allesand
Copy link

allesand commented May 2, 2024

I only imported contacts so far - that worked as expected. Trying more complex merges of zones etc. is next todo. But general workflow functions as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants