[chirp_devel] [PATCH 0 of 2 ] Wouxun, write on frequency ranges
Thanks to Gary Errol N9PTC who asked me to allow writing and offers himself (and his own radios) for testing I thinks it's now safe to add it to daily builds. I added a warning to let people know it could potentially brick radios even if Gary says it works. The warning is on a separate patch so it'll be easier to remove it once we feel safe ;)
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1351859117 -3600 # Node ID 17c395df835a5e2fa88574cbeab7df2431237e06 # Parent 18b37c240b739db341b88a1cd1a4543d8084b6ec [KG-UVD1P KG-UV6] Allow changing freq ranges Feature #285 Thanks to Gary Errol N9PTC for asking and testing
diff -r 18b37c240b73 -r 17c395df835a chirp/wouxun.py --- a/chirp/wouxun.py gio nov 01 20:57:24 2012 +0100 +++ b/chirp/wouxun.py ven nov 02 13:25:17 2012 +0100 @@ -211,7 +211,7 @@ return rf
def get_settings(self): - freqranges = RadioSettingGroup("freqranges", "Freq ranges (read only)") + freqranges = RadioSettingGroup("freqranges", "Freq ranges") top = RadioSettingGroup("top", "All Settings", freqranges)
rs = RadioSetting("menu_available", "Menu Available", @@ -273,8 +273,9 @@ for element in settings: if not isinstance(element, RadioSetting): if element.get_name() != "freqranges" : - # frequency ranges are read only self.set_settings(element) + else: + self._set_freq_settings(element) else: try: setattr(self._memobj.settings, @@ -284,7 +285,15 @@ print element.get_name() raise
- + def _set_freq_settings(self, settings): + for element in settings: + try: + setattr(self._memobj.freq_ranges, + element.get_name(), + encode_freq(int(element.value))) + except Exception, e: + print element.get_name() + raise
def get_raw_memory(self, number): return repr(self._memobj.memory[number - 1])
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1351860021 -3600 # Node ID 454f86d3dff21208e2e2eec1286e4a2349a2ad95 # Parent 17c395df835a5e2fa88574cbeab7df2431237e06 [KG-UVD1P KG-UV6] Add experimental warning for freq ranges write Feature #285
diff -r 17c395df835a -r 454f86d3dff2 chirp/wouxun.py --- a/chirp/wouxun.py ven nov 02 13:25:17 2012 +0100 +++ b/chirp/wouxun.py ven nov 02 13:40:21 2012 +0100 @@ -51,7 +51,8 @@ return freq
@directory.register -class KGUVD1PRadio(chirp_common.CloneModeRadio): +class KGUVD1PRadio(chirp_common.CloneModeRadio, + chirp_common.ExperimentalRadio): """Wouxun KG-UVD1P,UV2,UV3""" VENDOR = "Wouxun" MODEL = "KG-UVD1P" @@ -112,6 +113,13 @@ } names[199]; """
+ @classmethod + def get_experimental_warning(cls): + return ('This version of the Vouxun driver allow to write on frequency' + ' ranges, it has been tested and reports says it works but ' + ' writing bad values there can potentially brick your radio. ' + ' You have been warned, proceed at your own risk!') + def _identify(self): """Do the original wouxun identification dance""" for _i in range(0, 5):
return ('This version of the Vouxun driver allow to write on
frequency'
s/Vouxun/Wouxun/
' ranges, it has been tested and reports says it works but ' +
' writing bad values there can potentially brick your radio. ' + ' You have been warned, proceed at your own risk!')
If I may, I think the warning text should be this, in order to be proper English:
This version of the Wouxun driver allows you to modify the frequency range settings of your radio. This has been tested and reports from other users indicate that it is a safe thing to do. However, modifications to this value may have unintended consequences, including damage to your device. You have been warned. Proceed at your own risk!
What do you think?
I applied the other, thanks!
Thanks Dan, next time feel free to correct my english. :)
73 de IZ3GME Marco
On 04/11/2012 22:05, Dan Smith wrote:
return ('This version of the Vouxun driver allow to write on
frequency'
s/Vouxun/Wouxun/
' ranges, it has been tested and reports says it works but ' +
' writing bad values there can potentially brick your radio. ' + ' You have been warned, proceed at your own risk!')
If I may, I think the warning text should be this, in order to be proper English:
This version of the Wouxun driver allows you to modify the frequency range settings of your radio. This has been tested and reports from other users indicate that it is a safe thing to do. However, modifications to this value may have unintended consequences, including damage to your device. You have been warned. Proceed at your own risk!
What do you think?
I applied the other, thanks!
chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
participants (3)
-
Dan Smith
-
IZ3GME Marco
-
Marco Filippi IZ3GME