|
| 1 | +# Developer Guide (English translation from German v0.1 by Aliazzz) |
| 2 | + |
| 3 | + |
| 4 | +## Build WebVisu.html |
| 5 | +To generate WebVisu.html from the source files you will need |
| 6 | +- the sources themselves, |
| 7 | +- Linux-PC installation, |
| 8 | +- PERL and |
| 9 | +- GNU CPP (C-PreProcessor). |
| 10 | + |
| 11 | +CPP is neccesery, because at the moment some "fancy" view elements |
| 12 | +"steelseries" in a special version of webvisu (=WebVisuPlus) are supported. |
| 13 | +!Support for this special version will sooner or later be dropped! |
| 14 | + |
| 15 | +Download the Sources as a Snapshot: |
| 16 | +https://sourceforge.net/p/webvisu/code/HEAD/tree/ |
| 17 | +Button "Download Snapshot" |
| 18 | + |
| 19 | +Change to "trunk/src": |
| 20 | +cd trunk/src |
| 21 | + |
| 22 | +Call the release script: |
| 23 | +./release.sh |
| 24 | + |
| 25 | +After calling the release script both the files |
| 26 | +"WebVisu.html" and "WebVisuPlus.html" are generated in /trunk/release |
| 27 | + |
| 28 | + |
| 29 | +### Internal working of the Release process |
| 30 | +The Release process internally runs twice. For every result file once. |
| 31 | +During the Release process the results files with extension *.pp.* |
| 32 | +are processed by the Preprozessor. |
| 33 | +Support for the "steelseries" is either activated or removed. |
| 34 | + |
| 35 | +The resultfiles are then merged in a single file. |
| 36 | +Furthermore, all *.js files are obfuscated and compressed. |
| 37 | +After this, the codes "<script src="XXX.js"></script>" in the "WebViduDev.pp.html" file. |
| 38 | +are replaced with the entire content of the obfuscated and compression step. |
| 39 | +This results in "<script>XXX</script>" within the "WebViduDev.pp.html" file. |
| 40 | +This way, external file dependancies are not needed any more. |
| 41 | + |
| 42 | + |
| 43 | +## Development Process |
| 44 | +During development, its very nice to debug the code without much effort. |
| 45 | +To achieve this, the sourcecode is optimized in such a way that it functions without external dependencies. |
| 46 | + |
| 47 | + |
| 48 | +### Testing on a Target |
| 49 | +It is possible to store the *.js Files and the WebVisuDev.pp.html directly in a target directory (a Codesys webserver root). |
| 50 | +The "WebVisuDev.pp.html" should then be renamed to "WebVisuDev.html", because otherwise the CoDeSys |
| 51 | +Webserver will interpret this file wrongly (as a *.pp - at least on my target PLC (of original Author) ) |
| 52 | +Files ending with "*.min.js" can be copied directly. |
| 53 | + |
| 54 | +The files to be copied to the target; |
| 55 | +- codesys.pp.js |
| 56 | +- drawing.pp.js |
| 57 | +- inflate.js |
| 58 | +- jquery-2.0.3.min.js |
| 59 | +- jquery-ajax-blob-arraybuffer.js |
| 60 | +- sprintf.js |
| 61 | +- steelseries-min.js |
| 62 | +- utils.pp.js |
| 63 | +- WebVisuDev.pp.html => WebVisuDev.html |
| 64 | +- zip.js |
| 65 | + |
| 66 | +Calling the WebVisu: |
| 67 | +Calling webvisualistaion is brand dependant (though but in most cases it's) |
| 68 | +http://[IP_ADDRESS_OF_PLC]/webserv/WebVisuDev.html |
| 69 | +or |
| 70 | +http://[IP_ADDRESS_OF_PLC]/WebVisuDev.html |
| 71 | + |
| 72 | + |
| 73 | +### Test unter Linux |
| 74 | +In directory /trunk/tools a minimalistic Python2 Webserver can be found. |
| 75 | +Difference with the Python-Documentation example lies in a changes ("Hacks") |
| 76 | +that ignore smaller and larger abnormalities in the incomming data. |
| 77 | + |
| 78 | +To enable this, one should copy the PLC-reports of the Visu-data from the PLC to a sub report. |
| 79 | +E.g.: /trunk/tickets/bug0815/PLC |
| 80 | + |
| 81 | +After this, the webserver can be started from /trunk-Verzeichnis : |
| 82 | +cd /trunk |
| 83 | +python tools/SimpleWebServer.py |
| 84 | + |
| 85 | +The Webserver starts on Port 8080. |
| 86 | + |
| 87 | +By calling from the Browser a PLC-path must be added, to store the error messages, if any: |
| 88 | +http://localhost:8080/src/WebVisuDev.pp.html?plcDir=/tickets/bug0815/PLC/ |
| 89 | + |
| 90 | +The Webserver only anwsers in response to GETVALUE- and SETVALUE- requests from the Visu. |
| 91 | +The Webserver feeds every number with a "0" and every string with "Hallo". |
| 92 | + |
| 93 | +For testing the Firefox-Developpersconsole can be used. |
0 commit comments