You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • Testing plugin is designed as a simple GUI to support testing and quick&dirty presentations.
    It supports a lot of functions, but it's not a full blown up GUI-Interface.
    WebIDE would not be the right place for a sophisticated GUI, this should be done in a seperate application.

    Testing supports 2 main functions.
    1. Display values from Espruino board
    WebIDE defines a function on Espruino, which creates and sends an JSON-Object and calls this function. Incoming data is interpreted and displayed as circle(alarm, warning,status), bar(0-100) or text(string or integer).
    2. Actions sent to Espruino board
    Clicking on the image sends data to Espruino. This can be assigning a value(number, boolean, string) or a command(e.g. calling a function). Commands are designed for short snippets right now, this could possibly be changed(from textbox to textarea).

    Definition of display and actions is stored locally, in a subfolder of local project folder (see link to tours in project part of options). Format is JSON see example:

    1. { "imageUrl":"Alarming.jpg",
    2. "testMode":"Image",
    3. "dataPoints":[
    4. {"label":"L07","expression":"a1","type":"number","points":[],"display":"A","x":"930","y":"300"},
    5. {"label":"P13","expression":"a2 * 0.7","type":"number","points":[],"display":"A","x":"670","y":"290"},
    6. {"label":"GeneralAlarm","expression":"as*2","type":"number","points":[],"display":"none","x":"0","y":"0"},
    7. {"label":"F03","expression":"w1*0.5","type":"number","points":[],"display":"W","x":"45","y":"455"},
    8. {"label":"T07","expression":"w2*0.3","type":"number","points":[],"display":"W","x":"170","y":"380"},
    9. {"label":"GeneralWarning","expression":"ws*1.5","type":"number","points":[],"display":"none","x":"0","y":"0"},
    10. {"label":"Motor","expression":"s1","type":"number","points":[],"display":"S","x":"170","y":"480"},
    11. {"label":"Log","expression":"asyncLog","type":"text","points":[],"display":"T","x":525,"y":75},
    12. {"label":"L09","expression":"process.memory().free / 30","type":"number","display":"B","x":"760","y":"790"}
    13. ],
    14. "actionPoints":[
    15. {"label":"Alarm","expression":"testAlarm()","type":"command","x":"66","y":"30"},
    16. {"label":"Warning","expression":"testWarning()","type":"command","x":"208","y":"30"},
    17. {"label":"Status","expression":"testStatus()","type":"command","x":"337","y":"30"},
    18. {"label":"Reset","expression":"resetAll();","type":"command","x":"0","y":"0"}
    19. ]
    20. }
About

Avatar for JumJum @JumJum started