OpenRTX / dmrconfig

Configuration utility for DMR radios
BSD 3-Clause "New" or "Revised" License
233 stars 55 forks source link

Ignore missing channels in zones/scanlists #22

Open prokrypt opened 5 years ago

prokrypt commented 5 years ago

I like to group my channels together in blocks, and sometimes I delete channels by removing the entire line. It would be much easier if dmrconfig can ignore missing channels within defined ranges in zones and scanlists. Maybe just throw non-fatal warnings, or a list/count of missing channels? Maybe just ignore silently? Also, maybe throw a warning when a channel is not listed in any zone. I just found one :|

Serial port: /dev/ttyACM0
Connect to BTECH DMR-6x2.
Read device: ##### done.
Write codeplug to file 'backup.img'.
Read configuration from file 'device.conf'.
Zone 2a 'Home/Analog': channel 130 not found.
Zone 2a 'Home/Analog': channel 131 not found.
Scanlist 2 'Analog': channel 130 not found.
Scanlist 2 'Analog': channel 131 not found.
Total 4 errors.

What current config has to be like to prevent errors:

Zone    Name             Channels
    1   Home/Digital     1-19
    2   Home/Analog      102-105,115-129,132-140
...

What I would prefer it to be like:

Zone    Name             Channels
    1   Home/Digital     1-99
    2   Home/Analog      100-199
...
prokrypt commented 5 years ago

I just thought about this again. If you do make those changes, writing to the radio will be problem-free, but reading back the data into a config file would obviously omit the missing channels. Perhaps we can have dmrconfig use an extra config file with overrides?

fraburnham commented 5 years ago

What about filling the channel with some default value (150MHz for example) and ignoring them like @prokrypt suggests? Perhaps adding a column to the channel named skipped and a cli flag to omit skipped channels on read.

edit: #30 may work for you (@prokrypt) to at least reduce the time it takes to notice an error.