Description
- Description of the arc widget
Interface version
Version number |
Writer |
Date |
Description |
1.0 |
Qin Zhitian |
June 29, 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.type |
string |
action:value_change-‘value_change-event trigger’;size-‘set the size of arc‘;range-’Set the minimum and maximum values of arc‘;angle-‘set the start and end angle of arc’;bk_angle-‘set the start and end angle of arc background’;color-‘set arc color’; |
attr.value_1 |
int |
parameter:size-‘length’;angle-‘minimum value’;angle-‘start angle’;bk_angle-‘start angle of arc background’; |
attr.value_2 |
int |
parameter:size-‘width’;angle-‘maximum’;angle-‘end angle’;bk_angle-‘end angle of arc background’; |
attr.type |
string |
type:bg-‘set the background color of arc’;indic-‘set the indicator color of arc’; |
attr.color_R |
int |
parameter: value of R, 0-255; |
attr.color_G |
int |
parameter: value of G, 0-255; |
attr.color_B |
int |
parameter: value of B, 0-255; |
Call example
{
"wid": "s1",
"cmd" : "set",
"attr": {
"type": "value_change",
}
}
Note: set event trigger callback;
{
"wid": "s1",
"cmd" : "set",
"attr": {
"action": "size",
"value_1":100,
"value_2":100
}
}
Note: set the arc size to 100 * 100
{
"wid": "s1",
"cmd" : "set",
"attr": {
"action": "range",
"value_1":0,
"value_2":200
}
}
Note: set the value range of arc to 0-200;
{
"wid": "s1",
"cmd" : "set",
"attr": {
"action": "angle",
"value_1":0,
"value_2":200
}
}
Note: set the start angle of arc as 0 and the end angle as 200;
{
"wid": "s1",
"cmd" : "set",
"attr": {
"action": "bk_angle",
"value_1":0,
"value_2":200
}
}
Note: set the start angle of arc background to 0 and the end angle to 200;
{
"wid": "s1",
"cmd" : "set",
"attr": {
"action": "color",
"type":"indic",
"color_R":229,
"color_G":100,
"color_B":0
}
}
Note: set the indicator color of arc as R: 229, G: 100, B: 0;
{
"wid": "s1",
"cmd" : "set",
"attr": {
"action": "color",
"type":"bg",
"color_R":229,
"color_G":100,
"color_B":250
}
}
Note: set the background color of arc as R: 299, G: 100, B: 250;
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
{
"start_angle": 0,
"end_angle": 200,
"cur_angle": 100,
"code": 0
}
Description of return parameters
Parameter Name |
Type |
Description |
result |
string |
result information |
result.code |
int |
error code |
result.start_angle |
int |
get the starting angle of arc |
result.end_angle |
int |
get the ending angle of arc |
result.cur_angle |
int |
get the value of arc |
Error code
文档更新时间: 2021-08-18 18:23 作者:plj