1- # Developer Guide
2- (English translation from German v0.1 by Aliazzz)
1+ # Developer Guide (English)
32
3+ ## Credits
4+ The initial english translation was done by Aliazzz - thanks for your great work!
45
56## Build WebVisu.html
67To generate WebVisu.html from the source files you will need
@@ -31,6 +32,13 @@ Call the release script:
3132After calling the release script both the files
3233"WebVisu.html" and "WebVisuPlus.html" are generated in /trunk/release
3334
35+ The script "release.sh" can optionally be given the parameter "HTMLTITLE=".
36+ This sets the title of the generated HTML file to the passed value.
37+
38+ Example:
39+ ``` bash
40+ ./release.sh HTMLTITLE=WebVisu5
41+ ```
3442
3543### Internal working of the Release process
3644The Release process internally runs twice. For every result file once.
8694- http://[ IP_ADDRESS_OF_PLC] /WebVisuDev.html
8795
8896
89- ### Test unter Linux
97+ ### Test under Linux
9098In directory /trunk/tools a minimalistic Python2 Webserver can be found.
9199Difference with the Python-Documentation example lies in a changes ("Hacks")
92100that ignore smaller and larger abnormalities in the incomming data.
@@ -112,3 +120,70 @@ with "Hallo".
112120
113121For testing the Firefox-Developpersconsole can be used.
114122
123+ ## Arguments in the URL
124+ The WebVisu can be influenced by arguments in the URL.
125+ How arguments are encoded in URLs should be clear, here again a Example as a
126+ reminder:
127+
128+ - http://localhost:8080/src/WebVisuDev.pp.html?firstArg=1&secondArg=2&thirdArg=3
129+
130+ The first argument is separated with a "?", each additional argument with a "&".
131+
132+ - startVisu=...
133+
134+ Sets the visualization file to be loaded as the beginning.
135+ Default: "plc_visu"
136+
137+ - plcDir=...
138+
139+ Overwrites the automatic recognition of the PLC directory with the
140+ specified value.
141+
142+ - postUrl=...
143+
144+ Overrides the automatic recognition of the variable connection to the
145+ target.
146+
147+ - logOverlayWriteout
148+
149+ Activates a mini log window in the upper right corner. For browsers that
150+ do not provide a console.
151+
152+ - perfWriteout
153+
154+ Activates a small performance window in the upper left corner in which the
155+ times required for loading and updating the screen or the variables are
156+ displayed.
157+
158+ - useTouchEvents or dontUseTouchEvents
159+
160+ Overrides the automatic detection of touch events and activates or deactivates
161+ them.
162+
163+ - doPerfTest
164+
165+ Activates a small performance test. However, it is only used for development.
166+
167+ ## Click handling (from r84)
168+ With version r84 the handling of mouse clicks has been completely revised.
169+ Previously, click regions were determined on load and each of them was compared
170+ in the handler functions with the point of the mouse events.
171+ Since r84, click handling has been object-related and no longer works with
172+ coordinates, but with an invisible bitmap. During the graphical output of the
173+ elements (on the browser) each element is also drawn on this invisible bitmap.
174+ The difference is that on the invisible bitmap each element is filled with a
175+ certain color. This colour corresponds to the object ID.
176+ During a mouse event, the (invisible) click bitmap now shows the color of the
177+ point under the mouse and from this color the object ID is recalculated. The
178+ click handler then knows which element was clicked.
179+ This mechanism solves three main problems:
180+ - Invisible elements are not drawn and therefore not detected anymore
181+ - Click regions must always be rectangular. Circles or polygons become
182+ now evaluated correctly.
183+ - If there are several click actions per element, they can now be evaluated
184+ much faster.
185+
186+ To encode the object ID in a color, the 24 bits of the color value are used as
187+ a 24 bit integer. While the first 255 elements only using the blue portion,
188+ the other elements are using the green and then the red portions.
189+ The color value 0xFFFFFFFF is assigned to the background.
0 commit comments