Skip to content

Commit

Permalink
add tool to generate object code
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Jun 28, 2021
1 parent 6babba1 commit a2a54d4
Show file tree
Hide file tree
Showing 4 changed files with 660 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changes.md
Expand Up @@ -2,6 +2,7 @@

2021/06/28
* 增加函数matrix\_transform\_pointf。
* 增加一个生成object的框架代码的小工具。
* 完善编辑脚本,APP支持输出到不同目录(感谢[ufbycd](https://github.com/ufbycd)提供补丁)。

2021/06/27
Expand Down
52 changes: 52 additions & 0 deletions tools/object_gen/README.md
@@ -0,0 +1,52 @@
# object 代码生成器

用来生成 object 的框架代码的小工具。

## 1.编写描述文件

```json
{
"name":"foobar",
"date":"2021-06-15",
"team":"AWTK Develop Team",
"author":"Li XianJing <xianjimli@hotmail.com>",
"desc":"foobar",
"copyright":"Guangzhou ZHIYUAN Electronics Co.,Ltd.",
"parent": "object",
"includes":[],
"props": [
{
"name":"type",
"desc":"a int value",
"init_value":0,
"type":"uint32_t"
},
{
"name":"name",
"desc":"a string value",
"init_value":"NULL",
"type":"char*"
}
]
}
```

属性的类型目前支持:

* int8\_t
* int16\_t
* int32\_t
* int64\_t
* uint8\_t
* uint16\_t
* uint32\_t
* uint64\_t
* float
* double
* char*

## 2.生成代码

```
node gen_object.js samples/foobar.json
```

0 comments on commit a2a54d4

Please sign in to comment.