欢迎图片

Changes for page Lua Script

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

From version 8.1
edited by xingzhi lin
on 2025/10/31 11:07
Change comment: There is no comment for this version
To version 10.1
edited by xingzhi lin
on 2025/10/31 11:55
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -7902,7 +7902,6 @@
7902 7902  
7903 7903  == user_secure.usersecure_deleteInfo ==
7904 7904  
7905 -
7906 7906  **Prototype : **user_secure.usersecure_deleteInfo(username)
7907 7907  
7908 7908  **Function: **Delete user information
... ... @@ -7923,7 +7923,6 @@
7923 7923  
7924 7924  == user_secure.usersecure_updatepermission ==
7925 7925  
7926 -
7927 7927  **Prototype : **user_secure.usersecure_updatepermission(username, permission)
7928 7928  
7929 7929  **Function: **Modify permissions
... ... @@ -7965,37 +7965,103 @@
7965 7965  ret, msg = user_secure.usersecure_login("user1", "123")
7966 7966  {{/code}}
7967 7967  
7968 -
7969 7969  == user_secure.usersecure_logout ==
7970 7970  
7968 +**Prototype : **user_secure.usersecure_logout()
7969 +
7970 +**Function: **User logout
7971 +
7972 +**Return: **
7973 +
7974 +* Failure: Returns nil
7975 +
7976 +**Example**
7977 +
7978 +{{code language="LUA"}}
7979 +ret, msg = user_secure.usersecure_logout
7980 +{{/code}}
7981 +
7971 7971  == user_secure.usersecure_updatepwd ==
7972 7972  
7984 +**Prototype : **user_secure.usersecure_updatepwd (username, old, pwd, supwd)
7985 +
7986 +**Function: **Modify password
7987 +
7988 +**Parameters**:
7989 +
7990 +* username (string): Username, 16 characters
7991 +* old (string): Old password, 8 characters
7992 +* (((
7993 +pwd (string): New password, 8 characterssupwd (string): Confirm password, 8 characters
7994 +)))
7995 +
7996 +**Return: **
7997 +
7998 +* Success: CRC encrypted data
7999 +* Failure: Returns nil
8000 +
8001 +**Example**
8002 +
8003 +{{code language="LUA"}}
8004 +user_secure.usersecure_updatepwd("user1","123","321","321")
8005 +{{/code}}
8006 +
7973 7973  = LuaChart =
7974 7974  
7975 7975  == chart.setAlarmBtnSpacing ==
7976 7976  
7977 -**Prototype : **user_secure.usersecure_getInfo()
8011 +**Prototype : **chart.setAlarmBtnSpacing(partname, spacing)
7978 7978  
7979 -**Function: **Connect to a DB file.(If the file does not exist)
8013 +**Function: **Set the spacing between new alarm buttons
7980 7980  
7981 7981  **Parameters**:
7982 7982  
7983 -* dbFilePath (string): Full path to the DB file to connect to (create)
8017 +* (((
8018 +partname(string): Component name
8019 +)))
8020 +* (((
8021 +spacing(int): Button spacing (unit: px (pixels))
8022 +)))
7984 7984  
7985 7985  **Return: **
7986 7986  
7987 -* Success: database object
7988 -* Failure: Returns nil and error.
8026 +* Success: User data table
8027 +* Failure: Returns nil
7989 7989  
7990 7990  **Example**
7991 7991  
7992 7992  {{code language="LUA"}}
7993 -sql = require "Luasqlite" -- Introducing the lua libraries  
7994 -env = sql.sqlite3() -- Get the environment class
8032 +chart.setAlarmBtnSpacing("1_ALM_0", 5)
7995 7995  {{/code}}
7996 7996  
7997 7997  == chart.setAlarmBtnScale ==
7998 7998  
8037 +
8038 +**Prototype : **chart.setAlarmBtnScale(partname, scale)
8039 +
8040 +**Function: **Set the new alarm button size scaling
8041 +
8042 +**Parameters**:
8043 +
8044 +* (((
8045 +partname(string): Component name
8046 +)))
8047 +* (((
8048 +scale(double): Scaling factor, default is 1, range [0.1, 5]
8049 +)))
8050 +
8051 +**Return: **
8052 +
8053 +* Success: True
8054 +* Failure: False
8055 +
8056 +**Example**
8057 +
8058 +{{code language="LUA"}}
8059 +chart.setAlarmBtnScale("1_ALM_0", 1.5)
8060 +{{/code}}
8061 +
8062 +
7999 7999  == chart.setFormulaBtnSpacing ==
8000 8000  
8001 8001  == chart.setFormulaBtnScale ==