motion-master-client 0.0.3 → 0.0.6
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/README.md +123 -49
- package/package.json +21 -6
- package/src/{index.ts → index.d.ts} +23 -22
- package/src/index.js +27 -0
- package/src/index.js.map +1 -0
- package/src/lib/cia402.d.ts +30 -0
- package/src/lib/cia402.js +112 -0
- package/src/lib/cia402.js.map +1 -0
- package/src/lib/device-log-line.d.ts +5 -0
- package/src/lib/device-log-line.js +3 -0
- package/src/lib/device-log-line.js.map +1 -0
- package/src/lib/{device-parameter.ts → device-parameter.d.ts} +56 -69
- package/src/lib/device-parameter.js +39 -0
- package/src/lib/device-parameter.js.map +1 -0
- package/src/lib/device.d.ts +8 -0
- package/src/lib/device.js +3 -0
- package/src/lib/device.js.map +1 -0
- package/src/lib/examples/get-firmware-version-for-all-devices.d.ts +1 -0
- package/src/lib/examples/get-firmware-version-for-all-devices.js +15 -0
- package/src/lib/examples/get-firmware-version-for-all-devices.js.map +1 -0
- package/src/lib/hardware-description.d.ts +37 -0
- package/src/lib/hardware-description.js +48 -0
- package/src/lib/hardware-description.js.map +1 -0
- package/src/lib/logger.d.ts +1 -0
- package/src/lib/logger.js +8 -0
- package/src/lib/logger.js.map +1 -0
- package/src/lib/monitoring-config.d.ts +6 -0
- package/src/lib/monitoring-config.js +3 -0
- package/src/lib/monitoring-config.js.map +1 -0
- package/src/lib/monitoring-entry.d.ts +9 -0
- package/src/lib/monitoring-entry.js +3 -0
- package/src/lib/monitoring-entry.js.map +1 -0
- package/src/lib/motion-master-client.d.ts +18 -0
- package/src/lib/motion-master-client.js +73 -0
- package/src/lib/motion-master-client.js.map +1 -0
- package/src/lib/motion-master-pub-sub-client.d.ts +16 -0
- package/src/lib/motion-master-pub-sub-client.js +68 -0
- package/src/lib/motion-master-pub-sub-client.js.map +1 -0
- package/src/lib/motion-master-pub-sub-socket.d.ts +28 -0
- package/src/lib/motion-master-pub-sub-socket.js +3 -0
- package/src/lib/motion-master-pub-sub-socket.js.map +1 -0
- package/src/lib/motion-master-pub-sub-web-socket.d.ts +13 -0
- package/src/lib/motion-master-pub-sub-web-socket.js +61 -0
- package/src/lib/motion-master-pub-sub-web-socket.js.map +1 -0
- package/src/lib/motion-master-pub-sub-worker-socket.d.ts +13 -0
- package/src/lib/motion-master-pub-sub-worker-socket.js +37 -0
- package/src/lib/motion-master-pub-sub-worker-socket.js.map +1 -0
- package/src/lib/motion-master-req-res-client.d.ts +956 -0
- package/src/lib/motion-master-req-res-client.js +1521 -0
- package/src/lib/motion-master-req-res-client.js.map +1 -0
- package/src/lib/motion-master-req-res-socket.d.ts +38 -0
- package/src/lib/motion-master-req-res-socket.js +3 -0
- package/src/lib/motion-master-req-res-socket.js.map +1 -0
- package/src/lib/motion-master-req-res-web-socket.d.ts +20 -0
- package/src/lib/motion-master-req-res-web-socket.js +100 -0
- package/src/lib/motion-master-req-res-web-socket.js.map +1 -0
- package/src/lib/motion-master-req-res-worker-socket.d.ts +15 -0
- package/src/lib/motion-master-req-res-worker-socket.js +53 -0
- package/src/lib/motion-master-req-res-worker-socket.js.map +1 -0
- package/src/lib/motion-master.proto.js +5 -3
- package/src/lib/operators.d.ts +21 -0
- package/src/lib/operators.js +71 -0
- package/src/lib/operators.js.map +1 -0
- package/src/lib/options.d.ts +34 -0
- package/src/lib/options.js +38 -0
- package/src/lib/options.js.map +1 -0
- package/src/lib/parameter.d.ts +65 -0
- package/src/lib/parameter.js +70 -0
- package/src/lib/parameter.js.map +1 -0
- package/src/lib/request-status-resolver.d.ts +4 -0
- package/src/lib/request-status-resolver.js +345 -0
- package/src/lib/request-status-resolver.js.map +1 -0
- package/src/lib/system-log-line.d.ts +8 -0
- package/src/lib/system-log-line.js +3 -0
- package/src/lib/system-log-line.js.map +1 -0
- package/src/lib/types.d.ts +50 -0
- package/src/lib/types.js +23 -0
- package/src/lib/types.js.map +1 -0
- package/src/lib/urls.d.ts +3 -0
- package/src/lib/urls.js +10 -0
- package/src/lib/urls.js.map +1 -0
- package/src/lib/util.d.ts +30 -0
- package/src/lib/util.js +279 -0
- package/src/lib/util.js.map +1 -0
- package/.babelrc +0 -3
- package/.eslintrc.json +0 -18
- package/jest.config.ts +0 -15
- package/motion-master.proto +0 -1822
- package/src/lib/device-log-line.ts +0 -5
- package/src/lib/device-parameter.spec.ts +0 -85
- package/src/lib/hardware-description.spec.ts +0 -223
- package/src/lib/hardware-description.ts +0 -79
- package/src/lib/logger.ts +0 -5
- package/src/lib/monitoring-config.ts +0 -6
- package/src/lib/monitoring-entry.ts +0 -11
- package/src/lib/motion-master-client.ts +0 -94
- package/src/lib/motion-master-pub-sub-client.ts +0 -94
- package/src/lib/motion-master-pub-sub-socket.ts +0 -33
- package/src/lib/motion-master-pub-sub-web-socket.ts +0 -71
- package/src/lib/motion-master-pub-sub-worker-socket.ts +0 -58
- package/src/lib/motion-master-req-res-client.spec.ts +0 -126
- package/src/lib/motion-master-req-res-client.ts +0 -1990
- package/src/lib/motion-master-req-res-socket.ts +0 -45
- package/src/lib/motion-master-req-res-web-socket.ts +0 -119
- package/src/lib/motion-master-req-res-worker-socket.ts +0 -63
- package/src/lib/operators.ts +0 -93
- package/src/lib/options.ts +0 -12
- package/src/lib/parameter.spec.ts +0 -81
- package/src/lib/parameter.ts +0 -119
- package/src/lib/request-status-resolver.ts +0 -380
- package/src/lib/system-log-line.ts +0 -8
- package/src/lib/types.ts +0 -58
- package/src/lib/urls.ts +0 -6
- package/src/lib/util.ts +0 -261
- package/tsconfig.json +0 -22
- package/tsconfig.lib.json +0 -10
- package/tsconfig.spec.json +0 -20
- package/typedoc.json +0 -10
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
|
|
4
|
-
import { MotionMasterMessage, RequestStatus, StatusKey } from "./types";
|
|
5
|
-
|
|
6
|
-
export const requestStatusResolver: { [key in StatusKey]: <T>(status: T) => RequestStatus } = {
|
|
7
|
-
systemPong: () => 'succeeded',
|
|
8
|
-
systemVersion: (status: MotionMasterMessage.Status.ISystemVersion) => {
|
|
9
|
-
return status.version ? 'succeeded' : 'failed';
|
|
10
|
-
},
|
|
11
|
-
systemEvent: (status: MotionMasterMessage.Status.ISystemEvent) => {
|
|
12
|
-
if (status.error) {
|
|
13
|
-
return 'failed';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return 'succeeded';
|
|
17
|
-
},
|
|
18
|
-
deviceInfo: (status: MotionMasterMessage.Status.IDeviceInfo) => {
|
|
19
|
-
return status.devices ? 'succeeded' : 'failed';
|
|
20
|
-
},
|
|
21
|
-
deviceParameterInfo: (status: MotionMasterMessage.Status.IDeviceParameterInfo) => {
|
|
22
|
-
return status.parameters ? 'succeeded' : 'failed';
|
|
23
|
-
},
|
|
24
|
-
deviceParameterValues: (status: MotionMasterMessage.Status.IDeviceParameterValues) => {
|
|
25
|
-
if (status.progress) {
|
|
26
|
-
if (status.progress.percentage === 100) {
|
|
27
|
-
return 'succeeded';
|
|
28
|
-
} else {
|
|
29
|
-
return 'running';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return 'succeeded';
|
|
34
|
-
},
|
|
35
|
-
multiDeviceParameterValues: () => 'succeeded',
|
|
36
|
-
deviceFileList: (status: MotionMasterMessage.Status.IDeviceFileList) => {
|
|
37
|
-
if (status.error) {
|
|
38
|
-
return 'failed';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return 'succeeded';
|
|
42
|
-
},
|
|
43
|
-
deviceFile: (status: MotionMasterMessage.Status.IDeviceFile) => {
|
|
44
|
-
if (status.error) {
|
|
45
|
-
return 'failed';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return 'succeeded';
|
|
49
|
-
},
|
|
50
|
-
deviceEvent: (status: MotionMasterMessage.Status.IDeviceEvent) => {
|
|
51
|
-
if (status.error) {
|
|
52
|
-
return 'failed';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return 'succeeded';
|
|
56
|
-
},
|
|
57
|
-
deviceFirmwareInstallation: (status: MotionMasterMessage.Status.IDeviceFirmwareInstallation) => {
|
|
58
|
-
if (status.error) {
|
|
59
|
-
return 'failed';
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (status.success) {
|
|
63
|
-
if (status.success.code === MotionMasterMessage.Status.DeviceFirmwareInstallation.Success.Code.DONE) {
|
|
64
|
-
return 'succeeded';
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (status.success.code === MotionMasterMessage.Status.DeviceFirmwareInstallation.Success.Code.UNSPECIFIED) {
|
|
68
|
-
return 'succeeded';
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return 'running';
|
|
73
|
-
},
|
|
74
|
-
deviceLog: (status: MotionMasterMessage.Status.IDeviceLog) => {
|
|
75
|
-
if (status.error) {
|
|
76
|
-
return 'failed';
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return 'succeeded';
|
|
80
|
-
},
|
|
81
|
-
deviceFaultReset: (status: MotionMasterMessage.Status.IDeviceFaultReset) => {
|
|
82
|
-
if (status.error) {
|
|
83
|
-
return 'failed';
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return 'succeeded';
|
|
87
|
-
},
|
|
88
|
-
coggingTorqueRecording: (status: MotionMasterMessage.Status.ICoggingTorqueRecording) => {
|
|
89
|
-
if (status.error) {
|
|
90
|
-
return 'failed';
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (status.success) {
|
|
94
|
-
if (status.success.code === MotionMasterMessage.Status.CoggingTorqueRecording.Success.Code.DONE) {
|
|
95
|
-
return 'succeeded';
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (status.success.code === MotionMasterMessage.Status.CoggingTorqueRecording.Success.Code.UNSPECIFIED) {
|
|
99
|
-
return 'succeeded';
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return 'running';
|
|
104
|
-
},
|
|
105
|
-
coggingTorqueData: (status: MotionMasterMessage.Status.ICoggingTorqueData) => {
|
|
106
|
-
if (status.error) {
|
|
107
|
-
return 'failed';
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return 'succeeded';
|
|
111
|
-
},
|
|
112
|
-
offsetDetection: (status: MotionMasterMessage.Status.IOffsetDetection) => {
|
|
113
|
-
if (status.error) {
|
|
114
|
-
return 'failed';
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (status.success) {
|
|
118
|
-
if (status.success.code === MotionMasterMessage.Status.OffsetDetection.Success.Code.DONE) {
|
|
119
|
-
return 'succeeded';
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (status.success.code === MotionMasterMessage.Status.OffsetDetection.Success.Code.UNSPECIFIED) {
|
|
123
|
-
return 'succeeded';
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return 'running';
|
|
128
|
-
},
|
|
129
|
-
plantIdentification: (status: MotionMasterMessage.Status.IPlantIdentification) => {
|
|
130
|
-
if (status.error) {
|
|
131
|
-
return 'failed';
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (status.success) {
|
|
135
|
-
if (status.success.code === MotionMasterMessage.Status.PlantIdentification.Success.Code.DONE) {
|
|
136
|
-
return 'succeeded';
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (status.success.code === MotionMasterMessage.Status.PlantIdentification.Success.Code.UNSPECIFIED) {
|
|
140
|
-
return 'succeeded';
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return 'running';
|
|
145
|
-
},
|
|
146
|
-
autoTuning: (status: MotionMasterMessage.Status.IAutoTuning) => {
|
|
147
|
-
if (status.error) {
|
|
148
|
-
return 'failed';
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (status.success) {
|
|
152
|
-
if (status.success.code === MotionMasterMessage.Status.AutoTuning.Success.Code.POSITION_DONE ||
|
|
153
|
-
status.success.code === MotionMasterMessage.Status.AutoTuning.Success.Code.VELOCITY_DONE) {
|
|
154
|
-
return 'succeeded';
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (status.success === MotionMasterMessage.Status.AutoTuning.Success.Code.UNSPECIFIED) {
|
|
158
|
-
return 'succeeded';
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return 'running';
|
|
163
|
-
},
|
|
164
|
-
motionController: (status: MotionMasterMessage.Status.IMotionController) => {
|
|
165
|
-
if (status.error) {
|
|
166
|
-
return 'failed';
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return 'succeeded';
|
|
170
|
-
},
|
|
171
|
-
signalGenerator: (status: MotionMasterMessage.Status.ISignalGenerator) => {
|
|
172
|
-
if (status.error) {
|
|
173
|
-
return 'failed';
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if (status.success) {
|
|
177
|
-
if (status.success.code === MotionMasterMessage.Status.SignalGenerator.Success.Code.DONE) {
|
|
178
|
-
return 'succeeded';
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (status.success.code === MotionMasterMessage.Status.SignalGenerator.Success.Code.PARAMETERS_SET) {
|
|
182
|
-
return 'succeeded';
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (status.success.code === MotionMasterMessage.Status.SignalGenerator.Success.Code.UNSPECIFIED) {
|
|
186
|
-
return 'succeeded';
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return 'running';
|
|
191
|
-
},
|
|
192
|
-
monitoringParameterValues: (status: MotionMasterMessage.Status.IMonitoringParameterValues) => {
|
|
193
|
-
if (status.error) {
|
|
194
|
-
return 'failed';
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return 'succeeded';
|
|
198
|
-
},
|
|
199
|
-
deviceStop: (status: MotionMasterMessage.Status.IDeviceStop) => {
|
|
200
|
-
if (status.error) {
|
|
201
|
-
return 'failed';
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return 'succeeded';
|
|
205
|
-
},
|
|
206
|
-
ethercatNetworkState: (status: MotionMasterMessage.Status.IEthercatNetworkState) => {
|
|
207
|
-
if (status.error) {
|
|
208
|
-
return 'failed';
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return 'succeeded';
|
|
212
|
-
},
|
|
213
|
-
narrowAngleCalibration: (status: MotionMasterMessage.Status.INarrowAngleCalibration) => {
|
|
214
|
-
if (status.error) {
|
|
215
|
-
return 'failed';
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (status.success) {
|
|
219
|
-
if (status.success.code === MotionMasterMessage.Status.NarrowAngleCalibration.Success.Code.DONE) {
|
|
220
|
-
return 'succeeded';
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (status.success.code === MotionMasterMessage.Status.NarrowAngleCalibration.Success.Code.UNSPECIFIED) {
|
|
224
|
-
return 'succeeded';
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return 'running';
|
|
229
|
-
},
|
|
230
|
-
systemIdentification: (status: MotionMasterMessage.Status.ISystemIdentification) => {
|
|
231
|
-
if (status.error) {
|
|
232
|
-
return 'failed';
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
if (status.success) {
|
|
236
|
-
if (status.success.code === MotionMasterMessage.Status.SystemIdentification.Success.Code.DONE) {
|
|
237
|
-
return 'succeeded';
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
if (status.success.code === MotionMasterMessage.Status.SystemIdentification.Success.Code.UNSPECIFIED) {
|
|
241
|
-
return 'succeeded';
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
return 'running';
|
|
246
|
-
},
|
|
247
|
-
circuloEncoderMagnetDistance: (status: MotionMasterMessage.Status.ICirculoEncoderMagnetDistance) => {
|
|
248
|
-
if (typeof status.distance === 'number' || typeof status.position === 'number') {
|
|
249
|
-
return 'succeeded';
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
return 'failed';
|
|
253
|
-
},
|
|
254
|
-
circuloEncoderNarrowAngleCalibrationProcedure: (status: MotionMasterMessage.Status.ICirculoEncoderNarrowAngleCalibrationProcedure) => {
|
|
255
|
-
if (status.error) {
|
|
256
|
-
return 'failed';
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (status.success) {
|
|
260
|
-
if (status.success.code === MotionMasterMessage.Status.CirculoEncoderNarrowAngleCalibrationProcedure.Success.Code.STOPPED) {
|
|
261
|
-
return 'failed';
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
if (status.success.code === MotionMasterMessage.Status.CirculoEncoderNarrowAngleCalibrationProcedure.Success.Code.DONE) {
|
|
265
|
-
return 'succeeded';
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (status.success === MotionMasterMessage.Status.CirculoEncoderNarrowAngleCalibrationProcedure.Success.Code.UNSPECIFIED) {
|
|
269
|
-
return 'succeeded';
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return 'running';
|
|
274
|
-
},
|
|
275
|
-
deviceCia402State: (status: MotionMasterMessage.Status.IDeviceCiA402State) => {
|
|
276
|
-
if (status.error) {
|
|
277
|
-
return 'failed';
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
return 'succeeded';
|
|
281
|
-
},
|
|
282
|
-
systemLog: (status: MotionMasterMessage.Status.ISystemLog) => {
|
|
283
|
-
if (status.content) {
|
|
284
|
-
return 'succeeded';
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
return 'failed';
|
|
288
|
-
},
|
|
289
|
-
deviceSiiRestore: (status: MotionMasterMessage.Status.IDeviceSiiRestore) => {
|
|
290
|
-
if (status.error) {
|
|
291
|
-
return 'failed';
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
if (status.success) {
|
|
295
|
-
if (status.success.code === MotionMasterMessage.Status.DeviceSiiRestore.Success.Code.DONE) {
|
|
296
|
-
return 'succeeded';
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
if (status.success.code === MotionMasterMessage.Status.DeviceSiiRestore.Success.Code.UNSPECIFIED) {
|
|
300
|
-
return 'succeeded';
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
return 'running';
|
|
305
|
-
},
|
|
306
|
-
openLoopFieldControl: (status: MotionMasterMessage.Status.IOpenLoopFieldControl) => {
|
|
307
|
-
if (status.error) {
|
|
308
|
-
return 'failed';
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
if (status.success) {
|
|
312
|
-
if (status.success.code === MotionMasterMessage.Status.OpenLoopFieldControl.Success.Code.DONE) {
|
|
313
|
-
return 'succeeded';
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
if (status.success.code === MotionMasterMessage.Status.OpenLoopFieldControl.Success.Code.UNSPECIFIED) {
|
|
317
|
-
return 'succeeded';
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return 'running';
|
|
322
|
-
},
|
|
323
|
-
fullAutoTuning: (status: MotionMasterMessage.Status.IFullAutoTuning) => {
|
|
324
|
-
if (status.error) {
|
|
325
|
-
return 'failed';
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
if (status.success) {
|
|
329
|
-
if (status.success.code === MotionMasterMessage.Status.FullAutoTuning.Success.Code.POSITION_STOPPED ||
|
|
330
|
-
status.success.code === MotionMasterMessage.Status.FullAutoTuning.Success.Code.VELOCITY_STOPPED) {
|
|
331
|
-
return 'failed';
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if (status.success.code === MotionMasterMessage.Status.FullAutoTuning.Success.Code.POSITION_DONE ||
|
|
335
|
-
status.success.code === MotionMasterMessage.Status.FullAutoTuning.Success.Code.VELOCITY_DONE) {
|
|
336
|
-
return 'succeeded';
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
if (status.success === MotionMasterMessage.Status.FullAutoTuning.Success.Code.UNSPECIFIED) {
|
|
340
|
-
return 'succeeded';
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
return 'running';
|
|
345
|
-
},
|
|
346
|
-
circuloEncoderConfiguration: (status: MotionMasterMessage.Status.ICirculoEncoderConfiguration) => {
|
|
347
|
-
if (status.error) {
|
|
348
|
-
return 'failed';
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
if (status.success) {
|
|
352
|
-
if (status.success.code === MotionMasterMessage.Status.CirculoEncoderConfiguration.Success.Code.DONE) {
|
|
353
|
-
return 'succeeded'
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
if (status.success.code === MotionMasterMessage.Status.CirculoEncoderConfiguration.Success.Code.UNSPECIFIED) {
|
|
357
|
-
return 'succeeded'
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
return 'running';
|
|
362
|
-
},
|
|
363
|
-
osCommand: (status: MotionMasterMessage.Status.IOsCommand) => {
|
|
364
|
-
if (status.error) {
|
|
365
|
-
return 'failed';
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
if (status.success) {
|
|
369
|
-
if (status.success.code === MotionMasterMessage.Status.OsCommand.Success.Code.DONE) {
|
|
370
|
-
return 'succeeded';
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
if (status.success.code === MotionMasterMessage.Status.OsCommand.Success.Code.UNSPECIFIED) {
|
|
374
|
-
return 'succeeded';
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
return 'running';
|
|
379
|
-
},
|
|
380
|
-
};
|
package/src/lib/types.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { motionmaster } from "./motion-master.proto";
|
|
2
|
-
|
|
3
|
-
export import MotionMasterMessage = motionmaster.MotionMasterMessage;
|
|
4
|
-
|
|
5
|
-
export type StatusKey = keyof MotionMasterMessage.IStatus;
|
|
6
|
-
|
|
7
|
-
export type RequestStatus =
|
|
8
|
-
| 'succeeded'
|
|
9
|
-
| 'failed'
|
|
10
|
-
| 'running';
|
|
11
|
-
|
|
12
|
-
export class RequestError extends Error { }
|
|
13
|
-
|
|
14
|
-
export type ParameterAddress = [number, number]; // index, subindex
|
|
15
|
-
export type ParameterAddressValue = [number, number, number, ParameterTypeValueKey?]; // index, subindex, value, typeValue
|
|
16
|
-
export type ParameterTypeValue = Omit<MotionMasterMessage.Request.SetDeviceParameterValues.IParameterValue, 'index' | 'subindex'>;
|
|
17
|
-
export type ParameterTypeValueKey = keyof ParameterTypeValue;
|
|
18
|
-
export type ParameterValueType = number | string | Uint8Array;
|
|
19
|
-
|
|
20
|
-
export type DeviceRefObj = {
|
|
21
|
-
deviceAddress?: (number | null); // alredy defined in proto request messages
|
|
22
|
-
deviceSerialNumber?: (string | null);
|
|
23
|
-
devicePosition?: (number | null);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type ParameterInfoAndValue = MotionMasterMessage.Status.DeviceParameterInfo.IParameter
|
|
27
|
-
& MotionMasterMessage.Status.DeviceParameterValues.IParameterValue;
|
|
28
|
-
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
-
export import EthercatNetworkState = MotionMasterMessage.Request.SetEthercatNetworkState.State;
|
|
31
|
-
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
|
-
export import ControllerType = MotionMasterMessage.Request.EnableMotionController.ControllerType;
|
|
34
|
-
|
|
35
|
-
export type ClientStatusProps = { request: RequestStatus, messageId?: string };
|
|
36
|
-
|
|
37
|
-
export type SystemVersionStatus = MotionMasterMessage.Status.ISystemVersion & ClientStatusProps;
|
|
38
|
-
export type SystemLogStatus = MotionMasterMessage.Status.ISystemLog & ClientStatusProps;
|
|
39
|
-
export type DeviceInfoStatus = MotionMasterMessage.Status.IDeviceInfo & ClientStatusProps;
|
|
40
|
-
export type DeviceParameterInfoStatus = MotionMasterMessage.Status.IDeviceParameterInfo & ClientStatusProps;
|
|
41
|
-
export type DeviceParameterValuesStatus = MotionMasterMessage.Status.IDeviceParameterValues & ClientStatusProps;
|
|
42
|
-
export type DeviceFileStatus = MotionMasterMessage.Status.IDeviceFile & ClientStatusProps;
|
|
43
|
-
export type DeviceFileListStatus = MotionMasterMessage.Status.IDeviceFileList & ClientStatusProps;
|
|
44
|
-
export type DeviceStopStatus = MotionMasterMessage.Status.IDeviceStop & ClientStatusProps;
|
|
45
|
-
export type DeviceFaultResetStatus = MotionMasterMessage.Status.IDeviceFaultReset & ClientStatusProps;
|
|
46
|
-
export type EthercatNetworkStateStatus = MotionMasterMessage.Status.IEthercatNetworkState & ClientStatusProps;
|
|
47
|
-
export type CoggingTorqueRecordingStatus = MotionMasterMessage.Status.ICoggingTorqueRecording & ClientStatusProps;
|
|
48
|
-
export type DeviceLogStatus = MotionMasterMessage.Status.IDeviceLog & ClientStatusProps;
|
|
49
|
-
export type MonitoringParameterValuesStatus = MotionMasterMessage.Status.IMonitoringParameterValues & ClientStatusProps;
|
|
50
|
-
export type CoggingTorqueDataStatus = MotionMasterMessage.Status.ICoggingTorqueData & ClientStatusProps;
|
|
51
|
-
export type OffsetDetectionStatus = MotionMasterMessage.Status.IOffsetDetection & ClientStatusProps;
|
|
52
|
-
export type SystemIdentificationStatus = MotionMasterMessage.Status.ISystemIdentification & ClientStatusProps;
|
|
53
|
-
export type CirculoEncoderMagnetDistanceStatus = MotionMasterMessage.Status.ICirculoEncoderMagnetDistance & ClientStatusProps;
|
|
54
|
-
export type DeviceFirmwareInstallationStatus = MotionMasterMessage.Status.IDeviceFirmwareInstallation & ClientStatusProps;
|
|
55
|
-
export type ComputeAutoTuningGainsStatus = MotionMasterMessage.Status.IAutoTuning & ClientStatusProps;
|
|
56
|
-
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
58
|
-
export import ValueType = MotionMasterMessage.Status.DeviceParameterInfo.Parameter.ValueType;
|
package/src/lib/urls.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const firmwarePackageBaseUrl = 'https://synapticon.s3.amazonaws.com/somanet-software/releases/';
|
|
2
|
-
export const listFirmwarePackagesUrl = 'https://pc27e3jixd.execute-api.us-east-1.amazonaws.com/default/listFirmwarePackages';
|
|
3
|
-
|
|
4
|
-
export function getFirmwarePackageUrl(filename: string) {
|
|
5
|
-
return firmwarePackageBaseUrl + filename;
|
|
6
|
-
}
|