LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pattern match simulation

Solved!
Go to solution

Hey all,

 

I'm trying here to create something like the pattern matching thing on the smartphone (to unlock the phone). But I got things to ask. I couldnt find any topics which might help, perhaps I couldnt find the right keyword for this.

In the attached VI, I can click anywhere inside the cluster, then drag anywhere inside the cluster to change the bool controls OFF --> ON or ON --> OFF.

My Problem is, when I click directly above a bool control, it doesnt change the bool control directly. I have to click somewhere else first then hover my mouse above it to turn it on. Anyone has idea how can I solve this problem? I would have the bool control changed by click, then I can hover my mouse to other bool controls to turn it on either.

 

Yan.

0 Kudos
Message 1 of 5
(3,104 Views)

Hello Mystogan,

 

You need to change your Cluster "indicator" to a "control" and add a event "Value Change" for each "Cluster.BooleschN" case in the event case structure.

 

In the VI snippet below I only added a "Value Change" for the first Boolesch, you will need to add it for other cases.

 

Michel

 

bool.png

0 Kudos
Message 2 of 5
(3,079 Views)

Hi Michel,

 

I'm sorry I dont really get your point. Can you please explain more?

I cant use your snippet since I'm using LV2010 here.What should happen in the "Value Change" event? can you perhaps save it for LV2010 version please?

 

I think, my problem is, I'm trying  to "combine" two different events to get one job done:

hover my mouse over a bool and then click it--> the bool turned ON, then I can move my mouse to other bools to turn them ON either.

 

What I have now:

when I click (mouse down) anywhere in cluster, the indicator "clicked?" will be set to TRUE, then I can hover my mouse (while holding it down) to any bool to turn it on.

 

 

BUT, if I click it on a bool, the bool doesnt turn ON by this first click, I need to move my mouse somewhere else (holding mouse down inside the cluster), then back to the bool to turn it ON.

 

I've just read about dynamic event registration. But I dont think I can "combine" two events to get one job done.

 

Yan.

0 Kudos
Message 3 of 5
(3,064 Views)
Solution
Accepted by topic author Mystogan

You just need to double up your events.  You should have the Mouse Enter and Mouse Down events for the booleans handled together.  The Mouse Down for the cluster will always happen before the Mouse Down for the boolean (which is inside of the cluster).  So your Clicked status will be correct when you check the status on the boolean's event.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 5
(3,056 Views)

Hi crossrulz,

 

that is a simple but effective solution. Thank you very much.

This means, when I click a boolean, there are 2 events coming: mouse down cluster and mouse down boolean.

Why havent I thought about this?

 

Thanks,

Yan.

0 Kudos
Message 5 of 5
(3,050 Views)