Changes for page Lua Script
Last modified by Devin Chen on 2025/11/10 16:04
From version 10.1
edited by xingzhi lin
on 2025/10/31 11:55
on 2025/10/31 11:55
Change comment:
There is no comment for this version
To version 7.3
edited by xingzhi lin
on 2025/10/31 11:01
on 2025/10/31 11:01
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -7875,7 +7875,7 @@ 7875 7875 7876 7876 == user_secure.usersecure_addInfo == 7877 7877 7878 -**Prototype : **user_secure.usersecure_addInfo(username ,password,supassword,desc,hide,permission)7878 +**Prototype : **user_secure.usersecure_addInfo(username,password,supassword,desc,hide,permission) 7879 7879 7880 7880 **Function: **Add user information 7881 7881 ... ... @@ -7902,6 +7902,7 @@ 7902 7902 7903 7903 == user_secure.usersecure_deleteInfo == 7904 7904 7905 + 7905 7905 **Prototype : **user_secure.usersecure_deleteInfo(username) 7906 7906 7907 7907 **Function: **Delete user information ... ... @@ -7922,144 +7922,40 @@ 7922 7922 7923 7923 == user_secure.usersecure_updatepermission == 7924 7924 7925 -**Prototype : **user_secure.usersecure_updatepermission(username, permission) 7926 - 7927 -**Function: **Modify permissions 7928 - 7929 -**Parameters**: 7930 - 7931 -* username 7932 -* permission(table): Permissions; 1 for granted permissions, 0 for no permissions 7933 - 7934 -**Return: ** 7935 - 7936 -* Failure: Returns nil 7937 - 7938 -**Example** 7939 - 7940 -{{code language="LUA"}} 7941 -tab = {0,1,1,1,1,1,1,1,1,1,1,1} 7942 -ret, msg =user_secure.usersecure_updatepermission("user1","tab") 7943 -{{/code}} 7944 - 7945 7945 == user_secure.usersecure_login == 7946 7946 7947 -**Prototype : **user_secure.usersecure_login(username,pwd) 7948 7948 7949 -**Function: **User login 7950 7950 7951 -**Parameters**: 7952 - 7953 -* username 7954 -* pwd: password 7955 - 7956 -**Return: ** 7957 - 7958 -* Failure: Returns nil 7959 - 7960 -**Example** 7961 - 7962 -{{code language="LUA"}} 7963 -ret, msg = user_secure.usersecure_login("user1", "123") 7964 -{{/code}} 7965 - 7966 7966 == user_secure.usersecure_logout == 7967 7967 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 - 7982 7982 == user_secure.usersecure_updatepwd == 7983 7983 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 - 8007 8007 = LuaChart = 8008 8008 8009 8009 == chart.setAlarmBtnSpacing == 8010 8010 8011 -**Prototype : **c hart.setAlarmBtnSpacing(partname, spacing)7938 +**Prototype : **user_secure.usersecure_getInfo() 8012 8012 8013 -**Function: ** Set thespacingbetweennewalarm buttons7940 +**Function: **Connect to a DB file.(If the file does not exist) 8014 8014 8015 8015 **Parameters**: 8016 8016 8017 -* ((( 8018 -partname(string): Component name 8019 -))) 8020 -* ((( 8021 -spacing(int): Button spacing (unit: px (pixels)) 8022 -))) 7944 +* dbFilePath (string): Full path to the DB file to connect to (create) 8023 8023 8024 8024 **Return: ** 8025 8025 8026 -* Success: Userdatatable8027 -* Failure: Returns nil 7948 +* Success: database object 7949 +* Failure: Returns nil and error. 8028 8028 8029 8029 **Example** 8030 8030 8031 8031 {{code language="LUA"}} 8032 -chart.setAlarmBtnSpacing("1_ALM_0", 5) 7954 +sql = require "Luasqlite" -- Introducing the lua libraries 7955 +env = sql.sqlite3() -- Get the environment class 8033 8033 {{/code}} 8034 8034 8035 8035 == chart.setAlarmBtnScale == 8036 8036 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 - 8063 8063 == chart.setFormulaBtnSpacing == 8064 8064 8065 8065 == chart.setFormulaBtnScale ==