C

Monitor: Verifying the Rendering Output

The Monitor example demonstrates how you can verify the rendering output of the Indicators example application from the external Monitor process. For each safety-critical QML type in Indicators, Monitor reads the expected CRC (Cyclic Redundancy Check) value from the layout file and compares it with the actual CRC value. You can view the verification statuses in the Application Output pane in Qt Creator.

You can run the Monitor example both in your host environment and the target platform. Also, the output verification is supported in the OpenWFD platform adaptation.

The following sequence diagram shows the communication between Monitor, Indicators, and OpenWFD. When you start Monitor, it connects to the Indicators process using the TCP/IP socket. The TCP/IP implementation uses the POSIX API. Most of the operating system provides the POSIX but in Windows, you must use for example Cygwin or Windows Subsystem for Linux (WSL).

Enabling Output Verification in Indicators

Before you can use Monitor, you need to enable the output verification functionality in the Indicators example. Add the following definition to the Indicators.pro file:

DEFINES += USE_OUTPUTVERIFIER

After you have modified the project file, select Build > Run to build and run Indicators. You find the detailed instructions for building examples under the topics in Building Qt Safe Renderer.

In general, Monitor can verify the rendering output of any Qt Safe Renderer application where the output verification feature is enabled. For more information, see Using of OutputVerifier Class.

Running Monitor Example

To build and run Monitor, select Build > Run. You find the detailed instructions for building examples under the topics in Building Qt Safe Renderer. You can also build the Monitor example from the command line using the make tool. Build Monitor with the Indicators controller as follows:

make -f Makefile_gcc qsrMonitor-indicators

You can start Monitor from the command line by running the qsrMonitor-indicators binary. You can use the following command line options:

OptionDescription
-iQt Safe Renderer process
-pThe port.

In the desktop application, the default port is 32112. In QNX, you need to run the message proxy example. The message proxy listens the port 32123 and forwards events to the Qt Safe Renderer process.

You can test the output verification by moving some other application windows on top of the Indicators example and its safety-critical UI elements. When the rendering fails or succeeds, the corresponding verification status appears in the Qt Creator's application output pane.

Modify Monitor example

You can variate the controller functionality. The example controller changes UI states in a predefined order. In real world use case, you must change Qt Safe Renderer states based on the system status which is triggered for example from canbus.

There are two examples of control structures. For more information, see the files demostates.c and indicators.c.

The default error handling prints the error to the std output. The default error handling logic can be changed by implementing a callback function. See the example implementation in the monitorLoop function.

To change the connection method (for example, from TCP/IP to the SPI (Serial Peripheral Interface) or CAN (Controller Area Network) bus), you need to implement connection_stub.c and create a proxy which receives the data from the interface and sends the events to the Qt Safe Renderer process using the platform-specific message queue.

Example Files

Files:

Available under certain Qt licenses.
Find out more.