diff --git a/.claude/skills/nextion-hmi/SKILL.md b/.claude/skills/nextion-hmi/SKILL.md index 5bc05d1..c61741a 100644 --- a/.claude/skills/nextion-hmi/SKILL.md +++ b/.claude/skills/nextion-hmi/SKILL.md @@ -37,6 +37,11 @@ Back up the user's file first (copy it) unless they said not to; edits write in `encoding` + `chars` (only the characters you need) and a TrueType file that has them; decode the project with the same encoding to see the text readably. Pictures: `quality` 1-99 stores JPEG (Intelligent only, smaller files). +- `build_tft` compiles to `.tft` without the Editor's compiler, but only for model NX4832T035 and a + small subset (pages, hotspots, int variables, timers, pictures, fonts, plain script); it says + what it cannot compile. It needs the Editor's install folder for the firmware files. Its + output is byte-identical to the Editor's for the test projects but has never been loaded onto + a display -- tell the user, and never upload it yourself. - Pictures: `add_picture` returns an id for `pic` / `picc` (crop) / `pic2` etc. Works for Basic and Intelligent displays (Intelligent keeps PNG transparency). - Event code is Nextion script, one line per list item, e.g. `["page settings"]`, diff --git a/CLAUDE.md b/CLAUDE.md index 2d998b2..ec084f7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,7 +27,7 @@ examples/make_demo.py builds demo/ (demo.HMI, decoded/, render/) .mcp.json registers the MCP server for Claude Code in this repo .claude/skills/nextion-hmi/SKILL.md how to use the tools on a user's project (keep in sync with mcp_server.py) tests/ unittest suite; fixtures/demo_editor_saved.HMI = the demo re-saved by the Editor -tools/ template generator +tools/ template generator; make_tft_samples.py (study projects for the .tft compiler) docs/ FORMAT.md (spec), RENDER.md, COVERAGE.md, NOTES.md (open points, what was tried) ``` diff --git a/docs/NOTES.md b/docs/NOTES.md index 96e9d22..47e812f 100644 --- a/docs/NOTES.md +++ b/docs/NOTES.md @@ -168,3 +168,21 @@ Not done: sliders, touch cap and every drawing component (text, number, button, gauge, waveform, picture, crop, checkbox, radio, QR code ...); string variables and string functions; page backgrounds other than a solid colour; global (vscope) components; other models, portrait, other series; and nothing has been loaded onto a display. + +Samples: `tools/make_tft_samples.py` writes the 63 study projects (`tools/tft_samples.json`); +45 are reproduced, the other 18 are one-component projects of the types still to do (their +Editor output is needed again if the scratch copies are gone: ~45 s of Editor time each). + +Starting points for the next component types (from those samples, not yet in the builder): + +- Record slots after 14 follow the type's own attribute list; the RAM order is not the slot + order (text: font, isbr, pco, bco, xcen, ycen, pw, then txt with `txt_maxl + 1` bytes). + Kinds seen: 0x21/0x31 u8, 0x22/0x32 u16, 0x39 i32, 0x3F string (size = bytes reserved), + 0x02 `txt_maxl`. +- Text draw section: `09 1C 08 x,y,w,h,,,,,,1,,0,0,,0` + then `09 13 04` with four `03 7FFF` numbers and a record reference; every `<..>` is a + record reference, so changing an attribute at run time needs no recompilation. +- Progress bar draw section: `=*w/100`, then two fills (`09 0D 04`) for the + filled and the empty part. Gauge: one `09 0A 08` line. QR code: one `09 08 08` line. +- Slider and touch cap add the init line `09 16 04 1`; slider has a `slide` event label. +- Object flag byte: 0x37 types with a rectangle, 0x27 timer and touch cap, 0x07 variable. diff --git a/src/nxhmi/mcp_server.py b/src/nxhmi/mcp_server.py index 6481522..9436975 100644 --- a/src/nxhmi/mcp_server.py +++ b/src/nxhmi/mcp_server.py @@ -158,6 +158,17 @@ def t_add_picture(path, image_path, quality=100): return {"picture_id": pid} +def t_build_tft(path, tft_path, editor_dir=None): + from . import tft_build + try: + out = tft_build.build_tft(_load(path), editor_dir or tft_build.DEFAULT_EDITOR_DIR) + except tft_build.Unsupported as e: + raise ValueError("cannot compile this project yet: %s" % e) + with open(tft_path, "wb") as f: + f.write(out) + return {"tft": tft_path, "bytes": len(out)} + + def t_add_font(path, height, ttf_path=None, encoding="ascii", chars=None): from . import fonts h = _load(path) @@ -248,6 +259,11 @@ TOOLS = { "(then give chars, and a ttf_path that has those characters; the project's encoding " "should match).", {"path": S, "height": {"type": "integer"}, "ttf_path": S, "encoding": S, "chars": S}, ["path", "height"]), + "build_tft": (t_build_tft, "Compile the project to a .tft firmware file. Research stage: model NX4832T035 only; " + "pages, hotspots, int variables, timers, pictures, fonts and plain script; anything else is " + "refused with the reason. Needs a Nextion Editor installation (editor_dir) for the firmware " + "files. The output has never been tried on a real display.", + {"path": S, "tft_path": S, "editor_dir": S}, ["path", "tft_path"]), "verify": (t_verify, "Check every checksum in the project.", {"path": S}, ["path"]), "list_kinds": (t_kinds, "Component kinds that can be added.", {}, []), "schema": (t_schema, "Attributes of a component kind: names, types, defaults, allowed values.", {"kind": S}, ["kind"]), diff --git a/tests/test_mcp.py b/tests/test_mcp.py index 961fd25..28a5c75 100644 --- a/tests/test_mcp.py +++ b/tests/test_mcp.py @@ -77,6 +77,24 @@ class Tools(unittest.TestCase): self.assertTrue(r["result"]["isError"]) self.assertIn("pages: home", r["result"]["content"][0]["text"]) + def test_build_tft(self): + from nxhmi import project, tft, tft_build + for i, n in enumerate(tft_build.FIRMWARE_FILES): # stand-ins for the Editor's files + with open(os.path.join(self.tmp, n), "wb") as f: + f.write(bytes([i]) * 50) + p, out = os.path.join(self.tmp, "min.HMI"), os.path.join(self.tmp, "min.tft") + project.new_project("NX4832T035_011").save(p) + r = self.j("build_tft", path=p, tft_path=out, editor_dir=self.tmp) + with open(out, "rb") as f: + data = f.read() + self.assertEqual(r["bytes"], len(data)) + self.assertTrue(tft.verify_header(data) and tft.verify_trailer(data)) + # the demo uses component types that cannot be compiled yet: a tool error, not a crash + r = M.handle({"jsonrpc": "2.0", "id": 1, "method": "tools/call", + "params": {"name": "build_tft", "arguments": {"path": self.hmi, "tft_path": out, + "editor_dir": self.tmp}}}) + self.assertTrue(r["result"]["isError"]) + def test_schema(self): s = self.j("schema", kind="text") xcen = next(a for a in s["attributes"] if a["name"] == "xcen") diff --git a/tools/make_tft_samples.py b/tools/make_tft_samples.py new file mode 100644 index 0000000..30adbd1 --- /dev/null +++ b/tools/make_tft_samples.py @@ -0,0 +1,58 @@ +"""Generate the tiny projects used to study and regression-test the .tft compiler. + + python tools/make_tft_samples.py OUT_DIR + +Writes one .HMI per entry of tools/tft_samples.json. Compile each in Nextion Editor +(Compile, then File > "TFT file output" > Output) and put the result next to it as .tft; +then NXHMI_TFT_SAMPLES=OUT_DIR python -m unittest discover -s tests -p test_tft_build.py +checks that nxhmi.tft_build reproduces every one it supports byte for byte. The .tft files embed +Nextion firmware: keep OUT_DIR outside the repo. + +Entry keys: fonts [heights], pics [[w, h], ...], program (Program.s text), and either +page/comps/events for a single page or pages [{name, page, comps, events}, ...]; +comps = [[kind, {attributes}], ...], events = {":": [lines]}. +""" +import io +import json +import os +import sys + +sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "src")) +from nxhmi import components as C, fonts, project # noqa: E402 +from nxhmi.page import Page # noqa: E402 + + +def make(spec): + kw = {"program": spec["program"]} if "program" in spec else {} + h = project.new_project("NX4832T035_011", **kw) + for height in spec.get("fonts", []): + project.add_font(h, fonts.from_ttf(None, height)) + for i, (w, hh) in enumerate(spec.get("pics", [])): + from PIL import Image + b = io.BytesIO() + Image.new("RGB", (w, hh), (200, 40 + 30 * i, 40)).save(b, "PNG") + project.add_picture(h, b.getvalue()) + for pi, ps in enumerate(spec.get("pages", [spec])): + if pi: + project.add_page(h, ps.get("name", "page%d" % pi)) + entry = "%d.pa" % pi + p = Page.parse(h.read(entry)) + for k, v in ps.get("page", {}).items(): + p.components[0].set(k, v) + for kind, attrs in ps.get("comps", []): + C.add(p, kind, **attrs) + for key, lines in ps.get("events", {}).items(): + i, group = key.split(":") + p.components[int(i)].set_event(group, lines) + h.write(entry, p.pack()) + return h + + +if __name__ == "__main__": + out = sys.argv[1] + os.makedirs(out, exist_ok=True) + with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "tft_samples.json")) as f: + specs = json.load(f) + for name, spec in specs.items(): + make(spec).save(os.path.join(out, name + ".HMI")) + print("%d projects written to %s" % (len(specs), out)) diff --git a/tools/tft_samples.json b/tools/tft_samples.json new file mode 100644 index 0000000..04c4a60 --- /dev/null +++ b/tools/tft_samples.json @@ -0,0 +1,1078 @@ +{ +"p00": { +"events": { +"0:codesloadend": [ +"print \"\"" +] +} +}, +"p01": { +"events": { +"0:codesloadend": [ +"print \"a\"" +] +} +}, +"p02": { +"events": { +"0:codesloadend": [ +"print \"aa\"" +] +} +}, +"p03": { +"events": { +"0:codesloadend": [ +"print \"aaa\"" +] +} +}, +"p04": { +"events": { +"0:codesloadend": [ +"print \"aaaa\"" +] +} +}, +"p05": { +"events": { +"0:codesloadend": [ +"print \"aaaaa\"" +] +} +}, +"p06": { +"events": { +"0:codesloadend": [ +"print \"aaaaaa\"" +] +} +}, +"p07": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaa\"" +] +} +}, +"p08": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaaa\"" +] +} +}, +"p09": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaaaa\"" +] +} +}, +"p10": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaaaaa\"" +] +} +}, +"p11": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaaaaaa\"" +] +} +}, +"p12": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaaaaaaa\"" +] +} +}, +"p13": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaaaaaaaa\"" +] +} +}, +"p14": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaaaaaaaaa\"" +] +} +}, +"p15": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaaaaaaaaaa\"" +] +} +}, +"p16": { +"events": { +"0:codesloadend": [ +"print \"aaaaaaaaaaaaaaaa\"" +] +} +}, +"k_hotspot": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +] +] +}, +"k_timer": { +"comps": [ +[ +"timer", +{} +] +] +}, +"k_variable": { +"comps": [ +[ +"variable", +{} +] +] +}, +"k_progress_bar": { +"comps": [ +[ +"progress_bar", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +] +] +}, +"k_slider": { +"comps": [ +[ +"slider", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +] +] +}, +"k_gauge": { +"comps": [ +[ +"gauge", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +] +] +}, +"k_waveform": { +"comps": [ +[ +"waveform", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +] +] +}, +"k_checkbox": { +"comps": [ +[ +"checkbox", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +] +] +}, +"k_radio": { +"comps": [ +[ +"radio", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +] +] +}, +"k_qrcode": { +"comps": [ +[ +"qrcode", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +] +] +}, +"k_touch_cap": { +"comps": [ +[ +"touch_cap", +{} +] +] +}, +"k_hot2": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"hotspot", +{ +"x": 100, +"y": 120, +"w": 61, +"h": 41 +} +] +] +}, +"k_hotx": { +"comps": [ +[ +"hotspot", +{ +"x": 11, +"y": 10, +"w": 60, +"h": 40 +} +] +] +}, +"k_hotev": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +] +], +"events": { +"1:codesdown": [ +"dim=50" +], +"1:codesup": [ +"dims=60", +"page 0" +] +} +}, +"n_base": {}, +"n_font": { +"fonts": [ +16 +] +}, +"n_font2": { +"fonts": [ +16, +24 +] +}, +"n_pic": { +"pics": [ +[ +8, +8 +] +] +}, +"n_pic2": { +"pics": [ +[ +8, +8 +], +[ +20, +10 +] +] +}, +"n_fp": { +"fonts": [ +16 +], +"pics": [ +[ +8, +8 +] +] +}, +"n_2pg": { +"pages": [ +{}, +{ +"name": "second" +} +] +}, +"f_text": { +"fonts": [ +16 +], +"comps": [ +[ +"text", +{ +"x": 10, +"y": 10, +"w": 100, +"h": 30 +} +] +] +}, +"f_number": { +"fonts": [ +16 +], +"comps": [ +[ +"number", +{ +"x": 10, +"y": 10, +"w": 100, +"h": 30 +} +] +] +}, +"f_button": { +"fonts": [ +16 +], +"comps": [ +[ +"button", +{ +"x": 10, +"y": 10, +"w": 100, +"h": 30 +} +] +] +}, +"f_xfloat": { +"fonts": [ +16 +], +"comps": [ +[ +"xfloat", +{ +"x": 10, +"y": 10, +"w": 100, +"h": 30 +} +] +] +}, +"f_scrolling_text": { +"fonts": [ +16 +], +"comps": [ +[ +"scrolling_text", +{ +"x": 10, +"y": 10, +"w": 100, +"h": 30 +} +] +] +}, +"f_dual_state_button": { +"fonts": [ +16 +], +"comps": [ +[ +"dual_state_button", +{ +"x": 10, +"y": 10, +"w": 100, +"h": 30 +} +] +] +}, +"f_picture": { +"pics": [ +[ +100, +30 +] +], +"comps": [ +[ +"picture", +{ +"x": 10, +"y": 10, +"w": 100, +"h": 30, +"pic": 0 +} +] +] +}, +"f_crop": { +"pics": [ +[ +100, +30 +] +], +"comps": [ +[ +"crop", +{ +"x": 10, +"y": 10, +"w": 100, +"h": 30, +"picc": 0 +} +] +] +}, +"f_text2": { +"fonts": [ +16 +], +"comps": [ +[ +"text", +{ +"x": 20, +"y": 10, +"w": 100, +"h": 30, +"txt": "hello", +"bco": 31, +"pco": 63488 +} +] +] +}, +"f_text3": { +"fonts": [ +16 +], +"comps": [ +[ +"text", +{ +"x": 10, +"y": 10, +"w": 100, +"h": 30, +"txt": "hello world", +"txt_maxl": 20 +} +], +[ +"text", +{ +"x": 10, +"y": 100, +"w": 100, +"h": 30 +} +] +] +}, +"c_sys1": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"dim=50", +"dims=60", +"baud=9600", +"bauds=9600", +"spax=1", +"spay=2", +"thc=0", +"thdra=1", +"ussp=30", +"thsp=31" +] +} +}, +"c_cmd1": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"page 0", +"page page0", +"ref 0", +"ref m0", +"click m0,1", +"click 1,0", +"get dim", +"print dim", +"printh 0a 0d", +"prints dim,1", +"vis m0,0", +"tsw m0,1", +"tsw 255,0" +] +} +}, +"c_cmd3": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"touch_j", +"ref_stop", +"ref_star", +"code_c", +"rest", +"print \"abc\"", +"print va0.val", +"get va0.val", +"printh 01", +"get \"hi\"", +"cls WHITE", +"cls GRAY", +"cls BROWN" +] +} +}, +"c_one": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"dim=50" +] +} +}, +"c_two": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"dim=50", +"dim=50" +] +} +}, +"d_sys2": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"thup=1", +"sendxy=1", +"delay=10", +"sleep=0", +"bkcmd=3", +"sys0=1", +"sys1=2", +"sys2=3", +"wup=0", +"usup=1", +"addr=0", +"recmod=0", +"dp=0" +] +}, +"program": "int sys0=0,sys1=0,sys2=0\r\nbaud=115200\r\npage 0\r\n" +}, +"d_cmd2": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"com_stop", +"com_star", +"randset 1,100", +"sys0=rand", +"cls RED", +"cls 1024", +"fill 0,0,10,10,RED", +"line 0,0,10,10,BLUE", +"draw 0,0,10,10,GREEN", +"cir 50,50,10,YELLOW", +"cirs 50,50,10,BLACK", +"doevents", +"sendme" +] +}, +"program": "int sys0=0,sys1=0,sys2=0\r\nbaud=115200\r\npage 0\r\n" +}, +"d_flow1": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"if(sys0==1)", +"{", +" sys1=2", +"}", +"if(sys0!=1)", +"{", +" sys1=3", +"}else", +"{", +" sys1=4", +"}", +"while(sys0<10)", +"{", +" sys0++", +"}", +"for(sys0=0;sys0<10;sys0++)", +"{", +" sys1--", +"}" +] +}, +"program": "int sys0=0,sys1=0,sys2=0\r\nbaud=115200\r\npage 0\r\n" +}, +"d_flow2": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"if(sys0>1&&sys1<2)", +"{", +" sys2=1", +"}else if(sys0>=3||sys1<=4)", +"{", +" sys2=2", +"}else", +"{", +" sys2=3", +"}" +] +}, +"program": "int sys0=0,sys1=0,sys2=0\r\nbaud=115200\r\npage 0\r\n" +}, +"d_op": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"sys0=sys1+sys2", +"sys0=sys1-sys2*3", +"sys0=sys1/2", +"sys0=sys1%7", +"sys0+=2", +"sys0-=1", +"sys0*=2", +"sys0/=2", +"sys0=sys1<<2", +"sys0=sys1>>1", +"sys0=sys1&255", +"sys0=sys1|sys2", +"sys0=sys1^sys2", +"sys0=0x1F", +"sys0=-5" +] +}, +"program": "int sys0=0,sys1=0,sys2=0\r\nbaud=115200\r\npage 0\r\n" +}, +"d_attr": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesloadend": [ +"va0.val=5", +"va0.val++", +"va0.val+=sys0", +"tm0.en=0", +"tm0.tim=100", +"page0.bco=RED", +"page0.va0.val=1", +"sys0=va0.val", +"sys0=tm0.tim", +"sys0=dp", +"sys0=page0.bco", +"b[1].x=5", +"p[0].b[2].val=7", +"sys0=m0.x", +"sys0=m0.id" +] +}, +"program": "int sys0=0,sys1=0,sys2=0\r\nbaud=115200\r\npage 0\r\n" +}, +"d_num": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"program": "int sys0=0,sys1=0,sys2=0\r\nbaud=115200\r\npage 0\r\n", +"events": { +"0:codesloadend": [ +"dim=99", +"dim=100", +"sys0=255", +"sys0=256", +"sys0=999", +"sys0=1000", +"sys0=9999", +"sys0=65535", +"sys0=65536", +"sys0=-5", +"sys0=0x1F", +"sys0=-1000", +"sys0=sys1+100", +"sys0=sys1+1000", +"va0.val=1000", +"va0.val=7" +] +} +}, +"d_ev": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"events": { +"0:codesload": [ +"sys0=1" +], +"0:codesloadend": [ +"sys0=2" +], +"0:codesdown": [ +"sys0=3" +], +"0:codesup": [ +"sys0=4" +], +"0:codesunload": [ +"sys0=5" +], +"1:codesdown": [ +"sys0=6" +], +"1:codesup": [ +"sys0=7" +], +"3:codestimer": [ +"sys0=8" +] +}, +"program": "int sys0=0,sys1=0,sys2=0\r\nbaud=115200\r\npage 0\r\n" +}, +"d_prog": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"program": "int sys0=0,sys1=0,sys2=0\r\nint abc=5\r\nbaud=115200\r\nsys0=abc\r\npage 0\r\n" +}, +"d_decl": { +"comps": [ +[ +"hotspot", +{ +"x": 10, +"y": 10, +"w": 60, +"h": 40 +} +], +[ +"variable", +{} +], +[ +"timer", +{} +] +], +"program": "int sys0=0,sys1=0,sys2=0\r\nbaud=115200\r\npage 0\r\n" +} +} \ No newline at end of file