motion-master-client 0.0.57 → 0.0.58

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.
Files changed (132) hide show
  1. package/README.md +138 -123
  2. package/package.json +21 -6
  3. package/src/{index.ts → index.d.ts} +26 -26
  4. package/src/index.js +30 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/cia402.d.ts +182 -0
  7. package/src/lib/cia402.js +392 -0
  8. package/src/lib/cia402.js.map +1 -0
  9. package/src/lib/config-file.d.ts +13 -0
  10. package/src/lib/config-file.js +50 -0
  11. package/src/lib/config-file.js.map +1 -0
  12. package/src/lib/device-log-line.d.ts +5 -0
  13. package/src/lib/device-log-line.js +3 -0
  14. package/src/lib/device-log-line.js.map +1 -0
  15. package/src/lib/device-parameter.d.ts +56 -0
  16. package/src/lib/device-parameter.js +39 -0
  17. package/src/lib/device-parameter.js.map +1 -0
  18. package/src/lib/device.d.ts +9 -0
  19. package/src/lib/device.js +3 -0
  20. package/src/lib/device.js.map +1 -0
  21. package/src/lib/hardware-description.d.ts +41 -0
  22. package/src/lib/hardware-description.js +94 -0
  23. package/src/lib/hardware-description.js.map +1 -0
  24. package/src/lib/logger.d.ts +1 -0
  25. package/src/lib/logger.js +8 -0
  26. package/src/lib/logger.js.map +1 -0
  27. package/src/lib/monitoring-config.d.ts +6 -0
  28. package/src/lib/monitoring-config.js +3 -0
  29. package/src/lib/monitoring-config.js.map +1 -0
  30. package/src/lib/{monitoring-entry.ts → monitoring-entry.d.ts} +9 -10
  31. package/src/lib/monitoring-entry.js +3 -0
  32. package/src/lib/monitoring-entry.js.map +1 -0
  33. package/src/lib/motion-master-client.d.ts +58 -0
  34. package/src/lib/motion-master-client.js +180 -0
  35. package/src/lib/motion-master-client.js.map +1 -0
  36. package/src/lib/motion-master-pub-sub-client.d.ts +17 -0
  37. package/src/lib/motion-master-pub-sub-client.js +73 -0
  38. package/src/lib/motion-master-pub-sub-client.js.map +1 -0
  39. package/src/lib/motion-master-pub-sub-socket.d.ts +42 -0
  40. package/src/lib/motion-master-pub-sub-socket.js +3 -0
  41. package/src/lib/motion-master-pub-sub-socket.js.map +1 -0
  42. package/src/lib/motion-master-pub-sub-web-socket.d.ts +18 -0
  43. package/src/lib/motion-master-pub-sub-web-socket.js +66 -0
  44. package/src/lib/motion-master-pub-sub-web-socket.js.map +1 -0
  45. package/src/lib/motion-master-pub-sub-worker-socket.d.ts +18 -0
  46. package/src/lib/motion-master-pub-sub-worker-socket.js +48 -0
  47. package/src/lib/motion-master-pub-sub-worker-socket.js.map +1 -0
  48. package/src/lib/motion-master-req-res-client.d.ts +948 -0
  49. package/src/lib/motion-master-req-res-client.js +1739 -0
  50. package/src/lib/motion-master-req-res-client.js.map +1 -0
  51. package/src/lib/motion-master-req-res-socket.d.ts +60 -0
  52. package/src/lib/motion-master-req-res-socket.js +3 -0
  53. package/src/lib/motion-master-req-res-socket.js.map +1 -0
  54. package/src/lib/motion-master-req-res-web-socket.d.ts +28 -0
  55. package/src/lib/motion-master-req-res-web-socket.js +98 -0
  56. package/src/lib/motion-master-req-res-web-socket.js.map +1 -0
  57. package/src/lib/motion-master-req-res-worker-socket.d.ts +24 -0
  58. package/src/lib/motion-master-req-res-worker-socket.js +72 -0
  59. package/src/lib/motion-master-req-res-worker-socket.js.map +1 -0
  60. package/src/lib/motion-master.proto.d.ts +5183 -5183
  61. package/src/lib/motion-master.proto.js +53218 -53218
  62. package/src/lib/operators.d.ts +20 -0
  63. package/src/lib/operators.js +84 -0
  64. package/src/lib/operators.js.map +1 -0
  65. package/src/lib/options.d.ts +10 -0
  66. package/src/lib/options.js +14 -0
  67. package/src/lib/options.js.map +1 -0
  68. package/src/lib/parameter.d.ts +80 -0
  69. package/src/lib/parameter.js +128 -0
  70. package/src/lib/parameter.js.map +1 -0
  71. package/src/lib/product-id-range.d.ts +7 -0
  72. package/src/lib/product-id-range.js +12 -0
  73. package/src/lib/product-id-range.js.map +1 -0
  74. package/src/lib/request-status-resolver.d.ts +4 -0
  75. package/src/lib/request-status-resolver.js +345 -0
  76. package/src/lib/request-status-resolver.js.map +1 -0
  77. package/src/lib/system-log-line.d.ts +9 -0
  78. package/src/lib/system-log-line.js +3 -0
  79. package/src/lib/system-log-line.js.map +1 -0
  80. package/src/lib/{types.ts → types.d.ts} +209 -141
  81. package/src/lib/types.js +29 -0
  82. package/src/lib/types.js.map +1 -0
  83. package/src/lib/urls.d.ts +3 -0
  84. package/src/lib/urls.js +10 -0
  85. package/src/lib/urls.js.map +1 -0
  86. package/src/lib/util.d.ts +43 -0
  87. package/src/lib/util.js +341 -0
  88. package/src/lib/util.js.map +1 -0
  89. package/src/lib/web-socket-connection-close-codes.d.ts +8 -0
  90. package/src/lib/web-socket-connection-close-codes.js +89 -0
  91. package/src/lib/web-socket-connection-close-codes.js.map +1 -0
  92. package/.babelrc +0 -3
  93. package/.eslintrc.json +0 -18
  94. package/jest.config.ts +0 -16
  95. package/motion-master.proto +0 -1861
  96. package/project.json +0 -45
  97. package/src/lib/cia402.spec.ts +0 -77
  98. package/src/lib/cia402.ts +0 -414
  99. package/src/lib/config-file.spec.ts +0 -114
  100. package/src/lib/config-file.ts +0 -63
  101. package/src/lib/device-log-line.ts +0 -5
  102. package/src/lib/device-parameter.spec.ts +0 -85
  103. package/src/lib/device-parameter.ts +0 -79
  104. package/src/lib/device.ts +0 -10
  105. package/src/lib/hardware-description.spec.ts +0 -253
  106. package/src/lib/hardware-description.ts +0 -129
  107. package/src/lib/logger.ts +0 -5
  108. package/src/lib/monitoring-config.ts +0 -6
  109. package/src/lib/motion-master-client.ts +0 -266
  110. package/src/lib/motion-master-pub-sub-client.ts +0 -100
  111. package/src/lib/motion-master-pub-sub-socket.ts +0 -46
  112. package/src/lib/motion-master-pub-sub-web-socket.ts +0 -77
  113. package/src/lib/motion-master-pub-sub-worker-socket.ts +0 -57
  114. package/src/lib/motion-master-req-res-client.spec.ts +0 -740
  115. package/src/lib/motion-master-req-res-client.ts +0 -2211
  116. package/src/lib/motion-master-req-res-socket.ts +0 -68
  117. package/src/lib/motion-master-req-res-web-socket.ts +0 -123
  118. package/src/lib/motion-master-req-res-worker-socket.ts +0 -89
  119. package/src/lib/operators.ts +0 -108
  120. package/src/lib/options.ts +0 -12
  121. package/src/lib/parameter.spec.ts +0 -160
  122. package/src/lib/parameter.ts +0 -188
  123. package/src/lib/product-id-range.ts +0 -8
  124. package/src/lib/request-status-resolver.ts +0 -403
  125. package/src/lib/system-log-line.ts +0 -9
  126. package/src/lib/urls.ts +0 -6
  127. package/src/lib/util.ts +0 -332
  128. package/src/lib/web-socket-connection-close-codes.ts +0 -85
  129. package/tsconfig.json +0 -23
  130. package/tsconfig.lib.json +0 -10
  131. package/tsconfig.spec.json +0 -20
  132. package/typedoc.json +0 -10
