[chirp_devel] [PATCH 0 of 2 ] Fix charset in ft8x7 drivers
I under estimated the problem of "icon" chars supported by this yaesu radio when I wrote drivers. To avoid crashes under OSX I now have restricted the CHARSET to printable (and supported by radio) chars that are ASCII. Unsupported chars are now replaced with a * when found in labels. I don't really love this solution but I didn't find a better way to manage those chars.
If ther are ways to support full charset or at least some more then new CHARSET please let me know (eg. here https://bg8net.dyndns.org/OpLog/yaesu_charset.png the full 857 table).
73 de IZ3GME Marco
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1368383832 -7200 # Node ID 45b55e192e7394c347e8361d860db4e1f6f62094 # Parent 40ec9b65ae38af741643125a7cc77a8c3304172f [ft817] replace char we do not support in labels with * fix #857
diff -r 40ec9b65ae38 -r 45b55e192e73 chirp/ft817.py --- a/chirp/ft817.py gio mag 09 14:47:30 2013 +0200 +++ b/chirp/ft817.py dom mag 12 20:37:12 2013 +0200 @@ -46,7 +46,8 @@ (76000000, 108000000), (108000000, 137000000), (137000000, 154000000), (420000000, 470000000)]
- CHARSET = [chr(x) for x in range(0, 256)] + CHARSET = list(chirp_common.CHARSET_ASCII) + CHARSET.remove("\")
# Hi not used in memory POWER_LEVELS = [chirp_common.PowerLevel("Hi", watts=5.00), @@ -612,9 +613,15 @@
if _mem.tag_on_off == 1: for i in _mem.name: - if i == "\xFF": + if i == 0xFF: break - mem.name += self.CHARSET[i] + if chr(i) in self.CHARSET: + mem.name += chr(i) + else: + # radio have some graphical chars that are not supported + # we replace those with a * + print "Replacing char %x with *" % i + mem.name += "*" mem.name = mem.name.rstrip() else: mem.name = "" @@ -680,8 +687,12 @@ _mem.rit = 0 # not supported in chirp _mem.freq = mem.freq / 10 _mem.offset = mem.offset / 10 - for i in range(0, 8): - _mem.name[i] = self.CHARSET.index(mem.name.ljust(8)[i]) + for i in range(0, min(len(mem.name.rstrip()),8)): + _mem.name[i] = ord(mem.name[i]) + # rfill with 0xff to mimic radio + # "quick&dirty" use of i from previous cicle + for i in range(i+1,8): + _mem.name[i] = 0xff
for setting in mem.extra: setattr(_mem, setting.get_name(), setting.value)
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1368383834 -7200 # Node ID d8fb83898f89108551d6b2ad62da25eb739395ff # Parent 45b55e192e7394c347e8361d860db4e1f6f62094 [ft857] replace char we do not support in labels with * fix #857
diff -r 45b55e192e73 -r d8fb83898f89 chirp/ft857.py --- a/chirp/ft857.py dom mag 12 20:37:12 2013 +0200 +++ b/chirp/ft857.py dom mag 12 20:37:14 2013 +0200 @@ -60,6 +60,10 @@ (76000000, 108000000), (108000000, 137000000), (137000000, 164000000), (420000000, 470000000)]
+ CHARSET = list(chirp_common.CHARSET_ASCII) + for i in "\{|}": + CHARSET.remove(i) + MEM_FORMAT = """ struct mem_struct{ u8 tag_on_off:1,
participants (1)
-
Marco Filippi IZ3GME