@dobot-plus/template 1.3.7 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lua/control.lua CHANGED
@@ -1,19 +1,19 @@
1
1
  --- @module $PLUGIN_NAME$
2
2
  --- @description This is the control module for the plugin.
3
- --- 该模块为插件的功能模块,用于实现各种控制功能。
3
+ --- This module contains the main control functions that will be called by the plugin's main logic.
4
4
 
5
5
  local $PLUGIN_NAME$ = {}
6
6
 
7
7
  $PLUGIN_NAME$.controlMethod1 = function(params)
8
- -- TODO 实现函数逻辑
8
+ -- TODO implement the logic for controlMethod1
9
9
  end
10
10
 
11
11
  $PLUGIN_NAME$.controlMethod2 = function(params)
12
- -- TODO 实现函数逻辑
12
+ -- TODO implement the logic for controlMethod2
13
13
  end
14
14
 
15
15
  $PLUGIN_NAME$.controlMethod3 = function(params)
16
- -- TODO 实现函数逻辑
16
+ -- TODO implement the logic for controlMethod3
17
17
  end
18
18
 
19
19
  return $PLUGIN_NAME$
package/lua/daemon.lua CHANGED
@@ -1,6 +1,7 @@
1
1
  --- @module daemon
2
2
  --- @description This is the daemon module for the plugin.
3
- --- 该模块插件的入口进程,在插件安装成功后自动执行该文件中的 EventLoop 方法,该方法会不断的执行,直到程序退出。
3
+ --- This module is the entry process of the plugin, and the EventLoop method in this file will be automatically executed after the plugin is successfully installed.
4
+ --- The method will continue to execute until the program exits.
4
5
 
5
6
  local mqtt = require('$PLUGIN_NAME$.mqtt')
6
7
 
@@ -11,7 +12,7 @@ end
11
12
 
12
13
  function StopHandler()
13
14
  print('program is stopped')
14
- -- 在这里执行任何需要在程序停止时的操作
15
+ -- Execute any operations that need to be performed when the program stops
15
16
  end
16
17
 
17
18
  local function EventLoop()
package/lua/httpAPI.lua CHANGED
@@ -1,27 +1,24 @@
1
1
  --- @module httpAPI
2
2
  --- @description This is the http module for the plugin.
3
- --- 该模块为控制器处理插件的 http 请求提供接口
3
+ --- This module provides interfaces for the controller to handle HTTP requests for the plugin.
4
4
 
5
5
  local $PLUGIN_NAME$ = require("$PLUGIN_NAME$")
6
6
 
7
7
  local httpModule = {}
8
8
 
9
- --- This function will be called when plugin uninstalled
10
- --- 插件卸载时执行该函数
9
+ --- This function will be called when the plugin is uninstalled
11
10
  httpModule.OnUninstall = function()
12
- -- TODO 需要在插件卸载时执行的操作
11
+ -- TODO implement the operations that need to be performed when the plugin is uninstalled
13
12
  end
14
13
 
15
- --- This function will be called when plugin installed
16
- --- 插件安装时自动执行该函数
14
+ --- This function will be called when the plugin is installed
17
15
  httpModule.OnInstall = function()
18
- -- TODO 需要在插件安装时执行的操作
16
+ -- TODO implement the operations that need to be performed when the plugin is installed
19
17
  end
20
18
 
21
19
  --- This function will be called when plugin installed, this action will export some http method for device hotkey binding
22
- --- 插件安装时自动执行该函数,该函数会导出一些的http方法,供设备热键绑定使用
23
20
  httpModule.OnRegistHotKey = function()
24
- -- 短按:可选 demoMethod1 demoMethod2 长按:可选 demoMethod3
21
+ -- Short press: optional demoMethod1 demoMethod2, Long press: optional demoMethod3
25
22
  return {press = {"demoMethod1", "demoMethod2"}, longPress = {"demoMethod3"}}
26
23
  end
27
24
 
@@ -29,12 +26,12 @@ end
29
26
  --- The return value will response the http request, the return value is not necessory
30
27
  --- @param params table
31
28
  --- @return string The return value will response the http request, the return value is not necessory
32
- --- 该方法会在http请求接收到后,自动执行,对应请求的 url为: http://<控制器ip>:<插件端口>/dobotPlus/[插件名]_[插件版本]/demoMethod1
29
+ --- This method will be automatically executed when the HTTP request is received, corresponding to the URL: http://<controller_ip>:<plugin_port>/dobotPlus/[plugin_name]_[plugin_version]/demoMethod1
33
30
  httpModule.demoMethod1 = function(params)
