08-31-2018 03:52 AM - edited 08-31-2018 03:55 AM
In order to set conditions from multiples booleans, I usually do this:
Do you know if there is there a better solution, I mean: faster to program and easyier to understand for other people??
08-31-2018 04:21 AM - edited 08-31-2018 04:22 AM
I'd say that is pretty straightforward.
If most values are unique, you can also use the integer as in index to an array. So, make an array constant, and use Index Array with the 2th complement value. That would be better, as you'll have overview (no need to select a case to see the value). The array of enums would require an array constant with a cluster holding the array of enums if the size of the array isn't always 2. If it is always 2, you can use a 2D array of enums.
Of course if the resulting values are a combination of the 3 Booleans, three separate selectors might be possible. But I guess you would have used that if it that was the case.
08-31-2018 04:29 AM
Can you place your buttons into Radio buttons container?
In this case you will operate with enum, and it's much more easier to understand.
Another case to use Event structure. You really no need to check another buttons if you make changes in one of them. So one button -> one event case.
08-31-2018 04:33 AM - edited 08-31-2018 04:34 AM
It's clearly two's complement, so radio buttons are out.
If it wasn't two's complement (there would only be 4 options), a radio button would be useful.
08-31-2018 06:08 PM
Hooovahh is always making fun .VIMs for the community, so let me try this one:
You give it a cluster of booleans and it returns a typedef'd enumeration that can be passed to a case selector. This mimics what you're doing... it's just slightly cleaner through use of an enumeration. No need to spend brainpower on binary case selector math.
.VIM looks like this on the inside:
08-31-2018 06:11 PM
oh, and in case it wasn't clear, user code would look like this: