LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Design Pattern for Tabbed Event Structure

Solved!
Go to solution

Hi All,

 

Been working on a user interface using an event structure design pattern to respond to button presses.

The interface got quite large and I decided to organize the buttons into groups and put them on different tabs (to group the functionality). 

 

However when I put a case statement around the event structure to seperate the code on the diagram too I was not able to switch tabs and the interface gets stuck.

 

Example attached.

 

I could put all the button events from different tabs into one event structure but thought this might get very large and unreadable. Is there a standard design pattern that addresses this problem?

 

Many thanks.

 

Mark.

0 Kudos
Message 1 of 2
(2,526 Views)
Solution
Accepted by topic author markedwards

Medwar19 wrote:

Hi All,

 

Been working on a user interface using an event structure design pattern to respond to button presses.

The interface got quite large and I decided to organize the buttons into groups and put them on different tabs (to group the functionality). 

 

However when I put a case statement around the event structure to seperate the code on the diagram too I was not able to switch tabs and the interface gets stuck.

 

Example attached.

 

I could put all the button events from different tabs into one event structure but thought this might get very large and unreadable. Is there a standard design pattern that addresses this problem?

 

Many thanks.

 

Mark.


Standard?

 

If you tabs equate to states then the top level get set up to call a sub-VI that is responcible for that state.

 

2_Init_GUI_Controller.PNG

 

Then inside the sub-VI handling that state I use Dynamic Event registration to set up the events that I  have to service while in that state.

 

This is what one of those sub-VI can look like.

 

7_Get_Refs_In_Use.PNG

 

Which makes it very clearn what we are handling in thois mode of operation.

 

Ton wrote a Nugget on Dynamic Event Registration that can be found here.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 2
(2,516 Views)