// 项目json结构 { // 版本号 "version": "1.0.0", // 应用元数据 "meta": { // 项目名称 "name": "智能HOME项目", // 项目版本号 "version": "1.0.0", // 项目描述 "description": "智能HOME项目", // 项目类型 "type": "chip", // 'analog_display' | 'chip' | 'board' 1: 模拟显示 2: 芯片 3: 板卡 // 屏幕类型 "screenType": "single", // 'single' | 'double' 1:单屏 2:双屏 // 语言 "language": "zh-cn", // 资源打包方式 "resourcePackaging": "c_bin", // 'c' | 'c_bin' 1: C源码 2: C源码+BIN // BIN数量 "binNum": "1", // 1~32 // 芯片配置 "chip": { // 芯片型号 "model": "ESP32" }, // 板卡配置 "board": { // 板卡型号 "model": "ESP32", }, // 屏幕配置 "screens": [ { // 屏幕类型 "type": "1", // 1:主屏 2:副屏 // 接口类型 "interface": "RGB", // 屏幕宽 "width": 1920, // 屏幕高 "height": 1080, // 颜色深度 "colorDepth": "16bit", // 颜色格式 "colorFormat": "BGR", // 屏幕参数 "params": { "PCLK": "", "VBP": "", "VFP": "", "HBP": "", "HFP": "", "HSYNC": "", "VSYNC": "", "HSYNC_WIDTH": "", "HSYNC_WIDTH": "" } } ], // 创建时间 "createTime": "2025-09-01 12:00:00", // 修改时间 "modifyTime": "2025-09-01 12:00:00", }, // BIN列表 "bins": [ { "id": "bin_1", "fileName": "bin1.bin", "path": "./src/bin/bin1.bin" } ], // 资源 "resources": { // 图片资源 "images": [ { "id": "img_1", "fileName": "image1.png", "fielType": "png", "path": "./src/assets/images/image1.png", "compressFormat": "rle", // 无压缩、RLE压缩、QOI压缩、JPEG压缩、PNG压缩 "alpha": 1, // 透明度0-1 "bin": "bin_1" // 关联的BIN ID } ], // 字体资源 "fonts": [ { "id": "font_1", "fileName": "font1.ttf", "fielType": "ttf", "path": "./src/assets/fonts/font1.ttf", "range": ["page", "custom", "range"], // 'all' | 'page' | 'custom' | 'range' 0: 全部 1:界面文本 2:自定义文本 3: 编码范围 // 编码范围 "codeRange": ["0x4E00-0x9FA5"], // 额外的文本内容 "extText": "abcdefghijklmnopqrstuvwxyz", "bin": "bin_1" // 关联的BIN ID } ], "others": [ // 动画资源 { "id": "o_1", "fileName": "other.an", "fileType": "an", "path": "./src/assets/others/other.an" }, // 样式资源 { "id": "o_2", "fileName": "a.style", "fileType": "style", "path": "./src/assets/others/a.style" } ] }, // 全局变量定义 "variables": [ { // 组ID "id": "group_1", // 组名称 "name": "全局变量", // 变量 "variables": [ { "id": "var_1", "name": "a", "value": "1", "type": "int" } ] } ], // 主题 "themes": [ { "id": "theme_0", // 主题名称 "name": "默认主题", // 默认主题 "default": true, // 颜色集 "colors": [ { "id": "color_1", // 颜色名称 "name": "背景颜色", // 颜色值 "value": "#000000", // 透明度 "alpha": 1 } ] }, { "id": "theme_1", // 主题名称 "name": "高亮主题", // 默认主题 "default": false, // 颜色集 这里的颜色只能从默认主题获取,可以修改值 "colors": [ { "id": "color_1", // 颜色名称 "name": "背景颜色", // 颜色值 "value": "#ffffff", // 透明度 "alpha": 1 } ] } ], // 动画 "animations": [ { // 动画名称 "name": "move_x_animation", // 时间轴 "timeline": [ { // 目标属性 "target": "x", // 开始值 "start": 0, // 结束值 "end": 100, // 延迟时间 "delay": 0, // 动画时间 "duration": 500, // 动画效果 "timingFunction": "ease", // 动画次数 "iterationCount": "infinite" // 数值或infinite } ] } ], // 多语言 "languages": [ { "id": "language_1", // 语言表示 "key": "hello", // 语言内容 "values": [ { "language": "zh-cn", "value": "你好", "font": "font_1" }, { "language": "en", "value": "hello" }, { "language": "ja", "value": "こんにちは" }, { "language": "ko", "value": "안녕하세요" }, { "language": "fr", "value": "bonjour" } ] } ], // 方法 "methods": [ { "id": "method_1", "name": "lv_obj_click", "action": "static lv_obj_click(void* ctx) { // TODO: 添加事件处理逻辑 }" } ], // 屏幕 "screens": [ { "id": "screen_1", "name": "主屏", // 类型 "type": "screen", // 屏幕宽 未设置取通用配置 "width": 1920, // 屏幕高 未设置取通用配置 "height": 1080, // 隐藏 "hidden": false, // 锁定 "locked": false, // 页面 "pages": [ { "id": "page_1", // 页面名称 "name": "启动页", // 类型 "type": "page", // 隐藏 "hidden": false, // 锁定 "locked": false, // 参考线 "referenceLine": [ { "id": "r_1", // 垂直 水平 "layout": "horizontal", // 位置 "position": 0, // 显示 "visible": true } ], // 属性 "props": {}, // 样式 "style": {}, // 事件 "events": [], // 页面变量 "variables": [ { "id": "page_1_var_1", "name": "page_1_a", "value": "1", "type": "int" } ], // 子组件 "children": [ { "id": "lv_obj_01", // 控件名称 "name": "obj_01", // 类型 "type": "widget", // 控件类型 "widgetType": "lv_obj", // 隐藏 "hidden": false, // 锁定 "locked": false, // 属性 根据每个控件生成 "props": { // 坐标x "x": 0, // 坐标y "y": 0, // 宽度 "width": 100, // 高度 "height": 100, // 布局方式 flex grid "layout": "flex", // 启用 "enable": true, // 可见 "visible": true, // 值 "value": { "valueType": "VARIABLE", "value": "page_1_a" }, }, // 样式 根据每个控件生成 "style": { // 样式 "style": "default", "state": { // 默认状态 "normal": { // 直接使用颜色值 "bg_color": "#000000", "border": "all", // all left right top bottom // 绑定变量或主题色 "border_color": { // valueType的值: TEXT: 文本,VARIABLE: 变量,LANGUAGE: 多语言, COLOR: 主题颜色,不同的控件可以配置不同类型的属性 "valueType": "TEXT", "value": "#ffffff" }, "border_width": 1, "round_radius": 4 }, // 禁用状态 "disabled": { "bg_color": "#000000", "border": "all", } } }, // 事件 "events": [ { "id": "event_1", // 事件名称 "name": "lv_obj_click_event", // 触发事件 "trigger": "click", // 动作类型 "type": "function", // 'play_animation' | 'function' -> play_animation: 播放动画 function: 执行函数 // 动画ID animation: "", // 动画播放前函数ID animationPlayerBeforeEvent: "", // 动画播放后函数ID animationPlayerAfterEvent: "", // 函数ID function: "method_1" }, // 加载完毕播放动画 { "id": "event_1", // 事件名称 "name": "lv_obj_click_event", // 触发事件 "trigger": "click", // 动作类型 "type": "play_animation", // 'play_animation' | 'function' -> play_animation: 播放动画 function: 执行函数 // 动画ID animation: "animation_1", // 动画播放前函数ID animationPlayerBeforeEvent: "method_animation_1", // 动画播放后函数ID animationPlayerAfterEvent: "method_animation_2", // 函数ID function: "" } ], // 子对象 "children": [ { "id": "label_1", "name": "lv_label", "parentId": "lv_obj_01", "type": "object", "hidden": false, "locked": false, "props": [ { "id": "prop_1", "name": "text", "type": "string", "text": { "valueType": "LANGUAGE", "value": "hello" } } ] } ] } ] } ] } ] }