[chirp_devel] [PATCH] [leixen] Support non-standard tones on VV898 radio memories
# HG changeset patch # User Brian Dickman brian.maybe@gmail.com # Date 1472622871 25200 # Tue Aug 30 22:54:31 2016 -0700 # Node ID 2e7f65569ba66c5ca8d9d3733ae8067e3948361a # Parent bf777f74e27695ef2f54e7852dda88fb14bbfa2d [leixen] Support non-standard tones on VV898 radio memories. Fixes #3899.
This issue used to cause some download corruption when a radio memory had one of the non-standard tones (as the factory image did). Note that there is no RadioFeatures "valid tones" map, so these extra tones can not currently be selected during new memory creation.
diff -r bf777f74e276 -r 2e7f65569ba6 chirp/drivers/leixen.py --- a/chirp/drivers/leixen.py Mon Aug 29 10:29:40 2016 -0700 +++ b/chirp/drivers/leixen.py Tue Aug 30 22:54:31 2016 -0700 @@ -356,6 +356,15 @@ ack = radio.pipe.read(8)
+class LeixenMemory(chirp_common.Memory): + '''Leixen memory which supports non-standard tones and codes''' + def __init__(self): + chirp_common.Memory.__init__(self) + + self._valid_map["rtone"] = TONES + self._valid_map["ctone"] = TONES + + # Declaring Aliases class LT898UV(chirp_common.Alias): VENDOR = "LUITON" @@ -466,7 +475,7 @@ _mem = self._memobj.memory[number - 1] _name = self._memobj.name[number - 1]
- mem = chirp_common.Memory() + mem = LeixenMemory() mem.number = number
if _mem.get_raw()[:4] == "\xFF\xFF\xFF\xFF":
Hi Brian,
This issue used to cause some download corruption when a radio memory had one of the non-standard tones (as the factory image did). Note that there is no RadioFeatures "valid tones" map, so these extra tones can not currently be selected during new memory creation.
Yeah, this is a bummer. We probably should add it to RadioFeatures in some way.
+class LeixenMemory(chirp_common.Memory):
- '''Leixen memory which supports non-standard tones and codes'''
- def __init__(self):
chirp_common.Memory.__init__(self)
self._valid_map["rtone"] = TONES
self._valid_map["ctone"] = TONES
I don't really like doing this because if another part of the code (say the import logic) creates a Memory it won't be capable of doing what the radio is.
For the AnyTone 5888UV a while back I added TONES_EXTRA in chirp_common and just concat that to the _valid_map. I did that because some radio drivers use the base list and depend on it being in a specific ordering.
Can we just add the extra tones to that TONES_EXTRA list to solve this?
--Dan
# HG changeset patch # User Brian Dickman brian.maybe@gmail.com # Date 1472697765 25200 # Wed Aug 31 19:42:45 2016 -0700 # Node ID 6627b6052c929ba4d9d43987373a1afdbd5cb167 # Parent bf777f74e27695ef2f54e7852dda88fb14bbfa2d [leixen] Support non-standard tones on VV898 radio memories. Fixes #3899.
This issue used to cause some download corruption when a radio memory had one of the non-standard tones (as the factory image did). Note that there is no RadioFeatures "valid tones" map, so these extra tones can not currently be selected during new memory creation.
diff -r bf777f74e276 -r 6627b6052c92 chirp/chirp_common.py --- a/chirp/chirp_common.py Mon Aug 29 10:29:40 2016 -0700 +++ b/chirp/chirp_common.py Wed Aug 31 19:42:45 2016 -0700 @@ -29,7 +29,8 @@ 225.7, 229.1, 233.6, 241.8, 250.3, 254.1, ]
-TONES_EXTRA = [62.5] +TONES_EXTRA = [56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, + 62.5, 63.0, 64.0 ]
OLD_TONES = list(TONES) [OLD_TONES.remove(x) for x in [159.8, 165.5, 171.3, 177.3, 183.5, 189.9,
participants (2)
-
Brian Dickman
-
Dan Smith