Changes for page Lua Script
Last modified by Devin Chen on 2025/11/10 16:04
From version 4.1
edited by xingzhi lin
on 2025/09/24 10:38
on 2025/09/24 10:38
Change comment:
There is no comment for this version
To version 12.1
edited by Devin Chen
on 2025/11/10 16:04
on 2025/11/10 16:04
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. lxz1 +XWiki.DevinChen - Content
-
... ... @@ -591,7 +591,7 @@ 591 591 * type(number):type,type=1 is write-through 592 592 * element4:element 593 593 594 -|(% style="width:203px" %)Value|(% style="width:967px" %)Describe 594 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe 595 595 |(% style="width:203px" %)0|(% style="width:967px" %)Default 596 596 |(% style="width:203px" %)1|(% style="width:967px" %)Forced prohibition of the use of the high-order function 597 597 |(% style="width:203px" %)2|(% style="width:967px" %)Enable high and low character swapping ... ... @@ -608,12 +608,18 @@ 608 608 609 609 * element5:element 610 610 611 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe 612 +|(% style="width:203px" %)0|(% style="width:967px" %)Default 613 +|(% style="width:203px" %)4|(% style="width:967px" %)Gbk text, normal setting 614 +|(% style="width:203px" %)5|(% style="width:967px" %)Gbk text, the first byte is the string length 615 +|(% style="width:203px" %)12|(% style="width:967px" %)Unicode text 611 611 612 - 613 613 * element6:element 614 614 619 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe 620 +|(% style="width:203px" %)0|(% style="width:967px" %)Default 621 +|(% style="width:203px" %)11|(% style="width:967px" %)Characters are stored in one word 615 615 616 - 617 617 Return: 618 618 619 619 * Success: the designated length of the string ... ... @@ -622,12 +622,12 @@ 622 622 Example: 623 623 624 624 {{code language="Lua"}} 625 -print(we_bas_getstring("@W_HDW0", 10)) 631 +print(we_bas_getstring("@W_HDW0", 10,0,0,0,0)) 626 626 {{/code}} 627 627 628 628 == [[we_bas_setstring>>||anchor="HAddressclass"]] == 629 629 630 -Prototype: we_bas_setstring(address, str [, len]) 636 +Prototype: we_bas_setstring(address, str [, len, type, element4, element5, element6]) 631 631 632 632 Function: Write string 633 633 ... ... @@ -636,7 +636,37 @@ 636 636 * address(string):address 637 637 * str(string):string 638 638 * len(number):length, if not set, it will be the bytes of the string 645 +* element4:element 639 639 647 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe 648 +|(% style="width:203px" %)0|(% style="width:967px" %)Default 649 +|(% style="width:203px" %)1|(% style="width:967px" %)Forced prohibition of the use of the high-order function 650 +|(% style="width:203px" %)2|(% style="width:967px" %)Enable high and low character swapping 651 +|(% style="width:203px" %)3|(% style="width:967px" %)Enable high and low byte swapping 652 +|(% style="width:203px" %)4|(% style="width:967px" %)Gbk text, normal setting 653 +|(% style="width:203px" %)5|(% style="width:967px" %)Gbk text, the first byte is the string length 654 +|(% style="width:203px" %)6|(% style="width:967px" %)Endian-reversed type1: 12345678 -> 87654321 655 +|(% style="width:203px" %)7|(% style="width:967px" %)Endian-reversed type2: 12345678 -> 78563412 656 +|(% style="width:203px" %)8|(% style="width:967px" %)Endian-reversed type3: 12345678 -> 56781234 657 +|(% style="width:203px" %)9|(% style="width:967px" %)Endian-reversed type4: 12345678 -> 65872143 658 +|(% style="width:203px" %)10|(% style="width:967px" %)Endian-reversed type5: 12345678 -> 43218765 659 +|(% style="width:203px" %)11|(% style="width:967px" %)Characters are stored in one word 660 +|(% style="width:203px" %)12|(% style="width:967px" %)Unicode text 661 + 662 +* element5:element 663 + 664 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe 665 +|(% style="width:203px" %)0|(% style="width:967px" %)Default 666 +|(% style="width:203px" %)4|(% style="width:967px" %)Gbk text, normal setting 667 +|(% style="width:203px" %)5|(% style="width:967px" %)Gbk text, the first byte is the string length 668 +|(% style="width:203px" %)12|(% style="width:967px" %)Unicode text 669 + 670 +* element6:element 671 + 672 +|=(% style="width: 203px;" %)Value|=(% style="width: 967px;" %)Describe 673 +|(% style="width:203px" %)0|(% style="width:967px" %)Default 674 +|(% style="width:203px" %)11|(% style="width:967px" %)Characters are stored in one word 675 + 640 640 Return: 641 641 642 642 * Success: true ... ... @@ -646,7 +646,7 @@ 646 646 647 647 {{code language="Lua"}} 648 648 local str = "Hello" 649 -we_bas_setstring("@W_HDW0", str) 685 +we_bas_setstring("@W_HDW0", str, 10, 0, 0, 0, 0) 650 650 {{/code}} 651 651 652 652 == [[we_bas_bmov>>||anchor="HAddressclass"]] == ... ... @@ -3337,7 +3337,7 @@ 3337 3337 3338 3338 == [[mqtt.create>>||anchor="HMQTT"]] == 3339 3339 3340 -Prototype: mqtt.create(serverurl, clientid) 3376 +Prototype: mqtt.create(serverurl, clientid[, int useDomain]) 3341 3341 3342 3342 Function: Create mqtt client object 3343 3343 ... ... @@ -3348,6 +3348,7 @@ 3348 3348 host: Hostname/IP address 3349 3349 port: such as 1883 3350 3350 * clientid(string): client ID 3387 +* int useDomain: 0 (Try converting to IP for connection); 1(Use domain name for connection) 3351 3351 3352 3352 Return: 3353 3353 ... ... @@ -7807,6 +7807,337 @@ 7807 7807 |crc16_arc|0x8005|0x0000|0x0000|true|true|123456789|0xBB3D 7808 7808 |crc32|0x04C11DB7|0xFFFFFFF|0xFFFFFFF|true|true|123456789|0xCBF43926 7809 7809 7847 += LuaUserSecure = 7848 + 7849 +== user_secure.usersecure_getInfo == 7850 + 7851 +**Prototype : **user_secure.usersecure_getInfo() 7852 + 7853 +**Function: **Get all user information 7854 + 7855 +**Return: ** 7856 + 7857 +* Success: User data table 7858 +* Failure: Returns nil 7859 + 7860 +**Example** 7861 + 7862 +{{code language="LUA"}} 7863 +secure = user_secure.usersecure_getInfo() 7864 + for index,j in pairs(secure) do 7865 + for msg,value in pairs(j) do 7866 + if "permission" == msg then 7867 + print("index",index,"msg",msg,"value",table.concat(value,',')) 7868 + else 7869 + print("index",index,"msg",msg,"value",value) 7870 + end 7871 + 7872 + end 7873 + end 7874 + 7875 +{{/code}} 7876 + 7877 +== user_secure.usersecure_addInfo == 7878 + 7879 +**Prototype : **user_secure.usersecure_addInfo(username, password, supassword, desc, hide, permission) 7880 + 7881 +**Function: **Add user information 7882 + 7883 +**Parameters**: 7884 + 7885 +* username(string): New username (16 characters) 7886 +* password(string): Password (8 characters) 7887 +* supassword(string): Confirm password (8 characters) 7888 +* desc(string): Description (10 characters) 7889 +* hide(bool): Controls hiding; true: hide if insufficient permissions 7890 +* permission(table): Permissions; 1 for granted permissions, 0 for no permissions 7891 + 7892 +**Return: ** 7893 + 7894 +* Success: Return 0 7895 +* Failure: Returns nil 7896 + 7897 +**Example** 7898 + 7899 +{{code language="LUA"}} 7900 +tab = {0,1,1,1,1,1,1,1,1,1,1,1} 7901 +user_secure.usersecure_addInfo("user1","123","123","user1",false,"tab") 7902 +{{/code}} 7903 + 7904 +== user_secure.usersecure_deleteInfo == 7905 + 7906 +**Prototype : **user_secure.usersecure_deleteInfo(username) 7907 + 7908 +**Function: **Delete user information 7909 + 7910 +**Parameters**: 7911 + 7912 +* username 7913 + 7914 +**Return: ** 7915 + 7916 +* Failure: Returns nil 7917 + 7918 +**Example** 7919 + 7920 +{{code language="LUA"}} 7921 +ret, msg = user_secure.usersecure_deleteInfo("user1") 7922 +{{/code}} 7923 + 7924 +== user_secure.usersecure_updatepermission == 7925 + 7926 +**Prototype : **user_secure.usersecure_updatepermission(username, permission) 7927 + 7928 +**Function: **Modify permissions 7929 + 7930 +**Parameters**: 7931 + 7932 +* username 7933 +* permission(table): Permissions; 1 for granted permissions, 0 for no permissions 7934 + 7935 +**Return: ** 7936 + 7937 +* Failure: Returns nil 7938 + 7939 +**Example** 7940 + 7941 +{{code language="LUA"}} 7942 +tab = {0,1,1,1,1,1,1,1,1,1,1,1} 7943 +ret, msg =user_secure.usersecure_updatepermission("user1","tab") 7944 +{{/code}} 7945 + 7946 +== user_secure.usersecure_login == 7947 + 7948 +**Prototype : **user_secure.usersecure_login(username,pwd) 7949 + 7950 +**Function: **User login 7951 + 7952 +**Parameters**: 7953 + 7954 +* username 7955 +* pwd: password 7956 + 7957 +**Return: ** 7958 + 7959 +* Failure: Returns nil 7960 + 7961 +**Example** 7962 + 7963 +{{code language="LUA"}} 7964 +ret, msg = user_secure.usersecure_login("user1", "123") 7965 +{{/code}} 7966 + 7967 +== user_secure.usersecure_logout == 7968 + 7969 +**Prototype : **user_secure.usersecure_logout() 7970 + 7971 +**Function: **User logout 7972 + 7973 +**Return: ** 7974 + 7975 +* Failure: Returns nil 7976 + 7977 +**Example** 7978 + 7979 +{{code language="LUA"}} 7980 +ret, msg = user_secure.usersecure_logout 7981 +{{/code}} 7982 + 7983 +== user_secure.usersecure_updatepwd == 7984 + 7985 +**Prototype : **user_secure.usersecure_updatepwd (username, old, pwd, supwd) 7986 + 7987 +**Function: **Modify password 7988 + 7989 +**Parameters**: 7990 + 7991 +* username (string): Username, 16 characters 7992 +* old (string): Old password, 8 characters 7993 +* ((( 7994 +pwd (string): New password, 8 characterssupwd (string): Confirm password, 8 characters 7995 +))) 7996 + 7997 +**Return: ** 7998 + 7999 +* Success: CRC encrypted data 8000 +* Failure: Returns nil 8001 + 8002 +**Example** 8003 + 8004 +{{code language="LUA"}} 8005 +user_secure.usersecure_updatepwd("user1","123","321","321") 8006 +{{/code}} 8007 + 8008 += LuaChart = 8009 + 8010 +== chart.setAlarmBtnSpacing == 8011 + 8012 +**Prototype : **chart.setAlarmBtnSpacing(partname, spacing) 8013 + 8014 +**Function: **Set the spacing between new alarm buttons 8015 + 8016 +**Parameters**: 8017 + 8018 +* ((( 8019 +partname(string): Component name 8020 +))) 8021 +* ((( 8022 +spacing(int): Button spacing (unit: px (pixels)) 8023 +))) 8024 + 8025 +**Return: ** 8026 + 8027 +* Success: User data table 8028 +* Failure: Returns nil 8029 + 8030 +**Example** 8031 + 8032 +{{code language="LUA"}} 8033 +chart.setAlarmBtnSpacing("1_ALM_0", 5) 8034 +{{/code}} 8035 + 8036 +== chart.setAlarmBtnScale == 8037 + 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 + 8064 +== chart.setFormulaBtnSpacing == 8065 + 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 + 8092 +== chart.setFormulaBtnScale == 8093 + 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 + 8120 +== chart.setBarChartBtnSpacing == 8121 + 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 + 8148 +== chart.setBarChartBtnScale == 8149 + 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 + 7810 7810 = Environment operation = 7811 7811 7812 7812 (% class="wikigeneratedid" id="HGetsqliteenvironment" %)