Integration of libcairo in pvbrowser
Backward Content Forward

pvserver template 1

overview.png
Overview of the structure of the (template) pvserver

pvserver consist of several threads. The 1 thread "Accept" waits for clients at a TCP port. For each new client, it starts a new thread "pvMain"that serves the client. It detects whether it is a pvbrowser client with pvprotocol or a webbrowser with http-protocol. Depending on this, the pvbrowser masks "maskX_slots" or websites with "httpd" are displayed. These functions are subroutines "call" in a "pvMain" worker thread.

This means that pvbrowser and webbrowser clients can connect via a "network" and process their "talk tcp" protocol.

Besides these threads, which are mandatory for every pvserver and which are specified by the pvdevelop IDE (source code is generated), there is another thread "Loop" in this pvserver template. This is started in the main() function of the pvserver and runs in an endless loop. In the template he draws a graphic (test. png/test. svg) to be displayed in the visualization by means of our libcairo connection. Such a "loop" thread would typically also read in the measured variables to be recorded and displayed in the visualization (e. g. via shared memory / from fieldbus /...) and output the setpoint variables.

The workers threads "pvMain" can send messages to the "loop" thread via "loopfifo" (rlFifo class) to send "send". The "send_mbxcmd" command line tool can also send these messages to the loop thread (rlMailbox class).

The aim is to allow the mouse events for our cairo widgets to be interpreted in "Loop". To do this,"maskX_slots" or "httpd" send the mouse events that have occurred on the clients (pvbrowser/webbrowser) to "Loop".


Backward Content Forward