@wandelbots/wandelbots-js-react-components 1.24.0 → 1.24.2
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/dist/components/jogging/JoggingCartesianAxisControl.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts +2 -0
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +4 -2
- package/src/components/jogging/JoggingPanel.tsx +2 -2
- package/src/components/jogging/JoggingStore.ts +14 -20
package/package.json
CHANGED
|
@@ -39,11 +39,15 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
39
39
|
const valueContainerRef = useRef<HTMLParagraphElement>(null)
|
|
40
40
|
|
|
41
41
|
function onPointerDownMinus(ev: React.PointerEvent) {
|
|
42
|
+
if (disabled) return
|
|
43
|
+
|
|
42
44
|
// Stop right click from triggering jog
|
|
43
45
|
if (ev.button === 0) startJogging("-")
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
function onPointerDownPlus(ev: React.PointerEvent) {
|
|
49
|
+
if (disabled) return
|
|
50
|
+
|
|
47
51
|
if (ev.button === 0) startJogging("+")
|
|
48
52
|
}
|
|
49
53
|
|
|
@@ -62,7 +66,6 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
62
66
|
onPointerDown={onPointerDownMinus}
|
|
63
67
|
onPointerUp={stopJogging}
|
|
64
68
|
onPointerOut={stopJogging}
|
|
65
|
-
disabled={disabled}
|
|
66
69
|
size="large"
|
|
67
70
|
sx={{
|
|
68
71
|
width: "55px",
|
|
@@ -118,7 +121,6 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
118
121
|
onPointerDown={onPointerDownPlus}
|
|
119
122
|
onPointerUp={stopJogging}
|
|
120
123
|
onPointerOut={stopJogging}
|
|
121
|
-
disabled={disabled}
|
|
122
124
|
size="large"
|
|
123
125
|
sx={{
|
|
124
126
|
width: "55px",
|
|
@@ -128,13 +128,13 @@ const JoggingPanelInner = observer(
|
|
|
128
128
|
// Update jogging mode on jogger based on user selections
|
|
129
129
|
useReaction(
|
|
130
130
|
() => [
|
|
131
|
-
store.currentTab,
|
|
131
|
+
store.currentTab.id,
|
|
132
132
|
store.selectedTcpId,
|
|
133
133
|
store.activeCoordSystemId,
|
|
134
134
|
store.activeDiscreteIncrement,
|
|
135
135
|
],
|
|
136
136
|
() => {
|
|
137
|
-
if (store.activationState
|
|
137
|
+
if (store.activationState !== "inactive") store.activate()
|
|
138
138
|
},
|
|
139
139
|
)
|
|
140
140
|
|
|
@@ -49,6 +49,9 @@ export class JoggingStore {
|
|
|
49
49
|
*/
|
|
50
50
|
activationError: unknown | null = null
|
|
51
51
|
|
|
52
|
+
/** To avoid activation race conditions */
|
|
53
|
+
activationCounter: number = 0
|
|
54
|
+
|
|
52
55
|
/** Locks to prevent UI interactions during certain operations */
|
|
53
56
|
locks = new Set<string>()
|
|
54
57
|
|
|
@@ -195,16 +198,7 @@ export class JoggingStore {
|
|
|
195
198
|
|
|
196
199
|
/** Activate the jogger with current settings */
|
|
197
200
|
async activate(opts: { manual?: boolean } = {}) {
|
|
198
|
-
|
|
199
|
-
currentTab,
|
|
200
|
-
selectedTcpId,
|
|
201
|
-
activeCoordSystemId,
|
|
202
|
-
activeDiscreteIncrement,
|
|
203
|
-
jogger,
|
|
204
|
-
} = this
|
|
205
|
-
|
|
206
|
-
if (this.activationState === "loading") return
|
|
207
|
-
|
|
201
|
+
console.log("activate!!")
|
|
208
202
|
if (this.manualActivationRequired && !opts.manual) return
|
|
209
203
|
|
|
210
204
|
runInAction(() => {
|
|
@@ -224,25 +218,25 @@ export class JoggingStore {
|
|
|
224
218
|
console.error(err)
|
|
225
219
|
}
|
|
226
220
|
|
|
227
|
-
if (currentTab.id === "cartesian") {
|
|
221
|
+
if (this.currentTab.id === "cartesian") {
|
|
228
222
|
const cartesianJoggingOpts = {
|
|
229
|
-
tcpId: selectedTcpId,
|
|
230
|
-
coordSystemId: activeCoordSystemId,
|
|
223
|
+
tcpId: this.selectedTcpId,
|
|
224
|
+
coordSystemId: this.activeCoordSystemId,
|
|
231
225
|
}
|
|
232
226
|
|
|
233
|
-
if (activeDiscreteIncrement) {
|
|
234
|
-
jogger.setJoggingMode("increment", cartesianJoggingOpts)
|
|
227
|
+
if (this.activeDiscreteIncrement) {
|
|
228
|
+
this.jogger.setJoggingMode("increment", cartesianJoggingOpts)
|
|
235
229
|
} else {
|
|
236
|
-
jogger.setJoggingMode("cartesian", cartesianJoggingOpts)
|
|
230
|
+
this.jogger.setJoggingMode("cartesian", cartesianJoggingOpts)
|
|
237
231
|
}
|
|
238
232
|
} else {
|
|
239
|
-
jogger.setJoggingMode("joint")
|
|
233
|
+
this.jogger.setJoggingMode("joint")
|
|
240
234
|
}
|
|
241
235
|
|
|
242
|
-
if (jogger.activeWebsocket) {
|
|
236
|
+
if (this.jogger.activeWebsocket) {
|
|
243
237
|
try {
|
|
244
|
-
jogger.stop()
|
|
245
|
-
await jogger.activeWebsocket.nextMessage()
|
|
238
|
+
this.jogger.stop()
|
|
239
|
+
await this.jogger.activeWebsocket.nextMessage()
|
|
246
240
|
} catch (err) {
|
|
247
241
|
runInAction(() => {
|
|
248
242
|
this.activationState = "inactive"
|