欢迎图片

Changes for page Lua Script

Last modified by Devin Chen on 2025/11/10 16:04

From version 9.1
edited by xingzhi lin
on 2025/10/31 11:32
Change comment: There is no comment for this version
To version 12.1
edited by Devin Chen
on 2025/11/10 16:04
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.lxz
1 +XWiki.DevinChen
Content
... ... @@ -3373,7 +3373,7 @@
3373 3373  
3374 3374  == [[mqtt.create>>||anchor="HMQTT"]] ==
3375 3375  
3376 -Prototype: mqtt.create(serverurl, clientid)
3376 +Prototype: mqtt.create(serverurl, clientid[, int useDomain])
3377 3377  
3378 3378  Function: Create mqtt client object
3379 3379  
... ... @@ -3384,6 +3384,7 @@
3384 3384   host: Hostname/IP address
3385 3385   port: such as 1883
3386 3386  * clientid(string): client ID
3387 +* int useDomain: 0 (Try converting to IP for connection); 1(Use domain name for connection)
3387 3387  
3388 3388  Return:
3389 3389  
... ... @@ -8008,36 +8008,172 @@
8008 8008  
8009 8009  == chart.setAlarmBtnSpacing ==
8010 8010  
8011 -**Prototype : **user_secure.usersecure_getInfo()
8012 +**Prototype : **chart.setAlarmBtnSpacing(partname, spacing)
8012 8012  
8013 -**Function: **Connect to a DB file.(If the file does not exist)
8014 +**Function: **Set the spacing between new alarm buttons
8014 8014  
8015 8015  **Parameters**:
8016 8016  
8017 -* dbFilePath (string): Full path to the DB file to connect to (create)
8018 +* (((
8019 +partname(string): Component name
8020 +)))
8021 +* (((
8022 +spacing(int): Button spacing (unit: px (pixels))
8023 +)))
8018 8018  
8019 8019  **Return: **
8020 8020  
8021 -* Success: database object
8022 -* Failure: Returns nil and error.
8027 +* Success: User data table
8028 +* Failure: Returns nil
8023 8023  
8024 8024  **Example**
8025 8025  
8026 8026  {{code language="LUA"}}
8027 -sql = require "Luasqlite" -- Introducing the lua libraries  
8028 -env = sql.sqlite3() -- Get the environment class
8033 +chart.setAlarmBtnSpacing("1_ALM_0", 5)
8029 8029  {{/code}}
8030 8030  
8031 8031  == chart.setAlarmBtnScale ==
8032 8032  
8038 +
8039 +**Prototype : **chart.setAlarmBtnScale(partname, scale)
8040 +
8041 +**Function: **Set the new alarm button size scaling
8042 +
8043 +**Parameters**:
8044 +
8045 +* (((
8046 +partname(string): Component name
8047 +)))
8048 +* (((
8049 +scale(double): Scaling factor, default is 1, range [0.1, 5]
8050 +)))
8051 +
8052 +**Return: **
8053 +
8054 +* Success: True
8055 +* Failure: False
8056 +
8057 +**Example**
8058 +
8059 +{{code language="LUA"}}
8060 +chart.setAlarmBtnScale("1_ALM_0", 1.5)
8061 +{{/code}}
8062 +
8063 +
8033 8033  == chart.setFormulaBtnSpacing ==
8034 8034  
8066 +
8067 +**Prototype : **chart.setFormulaBtnSpacing(partname, spacing)
8068 +
8069 +**Function: **Set the spacing between new formula buttons
8070 +
8071 +**Parameters**:
8072 +
8073 +* (((
8074 +partname(string): Component name
8075 +)))
8076 +* (((
8077 +spacing(int): Button spacing (unit: px (pixels))
8078 +)))
8079 +
8080 +**Return: **
8081 +
8082 +* Success: True
8083 +* Failure: False
8084 +
8085 +**Example**
8086 +
8087 +
8088 +{{code language="LUA"}}
8089 +chart.setFormulaBtnSpacing("2_FOA_0", 5)
8090 +{{/code}}
8091 +
8035 8035  == chart.setFormulaBtnScale ==
8036 8036  
8094 +
8095 +**Prototype : **chart.setFormulBtnScale(partname, scale)
8096 +
8097 +**Function: **Set the formula button size scaling
8098 +
8099 +**Parameters**:
8100 +
8101 +* (((
8102 +partname(string): Component name
8103 +)))
8104 +* (((
8105 +scale(double): Scaling factor, default is 1, range [0.1, 5]
8106 +)))
8107 +
8108 +**Return: **
8109 +
8110 +* Success: True
8111 +* Failure: False
8112 +
8113 +**Example**
8114 +
8115 +
8116 +{{code language="LUA"}}
8117 +chart.setFormulaBtnScale("2_FOA_0", 1.5)
8118 +{{/code}}
8119 +
8037 8037  == chart.setBarChartBtnSpacing ==
8038 8038  
8122 +
8123 +**Prototype : **chart.setBarChartBtnSpacing(partname, spacing)
8124 +
8125 +**Function: **Set the spacing between new barchart buttons
8126 +
8127 +**Parameters**:
8128 +
8129 +* (((
8130 +partname(string): Component name
8131 +)))
8132 +* (((
8133 +spacing(int): Button spacing (unit: px (pixels))
8134 +)))
8135 +
8136 +**Return: **
8137 +
8138 +* Success: True
8139 +* Failure: False
8140 +
8141 +**Example**
8142 +
8143 +
8144 +{{code language="LUA"}}
8145 +chart.setBarChartBtnSpacing("0_BC_0", 5)
8146 +{{/code}}
8147 +
8039 8039  == chart.setBarChartBtnScale ==
8040 8040  
8150 +
8151 +
8152 +**Prototype : **chart.setBarChartBtnScale(partname, scale)
8153 +
8154 +**Function: **Set the barchart button size scaling
8155 +
8156 +**Parameters**:
8157 +
8158 +* (((
8159 +partname(string): Component name
8160 +)))
8161 +* (((
8162 +scale(double): Scaling factor, default is 1, range [0.1, 5]
8163 +)))
8164 +
8165 +**Return: **
8166 +
8167 +* Success: True
8168 +* Failure: False
8169 +
8170 +**Example**
8171 +
8172 +
8173 +
8174 +{{code language="LUA"}}
8175 +chart.setBarChartBtnScale("0_BC_0", 1.5)
8176 +{{/code}}
8177 +
8041 8041  = Environment operation =
8042 8042  
8043 8043  (% class="wikigeneratedid" id="HGetsqliteenvironment" %)