34
- -- TODO 需要在接收到http请求后执行的操作
31
+ -- TODO implement the operations that need to be performed when the HTTP request is received
35
32
  $PLUGIN_NAME$.controlMethod1(params)
36
33
  return {
37
- --- Your responce data
34
+ --- Your response data
38
35
  status = true
39
36
  }
40
37
  end
@@ -46,7 +43,7 @@ end
46
43
  httpModule.demoMethod2 = function(params)
47
44
  $PLUGIN_NAME$.controlMethod2(params)
48
45
  return {
49
- --- Your responce data
46
+ --- Your response data
50
47
  status = true
51
48
  }
52
49
  end
package/lua/userAPI.lua CHANGED
@@ -1,6 +1,6 @@
1
1
  --- @module userAPI
2
2
  --- @description This is the user API module for the plugin.
3
- --- 该模块为脚本编程和积木编程提供插件接口
3
+ --- This module provides plugin interfaces for script programming and blockly programming.
4
4
 
5
5
  require("$PLUGIN_NAME$.modbus")
6
6
  local $PLUGIN_NAME$ = require("$PLUGIN_NAME$")
@@ -8,7 +8,7 @@ local $PLUGIN_NAME$ = require("$PLUGIN_NAME$")
8
8
  local userApiModule = {}
9
9
 
10
10
  function PauseHandler()
11
- --- 程序运行暂停时的回调函数
11
+ --- This function will be called when the program is paused
12
12
  print(" --- PauseHandler .... --- ")
13
13
  end
14
14
 
@@ -35,18 +35,18 @@ end
35
35
 
36
36
  -- This function will be called when the plugin is installed
37
37
  -- The export functions will be registered to the corresponding code block or script in blockly programming or script programming
38
- -- 该函数会在插件安装后自动执行,其中 ExportFunction 函数会将第二个参数的方法导出给脚本编程和积木编程使用
39
- -- 例如:ExportFunction('A', B) 会将当前模块中的 B 函数导出,并重命名为 'A'
40
- -- 在脚本编程和积木编程中可以使用 A 来使用该函数
38
+ -- This function will be automatically executed after the plugin is installed, and the ExportFunction function will export the method in the second parameter for use in script programming and blockly programming
39
+ -- For example: ExportFunction('A', B) will export the B function in the current module and rename it to 'A'
40
+ -- In script programming and blockly programming, you can use A to use this function
41
41
  function userApiModule.OnRegist()
42
42
  EcoLog(" --- OnRegist .... --- ")
43
- --- 程序运行暂停时的回调函数
43
+ --- This function will be called when the program is paused
44
44
  RegistePauseHandler('PauseHandler')
45
- -- 0. 接口导出
45
+ -- 0. Export functions
46
46
  local isErr = ExportFunction("demoMethod1", userApiModule.demoMethod1) or
47
47
  ExportFunction("demoMethod2", userApiModule.demoMethod2) or
48
48
  ExportFunction("demoMethod3", userApiModule.demoMethod3)
49
- -- 1. 错误的处理
49
+ -- 1. Error handling
50
50
  if isErr then
51
51
  EcoLog(" --- ERR to register .... --- ", isErr)
52
52
  dobotTool.SetError(0)
@@ -9,8 +9,8 @@ mqttFunc.MQTTConnect(connectId)
9
9
 
10
10
  return {
11
11
  mqtt = mqttFunc,
12
- --- 发布数据到指定的 MQTT 主题。
13
- --- @param data table 要发布的数据,数据将被编码为 JSON 格式。
12
+ --- Publish data to the specified MQTT topic.
13
+ --- @param data table The data to be published, which will be encoded in JSON format.
14
14
  publish = function(data)
15
15
  mqttFunc.MQTTPublish(connectId, MQTT_PUBLISH_TOPIC, jsonLuaUtils.encode(data), 0, false)
16
16
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dobot-plus/template",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "engines": {
5
5
  "node": "20"
6
6
  },
package/ui/Blocks.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  function App() {
2
- return <div className="app">这是点击积木时的弹窗页面</div>
2
+ return <div className="app">This is the blocks page</div>
3
3
  }
4
4
 
5
5
  export default App
package/ui/Toolbar.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  function App() {
2
- return <div className="app">这是导航栏界面</div>
2
+ return <div className="app">This is the toolbar page</div>
3
3
  }
4
4
 
5
5
  export default App