[chirp_devel] bitwise and arrays outside of structures
when I use this: u16 bank_used[20];
instead of putting the array in a struct like: struct { u16 in_use; } bank_used[20];
I get:
Traceback (most recent call last): File "/Users/jens/build/chirp.hg/chirpui/radiobrowser.py", line 263, in _tree_click for name, item in obj.items(): File "/Users/jens/build/chirp.hg/chirp/bitwise.py", line 155, in __getattr__ self.__class__)) AttributeError: Unknown attribute items in chirp.bitwise.u16DataElement
Would it be possible to declare arrays outside of structures?
-Jens
Would it be possible to declare arrays outside of structures?
It is, but I actually wonder if you're hitting a bug in the browser. I'll have to take a look. Does it work if you don't browse to it but just use it in your code somewhere?
It has to be a bug in the browser UI: I noticed it in one of other drivers but had to investigate it a little more.
73 de IZ3GME Marco
On Sun, 8 Sep 2013 07:07:21 -0700 Dan Smith dsmith@danplanet.com wrote:
Would it be possible to declare arrays outside of structures?
It is, but I actually wonder if you're hitting a bug in the browser. I'll have to take a look. Does it work if you don't browse to it but just use it in your code somewhere?
-- Dan Smith www.danplanet.com KK7DS
(Responding to correct thread...)
For me I was manipulating this inside of bank class code, from Banks view of UI. When I changed to using an array inside a struct it worked, and the exception went away.
________________________________ From: IZ3GME Marco iz3gme.marco@gmail.com To: chirp_devel@intrepid.danplanet.com Sent: Sunday, September 8, 2013 9:26 AM Subject: Re: [chirp_devel] bitwise and arrays outside of structures
It has to be a bug in the browser UI: I noticed it in one of other drivers but had to investigate it a little more.
73 de IZ3GME Marco
On Sun, 8 Sep 2013 07:07:21 -0700 Dan Smith dsmith@danplanet.com wrote:
Would it be possible to declare arrays outside of structures?
It is, but I actually wonder if you're hitting a bug in the browser. I'll have to take a look. Does it work if you don't browse to it but just use it in your code somewhere?
-- 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
Traceback (most recent call last): File "/Users/jens/build/chirp.hg/chirpui/radiobrowser.py", line 263, in _tree_click for name, item in obj.items(): File "/Users/jens/build/chirp.hg/chirp/bitwise.py", line 155, in __getattr__ self.__class__)) AttributeError: Unknown attribute items in chirp.bitwise.u16DataElement
Yeah, the only way I get this is if I click on an array element that isn't a structure. If I click on the array itself, I get the elements and I can edit them. This is just barfing an error when you click there, but it's harmless. I'll follow up with a patch that will clean up those array children so you don't see this.
It should be plenty functional right now though.
So digging this back up.
There does indeed appear to be something that doesnt work quite right when using array outside of a struct. I'm using this array in bank get/set. When I'm updating the bank matrix ui, nothing seems to change state. There are no exceptions thrown, so I'm not sure exactly how to troubleshoot what is going on.
When i change this one thing back to using a struct member its working.
So just a caution in case anybody else is running into strange behavior w/ non-struct-member arrays...
On Sunday, September 8, 2013 7:15 PM, Dan Smith dsmith@danplanet.com wrote:
Traceback (most recent call last): File "/Users/jens/build/chirp.hg/chirpui/radiobrowser.py", line 263, in _tree_click for name, item in obj.items(): File "/Users/jens/build/chirp.hg/chirp/bitwise.py", line 155, in __getattr__ self.__class__)) AttributeError: Unknown attribute items in chirp.bitwise.u16DataElement
Yeah, the only way I get this is if I click on an array element that isn't a structure. If I click on the array itself, I get the elements and I can edit them. This is just barfing an error when you click there, but it's harmless. I'll follow up with a patch that will clean up those array children so you don't see this.
It should be plenty functional right now though.
There does indeed appear to be something that doesnt work quite right when using array outside of a struct.
I just sent a patch to the list that adds tests for this scenario, both reading and writing. I don't think there is a problem with bitwise, as those tests work fine.
I'm using this array in bank get/set. When I'm updating the bank matrix ui, nothing seems to change state. There are no exceptions thrown, so I'm not sure exactly how to troubleshoot what is going on.
Hmm, well, adding print statements to make sure that it's doing what you think it's doing is probably the path to enlightenment there. I dunno what else to say if the tests show that it works. I'd have to be able to replicate the behavior in order to try to diagnose it myself.
Thanks Dan.
I'll have to spend some more time doing the printf debug method ;)
On , Dan Smith dsmith@danplanet.com wrote:
There does indeed appear to be something that doesnt work quite right when using array outside of a struct.
I just sent a patch to the list that adds tests for this scenario, both reading and writing. I don't think there is a problem with bitwise, as those tests work fine.
I'm using this array in bank get/set. When I'm updating the bank matrix ui, nothing seems to change state. There are no exceptions thrown, so I'm not sure exactly how to troubleshoot what is going on.
Hmm, well, adding print statements to make sure that it's doing what you think it's doing is probably the path to enlightenment there. I dunno what else to say if the tests show that it works. I'd have to be able to replicate the behavior in order to try to diagnose it myself.
participants (3)
-
Dan Smith
-
IZ3GME Marco
-
Jens J.