[chirp_devel] Fixed Frequency Radio
All,
I have a radio coming to me in the near future that will have something like 15 fixed simplex frequencies. In other words, the RX/TX frequencies cannot be changed. CHIRP will only be required to program the other per channel settings like CTCS, DTCS, Power, Skip and the like.
Does anyone know if there is a provision in CHIRP that will show the frequencies of the memory rows (or range of memory rows) but displays them as un-editible fields?
Thanks, Jim KC9HI
On Fri, Aug 18, 2017 at 9:49 AM, Dan Smith via chirp_devel chirp_devel@intrepid.danplanet.com wrote:
Does anyone know if there is a provision in CHIRP that will show the frequencies of the memory rows (or range of memory rows) but displays them as un-editible fields?
I think you can throw 'freq' into mem.immutable and then the editor won't let you change it.
--Dan
Thanks. I'll give that a try.
Jim
On Fri, Aug 18, 2017 at 9:49 AM, Dan Smith via chirp_devel chirp_devel@intrepid.danplanet.com wrote:
Does anyone know if there is a provision in CHIRP that will show the frequencies of the memory rows (or range of memory rows) but displays them as un-editible fields?
I think you can throw 'freq' into mem.immutable and then the editor won't let you change it.
Would someone possibly give me a rough example. I added the following under the "def get_memory(self, number):" section thinking that would do the trick, put it appears to do nothing.
mem.immutable = ["freq"]
Thanks, Jim
Would someone possibly give me a rough example. I added the following under the "def get_memory(self, number):" section thinking that would do the trick, put it appears to do nothing.
mem.immutable = ["freq"]
Yeah, that should do it. If not, the UI might need a tweak to honor it or something.
In a pinch, just raise an exception in your driver if the frequency is different than you expect during a set_memory() operation. Alternately, you could just ignore what mem.freq is set to entirely.
--Dan
On Mon, Aug 21, 2017 at 10:06 AM, Dan Smith via chirp_devel chirp_devel@intrepid.danplanet.com wrote:
Would someone possibly give me a rough example. I added the following under the "def get_memory(self, number):" section thinking that would do the trick, put it appears to do nothing.
mem.immutable = ["freq"]
Yeah, that should do it. If not, the UI might need a tweak to honor it or something.
There are several drivers use this method. Most don't have test drivers but the one or two that I found don't seem to honor it. I wonder if a change to the UI broke some time ago?
In a pinch, just raise an exception in your driver if the frequency is different than you expect during a set_memory() operation. Alternately, you could just ignore what mem.freq is set to entirely.
I think I ignore the mem.freq for the BTech GMRS-V1. I was hoping to come up with a better way of doing it. I've got time to think about.
Thanks for you input, Dan.
Jim
In a pinch, just raise an exception in your driver if the frequency is different than you expect during a set_memory() operation. Alternately, you could just ignore what mem.freq is set to entirely.
I am trying to do it as below...
class MyRadioFeatures(chirp_common.RadioFeatures): def validate_memory(self, mem): # Run the normal validation msgs = chirp_common.RadioFeatures.validate_memory(self, mem)
# Run my validation if mem.number <= 6 and mem.mode != "NFM": msgs.append(chirp_common.ValidationError( "Only NFM is supported on this channel"))
#if mem.number >=0 and mem.number <= 14: # if mem.duplex != "": # msgs.append(chirp_common.ValidationError( # "Only '(None)' is supported on this channel")) if (mem.number >= 15 and mem.number <= 22): if mem.duplex != "+": msgs.append(chirp_common.ValidationError( "Only '+' is supported on this channel")) if mem.offset != 5000000: msgs.append(chirp_common.ValidationError( "Only '5.000000' is supported on this channel"))
#if mem.number <= 22 and mem.freq != LIST_GMRS[mem.number]: # msgs.append(chirp_common.ValidationError( # "Editing this field is not supported on this channel"))
return msgs
But if I uncomment either either of the commented code, then I get a "Radio did not validate a valid memory" error when running the suite of tests.
BTECH GMRS-V1 Detect ←[1;32m PASSED:←[0m All tests BTECH GMRS-V1 Settings ←[1;32m PASSED:←[0m All tests BTECH GMRS-V1 Clone ←[1;32m PASSED:←[0m All tests BTECH GMRS-V1 Edges ←[1;32m PASSED:←[0m All tests BTECH GMRS-V1 BruteForce ←[1;41m FAILED:←[0m Radio did not validate a valid memory BTECH GMRS-V1 CopyAll ←[1;32m PASSED:←[0m All tests BTECH GMRS-V1 Banks ←[1;32mSKIPPED:←[0m Banks not supported
Any tips on what I can do to resolve this? The code otherwise works as I expect it to.
Thanks, Jim KC9HI
But if I uncomment either either of the commented code, then I get a "Radio did not validate a valid memory" error when running the suite of tests.
Well, right, because the tests expect all radios to be able to set channels within their supported bands.
For a radio with fixed channels, I would expect the valid_bands to be empty. That will probably make the tests avoid trying to set anything as they loop over an empty set of band edges. If not, you might need a tweak to the tests also. This would be the first fixed-channel radio in chirp that I know of, so not too surprising to end up with some changes to the tests I think.
--Dan
For a radio with fixed channels, I would expect the valid_bands to be empty. That will probably make the tests avoid trying to set anything as they loop over an empty set of band edges.
I'll give this a try. I would be a very simple fix if it works. Thanks.
This would be the first fixed-channel radio in chirp that I know of, so not too surprising to end up with some changes to the tests I think.
Actually the BTech GMRS-V1 has semi-fixed channels. Channels 0 through 22 are fixed and channels 23 through 127 are programmable. I think the driver may let the user go through the motions of programming the fixed channels, the radio just ignores the changes.
Jim
Actually the BTech GMRS-V1 has semi-fixed channels. Channels 0 through 22 are fixed and channels 23 through 127 are programmable. I think the driver may let the user go through the motions of programming the fixed channels, the radio just ignores the changes.
Oh I see, well, then maybe the valid_bands thing isn't the right fix. Because really the problem is just that the tests are using the first channel in the list as the test channel.
Sounds like a more complicated change is going to be needed. In the tests, perhaps it should go looking for a memory channel that isn't immutable before it tries to use it to set things?
Very rough idea:
test_mem = None for i in range(*rf.memory_bounds): m = radio.get_memory(i) if not 'freq' in m.immutable: test_mem = m break
if not test_mem: # skip because no memories are usable
# continue to do test with test_mem instead of just blindly using #1
--Dan
Very rough idea:
test_mem = None for i in range(*rf.memory_bounds): m = radio.get_memory(i) if not 'freq' in m.immutable: test_mem = m break
if not test_mem: # skip because no memories are usable
# continue to do test with test_mem instead of just blindly using #1
I think I follow what you are proposing. I'm not sure where this would go but I think I can figure it out with a little looking around.
The problem I currently have is I that I recently bought another house. I'm in the processing of moving to the new QTH and don't know when I will have my development computer back on-line. ;)
Jim
Very rough idea:
test_mem = None for i in range(*rf.memory_bounds): m = radio.get_memory(i) if not 'freq' in m.immutable: test_mem = m break
if not test_mem: # skip because no memories are usable
# continue to do test with test_mem instead of just blindly using #1
I think I follow what you are proposing. I'm not sure where this would go but I think I can figure it out with a little looking around.
In the test logic that currently probably just assumes it can use memory #1 for everything.
The problem I currently have is I that I recently bought another house. I'm in the processing of moving to the new QTH and don't know when I will have my development computer back on-line. ;)
Oooh, congrats!
--Dan
participants (2)
-
Dan Smith
-
Jim Unroe