Improve:AppManager doc.

This commit is contained in:
Fancy code 2024-05-27 11:36:05 +08:00
parent 5089d4415f
commit 70042cc449

View File

@ -180,7 +180,8 @@
| ---- | ---- |
| 描述 | 获取动态设置参数列表。 |
| 接口 | http://192.168.1.100/app/getdynamicparam |
| 参数 | ?index=all // 获取全部动态设置参数<br>?index=6 // 获取索引号为6的动态设置参数 |
| 参数 | ?index=all&language=xx // 获取全部动态设置参数<br>?index=6&language=xx // 获取索引号为6的动态设置参数 |
| 参数说明 | index设置项索引all代表全部<br>languageAPP当前语言由六帧探定义值设备根据该值回传对应语言的字符串 |
| 返回参数 | result:0-成功,-1-失败<br>info:动态参数列表 |
**获取全部动态参数返回示例:**
@ -194,45 +195,47 @@
"name": "SettingName", // 直接显示在APP界面
"type": "label", // 显示控件类型,只显示
"value": "0-表示字符串", // 当前值
"index": 0 // 参数索引,直接回传给设备
"index": 0 // 设置项索引,直接回传给设备
},
{
"name": "NumberName",
"type": "inputnum", // 数字输入框,带单位显示
"value": 123456789,
"length": 9, // 输入字符最大长度
"unit": "s", // 单位,可选,如果有则显示单位
"index": 1 // 参数索引,直接回传给设备
"index": 1 // 设置项索引,直接回传给设备
},
{
"name": "SwitchName",
"type": "switch", // 开关0-关1-开
"value": 0, // 当前值0-关1-开
"index": 2 // 参数索引,直接回传给设备
"index": 2 // 设置项索引,直接回传给设备
},
{
"name": "InputStringName",
"type": "inputstring", // 任意字符输入框,无限制
"type": "inputstring", // 任意字符(数字/字母/常见字符)输入框
"value": "0123abcDEF!@#", // 当前值
"index": 3 // 参数索引,直接回传给设备
"length": 15, // 输入字符最大长度
"index": 3 // 设置项索引,直接回传给设备
},
{
"name": "TimeSettingName",
"type": "time", // 时间设置(24小时制)格式hh-mm-ss
"value": "23:59:59", // 当前值格式hh-mm-ss
"index": 4 // 参数索引,直接回传给设备
"index": 4 // 设置项索引,直接回传给设备
},
{
"name": "ConfirmName",
"tips": "Confirm?", // 提示信息没有时使用name
"type": "comfirm", // 功能按钮(确认框)
"index": 5 // 参数索引,直接回传给设备
"index": 5 // 设置项索引,直接回传给设备
},
{
"name": "OptionName",
"type": "option", // 选项设置
"items": ["Option0","Option1"], // 选项列表,格式:["选项1","选项2",...]
"value": 1, // 当前值, 索引值0-Option01-Option1
"index": 6 // 参数索引,直接回传给设备
"index": 6 // 设置项索引,直接回传给设备
}
]
}
@ -243,8 +246,9 @@
| 参数名 | 类型 | 描述 |
| ---- | ---- | ---- |
| name | String | 直接显示在APP |
| type | String | 控件类型:<br>label-字符串,仅显示内容,无法修改<br>inputnum-数字<br>switch-开关(0-关1-开) <br>inputstring-任意字符输入<br>time-时间设置<br>comfirm-功能按钮(确认框)<br>option-选项设置 |
| type | String | 控件类型:<br>label-字符串,仅显示内容,无法修改<br>inputnum-数字<br>switch-开关(0-关1-开) <br>inputstring-任意字符(数字/字母/常见字符)输入<br>time-时间设置<br>comfirm-功能按钮(确认框)<br>option-选项设置 |
| value | ---- | 当前值类型根据type定义来确定 |
| length | int | 输入框的长度限制 |
| unit | String | 单位如果有则在APP界面显示 |
| index | int | 索引值,设备使用,根据索引值知道修改哪个参数 |
@ -273,16 +277,21 @@ sequenceDiagram
participant APP
participant CAMERA
APP ->> APP:进入设置界面
APP ->> +CAMERA:http:getdynamicparam?index=all
APP ->> +CAMERA:http:getdynamicparam?index=all&language=xx
CAMERA -->> -APP:return
loop 设置界面停留
opt 用户切换语言
note over APP: 语言切换后APP重新获取动态参数
APP ->> +CAMERA:http:getdynamicparam?index=2&language=xx
CAMERA -->> -APP:return
end
opt 用户修改参数
APP ->> APP:用户修改参数
APP ->> +CAMERA:http:dynamicparamset?index=2
CAMERA -->> -APP:return
alt result=0
APP ->> APP:修改成功
APP ->> +CAMERA:http:getdynamicparam?index=2
APP ->> +CAMERA:http:getdynamicparam?index=2&language=xx
CAMERA -->> -APP:return
APP ->> APP:刷新设置项显示
else result=-1