mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 00:04:28 +01:00
[GH-ISSUE #400] Feature request: external editor or better graphic commands #1344
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gitpower2017 on GitHub (Nov 19, 2024).
Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/400
Is your feature request related to a problem? Please describe.
An external display editor for JSON displays.
It is currently very time-consuming to design a display. Especially more complex shapes like a tank / cistern that displays the current fill level. It is very time-consuming to design using JSON and requires a lot of updates from the display until the result is correct.
Describe the solution you'd like
I can imagine two solutions.
1.) A better graphics command set that not only creates a coloured box, but e.g. a box with border and filling in different colours.
2.) An external editor that creates a JSON export. So that it can be used e.g. Node-Red / JavaScript directly. Including placeholders for the variables.
Additional context




Add any other context or screenshots about the feature request here.
Here are a few pictures of my results with JSON
@nlimper commented on GitHub (Nov 19, 2024):
For more complex graphs/images, IMHO it's better to draw them in any way that fits you better, and upload it as a jpeg to your tag. There is an example in python on the wiki (https://github.com/OpenEPaperLink/OpenEPaperLink/wiki/Image-upload), but it's even possible to draw such images within javascript: when asked ChatGPT for an example in javascript, it comes up with a good starting point (you just have to ask it to use the right upload method). Question to ChatGPT: "using javascript and canvas, draw a charge indicator (battery symbol) with a custom fill level. Upload the canvas as a jpeg using a POST request to a server".
Does this suit your needs? Of course, in theory it's possible to expand the json commands, but there are already more suitable/flexible languages for drawing.
@gitpower2017 commented on GitHub (Nov 27, 2024):
Unfortunately, taking a screenshot and then sending a graphic is not the right way for me.
It would be much nicer if the json commands were enhanced with a few more commands.
I would be very happy about an implementation.
@nlimper commented on GitHub (Dec 10, 2024):
I added placing of an image (in
30812dff49)Image
{ "image": [filename, x, y] }Places a JPG image (RGB, so no grayscale (can be tricky in some graphic software), baseline (non progressive)), located on the flash partition. The image cannot be scaled, so upload it the right size. It can be any size smaller than the tag, for example an icon. { "image": ["/testicon.jpg", 200, 50] }
Tip: use an image with fixed design elements for the background, and fill in any other data using the json commands.
Let me know if you are missing other drawing related stuff in the json commands
@gitpower2017 commented on GitHub (Dec 11, 2024):
I will test the new function. The approach is interesting, it can reduce the JSON statements.
Interesting is a function that only draws the frame of a BOX. The thickness of the line should be freely selectable.
Idee:
{ "boxline": [x, y, width, height, line width, color frame,color fill ] }
I currently create the box like this:
boxline = {"box": [' + xpt + ',' + ypt + ',' + wpt + ',' + hpt + ',1]}' + "," + '{"box": [' + (xpt + 2) + ',' + (ypt + 2) + ',' + (wpt - 4) + ',' + (hpt - 4) + ',' + cpty + ']}'
Since the “width and height” always causes problems for dynamic elements (box too large and outside the ePaper), I would prefer the box function with absolute values.
z.B.
{ "box1": [x-start, y-start, x-end, y-end, color] }
{ "boxline": [x-start, y-start, x-end, y-end line width, color frame,color fill ] }
@nlimper commented on GitHub (Dec 11, 2024):
I extented the
boxandrboxnow with optional border color and width: (e246ac578d)@gitpower2017 commented on GitHub (Dec 11, 2024):
this is nice.
@gitpower2017 commented on GitHub (Dec 12, 2024):
Here are a few more ideas for extending existing functions:
@nlimper commented on GitHub (Dec 12, 2024):
Those would be a bit problematic::
Of course, feel free to add those to the code if you like and do a PR, then we will merge it.
@gitpower2017 commented on GitHub (Dec 18, 2024):
Many thanks for the explanation and implementation.
The new functions have simplified handling.
Gruß