# HG changeset patch # User Jens Jensen # Date 1388430623 21600 # Mon Dec 30 13:10:23 2013 -0600 # Node ID d84a80dbe9516f12db94f51d233223cf5e69ee2c # Parent b2abb304c6a5e5eea5f69555d4ea176e5bfa565d [bj-uv55] more moves bj-uv55 from uv5r.py to bjuv55.py, fix import errors #1335 diff -r b2abb304c6a5 -r d84a80dbe951 chirp/bjuv55.py --- a/chirp/bjuv55.py Mon Dec 30 00:50:33 2013 -0600 +++ b/chirp/bjuv55.py Mon Dec 30 13:10:23 2013 -0600 @@ -242,13 +242,25 @@ def get_features(self): rf = super(BaojieBJUV55Radio, self).get_features() - #rf.has_settings = False rf.valid_name_length = 6 return rf def process_mmap(self): self._memobj = bitwise.parse(MEM_FORMAT % self._mem_params, self._mmap) + def set_memory(self, mem): + super(BaojieBJUV55Radio, self).set_memory(mem) + _mem = self._memobj.memory[mem.number] + if (mem.freq - mem.offset) > (400 * 1000000): + _mem.isuhf = True + else: + _mem.isuhf = False + if mem.tmode in ["Tone", "TSQL"]: + _mem.txtoneicon = True + else: + _mem.txtoneicon = False + + def _get_settings(self): _settings = self._memobj.settings basic = RadioSettingGroup("basic", "Basic Settings") diff -r b2abb304c6a5 -r d84a80dbe951 chirp/uv5r.py --- a/chirp/uv5r.py Mon Dec 30 00:50:33 2013 -0600 +++ b/chirp/uv5r.py Mon Dec 30 13:10:23 2013 -0600 @@ -240,13 +240,6 @@ struct limit uhf; } limits_old; - #seekto 0x1908; -struct { - struct limit vhf; - u8 unk11[11]; - struct limit uhf; -} limits_bj55; - """ # 0x1EC0 - 0x2000 @@ -734,30 +727,20 @@ else: _mem.txfreq = mem.freq / 10 - if self.MODEL == "BJ-UV55": - if (mem.freq - mem.offset) > (400 * 1000000): - _mem.isuhf = True - else: - _mem.isuhf = False - for i in range(0, 7): + _namelength = self.get_features().valid_name_length + for i in range(_namelength): try: _nam.name[i] = mem.name[i] except IndexError: _nam.name[i] = "\xFF" rxmode = txmode = "" - if self.MODEL == "BJ-UV55": - _mem.txtoneicon = False if mem.tmode == "Tone": _mem.txtone = int(mem.rtone * 10) _mem.rxtone = 0 - if self.MODEL == "BJ-UV55": - _mem.txtoneicon = True elif mem.tmode == "TSQL": _mem.txtone = int(mem.ctone * 10) _mem.rxtone = int(mem.ctone * 10) - if self.MODEL == "BJ-UV55": - _mem.txtoneicon = True elif mem.tmode == "DTCS": rxmode = txmode = "DTCS" _mem.txtone = UV5R_DTCS.index(mem.dtcs) + 1