Re: [chirp_devel] Proposal to make use of TSQL in csv import friendlier
Tom,
Thanks for the agreement on the direction, and I'll be happy to implement any way that makes sense.
The import_logic function _import_tone() isn't setting rtone to 88.5, it's setting it it to ctone, which csv import set to 88.5 because there isn't any such column in the csv, and then because the CSV pseudo radio is defined as having both rtone and ctone: # If copying from a radio with separate rtone/ctone to a radio # without, and the tmode is TSQL, then use the ctone value
I figured that's there for the case of real radios with separate rtone/ctone and don't want to break that. I considered having the csv import logic do the same check for a "cToneFreq" column I did in my suggested patch, and then if not present, set rf.has_ctone = False in the CSV pseudo-radio's features.
But I thought the symmetric "if there's only one of [ rtoneFreq, cToneFreq ] use it for both" approach would cover a multitude of user confusion. As you said, if one tone value is supplied, it's likely to be a better default for the other than 88.5.
If you still want it in import_logic, outline an approach that doesn't break the general case and I'll get to work on it.
-dan
On Apr 23, 2014, at 11:11 PM, Tom Hayward - esarfl@gmail.com wrote:
On Apr 22, 2014 12:49 PM, chirp.cordless@xoxy.net wrote:
But I'd like to propose a very specific change to csv import, such that if exactly one of the columns rToneFreq and cToneFreq exists in the csv file, that the value in that column be used for both rtone and ctone.
Makes sense to me. The rTone value is a much more useful default than 88.5.
This could probably be done in import logic, not CSV.
Tom KD7LXL
On Thu, Apr 24, 2014 at 8:15 AM, chirp.cordless@xoxy.net wrote:
Tom,
Thanks for the agreement on the direction, and I'll be happy to implement any way that makes sense.
The import_logic function _import_tone() isn't setting rtone to 88.5, it's setting it it to ctone, which csv import set to 88.5 because there isn't any such column in the csv, and then because the CSV pseudo radio is defined as having both rtone and ctone:
Let me try to understand this a little more thoroughly. Correct me if any of the following is not true. - The logic you are suggesting already exists in import logic - Import logic doesn't help in your case because you have an out-of-spec CSV
Where'd you get a CSV without all the Chirp columns? (just curious)
We already have lots of support for interpreting various differences in CSV. I don't see how supporting more oddities (like a missing column) is a problem--go for it!
I wonder if there is a better way to handle this. Like, if a CSV file is detected as to not be the standard format, maybe we pipe it through import logic so we don't have to essentially duplicate those rules in the CSV driver.
Tom
participants (2)
-
chirp.cordless@xoxy.net
-
Tom Hayward