GUI Tree View Client

This section explains how to implement the Example Entry/Exit Recipes in a GUI tree view client.

The following screenshot shows a tree view that displays two views of the recipe data.

At the top, for each tag that currently matches some recipe, we show the recipes it matches and the order in which we got the entry events. So for the tag 0011CE003200000558, 1/0 -> 0/0 means that the tag is in 1/0 and also 0/0, but it entered 1/0 first and the 0/0 afterwards. This shows how you can detect 'direction of motion' by putting together multiple recipes. The sequence in time in which recipes are activated or deactivated allows the application programmer to work out the direction the tag must have been moving.

At the bottom, each recipe and the tags that it contains, are shown.

The code for this example (in TagEntryExitExample.cs) is a bit more extensive and needs a bit of Windows Forms knowledge. Therefore, only the parts that relate to the abstract state maintenance are shown. The most important point to notice is that the events are executed in a separate thread; you might therefore have to use some mutual exclusion to protect the state.