Signed/Unsigned int property

Moderator: Benj

Post Reply
mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Signed/Unsigned int property

Post by mnf »

A minor visual bug...

Add an signed or unsigned int property to panel - this is shown as Z or Z+ - however the property is actually 32 bit. So should be shown as L or L+. I had to test whether the variable was 32 bit (which I needed) or 16bit....

Martin

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Signed/Unsigned int property

Post by kersing »

Have you tested on hardware or in simulation?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Signed/Unsigned int property

Post by mnf »

Tested on hardware (Arduino mega) - result was 32 bit.

Martin

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Signed/Unsigned int property

Post by LeighM »

Could you give an example?
A Flowcode project to demonstrate the issue?
Thanks

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Signed/Unsigned int property

Post by mnf »

bits.jpg
bits.jpg (37.86 KiB) Viewed 4480 times
How many bits does 'test' have Z implies 16....

Another visual glitch - component groups lose their description if the window is resized using the maximize/minimize button - though they recover if resizing by dragging the window. How many is lost depends on how small the window goes...
comps.jpg
comps.jpg (10.91 KiB) Viewed 4480 times
Martin

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Signed/Unsigned int property

Post by kersing »

Hi Martin,

That screenshot is in Flowcode, not on hardware... I agree it would be better to limit the size for values to 16 bit on display, but I am still curious what happens if you use this variable on hardware. My money is on it being 16 bit...

Best regards,

Jac
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Signed/Unsigned int property

Post by mnf »

Yes - the problem is in FC...

The actual value is 32 bit (on hardware) which is correct - it's just the mismatch of using Z for 16 bit values in variables and 32bit values in properties..

Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Signed/Unsigned int property

Post by Benj »

Yes you're correct the icon appears to be wrong there.

Interestingly the constants does it a bit better but still not 100% correct. An int is shown as a long and a byte as an int.
Consts.jpg
Consts.jpg (6.49 KiB) Viewed 4466 times
Maybe we can default to the Long icons rather than the Int icons for the signed/unsigned integer property types?

Post Reply