package/README.md CHANGED
@@ -1,123 +1,138 @@
1
- # Motion Master Client
2
-
3
- Motion Master Client is a library and CLI program written in [TypeScript](https://www.typescriptlang.org). It is used for communicating with Motion Master process over [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) connections by exchanging [Protocol Buffers](https://developers.google.com/protocol-buffers) serialized messages.
4
-
5
- ## Installation
6
-
7
- ```sh
8
- npm install motion-master-client
9
- ```
10
-
11
- ## Usage
12
-
13
- ```ts
14
- const reqResSocket = new MotionMasterReqResWebSocket();
15
- const pubSubSocket = new MotionMasterPubSubWebSocket();
16
-
17
- const client = new MotionMasterClient(reqResSocket, pubSubSocket);
18
-
19
- const clientId = v4();
20
- reqResSocket.open(`ws://oblac-drives-7dc95497.local:63524?clientId=${clientId}`);
21
- pubSubSocket.open(`ws://oblac-drives-7dc95497.local:63525?clientId=${clientId}`);
22
-
23
- client.request.getDeviceInfo().subscribe(console.log);
24
- ```
25
-
26
- ### Class Diagrams
27
-
28
- ```mermaid
29
- ---
30
- title: Client & socket classes
31
- ---
32
- classDiagram
33
- class MotionMasterClient {
34
- +MotionMasterReqResClient request
35
- +MotionMasterPubSubClient monitor
36
- +startMonitoring()
37
- +stopMonitoring()
38
- }
39
-
40
- class MotionMasterReqResClient {
41
- +MotionMasterReqResSocket socket
42
- note "Has all the request methods\ncorresponding to the proto file."
43
- }
44
-
45
- class MotionMasterReqResSocket
46
- <<interface>> MotionMasterReqResSocket
47
- MotionMasterReqResSocket: +BehaviorSubject~boolean~ opened\$
48
- MotionMasterReqResSocket: +BehaviorSubject~boolean~ alive\$
49
- MotionMasterReqResSocket: +Observable~MotionMasterMessage~ message\$
50
- MotionMasterReqResSocket: +open(string url, number pingSystemInterval?, number systemAliveTimeout?)
51
- MotionMasterReqResSocket: +close()
52
- MotionMasterReqResSocket: +send(MotionMasterMessage message)
53
-
54
- class MotionMasterReqResWebSocket {
55
- note "Keeps the connection alive by\nsending the ping system messages\nin regular intervals."
56
- }
57
-
58
- class MotionMasterReqResWorkerSocket {
59
- +Worker worker
60
- note "Passes messages between\nthe UI and worker thread."
61
- }
62
-
63
- class MotionMasterPubSubClient {
64
- +MotionMasterPubSubSocket socket
65
- +Subject<[string, MotionMasterMessage[]]> data\$
66
- +Observable~MotionMasterMessage~ notification\$
67
- +Observable~MotionMasterMessage~ systemEvent\$
68
- +Observable~MotionMasterMessage~ deviceEvent\$
69
- +subscribe(MonitoringConfig config)
70
- +unsubscribe(string messageId)
71
- +unsubscribeAll()
72
- }
73
-
74
- class MotionMasterPubSubSocket
75
- <<interface>> MotionMasterPubSubSocket
76
- MotionMasterPubSubSocket: +BehaviorSubject~boolean~ opened\$
77
- MotionMasterPubSubSocket: +Observable<[string, MotionMasterMessage]> data\$
78
- MotionMasterPubSubSocket: +open(string url)
79
- MotionMasterPubSubSocket: +close()
80
-
81
- class MotionMasterPubSubWebSocket {
82
- note "Deserializes incoming data into\na tuple of topic and message."
83
- }
84
-
85
- class MotionMasterPubSubWorkerSocket {
86
- +Worker worker
87
- note "Passes messages between\nthe UI and worker thread."
88
- }
89
-
90
- MotionMasterClient *-- MotionMasterReqResClient
91
- MotionMasterClient *-- MotionMasterPubSubClient
92
-
93
- MotionMasterReqResClient *-- MotionMasterReqResSocket
94
- MotionMasterReqResWebSocket <|-- MotionMasterReqResSocket
95
- MotionMasterReqResWorkerSocket <|-- MotionMasterReqResSocket
96
-
97
- MotionMasterPubSubClient *-- MotionMasterPubSubSocket
98
- MotionMasterPubSubWebSocket <|-- MotionMasterPubSubSocket
99
- MotionMasterPubSubWorkerSocket <|-- MotionMasterPubSubSocket
100
- ```
101
-
102
- ## Communication
103
-
104
- ### Protocols
105
-
106
- ### Message Exchange
107
-
108
- ## Running unit tests
109
-
110
- ## Features
111
-
112
- ## Goals
113
-
114
- Run `nx test motion-master-client` to execute the unit tests via [Jest](https://jestjs.io).
115
-
116
- https://github.com/protocolbuffers/protobuf/issues/2497#issuecomment-267422550
117
-
118
- explain status progress completed error
119
- request timeout
120
- ping mechanism
121
- reactive and async api
122
- two sockets
123
- matching request id (message id with response)
1
+ # Motion Master Client
2
+
3
+ Motion Master Client is a library and CLI program written in [TypeScript](https://www.typescriptlang.org). It is used for communicating with Motion Master process over [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) connections by exchanging [Protocol Buffers](https://developers.google.com/protocol-buffers) serialized messages.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install motion-master-client
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ const reqResSocket = new MotionMasterReqResWebSocket();
15
+ const pubSubSocket = new MotionMasterPubSubWebSocket();
16
+
17
+ const client = new MotionMasterClient(reqResSocket, pubSubSocket);
18
+
19
+ const clientId = v4();
20
+ reqResSocket.open(`ws://oblac-drives-7dc95497.local:63524?clientId=${clientId}`);
21
+ pubSubSocket.open(`ws://oblac-drives-7dc95497.local:63525?clientId=${clientId}`);
22
+
23
+ client.request.getDeviceInfo().subscribe(console.log);
24
+ ```
25
+
26
+ ## Class Diagrams
27
+
28
+ ```mermaid
29
+ ---
30
+ title: Client & socket classes
31
+ ---
32
+ classDiagram
33
+ class MotionMasterClient {
34
+ +MotionMasterReqResClient request
35
+ +MotionMasterPubSubClient monitor
36
+ +startMonitoring()
37
+ +stopMonitoring()
38
+ }
39
+
40
+ class MotionMasterReqResClient {
41
+ +MotionMasterReqResSocket socket
42
+ note "Has all the request methods\ncorresponding to the proto file."
43
+ }
44
+
45
+ class MotionMasterReqResSocket
46
+ <<interface>> MotionMasterReqResSocket
47
+ MotionMasterReqResSocket: +BehaviorSubject~boolean~ opened\$
48
+ MotionMasterReqResSocket: +BehaviorSubject~boolean~ alive\$
49
+ MotionMasterReqResSocket: +Observable~MotionMasterMessage~ message\$
50
+ MotionMasterReqResSocket: +open(string url, number pingSystemInterval?, number systemAliveTimeout?)
51
+ MotionMasterReqResSocket: +close()
52
+ MotionMasterReqResSocket: +send(MotionMasterMessage message)
53
+
54
+ class MotionMasterReqResWebSocket {
55
+ note "Keeps the connection alive by\nsending the ping system messages\nin regular intervals."
56
+ }
57
+
58
+ class MotionMasterReqResWorkerSocket {
59
+ +Worker worker
60
+ note "Passes messages between\nthe UI and worker thread."
61
+ }
62
+
63
+ class MotionMasterPubSubClient {
64
+ +MotionMasterPubSubSocket socket
65
+ +Subject<[string, MotionMasterMessage[]]> data\$
66
+ +Observable~MotionMasterMessage~ notification\$
67
+ +Observable~MotionMasterMessage~ systemEvent\$
68
+ +Observable~MotionMasterMessage~ deviceEvent\$
69
+ +subscribe(MonitoringConfig config)
70
+ +unsubscribe(string messageId)
71
+ +unsubscribeAll()
72
+ }
73
+
74
+ class MotionMasterPubSubSocket
75
+ <<interface>> MotionMasterPubSubSocket
76
+ MotionMasterPubSubSocket: +BehaviorSubject~boolean~ opened\$
77
+ MotionMasterPubSubSocket: +Observable<[string, MotionMasterMessage]> data\$
78
+ MotionMasterPubSubSocket: +open(string url)
79
+ MotionMasterPubSubSocket: +close()
80
+
81
+ class MotionMasterPubSubWebSocket {
82
+ note "Deserializes incoming data into\na tuple of topic and message."
83
+ }
84
+
85
+ class MotionMasterPubSubWorkerSocket {
86
+ +Worker worker
87
+ note "Passes messages between\nthe UI and worker thread."
88
+ }
89
+
90
+ MotionMasterClient *-- MotionMasterReqResClient
91
+ MotionMasterClient *-- MotionMasterPubSubClient
92
+
93
+ MotionMasterReqResClient *-- MotionMasterReqResSocket
94
+ MotionMasterReqResWebSocket <|-- MotionMasterReqResSocket
95
+ MotionMasterReqResWorkerSocket <|-- MotionMasterReqResSocket
96
+
97
+ MotionMasterPubSubClient *-- MotionMasterPubSubSocket
98
+ MotionMasterPubSubWebSocket <|-- MotionMasterPubSubSocket
99
+ MotionMasterPubSubWorkerSocket <|-- MotionMasterPubSubSocket
100
+ ```
101
+
102
+ ## Communication
103
+
104
+ ### Protocols
105
+
106
+ ### Message Exchange
107
+
108
+ ## Running unit tests
109
+
110
+ ## Features
111
+
112
+ ## Goals
113
+
114
+ Run `nx test motion-master-client` to execute the unit tests via [Jest](https://jestjs.io).
115
+
116
+ https://github.com/protocolbuffers/protobuf/issues/2497#issuecomment-267422550
117
+
118
+ explain status progress completed error
119
+ request timeout
120
+ ping mechanism
121
+ reactive and async api
122
+ two sockets
123
+ matching request id (message id with response)
124
+
125
+ ## Build & Publish
126
+
127
+ Update the `motion-master-client` version in `libs/motion-master-client/package.json`. Then, from the repository root, build the library by running:
128
+
129
+ ```sh
130
+ npm run build motion-master-client
131
+ ```
132
+
133
+ and publish the built library:
134
+
135
+ ```sh
136
+ cd dist/libs/motion-master-client
137
+ npm publish
138
+ ```
package/package.json CHANGED
@@ -1,6 +1,21 @@
1
- {
2
- "name": "motion-master-client",
3
- "version": "0.0.57",
4
- "type": "commonjs",
5
- "description": "A library and CLI program used for communicating with Motion Master."
6
- }
1
+ {
2
+ "name": "motion-master-client",
3
+ "version": "0.0.58",
4
+ "type": "commonjs",
5
+ "description": "A library and CLI program used for communicating with Motion Master.",
6
+ "dependencies": {
7
+ "fast-deep-equal": "^3.1.3",
8
+ "lodash": "^4.17.21",
9
+ "papaparse": "^5.4.1",
10
+ "protobufjs": "^7.2.3",
11
+ "roarr": "^7.15.0",
12
+ "rxjs": "^7.8.1",
13
+ "semver": "^7.5.1",
14
+ "uuid": "^9.0.0"
15
+ },
16
+ "peerDependencies": {
17
+ "tslib": "2.5.3"
18
+ },
19
+ "main": "./src/index.js",
20
+ "types": "./src/index.d.ts"
21
+ }
@@ -1,26 +1,26 @@
1
- export * from './lib/cia402';
2
- export * from './lib/config-file';
3
- export * from './lib/device-log-line';
4
- export * from './lib/device-parameter';
5
- export * from './lib/device';
6
- export * from './lib/hardware-description';
7
- export * from './lib/monitoring-config';
8
- export * from './lib/monitoring-entry';
9
- export * from './lib/motion-master-client';
10
- export * from './lib/motion-master-pub-sub-client';
11
- export * from './lib/motion-master-pub-sub-socket';
12
- export * from './lib/motion-master-pub-sub-web-socket';
13
- export * from './lib/motion-master-pub-sub-worker-socket';
14
- export * from './lib/motion-master-req-res-client';
15
- export * from './lib/motion-master-req-res-socket';
16
- export * from './lib/motion-master-req-res-web-socket';
17
- export * from './lib/motion-master-req-res-worker-socket';
18
- export * from './lib/operators';
19
- export * from './lib/options';
20
- export * from './lib/parameter';
21
- export * from './lib/request-status-resolver';
22
- export * from './lib/system-log-line';
23
- export * from './lib/types';
24
- export * from './lib/urls';
25
- export * from './lib/util';
26
- export * from './lib/web-socket-connection-close-codes';
1
+ export * from './lib/cia402';
2
+ export * from './lib/config-file';
3
+ export * from './lib/device-log-line';
4
+ export * from './lib/device-parameter';
5
+ export * from './lib/device';
6
+ export * from './lib/hardware-description';
7
+ export * from './lib/monitoring-config';
8
+ export * from './lib/monitoring-entry';
9
+ export * from './lib/motion-master-client';
10
+ export * from './lib/motion-master-pub-sub-client';
11
+ export * from './lib/motion-master-pub-sub-socket';
12
+ export * from './lib/motion-master-pub-sub-web-socket';
13
+ export * from './lib/motion-master-pub-sub-worker-socket';
14
+ export * from './lib/motion-master-req-res-client';
15
+ export * from './lib/motion-master-req-res-socket';
16
+ export * from './lib/motion-master-req-res-web-socket';
17
+ export * from './lib/motion-master-req-res-worker-socket';
18
+ export * from './lib/operators';
19
+ export * from './lib/options';
20
+ export * from './lib/parameter';
21
+ export * from './lib/request-status-resolver';
22
+ export * from './lib/system-log-line';
23
+ export * from './lib/types';
24
+ export * from './lib/urls';
25
+ export * from './lib/util';
26
+ export * from './lib/web-socket-connection-close-codes';
package/src/index.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/cia402"), exports);
5
+ tslib_1.__exportStar(require("./lib/config-file"), exports);
6
+ tslib_1.__exportStar(require("./lib/device-log-line"), exports);
7
+ tslib_1.__exportStar(require("./lib/device-parameter"), exports);
8
+ tslib_1.__exportStar(require("./lib/device"), exports);
9
+ tslib_1.__exportStar(require("./lib/hardware-description"), exports);
10
+ tslib_1.__exportStar(require("./lib/monitoring-config"), exports);
11
+ tslib_1.__exportStar(require("./lib/monitoring-entry"), exports);
12
+ tslib_1.__exportStar(require("./lib/motion-master-client"), exports);
13
+ tslib_1.__exportStar(require("./lib/motion-master-pub-sub-client"), exports);
14
+ tslib_1.__exportStar(require("./lib/motion-master-pub-sub-socket"), exports);
15
+ tslib_1.__exportStar(require("./lib/motion-master-pub-sub-web-socket"), exports);
16
+ tslib_1.__exportStar(require("./lib/motion-master-pub-sub-worker-socket"), exports);
17
+ tslib_1.__exportStar(require("./lib/motion-master-req-res-client"), exports);
18
+ tslib_1.__exportStar(require("./lib/motion-master-req-res-socket"), exports);
19
+ tslib_1.__exportStar(require("./lib/motion-master-req-res-web-socket"), exports);
20
+ tslib_1.__exportStar(require("./lib/motion-master-req-res-worker-socket"), exports);
21
+ tslib_1.__exportStar(require("./lib/operators"), exports);
22
+ tslib_1.__exportStar(require("./lib/options"), exports);
23
+ tslib_1.__exportStar(require("./lib/parameter"), exports);
24
+ tslib_1.__exportStar(require("./lib/request-status-resolver"), exports);
25
+ tslib_1.__exportStar(require("./lib/system-log-line"), exports);
26
+ tslib_1.__exportStar(require("./lib/types"), exports);
27
+ tslib_1.__exportStar(require("./lib/urls"), exports);
28
+ tslib_1.__exportStar(require("./lib/util"), exports);
29
+ tslib_1.__exportStar(require("./lib/web-socket-connection-close-codes"), exports);
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/motion-master-client/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,4DAAkC;AAClC,gEAAsC;AACtC,iEAAuC;AACvC,uDAA6B;AAC7B,qEAA2C;AAC3C,kEAAwC;AACxC,iEAAuC;AACvC,qEAA2C;AAC3C,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,0DAAgC;AAChC,wDAA8B;AAC9B,0DAAgC;AAChC,wEAA8C;AAC9C,gEAAsC;AACtC,sDAA4B;AAC5B,qDAA2B;AAC3B,qDAA2B;AAC3B,kFAAwD"}
@@ -0,0 +1,182 @@
1
+ export declare const statuswordBits: string[];
2
+ /**
3
+ * CIA402 refers to the CANopen application profile for drives and motion control.
4
+ * It defines various states that a CiA402-compliant device, such as a motor drive, can be in.
5
+ *
6
+ * @enum
7
+ */
8
+ export declare enum Cia402State {
9
+ /**
10
+ * Not ready to switch on (NRS).
11
+ *
12
+ * This is the initial state where the drive is not ready to be switched on.
13
+ * In this state, the drive is not powered or initialized.
14
+ */
15
+ NOT_READY_TO_SWITCH_ON = "NOT_READY_TO_SWITCH_ON",
16
+ /**
17
+ * Switch on disabled (SOD).
18
+ *
19
+ * In this state, the drive is powered and initialized but cannot be switched on.
20
+ * This state is usually used for safety purposes or when certain conditions need to be met before enabling the drive.
21
+ */
22
+ SWITCH_ON_DISABLED = "SWITCH_ON_DISABLED",
23
+ /**
24
+ * Ready to switch on (RTS).
25
+ *
26
+ * In this state, the drive is ready to be switched on.
27
+ * It has been powered and initialized, and it is waiting for the switch-on command.
28
+ */
29
+ READY_TO_SWITCH_ON = "READY_TO_SWITCH_ON",
30
+ /**
31
+ * Switched on (SWO).
32
+ *
33
+ * When the switch-on command is received, the drive enters this state.
34
+ * In this state, the drive is energized and ready to start motion.
35
+ */
36
+ SWITCHED_ON = "SWITCHED_ON",
37
+ /**
38
+ * Operation enabled (OP).
39
+ *
40
+ * This state indicates that the drive is enabled and ready to perform its intended operation.
41
+ * It can receive motion commands and execute them.
42
+ */
43
+ OPERATION_ENABLED = "OPERATION_ENABLED",
44
+ /**
45
+ * Quick stop active (QSA).
46
+ *
47
+ * This state is used to bring the drive to an immediate stop.
48
+ * It is typically triggered by an emergency stop or a quick stop command.
49
+ */
50
+ QUICK_STOP_ACTIVE = "QUICK_STOP_ACTIVE",
51
+ /**
52
+ * Fault reaction active (FRA).
53
+ *
54
+ * When a fault or error condition occurs, the drive enters this state.
55
+ * It indicates that the drive is responding to the fault by taking appropriate actions,
56
+ * such as shutting down or entering a safe state.
57
+ */
58
+ FAULT_REACTION_ACTIVE = "FAULT_REACTION_ACTIVE",
59
+ /**
60
+ * Fault (FLT).
61
+ *
62
+ * This state signifies that a fault condition has been detected and the drive is no longer operational.
63
+ * It requires manual intervention or troubleshooting to resolve the fault
64
+ * and bring the drive back to a functional state.
65
+ */
66
+ FAULT = "FAULT"
67
+ }
68
+ export declare const cia402StateMap: Map<number, Cia402State>;
69
+ export declare function getCia402State(value: number): Cia402State;
70
+ export declare function isInternalLimitActive(statusword: number): boolean;
71
+ export declare const controlwordBits: string[];
72
+ /**
73
+ * In the CiA402 standard for drives and motion control, the controlword is a key component
74
+ * used to command and control the operation of a CiA402-compliant device, such as a motor drive.
75
+ * The controlword is typically a 16-bit value,
76
+ * and it consists of several bits that represent different control commands.
77
+ *
78
+ * @enum
79
+ */
80
+ export declare enum ControlwordCommand {
81
+ SHUTDOWN = "SHUTDOWN",
82
+ SWITCH_ON = "SWITCH_ON",
83
+ SWITCH_ON_ENABLE_OPERATION = "SWITCH_ON_ENABLE_OPERATION",
84
+ DISABLE_VOLTAGE = "DISABLE_VOLTAGE",
85
+ /**
86
+ * Quick Stop.
87
+ *
88
+ * This command initiates a quick stop of the drive.
89
+ * When this bit is set to 1, the drive enters the "Quick stop active" state,
90
+ * causing the motor to decelerate and come to a stop as quickly as possible.
91
+ */
92
+ QUICK_STOP = "QUICK_STOP",
93
+ DISABLE_OPERATION = "DISABLE_OPERATION",
94
+ /**
95
+ * Enable Operation.
96
+ *
97
+ * This command enables the drive to perform its intended operation.
98
+ * When this bit is set to 1, the drive transitions from the "Ready to switch on" state to the "Operation enabled" state.
99
+ */
100
+ ENABLE_OPERATION = "ENABLE_OPERATION",
101
+ /**
102
+ * Fault Reset.
103
+ *
104
+ * This command resets a fault condition and clears any fault flags or errors that may have occurred.
105
+ * When this bit is set to 1, the drive attempts to recover from a fault and return to an operational state.
106
+ */
107
+ FAULT_RESET = "FAULT_RESET"
108
+ }
109
+ /**
110
+ * Return one of the controlword commands based its value.
111
+ *
112
+ * NOTE: DISABLE_OPERATION and ENABLE_OPERATION are never returned.
113
+ * Their values are the same as SWITCH_ON and SWITCH_ON_ENABLE_OPERATION.
114
+ * What controlword is commanded depends on the transition.
115
+ */
116
+ export declare function getCommandFromControlword(value: number): ControlwordCommand | undefined;
117
+ export declare const controlwordOptions: {
118
+ Shutdown: number;
119
+ 'Switch on': number;
120
+ 'Switch on + enable operation': number;
121
+ 'Disable voltage': number;
122
+ 'Quick stop': number;
123
+ 'Disable operation': number;
124
+ 'Enable operation': number;
125
+ 'Fault reset': number;
126
+ };
127
+ export declare const controlwordCommandOptions: ControlwordCommand[];
128
+ export declare const controlwordCommandBitmasks: {
129
+ SHUTDOWN: number[];
130
+ SWITCH_ON: number[];
131
+ SWITCH_ON_ENABLE_OPERATION: number[];
132
+ DISABLE_VOLTAGE: number[];
133
+ QUICK_STOP: number[];
134
+ DISABLE_OPERATION: number[];
135
+ ENABLE_OPERATION: number[];
136
+ FAULT_RESET: number[];
137
+ };
138
+ export declare function createControlwordCommand(value: number, command: ControlwordCommand): number;
139
+ /**
140
+ * CiA402 transitions.
141
+ *
142
+ * List of allowed transitions with controlword command.
143
+ *
144
+ * The following transitions are automatic:
145
+ * - 0: START -> NOT_READY_TO_SWITCH_ON
146
+ * - 1: NOT_READY_TO_SWITCH_ON -> SWITCH_ON_DISABLED
147
+ * - 13: ANY -> FAULT_REACTION_ACTIVE
148
+ * - 14: FAULT_REACTION_ACTIVE -> FAULT
149
+ */
150
+ export declare const cia402Transitions: {
151
+ from: Cia402State;
152
+ to: Cia402State;
153
+ transitions: number[];
154
+ command: ControlwordCommand;
155
+ }[];
156
+ export declare enum ModesOfOperation {
157
+ OPEN_LOOP_FIELD_MODE = -3,
158
+ DIAGNOSTICS_MODE = -2,
159
+ COGGING_COMPENSATION_RECORDING_MODE = -1,
160
+ NO_MODE_ASSIGNED = 0,
161
+ PROFILE_POSITION_MODE = 1,
162
+ PROFILE_VELOCITY_MODE = 3,
163
+ TORQUE_PROFILE_MODE = 4,
164
+ HOMING_MODE = 6,
165
+ CYCLIC_SYNC_POSITION_MODE = 8,
166
+ CYCLIC_SYNC_VELOCITY_MODE = 9,
167
+ CYCLIC_SYNC_TORQUE_MODE = 10
168
+ }
169
+ export declare const modesOfOperationOptions: {
170
+ 'Open loop field mode': ModesOfOperation;
171
+ 'Diagnostics mode': ModesOfOperation;
172
+ 'Cogging compensation recording mode': ModesOfOperation;
173
+ 'No mode assigned': ModesOfOperation;
174
+ 'Profile position mode': ModesOfOperation;
175
+ 'Profile velocity mode': ModesOfOperation;
176
+ 'Torque profile mode': ModesOfOperation;
177
+ 'Homing mode': ModesOfOperation;
178
+ 'Cyclic synchronous position mode': ModesOfOperation;
179
+ 'Cyclic synchronous velocity mode': ModesOfOperation;
180
+ 'Cyclic synchronous torque mode': ModesOfOperation;
181
+ };
182
+ export declare const supportedDriveModesBits: string[];