Yeah, belay this for another round. 
I'm currently working on mapping out the special channels (vfos, calls, u/l scan limits) as well as the some of the global settings.
I'm not sure exactly how those special channels are dealt with, as I didnt see a sample implementation in template, just an actual implementation like ft-857, etc.

How can I solve the issues with importing from floats that dont match (i.e., 6.25)? do I need to bracket them into my list at get_memory or set_memory time?

On the ToneSql type, how do I preserve a channel setting for Bell or Auto, if chirp doesnt support it. Do I have to be destructive and box all channels into one of the supported types? It's totally possible to have set Bell or Auto in memory on the radio. What happens when I import this now? How should I deal with this, if I cant tell chirp what are possible/legal values for my radio?

I commented out the ARS code, but now if I can do custom fields (i'll see how it's done with uv-5r) then I may be able to make this a bool field, and deal with the logic of ignoring/setting duplex field in get/set memory members.

I'll check the DCS values, probably differs from chirp_common list, but it has a field for it in radio memory. I'll do what you suggest, i.e., import chirp_common tones/dcs tones list, and remove unsupported tones. 
I understand it is semantics and style, but since these allowed tone values for this particular radio will NEVER change, I don't want to be dependent upon chirp_common tones never changing. It would be a long shot that they ever do change, but if they do, it would be more difficult to determine which tones are now supported/unsupported, since the "source of truth" gets altered. Anyhow, as I do doubt they will change upstream, I'll go with the subtractive pattern you suggest.



From: Dan Smith <dsmith@danplanet.com>
To: chirp_devel@intrepid.danplanet.com
Sent: Sunday, August 25, 2013 3:19 PM
Subject: Re: [chirp_devel] [FT-90] add initial support for FT-90R. #1087

> Initial support for Yaesu FT-90R. Probably a bit buggy. #1087

Do you want this to go into the tree, or are you just floating it for
comments?

> +# Copyright 2011 Dan Smith <dsmith@danplanet.com>

Be sure to add your copyright here.

> +    STEPS = [5, 10, 12.5, 15, 20, 25, 50]

Steps are floats, so these will cause issues during import from
something else, I think.

> +    MODES = ["AM", "FM", "Auto"]
> +    TMODES = ["", "Tone", "TSQL", "Bell", "DTCS"]

Auto and Bell aren't allowed, so memories that resolve to these are
going to break, right?

> +    TONES = [ 67.0, 69.3, 71.9, 74.4, 77.0, 79.7, 82.5,
> +          85.4, 88.5, 91.5, 94.8, 97.4, 100.0, 103.5,
> +          107.2, 110.9, 114.8, 118.8, 123.0, 127.3,
> +          131.8, 136.5, 141.3, 146.2, 151.4, 156.7,
> +          159.8, 162.2, 167.9, 173.8, 179.9, 183.5,
> +          186.2, 189.9, 192.8, 196.6, 199.5, 203.5, 
> +          206.5, 210.7, 218.1, 225.7, 229.1, 233.6,
> +          241.8, 250.3, 254.1,
> +          ]        

Is this list different than the main one in chirp_common? While it's a
little messy, I think it would be better to stick with the convention
of copying the main list and adding/removing tones to get to the
supported list. At the very least, it makes it easyier to come back
and figure out what the deltas are.

> +    POWER_LEVELS = ["Hi","Mid1","Mid2","Low"]

Need spaces after the commas

> +    #DUPLEX = ["", "-", "+", "split", "Auto"]
> +    DUPLEX = ["", "-", "+", "split"]

I like to avoid commented-out code whenever possible. Perhaps just a
comment above that says "Duplex index 4 is auto mode". Will memories
with auto set create an IndexError trying to look their value up in
this list?

> +    def get_memory(self, number):
> +        _mem = self._memobj.memory[number-1]
> +
> +        mem = chirp_common.Memory()
> +        mem.number = number
> +        mem.freq = _mem.rxfreq * 10      
> +        mem.offset = _mem.txfreqoffset * 10
> +        if not _mem.tmode < len(self.TMODES):
> +            _mem.tmode = 0
> +        mem.tmode = self.TMODES[_mem.tmode]
> +        mem.rtone = self.TONES[_mem.tone]
> +        mem.mode = self.MODES[_mem.mode]
> +
> +        '''
> +        # ars mode note yet working...
> +        # ARS mode:
> +        if _mem.ars and _mem.shift == 0:
> +            mem.duplex = self.DUPLEX[4] 

This will fail, right?

> +        else:
> +            mem.duplex = self.DUPLEX[_mem.shift]
> +        '''
> +        mem.duplex = self.DUPLEX[_mem.shift]
> +        mem.power = self.POWER_LEVELS[_mem.power]
> +        # radio has a known bug with 5khz step and squelch
> +        if _mem.step == 0:
> +            _mem.step = 2
> +        mem.tuning_step = self.STEPS[_mem.step]
> +        mem.skip = _mem.skip and "S" or ""
> +        mem.name = _mem.name
> +        return mem

I don't see the DCS code being decoded anywhere. IIRC, that was the
thing I could never figure out.

Thanks!

--
Dan Smith
www.danplanet.com
KK7DS

_______________________________________________
chirp_devel mailing list
chirp_devel@intrepid.danplanet.com
http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers