LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array of booleans to design a movie player!

Hi everyone,

 

I know that Arrays must be of the same type (U32, booleans, char...). But I'm wondering if arrays can be of identical elements but with different styles : Example :

 

booleanjpg.jpg Can these 2 elements be stored in the same array?

 

I'm asking the question in order to clean up my code with my movie player. Rather than having different events (play, pause, forward...), i'd like to store all the buttons in an array and just search for TRUE case in it :

 

Movietools.jpg 

 

Free customized buttons if someone answers Smiley Happy!

 

 

PS: I thought to bundle all the movie elements in a cluster and register the "cluster value changed" event...

 

 

0 Kudos
Message 1 of 10
(3,052 Views)

Hi!

I'd suggest to use a picture ring control instead of a boolean.

Each element of the array would be then of the same type (the picture ring) and can have a different value, i.e. a different picture.

 

Marco

Message 2 of 10
(3,049 Views)

I always forget that picture rings exist... But it looks like the problem won't be solved with them. You must use booleans to have 2 (4 or 6) different states associated with user events.

 

states.jpg 

 

I have just tried to create an array of picture rings but it seems impossible to have different pict rings with different pictures inside the array. They are all the same...

0 Kudos
Message 3 of 10
(3,030 Views)

I am not sure what you tried but the array of picture rings works fine for me.  Create on ring with all the images you want.  Then put that ring into an array.  Each element of the array can be set to display a different image.  Be sure to save as default.

 

Lynn 

0 Kudos
Message 4 of 10
(3,019 Views)

I didn't notice that each element of the array was displaying a different image... Thanks! But I am not sure it solves the problem. Because now, I lose all the advantages of a boolean type...

 

Consider that I have 4 buttons : play, stop, back and next (4 state buttons). That gives 16 images that I have now to display manually. The Search array function will only work for 4 of them : when a user clicks on a button, and will ignore the rest of the states. It will complicate the code given the fact that I must check mouse leave, etc...

 

0 Kudos
Message 5 of 10
(3,004 Views)

Overlay the images with transparent booleans.  Make the array of picture rings an indicator.  When a boolean button is pressed, write the appropriate values to the array to produce the visual appearance you want the user to see.

 

Lynn 

0 Kudos
Message 6 of 10
(2,996 Views)

Hi superfunk,

 

as you don't want to handle the "buttons" manually you should go the "cluster of different booleans" way...

When there are only booleans in the cluster you still can convert easily between cluster and array of booleans (but I wouldn't do this all the time...).

Message Edited by GerdW on 06-07-2010 04:44 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 10
(2,995 Views)

Provided I don't understand why you don't want to use 4 plain controls :),

with the picture array you can catch the button being pressed in a way similar to the following:

 

picring.png

 

...and, if you want, you can change the picture from NotPressed status to a Pressed status (meaning you need a number of pictures twice the number of buttons...)

 

Marco

Message 8 of 10
(2,994 Views)

GerdW wrote:

Hi superfunk,

 

as you don't want to handle the "buttons" manually you should go the "cluster of different booleans" way...


 

This is what I'll do!

 

Thanks all for your suggestions. 4 plain controls could have been nice too... By the way, no one is aking after my wonderful little buttons Smiley Very Happy? I must think of uploading them to the GUI community...

0 Kudos
Message 9 of 10
(2,982 Views)

Hi superfunk,

 

either post them to the GUI usergroups or to the example code pages... (I would prefer the UI interest group...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(2,956 Views)