@dobot-plus/template 1.2.7 → 1.2.9
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/.dobot/components/DobotPlusApp.tsx +78 -78
- package/.dobot/http/axios.ts +52 -52
- package/.dobot/http/http.ts +22 -22
- package/.dobot/index.ts +2 -2
- package/.dobot/protocol/methodsHandler.ts +15 -15
- package/.dobot/protocol/postMessageHandler.ts +289 -289
- package/.dobot/protocol/websocketHandler.ts +3 -3
- package/.dobot/shim.d.ts +3 -3
- package/.dobot/store/actions/toolActions.ts +69 -69
- package/.dobot/store/actions/userManagementActions.ts +25 -0
- package/.dobot/store/reducers/index.ts +8 -8
- package/.dobot/store/reducers/toolReducer.ts +152 -152
- package/.dobot/store/reducers/userManagementReducer.ts +35 -0
- package/.dobot/store/types.ts +237 -240
- package/.dobot/template/default.tsx.mustache +19 -19
- package/.dobot/template/entry.css +25 -25
- package/.dobot/template/entry.tsx +53 -53
- package/.dobot/template/index.html +23 -23
- package/.dobot/template/index.scss +5 -5
- package/.dobot/utils/i18n.ts +31 -31
- package/.dobot/utils/mqtt.ts +61 -61
- package/.dobot/utils/rem.js +21 -21
- package/.dobot/utils/tool.ts +15 -15
- package/.eslintrc.cjs +18 -18
- package/.luarc.json +8 -8
- package/.vscode/Api.schema.json +103 -103
- package/.vscode/Blocks.schema.json +94 -94
- package/.vscode/Main.schema.json +42 -42
- package/.vscode/Script.schema.json +22 -22
- package/.vscode/Toolbar.schema.json +19 -19
- package/.vscode/extensions.json +8 -8
- package/.vscode/settings.json +51 -51
- package/Resources/i18n/client/de.json +11 -11
- package/Resources/i18n/client/en.json +11 -11
- package/Resources/i18n/client/es.json +11 -11
- package/Resources/i18n/client/hk.json +11 -11
- package/Resources/i18n/client/ja.json +11 -11
- package/Resources/i18n/client/ko.json +11 -11
- package/Resources/i18n/client/ru.json +11 -11
- package/Resources/i18n/client/zh.json +11 -11
- package/Resources/i18n/plugin/de.json +3 -3
- package/Resources/i18n/plugin/en.json +3 -3
- package/Resources/i18n/plugin/es.json +3 -3
- package/Resources/i18n/plugin/hk.json +3 -3
- package/Resources/i18n/plugin/ja.json +3 -3
- package/Resources/i18n/plugin/ko.json +3 -3
- package/Resources/i18n/plugin/ru.json +3 -3
- package/Resources/i18n/plugin/zh.json +3 -3
- package/configs/Blocks.json +21 -21
- package/configs/Main.json +5 -5
- package/configs/Scripts.json +7 -7
- package/configs/Toolbar.json +5 -5
- package/dpt.json +4 -4
- package/lua/control.lua +18 -18
- package/lua/daemon.lua +22 -22
- package/lua/httpAPI.lua +66 -66
- package/lua/userAPI.lua +51 -51
- package/lua/utils/mqtt.lua +16 -16
- package/lua/utils/num_convert.lua +41 -41
- package/lua/utils/tcp.lua +30 -30
- package/lua/utils/util.lua +30 -30
- package/package.json +58 -49
- package/project.json +3 -3
- package/tsconfig.json +26 -26
- package/ui/Blocks.tsx +5 -5
- package/ui/Main.tsx +31 -31
- package/ui/Toolbar.tsx +5 -5
- package/.dobot/store/actions/userMagamentActions.ts +0 -25
- package/.dobot/store/reducers/userMagamentReducer.ts +0 -38
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { DeviceState } from '@dobot/store/types'
|
|
2
|
-
|
|
3
|
-
export const TOOL_ACTIONS_TYPE = {
|
|
4
|
-
SET_PORT_IP: 'setPortIp',
|
|
5
|
-
SET_TCP_STATUS: 'setTcpStatus',
|
|
6
|
-
SET_TCP_INFO: 'setTcpInfo',
|
|
7
|
-
SET_EXTEND_IO_INDEX: 'setExtendIOData',
|
|
8
|
-
SET_PORT: 'setPort',
|
|
9
|
-
SET_ONROBOT_TOOL: 'setOnRobotTool',
|
|
10
|
-
SET_DEVICE_STATE_DATA: 'setDeviceStateData',
|
|
11
|
-
SET_PLUGIN_PORT: 'setPluginPort',
|
|
12
|
-
SET_DOBOTPLUS_HOST: 'setDobotplusHost',
|
|
13
|
-
SET_IO_DATA: 'setIoData',
|
|
14
|
-
SET_POINT_DATA: 'setPointData',
|
|
15
|
-
SET_JOG_IN_PAUSED: 'setJogInPaused'
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
class ToolActions {
|
|
19
|
-
setPortIp = (params: string) => ({
|
|
20
|
-
type: TOOL_ACTIONS_TYPE.SET_PORT_IP,
|
|
21
|
-
params
|
|
22
|
-
})
|
|
23
|
-
setTcpStatus = (params: any) => ({
|
|
24
|
-
type: TOOL_ACTIONS_TYPE.SET_TCP_STATUS,
|
|
25
|
-
params
|
|
26
|
-
})
|
|
27
|
-
setTcpInfo = (params: any) => ({
|
|
28
|
-
type: TOOL_ACTIONS_TYPE.SET_TCP_INFO,
|
|
29
|
-
params
|
|
30
|
-
})
|
|
31
|
-
setExtendIOData = (params: any) => ({
|
|
32
|
-
type: TOOL_ACTIONS_TYPE.SET_EXTEND_IO_INDEX,
|
|
33
|
-
params
|
|
34
|
-
})
|
|
35
|
-
setPort = (params: any) => ({
|
|
36
|
-
type: TOOL_ACTIONS_TYPE.SET_PORT,
|
|
37
|
-
params
|
|
38
|
-
})
|
|
39
|
-
setOnRobotTool = (params: string[]) => ({
|
|
40
|
-
type: TOOL_ACTIONS_TYPE.SET_ONROBOT_TOOL,
|
|
41
|
-
params
|
|
42
|
-
})
|
|
43
|
-
setDeviceStateData = (params: DeviceState) => ({
|
|
44
|
-
type: TOOL_ACTIONS_TYPE.SET_DEVICE_STATE_DATA,
|
|
45
|
-
params
|
|
46
|
-
})
|
|
47
|
-
setPluginPort = (params: DeviceState) => ({
|
|
48
|
-
type: TOOL_ACTIONS_TYPE.SET_PLUGIN_PORT,
|
|
49
|
-
params
|
|
50
|
-
})
|
|
51
|
-
setDobotplusHost = (params: string) => ({
|
|
52
|
-
type: TOOL_ACTIONS_TYPE.SET_DOBOTPLUS_HOST,
|
|
53
|
-
params
|
|
54
|
-
})
|
|
55
|
-
setIoData = (params: DeviceState) => ({
|
|
56
|
-
type: TOOL_ACTIONS_TYPE.SET_IO_DATA,
|
|
57
|
-
params
|
|
58
|
-
})
|
|
59
|
-
setPointData = (params: any[]) => ({
|
|
60
|
-
type: TOOL_ACTIONS_TYPE.SET_POINT_DATA,
|
|
61
|
-
params
|
|
62
|
-
})
|
|
63
|
-
setJogInPaused = (params: boolean) => ({
|
|
64
|
-
type: TOOL_ACTIONS_TYPE.SET_JOG_IN_PAUSED,
|
|
65
|
-
params
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export const toolActions = new ToolActions()
|
|
1
|
+
import { DeviceState } from '@dobot/store/types'
|
|
2
|
+
|
|
3
|
+
export const TOOL_ACTIONS_TYPE = {
|
|
4
|
+
SET_PORT_IP: 'setPortIp',
|
|
5
|
+
SET_TCP_STATUS: 'setTcpStatus',
|
|
6
|
+
SET_TCP_INFO: 'setTcpInfo',
|
|
7
|
+
SET_EXTEND_IO_INDEX: 'setExtendIOData',
|
|
8
|
+
SET_PORT: 'setPort',
|
|
9
|
+
SET_ONROBOT_TOOL: 'setOnRobotTool',
|
|
10
|
+
SET_DEVICE_STATE_DATA: 'setDeviceStateData',
|
|
11
|
+
SET_PLUGIN_PORT: 'setPluginPort',
|
|
12
|
+
SET_DOBOTPLUS_HOST: 'setDobotplusHost',
|
|
13
|
+
SET_IO_DATA: 'setIoData',
|
|
14
|
+
SET_POINT_DATA: 'setPointData',
|
|
15
|
+
SET_JOG_IN_PAUSED: 'setJogInPaused'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class ToolActions {
|
|
19
|
+
setPortIp = (params: string) => ({
|
|
20
|
+
type: TOOL_ACTIONS_TYPE.SET_PORT_IP,
|
|
21
|
+
params
|
|
22
|
+
})
|
|
23
|
+
setTcpStatus = (params: any) => ({
|
|
24
|
+
type: TOOL_ACTIONS_TYPE.SET_TCP_STATUS,
|
|
25
|
+
params
|
|
26
|
+
})
|
|
27
|
+
setTcpInfo = (params: any) => ({
|
|
28
|
+
type: TOOL_ACTIONS_TYPE.SET_TCP_INFO,
|
|
29
|
+
params
|
|
30
|
+
})
|
|
31
|
+
setExtendIOData = (params: any) => ({
|
|
32
|
+
type: TOOL_ACTIONS_TYPE.SET_EXTEND_IO_INDEX,
|
|
33
|
+
params
|
|
34
|
+
})
|
|
35
|
+
setPort = (params: any) => ({
|
|
36
|
+
type: TOOL_ACTIONS_TYPE.SET_PORT,
|
|
37
|
+
params
|
|
38
|
+
})
|
|
39
|
+
setOnRobotTool = (params: string[]) => ({
|
|
40
|
+
type: TOOL_ACTIONS_TYPE.SET_ONROBOT_TOOL,
|
|
41
|
+
params
|
|
42
|
+
})
|
|
43
|
+
setDeviceStateData = (params: DeviceState) => ({
|
|
44
|
+
type: TOOL_ACTIONS_TYPE.SET_DEVICE_STATE_DATA,
|
|
45
|
+
params
|
|
46
|
+
})
|
|
47
|
+
setPluginPort = (params: DeviceState) => ({
|
|
48
|
+
type: TOOL_ACTIONS_TYPE.SET_PLUGIN_PORT,
|
|
49
|
+
params
|
|
50
|
+
})
|
|
51
|
+
setDobotplusHost = (params: string) => ({
|
|
52
|
+
type: TOOL_ACTIONS_TYPE.SET_DOBOTPLUS_HOST,
|
|
53
|
+
params
|
|
54
|
+
})
|
|
55
|
+
setIoData = (params: DeviceState) => ({
|
|
56
|
+
type: TOOL_ACTIONS_TYPE.SET_IO_DATA,
|
|
57
|
+
params
|
|
58
|
+
})
|
|
59
|
+
setPointData = (params: any[]) => ({
|
|
60
|
+
type: TOOL_ACTIONS_TYPE.SET_POINT_DATA,
|
|
61
|
+
params
|
|
62
|
+
})
|
|
63
|
+
setJogInPaused = (params: boolean) => ({
|
|
64
|
+
type: TOOL_ACTIONS_TYPE.SET_JOG_IN_PAUSED,
|
|
65
|
+
params
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const toolActions = new ToolActions()
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const userManagementActionsType = {
|
|
2
|
+
SETUSERMODALDATA: 'setUserModalData',
|
|
3
|
+
SET_PERMISSIONLIST: 'setPermissionList',
|
|
4
|
+
SET_CURRENT_LEVEL: 'setCurrentLevel',
|
|
5
|
+
SET_CURRENT_USER_INFO: 'setCurrentUserInfo'
|
|
6
|
+
}
|
|
7
|
+
class UserManagementActions {
|
|
8
|
+
setUserModalData = (params: any) => ({
|
|
9
|
+
type: userManagementActionsType.SETUSERMODALDATA,
|
|
10
|
+
params
|
|
11
|
+
})
|
|
12
|
+
setPermissionList = (params: any) => ({
|
|
13
|
+
type: userManagementActionsType.SET_PERMISSIONLIST,
|
|
14
|
+
params
|
|
15
|
+
})
|
|
16
|
+
setCurrentLevel = (params: any) => ({
|
|
17
|
+
type: userManagementActionsType.SET_CURRENT_LEVEL,
|
|
18
|
+
params
|
|
19
|
+
})
|
|
20
|
+
setCurrentUserInfo = (params: any) => ({
|
|
21
|
+
type: userManagementActionsType.SET_CURRENT_USER_INFO,
|
|
22
|
+
params
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
export const userManagementActions = new UserManagementActions()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { combineReducers } from 'redux'
|
|
2
|
-
import toolReducer from './toolReducer'
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
export default combineReducers({
|
|
6
|
-
toolReducer,
|
|
7
|
-
|
|
8
|
-
})
|
|
1
|
+
import { combineReducers } from 'redux'
|
|
2
|
+
import toolReducer from './toolReducer'
|
|
3
|
+
import userManagementReducer from './userManagementReducer'
|
|
4
|
+
|
|
5
|
+
export default combineReducers({
|
|
6
|
+
toolReducer,
|
|
7
|
+
userManagementReducer
|
|
8
|
+
})
|
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
import { TOOL_ACTIONS_TYPE } from '../actions/toolActions'
|
|
2
|
-
|
|
3
|
-
const initialStore = {
|
|
4
|
-
portData: {
|
|
5
|
-
ip: '192.168.5.1',
|
|
6
|
-
port: '22000',
|
|
7
|
-
isSync: false
|
|
8
|
-
},
|
|
9
|
-
tcpStatus: false,
|
|
10
|
-
tcpInfo: [],
|
|
11
|
-
extendIoData: [],
|
|
12
|
-
onRobotTool: [],
|
|
13
|
-
pluginPort: undefined,
|
|
14
|
-
dobotplusHost: 'http://localhost:9889',
|
|
15
|
-
deviceStateData: {
|
|
16
|
-
prjState: 'stopped'
|
|
17
|
-
},
|
|
18
|
-
ioData: {
|
|
19
|
-
ioList: {
|
|
20
|
-
input: [...Array(1)].map((item, index) => ({
|
|
21
|
-
address: index + 1,
|
|
22
|
-
init: `DI_${index + 1}`,
|
|
23
|
-
name: `DI_${index + 1}`,
|
|
24
|
-
editName: '',
|
|
25
|
-
value: 1,
|
|
26
|
-
isShow: true,
|
|
27
|
-
diValue: 0,
|
|
28
|
-
isDI: false,
|
|
29
|
-
type: 'Common',
|
|
30
|
-
configurationStr: '',
|
|
31
|
-
safeIOKey: 0
|
|
32
|
-
})),
|
|
33
|
-
inputSimulation: [...Array(1)].map((item, index) => ({
|
|
34
|
-
address: index + 1,
|
|
35
|
-
init: `AD_${index + 1}`,
|
|
36
|
-
name: `AD_${index + 1}`,
|
|
37
|
-
editName: '',
|
|
38
|
-
isShow: true,
|
|
39
|
-
value: 3.3
|
|
40
|
-
})),
|
|
41
|
-
output: [...Array(1)].map((item, index) => ({
|
|
42
|
-
address: index + 1,
|
|
43
|
-
init: `DO_${index + 1}`,
|
|
44
|
-
name: `DO_${index + 1}`,
|
|
45
|
-
editName: '',
|
|
46
|
-
value: 0,
|
|
47
|
-
isShow: true,
|
|
48
|
-
type: 'Common',
|
|
49
|
-
configurationStr: '',
|
|
50
|
-
safeIOKey: 0
|
|
51
|
-
}))
|
|
52
|
-
},
|
|
53
|
-
endEffectorIo: {
|
|
54
|
-
input: [...Array(1)].map((item, index) => ({
|
|
55
|
-
address: index + 17,
|
|
56
|
-
init: `DI_${index + 1}`,
|
|
57
|
-
name: `DI_${index + 1}`,
|
|
58
|
-
editName: '',
|
|
59
|
-
value: 1,
|
|
60
|
-
isShow: true,
|
|
61
|
-
diValue: 0,
|
|
62
|
-
isDI: false
|
|
63
|
-
})),
|
|
64
|
-
output: [...Array(1)].map((item, index) => ({
|
|
65
|
-
address: index + 17,
|
|
66
|
-
init: `DO_${index + 1}`,
|
|
67
|
-
name: `DO_${index + 1}`,
|
|
68
|
-
editName: '',
|
|
69
|
-
value: 1,
|
|
70
|
-
isShow: true
|
|
71
|
-
}))
|
|
72
|
-
},
|
|
73
|
-
isShowInputAll: true,
|
|
74
|
-
isShowOutputAll: true,
|
|
75
|
-
ioAO: [0, 0],
|
|
76
|
-
ioAI: [0, 0],
|
|
77
|
-
ioAIUnit: { mode1: 0, mode2: 0 },
|
|
78
|
-
ioAOUnit: { mode1: 0, mode2: 0 },
|
|
79
|
-
endAIUnit: { mode1: 0, mode2: 0, mode3: 0, mode4: 0 },
|
|
80
|
-
endAI: [0, 0, 0, 0],
|
|
81
|
-
toolMode: { mode1: 1, mode2: 1 },
|
|
82
|
-
ioData: {}
|
|
83
|
-
},
|
|
84
|
-
pointData: [],
|
|
85
|
-
jogInPaused: false
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const toolReducer = (
|
|
89
|
-
state = initialStore,
|
|
90
|
-
action: { type: string; params: any }
|
|
91
|
-
) => {
|
|
92
|
-
switch (action.type) {
|
|
93
|
-
case TOOL_ACTIONS_TYPE.SET_PORT_IP: {
|
|
94
|
-
return Object.assign({}, state, {
|
|
95
|
-
portData: {
|
|
96
|
-
ip: action.params,
|
|
97
|
-
port: state.portData.port,
|
|
98
|
-
isSync: true
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
case TOOL_ACTIONS_TYPE.SET_PORT: {
|
|
103
|
-
return Object.assign({}, state, {
|
|
104
|
-
portData: {
|
|
105
|
-
ip: state.portData.ip,
|
|
106
|
-
port: action.params,
|
|
107
|
-
isSync: true
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
}
|
|
111
|
-
case TOOL_ACTIONS_TYPE.SET_TCP_STATUS: {
|
|
112
|
-
return Object.assign({}, state, { tcpStatus: action.params })
|
|
113
|
-
}
|
|
114
|
-
case TOOL_ACTIONS_TYPE.SET_TCP_INFO: {
|
|
115
|
-
return Object.assign({}, state, { tcpInfo: action.params })
|
|
116
|
-
}
|
|
117
|
-
case TOOL_ACTIONS_TYPE.SET_EXTEND_IO_INDEX: {
|
|
118
|
-
const newData = action.params.map((item: any) => {
|
|
119
|
-
return {
|
|
120
|
-
name: item.name,
|
|
121
|
-
DONumber: item.doNumber,
|
|
122
|
-
DOStart: item.doStart,
|
|
123
|
-
DINumber: item.diNumber,
|
|
124
|
-
DIStart: item.diStart
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
return Object.assign({}, state, { extendIoData: newData })
|
|
128
|
-
}
|
|
129
|
-
case TOOL_ACTIONS_TYPE.SET_ONROBOT_TOOL: {
|
|
130
|
-
return Object.assign({}, state, { onRobotTool: action.params })
|
|
131
|
-
}
|
|
132
|
-
case TOOL_ACTIONS_TYPE.SET_DEVICE_STATE_DATA: {
|
|
133
|
-
return Object.assign({}, state, { deviceStateData: action.params })
|
|
134
|
-
}
|
|
135
|
-
case TOOL_ACTIONS_TYPE.SET_PLUGIN_PORT: {
|
|
136
|
-
return Object.assign({}, state, { pluginPort: action.params })
|
|
137
|
-
}
|
|
138
|
-
case TOOL_ACTIONS_TYPE.SET_DOBOTPLUS_HOST:
|
|
139
|
-
return Object.assign({}, state, { dobotplusHost: action.params })
|
|
140
|
-
case TOOL_ACTIONS_TYPE.SET_IO_DATA: {
|
|
141
|
-
return Object.assign({}, state, { deviceStateData: action.params })
|
|
142
|
-
}
|
|
143
|
-
case TOOL_ACTIONS_TYPE.SET_POINT_DATA:
|
|
144
|
-
return Object.assign({}, state, { pointData: action.params })
|
|
145
|
-
case TOOL_ACTIONS_TYPE.SET_JOG_IN_PAUSED:
|
|
146
|
-
return Object.assign({}, state, { jogInPaused: action.params })
|
|
147
|
-
default:
|
|
148
|
-
return state
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export default toolReducer
|
|
1
|
+
import { TOOL_ACTIONS_TYPE } from '../actions/toolActions'
|
|
2
|
+
|
|
3
|
+
const initialStore = {
|
|
4
|
+
portData: {
|
|
5
|
+
ip: '192.168.5.1',
|
|
6
|
+
port: '22000',
|
|
7
|
+
isSync: false
|
|
8
|
+
},
|
|
9
|
+
tcpStatus: false,
|
|
10
|
+
tcpInfo: [],
|
|
11
|
+
extendIoData: [],
|
|
12
|
+
onRobotTool: [],
|
|
13
|
+
pluginPort: undefined,
|
|
14
|
+
dobotplusHost: 'http://localhost:9889',
|
|
15
|
+
deviceStateData: {
|
|
16
|
+
prjState: 'stopped'
|
|
17
|
+
},
|
|
18
|
+
ioData: {
|
|
19
|
+
ioList: {
|
|
20
|
+
input: [...Array(1)].map((item, index) => ({
|
|
21
|
+
address: index + 1,
|
|
22
|
+
init: `DI_${index + 1}`,
|
|
23
|
+
name: `DI_${index + 1}`,
|
|
24
|
+
editName: '',
|
|
25
|
+
value: 1,
|
|
26
|
+
isShow: true,
|
|
27
|
+
diValue: 0,
|
|
28
|
+
isDI: false,
|
|
29
|
+
type: 'Common',
|
|
30
|
+
configurationStr: '',
|
|
31
|
+
safeIOKey: 0
|
|
32
|
+
})),
|
|
33
|
+
inputSimulation: [...Array(1)].map((item, index) => ({
|
|
34
|
+
address: index + 1,
|
|
35
|
+
init: `AD_${index + 1}`,
|
|
36
|
+
name: `AD_${index + 1}`,
|
|
37
|
+
editName: '',
|
|
38
|
+
isShow: true,
|
|
39
|
+
value: 3.3
|
|
40
|
+
})),
|
|
41
|
+
output: [...Array(1)].map((item, index) => ({
|
|
42
|
+
address: index + 1,
|
|
43
|
+
init: `DO_${index + 1}`,
|
|
44
|
+
name: `DO_${index + 1}`,
|
|
45
|
+
editName: '',
|
|
46
|
+
value: 0,
|
|
47
|
+
isShow: true,
|
|
48
|
+
type: 'Common',
|
|
49
|
+
configurationStr: '',
|
|
50
|
+
safeIOKey: 0
|
|
51
|
+
}))
|
|
52
|
+
},
|
|
53
|
+
endEffectorIo: {
|
|
54
|
+
input: [...Array(1)].map((item, index) => ({
|
|
55
|
+
address: index + 17,
|
|
56
|
+
init: `DI_${index + 1}`,
|
|
57
|
+
name: `DI_${index + 1}`,
|
|
58
|
+
editName: '',
|
|
59
|
+
value: 1,
|
|
60
|
+
isShow: true,
|
|
61
|
+
diValue: 0,
|
|
62
|
+
isDI: false
|
|
63
|
+
})),
|
|
64
|
+
output: [...Array(1)].map((item, index) => ({
|
|
65
|
+
address: index + 17,
|
|
66
|
+
init: `DO_${index + 1}`,
|
|
67
|
+
name: `DO_${index + 1}`,
|
|
68
|
+
editName: '',
|
|
69
|
+
value: 1,
|
|
70
|
+
isShow: true
|
|
71
|
+
}))
|
|
72
|
+
},
|
|
73
|
+
isShowInputAll: true,
|
|
74
|
+
isShowOutputAll: true,
|
|
75
|
+
ioAO: [0, 0],
|
|
76
|
+
ioAI: [0, 0],
|
|
77
|
+
ioAIUnit: { mode1: 0, mode2: 0 },
|
|
78
|
+
ioAOUnit: { mode1: 0, mode2: 0 },
|
|
79
|
+
endAIUnit: { mode1: 0, mode2: 0, mode3: 0, mode4: 0 },
|
|
80
|
+
endAI: [0, 0, 0, 0],
|
|
81
|
+
toolMode: { mode1: 1, mode2: 1 },
|
|
82
|
+
ioData: {}
|
|
83
|
+
},
|
|
84
|
+
pointData: [],
|
|
85
|
+
jogInPaused: false
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const toolReducer = (
|
|
89
|
+
state = initialStore,
|
|
90
|
+
action: { type: string; params: any }
|
|
91
|
+
) => {
|
|
92
|
+
switch (action.type) {
|
|
93
|
+
case TOOL_ACTIONS_TYPE.SET_PORT_IP: {
|
|
94
|
+
return Object.assign({}, state, {
|
|
95
|
+
portData: {
|
|
96
|
+
ip: action.params,
|
|
97
|
+
port: state.portData.port,
|
|
98
|
+
isSync: true
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
case TOOL_ACTIONS_TYPE.SET_PORT: {
|
|
103
|
+
return Object.assign({}, state, {
|
|
104
|
+
portData: {
|
|
105
|
+
ip: state.portData.ip,
|
|
106
|
+
port: action.params,
|
|
107
|
+
isSync: true
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
case TOOL_ACTIONS_TYPE.SET_TCP_STATUS: {
|
|
112
|
+
return Object.assign({}, state, { tcpStatus: action.params })
|
|
113
|
+
}
|
|
114
|
+
case TOOL_ACTIONS_TYPE.SET_TCP_INFO: {
|
|
115
|
+
return Object.assign({}, state, { tcpInfo: action.params })
|
|
116
|
+
}
|
|
117
|
+
case TOOL_ACTIONS_TYPE.SET_EXTEND_IO_INDEX: {
|
|
118
|
+
const newData = action.params.map((item: any) => {
|
|
119
|
+
return {
|
|
120
|
+
name: item.name,
|
|
121
|
+
DONumber: item.doNumber,
|
|
122
|
+
DOStart: item.doStart,
|
|
123
|
+
DINumber: item.diNumber,
|
|
124
|
+
DIStart: item.diStart
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
return Object.assign({}, state, { extendIoData: newData })
|
|
128
|
+
}
|
|
129
|
+
case TOOL_ACTIONS_TYPE.SET_ONROBOT_TOOL: {
|
|
130
|
+
return Object.assign({}, state, { onRobotTool: action.params })
|
|
131
|
+
}
|
|
132
|
+
case TOOL_ACTIONS_TYPE.SET_DEVICE_STATE_DATA: {
|
|
133
|
+
return Object.assign({}, state, { deviceStateData: action.params })
|
|
134
|
+
}
|
|
135
|
+
case TOOL_ACTIONS_TYPE.SET_PLUGIN_PORT: {
|
|
136
|
+
return Object.assign({}, state, { pluginPort: action.params })
|
|
137
|
+
}
|
|
138
|
+
case TOOL_ACTIONS_TYPE.SET_DOBOTPLUS_HOST:
|
|
139
|
+
return Object.assign({}, state, { dobotplusHost: action.params })
|
|
140
|
+
case TOOL_ACTIONS_TYPE.SET_IO_DATA: {
|
|
141
|
+
return Object.assign({}, state, { deviceStateData: action.params })
|
|
142
|
+
}
|
|
143
|
+
case TOOL_ACTIONS_TYPE.SET_POINT_DATA:
|
|
144
|
+
return Object.assign({}, state, { pointData: action.params })
|
|
145
|
+
case TOOL_ACTIONS_TYPE.SET_JOG_IN_PAUSED:
|
|
146
|
+
return Object.assign({}, state, { jogInPaused: action.params })
|
|
147
|
+
default:
|
|
148
|
+
return state
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export default toolReducer
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { userManagementActionsType } from '../actions/userManagementActions'
|
|
2
|
+
import { UserManagementState } from '@dobot/store/types'
|
|
3
|
+
|
|
4
|
+
const initialStore: UserManagementState = {
|
|
5
|
+
userModalData: {
|
|
6
|
+
show: false
|
|
7
|
+
},
|
|
8
|
+
permissionList: [
|
|
9
|
+
[1, 'TR_LEVEL_1'],
|
|
10
|
+
[2, 'TR_LEVEL_2'],
|
|
11
|
+
[3, 'TR_LEVEL_3']
|
|
12
|
+
],
|
|
13
|
+
currentLevel: 0,
|
|
14
|
+
currentUserInfo: ''
|
|
15
|
+
}
|
|
16
|
+
const userManagementReducer = (state = initialStore, action: { type: string; params: any }) => {
|
|
17
|
+
switch (action.type) {
|
|
18
|
+
case userManagementActionsType.SETUSERMODALDATA: {
|
|
19
|
+
return Object.assign({}, state, { userModalData: action.params })
|
|
20
|
+
}
|
|
21
|
+
case userManagementActionsType.SET_PERMISSIONLIST: {
|
|
22
|
+
return Object.assign({}, state, { permissionList: action.params })
|
|
23
|
+
}
|
|
24
|
+
case userManagementActionsType.SET_CURRENT_LEVEL: {
|
|
25
|
+
return Object.assign({}, state, { currentLevel: action.params })
|
|
26
|
+
}
|
|
27
|
+
case userManagementActionsType.SET_CURRENT_USER_INFO: {
|
|
28
|
+
return Object.assign({}, state, { currentUserInfo: action.params })
|
|
29
|
+
}
|
|
30
|
+
default:
|
|
31
|
+
return state
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default userManagementReducer
|