Tutorial 7 – Layout Server

Requirements:
Tutorial 6 – Display Layouts hotspot


The Base stores layouts, also known as “Views”, so that users of the Ocularis System can create/update/delete and share layouts with other users.

In this tutorial we’ll show how to access and use the layouts stored in the Base.

To access the layouts stored in the Base, we need to use the ILayoutServer interface. OCAdapter implements the ILayoutServer interface, so let’s start by storing that off:

From the SDK perspective, layouts are stored in a group structure; groups can hold both child groups and/or layouts. A root group exists that represents the root of the group layout structure, so next we’ll get that:

To access the child groups of a group we can use the ILayoutGroup method ChildGroups. Let’s print out all of the groups starting with the root group:

To access all of the layouts in each group, we can use the ILayoutGroup method Layouts. Let’s print out all of the layouts starting with the root group:

Now that we can access all of the layouts in each group, let’s flatten the structure and create an easier to access list:

We now have all of the layouts that are stored in Base in a list. Next, we’ll setup a display using one of those layouts.

Let’s return to our Form Shown event handler:

The idea is to take a layout from the list, enable streaming permissions for AxAuga on all cameras (because the layout can specify any camera using the layout property “salvo”, we need to enable them all), and then load the layout using LoadLayoutFromString. Here’s the code:

Layout’s GetAugaString method creates a layout representation in a form that AxAuga can understand.

Screenshots of the final program:
Series-1-Tutorial-7-2
Series-1-Tutorial-7-1

That’s about it. You can now access the Base to retrieve layouts or “Views” and use them to create a display.


Next:
Tutorial 8 – Browsing Video