欢迎图片

Changes for page Lua Script

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

From version 6.3
edited by xingzhi lin
on 2025/10/31 10:52
Change comment: There is no comment for this version
To version 11.1
edited by xingzhi lin
on 2025/11/03 11:23
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -7875,19 +7875,18 @@
7875 7875  
7876 7876  == user_secure.usersecure_addInfo ==
7877 7877  
7878 +**Prototype : **user_secure.usersecure_addInfo(username, password, supassword, desc, hide, permission)
7878 7878  
7879 -**Prototype : **user_secure.usersecure_addInfo(username,password,supassword,desc,hide,permission)
7880 -
7881 7881  **Function: **Add user information
7882 7882  
7883 7883  **Parameters**:
7884 7884  
7885 -* username(string):新增用户名(长度16位)
7886 -* password(string):密码(长度8位)
7887 -* supassword(string):确认密码(长度8位)
7888 -* desc(string):描述,(长度10位)
7889 -* hide(bool):控制隐藏,true :权限不足时隐藏
7890 -* permission(table):权限,1为拥有权限,0为无权限
7884 +* username(string): New username (16 characters)
7885 +* password(string): Password (8 characters)
7886 +* supassword(string): Confirm password (8 characters)
7887 +* desc(string): Description (10 characters)
7888 +* hide(bool): Controls hiding; true: hide if insufficient permissions
7889 +* permission(table): Permissions; 1 for granted permissions, 0 for no permissions
7891 7891  
7892 7892  **Return: **
7893 7893  
... ... @@ -7903,46 +7903,278 @@
7903 7903  
7904 7904  == user_secure.usersecure_deleteInfo ==
7905 7905  
7905 +**Prototype : **user_secure.usersecure_deleteInfo(username)
7906 +
7907 +**Function: **Delete user information
7908 +
7909 +**Parameters**:
7910 +
7911 +* username
7912 +
7913 +**Return: **
7914 +
7915 +* Failure: Returns nil
7916 +
7917 +**Example**
7918 +
7919 +{{code language="LUA"}}
7920 +ret, msg = user_secure.usersecure_deleteInfo("user1")
7921 +{{/code}}
7922 +
7923 +== user_secure.usersecure_updatepermission ==
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 +
7906 7906  == user_secure.usersecure_login ==
7907 7907  
7947 +**Prototype : **user_secure.usersecure_login(username,pwd)
7948 +
7949 +**Function: **User login
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 +
7908 7908  == user_secure.usersecure_logout ==
7909 7909  
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 +
7910 7910  == user_secure.usersecure_updatepwd ==
7911 7911  
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 +
7912 7912  = LuaChart =
7913 7913  
7914 7914  == chart.setAlarmBtnSpacing ==
7915 7915  
7916 -**Prototype : **user_secure.usersecure_getInfo()
8011 +**Prototype : **chart.setAlarmBtnSpacing(partname, spacing)
7917 7917  
7918 -**Function: **Connect to a DB file.(If the file does not exist)
8013 +**Function: **Set the spacing between new alarm buttons
7919 7919  
7920 7920  **Parameters**:
7921 7921  
7922 -* 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 +)))
7923 7923  
7924 7924  **Return: **
7925 7925  
7926 -* Success: database object
7927 -* Failure: Returns nil and error.
8026 +* Success: User data table
8027 +* Failure: Returns nil
7928 7928  
7929 7929  **Example**
7930 7930  
7931 7931  {{code language="LUA"}}
7932 -sql = require "Luasqlite" -- Introducing the lua libraries  
7933 -env = sql.sqlite3() -- Get the environment class
8032 +chart.setAlarmBtnSpacing("1_ALM_0", 5)
7934 7934  {{/code}}
7935 7935  
7936 7936  == chart.setAlarmBtnScale ==
7937 7937  
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 +
7938 7938  == chart.setFormulaBtnSpacing ==
7939 7939  
8065 +
8066 +**Prototype : **chart.setFormulaBtnSpacing(partname, spacing)
8067 +
8068 +**Function: **Set the spacing between new formula buttons
8069 +
8070 +**Parameters**:
8071 +
8072 +* (((
8073 +partname(string): Component name
8074 +)))
8075 +* (((
8076 +spacing(int): Button spacing (unit: px (pixels))
8077 +)))
8078 +
8079 +**Return: **
8080 +
8081 +* Success: True
8082 +* Failure: False
8083 +
8084 +**Example**
8085 +
8086 +
8087 +{{code language="LUA"}}
8088 +chart.setFormulaBtnSpacing("2_FOA_0", 5)
8089 +{{/code}}
8090 +
7940 7940  == chart.setFormulaBtnScale ==
7941 7941  
8093 +
8094 +**Prototype : **chart.setFormulBtnScale(partname, scale)
8095 +
8096 +**Function: **Set the formula button size scaling
8097 +
8098 +**Parameters**:
8099 +
8100 +* (((
8101 +partname(string): Component name
8102 +)))
8103 +* (((
8104 +scale(double): Scaling factor, default is 1, range [0.1, 5]
8105 +)))
8106 +
8107 +**Return: **
8108 +
8109 +* Success: True
8110 +* Failure: False
8111 +
8112 +**Example**
8113 +
8114 +
8115 +{{code language="LUA"}}
8116 +chart.setFormulaBtnScale("2_FOA_0", 1.5)
8117 +{{/code}}
8118 +
7942 7942  == chart.setBarChartBtnSpacing ==
7943 7943  
8121 +
8122 +**Prototype : **chart.setBarChartBtnSpacing(partname, spacing)
8123 +
8124 +**Function: **Set the spacing between new barchart buttons
8125 +
8126 +**Parameters**:
8127 +
8128 +* (((
8129 +partname(string): Component name
8130 +)))
8131 +* (((
8132 +spacing(int): Button spacing (unit: px (pixels))
8133 +)))
8134 +
8135 +**Return: **
8136 +
8137 +* Success: True
8138 +* Failure: False
8139 +
8140 +**Example**
8141 +
8142 +
8143 +{{code language="LUA"}}
8144 +chart.setBarChartBtnSpacing("0_BC_0", 5)
8145 +{{/code}}
8146 +
7944 7944  == chart.setBarChartBtnScale ==
7945 7945  
8149 +
8150 +
8151 +**Prototype : **chart.setBarChartBtnScale(partname, scale)
8152 +
8153 +**Function: **Set the barchart button size scaling
8154 +
8155 +**Parameters**:
8156 +
8157 +* (((
8158 +partname(string): Component name
8159 +)))
8160 +* (((
8161 +scale(double): Scaling factor, default is 1, range [0.1, 5]
8162 +)))
8163 +
8164 +**Return: **
8165 +
8166 +* Success: True
8167 +* Failure: False
8168 +
8169 +**Example**
8170 +
8171 +
8172 +
8173 +{{code language="LUA"}}
8174 +chart.setBarChartBtnScale("0_BC_0", 1.5)
8175 +{{/code}}
8176 +
7946 7946  = Environment operation =
7947 7947  
7948 7948  (% class="wikigeneratedid" id="HGetsqliteenvironment" %)