ic2100_enable_anm_display.patch

Jim Unroe, 07/05/2014 06:21 am

Download (2.3 kB)

b/chirp/ic2100.py Sat Jul 05 09:09:54 2014 -0400
15 15

  
16 16
from chirp import chirp_common, icf, util, directory
17 17
from chirp import bitwise, memmap
18
from chirp.settings import RadioSetting, RadioSettingGroup, \
19
    RadioSettingValueInteger, RadioSettingValueList, \
20
    RadioSettingValueBoolean, RadioSettingValueString, \
21
    RadioSettingValueFloat, InvalidValueError
18 22

  
19 23
MEM_FORMAT = """
20 24
struct {
......
25 29
  u8    unknown1;
26 30
  bbcd  offset[2];
27 31
  u8    is_12_5:1,
28
        unknownbits:3,
32
        unknownbit1:1,
33
        anm:1,
34
        unknownbit2:1,
29 35
        duplex:2,
30 36
        tmode:2;
31 37
  u8    ctone;
......
43 49
  u8    unknown1;
44 50
  bbcd  offset[2];
45 51
  u8    is_12_5:1,
46
        unknownbits:3,
52
        unknownbit1:1,
53
        anm:1,
54
        unknownbit2:1,
47 55
        duplex:2,
48 56
        tmode:2;
49 57
  u8    ctone;
......
59 67
  u8    unknown1;
60 68
  bbcd  offset[2];
61 69
  u8    is_12_5:1,
62
        unknownbits:3,
70
        unknownbit1:1,
71
        anm:1,
72
        unknownbit2:1,
63 73
        duplex:2,
64 74
        tmode:2;
65 75
  u8    ctone;
......
218 228
        mem.tmode = TMODES[_mem.tmode]
219 229
        mem.duplex = DUPLEX[_mem.duplex]
220 230
        
231
        mem.extra = RadioSettingGroup("Extra", "extra")
232

  
233
        rs = RadioSetting("anm", "Alphanumeric Name",
234
                          RadioSettingValueBoolean(_mem.anm))
235
        mem.extra.append(rs)
236

  
221 237
        return mem
222 238

  
223 239
    def set_memory(self, mem):
......
248 264
        _mem.tmode = TMODES.index(mem.tmode)
249 265
        _mem.duplex = DUPLEX.index(mem.duplex)
250 266

  
267
        for setting in mem.extra:
268
            setattr(_mem, setting.get_name(), setting.value)
269

  
251 270
    def get_raw_memory(self, number):
252 271
        return repr(self._memobj.memory[number])