@wandelbots/wandelbots-js-react-components 2.54.5-pr.feat-upgrade-safety-bar-to-v2.405.34adcc0 → 2.54.5-pr.feat-jogging-blocked.406.6849777
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/JoggingBlocked.d.ts +7 -0
- package/dist/components/jogging/JoggingBlocked.d.ts.map +1 -0
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts +4 -0
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/safetyBar/SafetyBar.d.ts +3 -3
- package/dist/components/safetyBar/SafetyBar.d.ts.map +1 -1
- package/dist/index.cjs +38 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3267 -3209
- package/dist/index.js.map +1 -1
- package/dist/lib/JoggerConnection.d.ts +2 -1
- package/dist/lib/JoggerConnection.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/jogging/JoggingBlocked.tsx +37 -0
- package/src/components/jogging/JoggingPanel.tsx +3 -1
- package/src/components/jogging/JoggingStore.ts +22 -0
- package/src/components/safetyBar/SafetyBar.tsx +6 -3
- package/src/i18n/locales/de/translations.json +3 -0
- package/src/i18n/locales/en/translations.json +3 -0
- package/src/lib/JoggerConnection.ts +23 -6
|
@@ -32,6 +32,7 @@ export declare class JoggerConnection {
|
|
|
32
32
|
tcp: string;
|
|
33
33
|
orientation: JoggerOrientation;
|
|
34
34
|
onError?: (err: unknown) => void;
|
|
35
|
+
onBlocked?: () => void;
|
|
35
36
|
/**
|
|
36
37
|
* Initialize the jogging connection using jogging endpoint or trajectory endpoint depending on the selected mode.
|
|
37
38
|
*
|
|
@@ -93,7 +94,7 @@ export declare class JoggerConnection {
|
|
|
93
94
|
* axis, either rotating or translating relative to the TCP.
|
|
94
95
|
* Promise resolves only after the motion has completed.
|
|
95
96
|
*/
|
|
96
|
-
runIncrementalCartesianMotion({ currentTcpPose, currentJoints,
|
|
97
|
+
runIncrementalCartesianMotion({ currentTcpPose, currentJoints, velocityInRelevantUnits, axis, direction, motion, }: {
|
|
97
98
|
currentTcpPose: Pose;
|
|
98
99
|
currentJoints: Vector3Simple;
|
|
99
100
|
coordSystemId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JoggerConnection.d.ts","sourceRoot":"","sources":["../../src/lib/JoggerConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EAG1B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAGV,UAAU,EACV,IAAI,EAEL,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAEpD,MAAM,MAAM,uBAAuB,GAAG;IAEpC,IAAI,CAAC,EAAE,UAAU,CAAA;IAGjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAA;IAGhC,GAAG,CAAC,EAAE,MAAM,CAAA;IAMZ,WAAW,CAAC,EAAE,iBAAiB,CAAA;CAChC,CAAA;AAMD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,CAAA;AAGzD,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,MAAM,CAAA;AAEnD,qBAAa,gBAAgB;
|
|
1
|
+
{"version":3,"file":"JoggerConnection.d.ts","sourceRoot":"","sources":["../../src/lib/JoggerConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EAG1B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAGV,UAAU,EACV,IAAI,EAEL,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;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rB,SAAS,EAAE,GAAG,GAAG,GAAG,CAAA;QACpB,MAAM,EACF;YACE,IAAI,EAAE,QAAQ,CAAA;YACd,YAAY,EAAE,MAAM,CAAA;SACrB,GACD;YACE,IAAI,EAAE,WAAW,CAAA;YACjB,UAAU,EAAE,MAAM,CAAA;SACnB,CAAA;KACN;CAmRF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wandelbots/wandelbots-js-react-components",
|
|
3
|
-
"version": "2.54.5-pr.feat-
|
|
3
|
+
"version": "2.54.5-pr.feat-jogging-blocked.406.6849777",
|
|
4
4
|
"description": "React UI toolkit for building applications on top of the Wandelbots platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Alert, AlertTitle, Backdrop, Button, Stack } from "@mui/material"
|
|
2
|
+
import { observer } from "mobx-react-lite"
|
|
3
|
+
import { useTranslation } from "react-i18next"
|
|
4
|
+
import { type JoggingStore } from "./JoggingStore"
|
|
5
|
+
|
|
6
|
+
export const JoggingBlocked = observer(({ store }: { store: JoggingStore }) => {
|
|
7
|
+
const { t } = useTranslation()
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<Backdrop
|
|
11
|
+
open={true}
|
|
12
|
+
sx={{
|
|
13
|
+
position: "absolute",
|
|
14
|
+
zIndex: (theme) => theme.zIndex.drawer + 1,
|
|
15
|
+
color: "#fff",
|
|
16
|
+
background: "rgba(15, 15, 15, 0.78)",
|
|
17
|
+
justifyContent: "flex-start",
|
|
18
|
+
alignItems: "flex-start",
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
<Stack sx={{ m: 2, width: "100%" }}>
|
|
22
|
+
<Alert severity="error" sx={{ mb: 2 }}>
|
|
23
|
+
<AlertTitle>{t("Jogging.Blocked.ti")}</AlertTitle>
|
|
24
|
+
{t("Jogging.Blocked.lb")}
|
|
25
|
+
</Alert>
|
|
26
|
+
|
|
27
|
+
<Button
|
|
28
|
+
variant="contained"
|
|
29
|
+
color="error"
|
|
30
|
+
onClick={() => store.unblock()}
|
|
31
|
+
>
|
|
32
|
+
{t("Jogging.Blocked.Reenable.bt")}
|
|
33
|
+
</Button>
|
|
34
|
+
</Stack>
|
|
35
|
+
</Backdrop>
|
|
36
|
+
)
|
|
37
|
+
})
|
|
@@ -10,6 +10,7 @@ import { useTranslation } from "react-i18next"
|
|
|
10
10
|
import { externalizeComponent } from "../../externalizeComponent"
|
|
11
11
|
import { JoggerConnection } from "../../lib/JoggerConnection"
|
|
12
12
|
import { LoadingCover } from "../LoadingCover"
|
|
13
|
+
import { JoggingBlocked } from "./JoggingBlocked"
|
|
13
14
|
import { JoggingCartesianTab } from "./JoggingCartesianTab"
|
|
14
15
|
import { JoggingJointTab } from "./JoggingJointTab"
|
|
15
16
|
import { JoggingStore } from "./JoggingStore"
|
|
@@ -182,7 +183,6 @@ const JoggingPanelInner = observer(
|
|
|
182
183
|
)
|
|
183
184
|
})}
|
|
184
185
|
</Tabs>
|
|
185
|
-
|
|
186
186
|
{/* Current tab content */}
|
|
187
187
|
<Stack
|
|
188
188
|
flexGrow={1}
|
|
@@ -191,6 +191,8 @@ const JoggingPanelInner = observer(
|
|
|
191
191
|
>
|
|
192
192
|
{renderTabContent()}
|
|
193
193
|
</Stack>
|
|
194
|
+
{/* Overlay when jogging connection is blocked */}
|
|
195
|
+
{!store.blocked && <JoggingBlocked store={store} />}
|
|
194
196
|
</Stack>
|
|
195
197
|
)
|
|
196
198
|
},
|
|
@@ -59,6 +59,9 @@ export class JoggingStore {
|
|
|
59
59
|
/** Locks to prevent UI interactions during certain operations */
|
|
60
60
|
locks = new Set<string>()
|
|
61
61
|
|
|
62
|
+
/** Block jogging UI interactions when connection is taken by another jogger */
|
|
63
|
+
blocked: boolean = false
|
|
64
|
+
|
|
62
65
|
/**
|
|
63
66
|
* Id of selected coordinate system from among those defined on the API side
|
|
64
67
|
*/
|
|
@@ -183,13 +186,21 @@ export class JoggingStore {
|
|
|
183
186
|
this.selectedCoordSystemId = coordSystems[0]?.coordinate_system || "world"
|
|
184
187
|
this.selectedTcpId = tcps[0]?.id || ""
|
|
185
188
|
|
|
189
|
+
// Make all properties observable and actions auto-bound
|
|
186
190
|
makeAutoObservable(this, {}, { autoBind: true })
|
|
187
191
|
|
|
192
|
+
// Register blocked watching
|
|
193
|
+
this.jogger.onBlocked = () => {
|
|
194
|
+
this.block()
|
|
195
|
+
}
|
|
196
|
+
|
|
188
197
|
// Load user settings from local storage if available
|
|
189
198
|
this.loadFromLocalStorage()
|
|
190
199
|
|
|
191
200
|
// Automatically save user settings to local storage when save changes
|
|
192
201
|
this.disposers.push(autorun(() => this.saveToLocalStorage()))
|
|
202
|
+
|
|
203
|
+
// Assign joggingStore to window
|
|
193
204
|
;(window as any).joggingStore = this
|
|
194
205
|
}
|
|
195
206
|
|
|
@@ -438,6 +449,17 @@ export class JoggingStore {
|
|
|
438
449
|
this.locks.delete(id)
|
|
439
450
|
}
|
|
440
451
|
|
|
452
|
+
block() {
|
|
453
|
+
this.blocked = true
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
unblock() {
|
|
457
|
+
this.blocked = false
|
|
458
|
+
if (this.jogger.mode === "jogging") {
|
|
459
|
+
this.jogger.initializeJoggingWebsocket()
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
441
463
|
/** Lock the UI until the given async callback resolves */
|
|
442
464
|
async withMotionLock(fn: () => Promise<void>) {
|
|
443
465
|
const lockId = uniqueId()
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Divider, Stack, type PopoverOrigin } from "@mui/material"
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
RobotControllerStateOperationModeEnum,
|
|
4
|
+
RobotControllerStateSafetyStateEnum,
|
|
5
|
+
} from "@wandelbots/nova-js/v1"
|
|
3
6
|
import { observer } from "mobx-react-lite"
|
|
4
7
|
import { externalizeComponent } from "../../externalizeComponent"
|
|
5
8
|
import { ControllerTypeIndicator } from "./ControllerTypeIndicator"
|
|
@@ -9,8 +12,8 @@ import { SafetyStateIndicator } from "./SafetyStateIndicator"
|
|
|
9
12
|
export interface SafetyBarProps {
|
|
10
13
|
isVirtual: boolean
|
|
11
14
|
motionGroupId: string
|
|
12
|
-
operationMode:
|
|
13
|
-
safetyState:
|
|
15
|
+
operationMode: RobotControllerStateOperationModeEnum
|
|
16
|
+
safetyState: RobotControllerStateSafetyStateEnum
|
|
14
17
|
anchorOrigin?: PopoverOrigin
|
|
15
18
|
transformOrigin?: PopoverOrigin
|
|
16
19
|
compact?: boolean
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
"Jogging.Velocity.lb": "Geschwindigkeit",
|
|
5
5
|
"General.degree.variable": "{{amount}}°",
|
|
6
6
|
"General.mm.variable": "{{amount}} mm",
|
|
7
|
+
"Jogging.Blocked.ti": "Verbindung blockiert",
|
|
8
|
+
"Jogging.Blocked.lb": "Ein anderer Client kontrolliert das Jogging.",
|
|
9
|
+
"Jogging.Blocked.Reenable.bt": "Wiederherstellen",
|
|
7
10
|
"Jogging.Cartesian.MotionType.lb": "Bewegungstyp",
|
|
8
11
|
"Jogging.Cartesian.Translation.bt": "Translation",
|
|
9
12
|
"Jogging.Cartesian.Rotation.bt": "Rotation",
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
"Jogging.Velocity.lb": "Velocity",
|
|
5
5
|
"General.degree.variable": "{{amount}}°",
|
|
6
6
|
"General.mm.variable": "{{amount}} mm",
|
|
7
|
+
"Jogging.Blocked.ti": "Connection blocked",
|
|
8
|
+
"Jogging.Blocked.lb": "Another client is currently controlling the jogging.",
|
|
9
|
+
"Jogging.Blocked.Reenable.bt": "Restore Panel",
|
|
7
10
|
"Jogging.Cartesian.MotionType.lb": "Motion type",
|
|
8
11
|
"Jogging.Cartesian.Translation.bt": "Translation",
|
|
9
12
|
"Jogging.Cartesian.Rotation.bt": "Rotation",
|
|
@@ -66,6 +66,7 @@ export class JoggerConnection {
|
|
|
66
66
|
// coordinateSystem?: string
|
|
67
67
|
orientation: JoggerOrientation
|
|
68
68
|
onError?: (err: unknown) => void
|
|
69
|
+
onBlocked?: () => void
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
72
|
* Initialize the jogging connection using jogging endpoint or trajectory endpoint depending on the selected mode.
|
|
@@ -248,12 +249,18 @@ export class JoggerConnection {
|
|
|
248
249
|
return
|
|
249
250
|
}
|
|
250
251
|
|
|
251
|
-
if (
|
|
252
|
-
(data && "error" in data) ||
|
|
253
|
-
data?.result?.kind === "MOTION_ERROR"
|
|
254
|
-
) {
|
|
252
|
+
if (data?.result?.kind === "MOTION_ERROR") {
|
|
255
253
|
clearTimeout(connectionFailedTimeout)
|
|
256
|
-
if (
|
|
254
|
+
if (
|
|
255
|
+
this.onBlocked &&
|
|
256
|
+
data?.result?.message.includes(
|
|
257
|
+
`Movement request rejected. Another client is currently executing a 'Jogging' motion!`,
|
|
258
|
+
)
|
|
259
|
+
) {
|
|
260
|
+
this.joggingSocket?.dispose()
|
|
261
|
+
this.onBlocked()
|
|
262
|
+
return
|
|
263
|
+
} else if (this.onError) {
|
|
257
264
|
this.onError(ev.data)
|
|
258
265
|
} else {
|
|
259
266
|
reject(new Error(ev.data))
|
|
@@ -370,7 +377,7 @@ export class JoggerConnection {
|
|
|
370
377
|
async runIncrementalCartesianMotion({
|
|
371
378
|
currentTcpPose,
|
|
372
379
|
currentJoints,
|
|
373
|
-
coordSystemId,
|
|
380
|
+
// coordSystemId,
|
|
374
381
|
velocityInRelevantUnits,
|
|
375
382
|
axis,
|
|
376
383
|
direction,
|
|
@@ -625,6 +632,16 @@ export class JoggerConnection {
|
|
|
625
632
|
)
|
|
626
633
|
}
|
|
627
634
|
|
|
635
|
+
if (
|
|
636
|
+
this.onBlocked &&
|
|
637
|
+
data.result.message.includes(
|
|
638
|
+
`Movement request rejected. Another client is currently executing a 'Jogging' motion!`,
|
|
639
|
+
)
|
|
640
|
+
) {
|
|
641
|
+
this.onBlocked()
|
|
642
|
+
return
|
|
643
|
+
}
|
|
644
|
+
|
|
628
645
|
if (data.result.kind === "INITIALIZE_RECEIVED") {
|
|
629
646
|
messageInitializeMovementResponse(data.result)
|
|
630
647
|
} else if (data.result.kind === "START_RECEIVED") {
|