Description
- Description of the bar widget
Interface version
Version number |
Writer |
Date |
Description |
1.0 |
Qin Zhitian |
June 22, 2021 |
initial release |
IP address
http:
API list
Name |
Description |
set |
set attributes |
get |
get attributes |
1. set
Description of request parameters
Parameter Name |
Type |
Description |
attr |
string |
attribute |
attr.action |
string |
action:range-‘set the minimum and maximum value of bar’;change-‘set the new value for a bar’;color-‘set the color of the bar’; |
attr.min |
int |
parameter:minimum value of bar |
attr.max |
int |
parameter:maximum value of bar |
attr.cvalue |
int |
parameter:bar value |
attr.type |
string |
parameter:bg-‘background color’ indic-‘indicator color’ |
attr.R |
int |
parameter:value of R |
attr.G |
int |
parameter:value of G |
attr.B |
int |
parameter:value of B |
Call example
{
"wid": "s1",
"cmd" : "set",
"attr": {
"action": "range",
"min":0,
"max":100,
}
}
Note: set the value range of bar to 0-100;
{
"wid": "s1",
"cmd" : "set",
"attr": {
"action": "change",
"cvalue":50
}
}
Note: set the value of bar to 50;
{
"wid":"s1",
"cmd": "set",
"attr":{
"action": "color",
"type": "bg",
"color_R":255,
"color_G":0,
"color_B":0
}
}
Note: set the background color of bar to R:255,G:0,B:0;
{
"wid":"s1",
"cmd": "set",
"attr":{
"action": "color",
"type": "indic",
"color_R":255,
"color_G":100,
"color_B":0
}
}
Note: set the indicator color of arc to R:255,G:100,B:0;
Return example
{
"code": 0
}
Description of return parameters
Parameter Name |
Type |
Description |
result |
string |
result information |
result.code |
int |
error code |
Error Code
##2、get
Description of request parameters
Parameter Name |
Type |
Description |
Call example
{
"wid": "s1",
"cmd" : "get"
}
Return example
{
"value": 50,
"code": 0
}
Description of return parameters
Parameter Name |
Type |
Description |
result |
string |
result information |
result.code |
int |
error code |
result.value |
int |
get the value of bar |
Error code
文档更新时间: 2021-08-18 18:38 作者:plj