Support:Howto:Application Binding

From Guiliani

Revision as of 18:16, 26 January 2017 by Patrik (talk | contribs) (Created page with "== Intro == === Assumed knowledge === * C++ * General Handling of Visual Studio * Basic Handling of GSE === Guiliani Event Flow === File:Guiliani Event Flo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Intro

Assumed knowledge

  • C++
  • General Handling of Visual Studio
  • Basic Handling of GSE

Guiliani Event Flow

Guiliani Event Flow

The most common way the Guiliani Event flow is triggered is a user interaction, like a touch on the display. The Guiliani Input device will be triggered or will poll a device driver and generate a GUIEvent which will then processed by the Event handler. That will forward it to affected controls. If the control shall interact with other controls or the application, it will queue a command or interacts with the datapool. Both methods are describe later. The control draws itself after that by calling the Graphics Wrapper which will handle the platform independent graphics library. The customer application can also queue commands or set values to the datapool.

DataPool

The datapool can be understood as a kind of database, which is easy-to use. Controls can observe from or set values to the data pool. The application can set to or get from values using the datapool asynchronously. The Datapool can be used for fast changing values, due to the low execution time and low latency.

Commands

Commands will be executed in the event loop. They’re queued until executed. Guiliani defines several standard commands and can be used with GSE by default:

Command Name Description
CMD_DIALOG_TRANSITION Changes to another dialog using an animated transition
CMD_LOAD_DIALOG Loads and displays a dialog at once
CMD_QUIT Quits the application
CMD_SETOBJECTSTATES Manipulates another object, like hides/shows it
CALLAPPLICATIONAPI Defines a Text API to do application binding

When using commands in GSE it can be populated to GSE with a custom extension.

Custom Extensions

Custom Extensions - Dependencies

The Application normally consists of the Guiliani library, user code and custom extensions code. GSE consists of a GSE library, Guiliani and the same sources of Custom Extensions as the application. For further information on events please read our documentation.

DataPool

Create Controls

You can either create a new project from scratch or just modify an existing project for this Howto. First create these Controls on one or more dialogs with the given IDs:

Control Type ID
Gauge OBJ_GAUGE_DPOOL
Text field OBJ_TEXTFIELD_DPOOL
Horizontal slide OBJ_HOR_SLIDER_DPOOL
Vertical Slide OBJ_VER_SLIDER_DPOOL

The ID names are not important. but it is important that you can identify them later. The Gauge has different standard parameters than the others. To the values correctly, set the following attributes:

Attribute Value
MinAngle 45
MaxAngle 225
MaxValue 200

Manage Datapool

Using the menu item "Resources->Manage datapool" it is possible to bind the control to a datapool entry. First we add a new Entry. You might change the name and add a description here. Now add the previously created controls as observers and close the dialog.

See the effect

To see the effect choose File->Run Simulation... to simulate the results. When dragging one slide each of the controls at once shows the same value.