05-11-2012 06:33 PM
Hi All,
Attached is the result page code. It suppose to act like a game where the picture appear at a random grid and show up. The user had to click on the correct 2D picture to level up after matching the same pattern
The problem I face now is that when the state machine is not in the Result page and the user had click on the 2D picture already, it will memorise the click and when it come to the Result state, the result will be generated and go to the next level if correct or stop at the start if wrong
Any solution for this?
05-11-2012 10:14 PM
From what I was seeing, I'm thinking the state machine might not be the architecture you want. I'm thinking you could use a while loop with an event structure. The event structure would then take care of all of your logic. Keep some shift registeres to keep track of states. This way, you can use the "Lock front panel until this event case completes".
05-12-2012 07:45 AM
Hi Crossrulz,
I dont understand your point 🙂
Can you elaborate. My state machine is not the full code as I am still figuring out the event structure. At the game state, I will process a random code generation to sequence through the state diagram. Now my problem is when the state is finished, it will alway got to the result state for the appropriate click. However, before going to the result state, when the mouse button is click, it will register the click already. So I would like to disable the event until the result state is called.
05-12-2012 12:00 PM - edited 05-12-2012 12:29 PM
@Paradigm1999 wrote:
The problem I face now is that when the state machine is not in the Result page and the user had click on the 2D picture already, it will memorise the click and when it come to the Result state, the result will be generated and go to the next level if correct or stop at the start if wrong
You would use one single event structure in the "Start" case, add "result" as a second condition to that same case. It will contain all possible events you need. (OK to start, mouse down, etc).
In the "mouse down" event cases use a case structure wired to the state that has an nearly empty default case, but does the appropriate state switching in the "result" case.
05-12-2012 12:33 PM
@altenbach wrote:
You would use one single event structure in the "Start" case, add "result" as a second condition to that same case. It will contain all possible events you need. (OK to start, mouse down, etc).In the "mouse down" event cases use a case structure wired to the state that has an nearly empty default case, but does the appropriate state switching in the "result" case.
Here's a broken draft that shows some of these points. Most of the other code is missing, but it should give you some ideas.
05-13-2012 10:39 AM
Hi altenbach,
Can I ask a few question
1) How you create the VI Server Reference for individual Array A1 to A8
2) I need to identify which Array had been click. If you bundle all the Array mouse down event structure together, how can I check or know which array had been click?
Thanks a lot
05-13-2012 11:19 AM - edited 05-13-2012 11:21 AM
Paradigm1999 wrote:1) How you create the VI Server Reference for individual Array A1 to A8
2) I need to identify which Array had been click. If you bundle all the Array mouse down event structure together, how can I check or know which array had been click?
05-13-2012 12:13 PM
You did already tried with cursor vi, with get busy.vi can disable click while completing the process.
05-14-2012 12:19 AM
Hi Mahu,
what you mean by cursor.vi and busy.vi? Where can I get these VI?
05-14-2012 12:55 AM
Hi Mahu,
I saw the set busy.vi but it cause the cursor to be in busy icon. Ppl may misunderstood it as the VI is not ready and is still loading. Is there a way to disable the cursor without marking it looks busy?