@wandelbots/wandelbots-js-react-components 1.24.0 → 1.24.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "1.24.0",
3
+ "version": "1.24.1",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -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 === "active") store.activate()
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
- const {
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"