beremiz

py_ext: fix CSV Writer

18 months ago, Edouard Tisserant
d2f5eb3c7d6e
py_ext: fix CSV Writer

fix POU logic :
- SAVE is a BOOL
- invocation of py_eval on rising edge of SAVE
- remove save python argument

fix python:
- use no encoding for file open (python2)
- re-use detected dialect if any
- use no "rt+" and truncate since no need to re-sniff dialect for output file
- return "OK" instead of "#SUCCESS", preventing POU logic to ACK result
- support creating new line if writing just after last line
- support appending data on short rows

fix example:
- use a HMI:Button to trigger CSV write instead of HMI:Input +1
- reload CSVs on on each new CSV opened in file browser
- add display of CSV write output
Include fonts in HMI
====================
Text inside HMI designed with Inkscape may not display properly in web browser.
The reason is that Inkscape and targeted web browser may disagree on fonts support.
To keep HMI text design consistent, missing fonts can be added to project in order
to have them served together with HMI so that web browser can support them.
Fonts used by Inkscape
----------------------
* System fonts
Vector fonts available at system level are systematically available
in Inkscape
* User fonts
When selected in Inkscape preferences, Inkscape also considers fonts
from these sources:
- "fonts" directory in Inkscape user's directory
- arbitrary absolute font directories set by user
There is no way to point to a directory relative to the SVG file
being edited.
At the time of writing this documentation, Inkscape doesn't support
embedding font in SVG file.
User then have to regularly update Inkscape preferences to ensure
that fonts used in currently edited design are available when editing
it.
Supported font types in SVGHMI
------------------------------
* Web Open Font Format 1 and 2
``.woff```, ``.woff2``
* TrueType fonts
``.ttf``
* OpenType fonts
``.otf``
.. note::
In order to be embedded in HMI, fonts are encoded base64
Add/remove fonts
----------------