@wandelbots/wandelbots-js-react-components 5.1.0 → 5.1.1-pr.feat-RB-3475-data-testid.572.d441fdf
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/VelocitySlider.d.ts +2 -1
- package/dist/components/VelocitySlider.d.ts.map +1 -1
- package/dist/components/jogging/JoggingBlocked.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts.map +1 -1
- package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts +4 -2
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingOptions.d.ts +2 -1
- package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts +8 -12
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/jogging/JoggingVelocitySlider.d.ts +2 -1
- package/dist/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
- package/dist/core.cjs.js +1 -1
- package/dist/core.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{theming-B5Q8EK1c.cjs → theming-CKOaq0km.cjs} +40 -40
- package/dist/{theming-B5Q8EK1c.cjs.map → theming-CKOaq0km.cjs.map} +1 -1
- package/dist/{theming-Bt0cspr6.js → theming-DvnKQk1c.js} +1349 -1267
- package/dist/{theming-Bt0cspr6.js.map → theming-DvnKQk1c.js.map} +1 -1
- package/package.json +1 -1
- package/src/components/VelocitySlider.tsx +10 -3
- package/src/components/jogging/JoggingBlocked.tsx +2 -0
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +6 -1
- package/src/components/jogging/JoggingCartesianTab.tsx +21 -3
- package/src/components/jogging/JoggingJointLimitDetector.tsx +5 -2
- package/src/components/jogging/JoggingJointTab.tsx +28 -4
- package/src/components/jogging/JoggingOptions.tsx +6 -4
- package/src/components/jogging/JoggingPanel.tsx +6 -0
- package/src/components/jogging/JoggingStore.ts +22 -36
- package/src/components/jogging/JoggingVelocitySlider.tsx +20 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wandelbots/wandelbots-js-react-components",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1-pr.feat-RB-3475-data-testid.572.d441fdf",
|
|
4
4
|
"description": "React UI toolkit for building applications on top of the Wandelbots platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -10,9 +10,10 @@ type VelocitySliderProps = {
|
|
|
10
10
|
min: number
|
|
11
11
|
max: number
|
|
12
12
|
velocity: number
|
|
13
|
-
onVelocityChange: (newVelocity: number) => void
|
|
13
|
+
onVelocityChange: (newVelocity: number, useDegree: boolean) => void
|
|
14
14
|
disabled?: boolean
|
|
15
15
|
renderValue?: (value: number) => ReactNode
|
|
16
|
+
useDegree: boolean
|
|
16
17
|
store: JoggingStore
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -25,11 +26,17 @@ export const VelocitySlider = observer((props: VelocitySliderProps) => {
|
|
|
25
26
|
function onSliderChange(_event: Event, newVelocity: number | number[]) {
|
|
26
27
|
if (newVelocity === props.velocity || !isNumber(newVelocity)) return
|
|
27
28
|
|
|
28
|
-
props.onVelocityChange(newVelocity)
|
|
29
|
+
props.onVelocityChange(newVelocity, props.useDegree)
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
|
-
<Stack
|
|
33
|
+
<Stack
|
|
34
|
+
direction="row"
|
|
35
|
+
gap={2}
|
|
36
|
+
alignItems="center"
|
|
37
|
+
data-testid="velocity-slider"
|
|
38
|
+
aria-label="velocity-slider"
|
|
39
|
+
>
|
|
33
40
|
{store.showVelocityLegend && (
|
|
34
41
|
<Typography
|
|
35
42
|
sx={{
|
|
@@ -137,7 +137,12 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
return (
|
|
140
|
-
<Stack
|
|
140
|
+
<Stack
|
|
141
|
+
height="64px"
|
|
142
|
+
direction="row"
|
|
143
|
+
justifyContent="center"
|
|
144
|
+
{...rest}
|
|
145
|
+
>
|
|
141
146
|
<IconButton
|
|
142
147
|
disabled={disabled}
|
|
143
148
|
disableRipple
|
|
@@ -192,10 +192,24 @@ export const JoggingCartesianTab = observer(
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
return (
|
|
195
|
-
<Stack
|
|
195
|
+
<Stack
|
|
196
|
+
data-testid="jogging-cartesian-tab"
|
|
197
|
+
aria-label="jogging-cartesian-tab"
|
|
198
|
+
flexGrow={1}
|
|
199
|
+
gap={2}
|
|
200
|
+
sx={{ padding: "18px 24px" }}
|
|
201
|
+
>
|
|
196
202
|
<Stack gap={2}>
|
|
197
|
-
<JoggingOptions
|
|
198
|
-
|
|
203
|
+
<JoggingOptions
|
|
204
|
+
store={store}
|
|
205
|
+
useDegree={store.selectedCartesianMotionType === "rotate"}
|
|
206
|
+
/>
|
|
207
|
+
|
|
208
|
+
<JoggingVelocitySlider
|
|
209
|
+
store={store}
|
|
210
|
+
useDegree={store.selectedCartesianMotionType === "rotate"}
|
|
211
|
+
/>
|
|
212
|
+
|
|
199
213
|
<Divider />
|
|
200
214
|
</Stack>
|
|
201
215
|
|
|
@@ -234,6 +248,8 @@ export const JoggingCartesianTab = observer(
|
|
|
234
248
|
axisList.map((axis) => (
|
|
235
249
|
<JoggingCartesianAxisControl
|
|
236
250
|
key={axis.id}
|
|
251
|
+
data-testid={`jogging-cartesian-axis-control-${axis.id}`}
|
|
252
|
+
aria-label={`jogging-cartesian-axis-control-${axis.id}`}
|
|
237
253
|
colors={axis.colors}
|
|
238
254
|
disabled={store.isLocked}
|
|
239
255
|
activeJoggingDirection={
|
|
@@ -278,6 +294,8 @@ export const JoggingCartesianTab = observer(
|
|
|
278
294
|
axisList.map((axis) => (
|
|
279
295
|
<JoggingCartesianAxisControl
|
|
280
296
|
key={axis.id}
|
|
297
|
+
data-testid={`jogging-cartesian-axis-control-${axis.id}`}
|
|
298
|
+
aria-label={`jogging-cartesian-axis-control-${axis.id}`}
|
|
281
299
|
colors={axis.colors}
|
|
282
300
|
disabled={store.isLocked}
|
|
283
301
|
activeJoggingDirection={
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Typography } from "@mui/material"
|
|
2
|
+
import { observer } from "mobx-react-lite"
|
|
2
3
|
import isEqual from "lodash-es/isEqual"
|
|
3
4
|
import { useRef, useState } from "react"
|
|
4
5
|
import { useTranslation } from "react-i18next"
|
|
@@ -9,7 +10,7 @@ import type { JoggingStore } from "./JoggingStore"
|
|
|
9
10
|
* Monitors the active robot motion state and displays a message if
|
|
10
11
|
* any joint limits are reached.
|
|
11
12
|
*/
|
|
12
|
-
export const JoggingJointLimitDetector = ({
|
|
13
|
+
export const JoggingJointLimitDetector = observer(({
|
|
13
14
|
store,
|
|
14
15
|
}: {
|
|
15
16
|
store: JoggingStore
|
|
@@ -40,6 +41,8 @@ export const JoggingJointLimitDetector = ({
|
|
|
40
41
|
|
|
41
42
|
return (
|
|
42
43
|
<Typography
|
|
44
|
+
data-testid="jogging-joint-limit-detector"
|
|
45
|
+
aria-label="jogging-joint-limit-detector"
|
|
43
46
|
color="error"
|
|
44
47
|
sx={{
|
|
45
48
|
margin: "0.5rem 1rem",
|
|
@@ -53,4 +56,4 @@ export const JoggingJointLimitDetector = ({
|
|
|
53
56
|
})}
|
|
54
57
|
</Typography>
|
|
55
58
|
)
|
|
56
|
-
}
|
|
59
|
+
})
|
|
@@ -36,8 +36,20 @@ export const JoggingJointTab = observer(
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
|
-
<Stack
|
|
40
|
-
|
|
39
|
+
<Stack
|
|
40
|
+
data-testid="jogging-joint-tab"
|
|
41
|
+
aria-label="jogging-joint-tab"
|
|
42
|
+
flexGrow={1}
|
|
43
|
+
gap={2}
|
|
44
|
+
sx={{ padding: "18px 24px" }}
|
|
45
|
+
>
|
|
46
|
+
<JoggingVelocitySlider
|
|
47
|
+
store={store}
|
|
48
|
+
useDegree={
|
|
49
|
+
store.jointCategory === JointCategory.REVOLUTE
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
|
|
41
53
|
<Divider />
|
|
42
54
|
|
|
43
55
|
<Stack
|
|
@@ -45,7 +57,12 @@ export const JoggingJointTab = observer(
|
|
|
45
57
|
alignItems="stretch"
|
|
46
58
|
sx={{ flexGrow: "1" }}
|
|
47
59
|
>
|
|
48
|
-
<Stack
|
|
60
|
+
<Stack
|
|
61
|
+
data-testid="jogging-joint-value-controls-wrapper"
|
|
62
|
+
aria-label="jogging-joint-value-controls-wrapper"
|
|
63
|
+
alignItems="center"
|
|
64
|
+
gap="24px"
|
|
65
|
+
>
|
|
49
66
|
{store.jogger.motionStream.joints.map((joint) => {
|
|
50
67
|
const jointLimits =
|
|
51
68
|
store.motionGroupDescription.operation_limits.auto_limits
|
|
@@ -54,6 +71,8 @@ export const JoggingJointTab = observer(
|
|
|
54
71
|
return (
|
|
55
72
|
<Stack
|
|
56
73
|
key={`joint-${joint.index}`}
|
|
74
|
+
data-testid={`jogging-joint-tab-${joint.index}`}
|
|
75
|
+
aria-label={`jogging-joint-tab-${joint.index}`}
|
|
57
76
|
direction="row"
|
|
58
77
|
alignItems="center"
|
|
59
78
|
justifyContent={"center"}
|
|
@@ -73,10 +92,15 @@ export const JoggingJointTab = observer(
|
|
|
73
92
|
)}
|
|
74
93
|
|
|
75
94
|
<JoggingJointValueControl
|
|
95
|
+
data-testid={`jogging-joint-value-control-${joint.index}`}
|
|
96
|
+
aria-label={`jogging-joint-value-control-${joint.index}`}
|
|
76
97
|
disabled={store.isLocked}
|
|
77
98
|
lowerLimit={jointLimits?.lower_limit}
|
|
78
99
|
upperLimit={jointLimits?.upper_limit}
|
|
79
|
-
useDegree={
|
|
100
|
+
useDegree={
|
|
101
|
+
store.jointCategory === JointCategory.REVOLUTE
|
|
102
|
+
}
|
|
103
|
+
|
|
80
104
|
getValue={() => {
|
|
81
105
|
const value =
|
|
82
106
|
store.jogger.motionStream.rapidlyChangingMotionState
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type OrientationId,
|
|
11
11
|
} from "./JoggingStore"
|
|
12
12
|
|
|
13
|
-
export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
|
|
13
|
+
export const JoggingOptions = observer(({ store, useDegree }: { store: JoggingStore, useDegree: boolean }) => {
|
|
14
14
|
const { t } = useTranslation()
|
|
15
15
|
const componentId = useId()
|
|
16
16
|
const joggingOptions: React.ReactElement[] = []
|
|
@@ -118,9 +118,9 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
|
|
|
118
118
|
? null
|
|
119
119
|
: store.discreteIncrementOptions.map((inc) => (
|
|
120
120
|
<MenuItem key={inc.id} value={inc.id}>
|
|
121
|
-
{
|
|
122
|
-
? `${inc.
|
|
123
|
-
: `${inc.
|
|
121
|
+
{useDegree
|
|
122
|
+
? `${inc.degrees}°`
|
|
123
|
+
: `${inc.mm}mm`}
|
|
124
124
|
</MenuItem>
|
|
125
125
|
))}
|
|
126
126
|
</AdornedSelect>,
|
|
@@ -130,6 +130,8 @@ export const JoggingOptions = observer(({ store }: { store: JoggingStore }) => {
|
|
|
130
130
|
return (
|
|
131
131
|
<Box
|
|
132
132
|
component="div"
|
|
133
|
+
data-testid="jogging-options"
|
|
134
|
+
aria-label="jogging-options"
|
|
133
135
|
sx={{
|
|
134
136
|
display: "grid",
|
|
135
137
|
gap: "16px",
|
|
@@ -96,6 +96,8 @@ export const JoggingPanel = externalizeComponent(
|
|
|
96
96
|
|
|
97
97
|
return (
|
|
98
98
|
<Stack
|
|
99
|
+
data-testid="jogging-panel"
|
|
100
|
+
aria-label="jogging-panel"
|
|
99
101
|
sx={{
|
|
100
102
|
maxWidth: "460px",
|
|
101
103
|
minWidth: "320px",
|
|
@@ -147,6 +149,8 @@ const JoggingPanelInner = observer(
|
|
|
147
149
|
<Stack flexGrow={1} sx={{ overflow: "hidden" }}>
|
|
148
150
|
{/* Tab selection */}
|
|
149
151
|
<Tabs
|
|
152
|
+
data-testid="jogging-tabs"
|
|
153
|
+
aria-label="jogging-tabs"
|
|
150
154
|
value={store.tabIndex}
|
|
151
155
|
onChange={store.onTabChange}
|
|
152
156
|
variant="fullWidth"
|
|
@@ -167,6 +171,8 @@ const JoggingPanelInner = observer(
|
|
|
167
171
|
return (
|
|
168
172
|
<Tab
|
|
169
173
|
key={tab.id}
|
|
174
|
+
data-testid={`jogging-tab-${tab.id}`}
|
|
175
|
+
aria-label={`jogging-tab-${tab.id}`}
|
|
170
176
|
label={
|
|
171
177
|
store.showTabIcons ? (
|
|
172
178
|
<Stack direction="row" alignItems="center">
|
|
@@ -46,7 +46,7 @@ export enum JointCategory {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
type TabType = "cartesian" | "joint" | "debug";
|
|
49
|
-
|
|
49
|
+
export type CartesianMotionType = "translate" | "rotate"
|
|
50
50
|
|
|
51
51
|
export class JoggingStore {
|
|
52
52
|
selectedTabId: TabType = "cartesian";
|
|
@@ -96,7 +96,7 @@ export class JoggingStore {
|
|
|
96
96
|
* When on the cartesian tab, jogging can be either translating or rotating
|
|
97
97
|
* around the TCP.
|
|
98
98
|
*/
|
|
99
|
-
selectedCartesianMotionType:
|
|
99
|
+
selectedCartesianMotionType: CartesianMotionType = "translate"
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* If the jogger is busy running an incremental jog, this will be set
|
|
@@ -379,41 +379,26 @@ export class JoggingStore {
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
/** Selected velocity in mm/sec or deg/sec */
|
|
382
|
-
|
|
383
|
-
return
|
|
384
|
-
? this.
|
|
385
|
-
: this.
|
|
382
|
+
velocityInDisplayUnits(useDegree: boolean) {
|
|
383
|
+
return useDegree
|
|
384
|
+
? this.rotationVelocityDegPerSec
|
|
385
|
+
: this.translationVelocityMmPerSec
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
|
|
388
389
|
/** Minimum selectable velocity in mm/sec or deg/sec */
|
|
389
|
-
|
|
390
|
-
return
|
|
391
|
-
? this.
|
|
392
|
-
: this.
|
|
390
|
+
minVelocityInDisplayUnits(useDegree: boolean) {
|
|
391
|
+
return useDegree
|
|
392
|
+
? this.minRotationVelocityDegPerSec
|
|
393
|
+
: this.minTranslationVelocityMmPerSec
|
|
393
394
|
}
|
|
394
395
|
|
|
395
|
-
/** Maximum selectable velocity in mm/sec or deg/sec */
|
|
396
|
-
get maxVelocityInDisplayUnits() {
|
|
397
|
-
return this.currentMotionType === "translate"
|
|
398
|
-
? this.maxTranslationVelocityMmPerSec
|
|
399
|
-
: this.maxRotationVelocityDegPerSec
|
|
400
|
-
}
|
|
401
396
|
|
|
402
|
-
/**
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
if (
|
|
408
|
-
(
|
|
409
|
-
this.selectedTabId === "cartesian" &&
|
|
410
|
-
this.selectedCartesianMotionType === "translate"
|
|
411
|
-
) || this.jointCategory === JointCategory.PRISMATIC
|
|
412
|
-
) {
|
|
413
|
-
return "translate"
|
|
414
|
-
} else {
|
|
415
|
-
return "rotate"
|
|
416
|
-
}
|
|
397
|
+
/** Maximum selectable velocity in mm/sec or deg/sec */
|
|
398
|
+
maxVelocityInDisplayUnits(useDegree: boolean) {
|
|
399
|
+
return useDegree
|
|
400
|
+
? this.maxRotationVelocityDegPerSec
|
|
401
|
+
: this.maxTranslationVelocityMmPerSec
|
|
417
402
|
}
|
|
418
403
|
|
|
419
404
|
|
|
@@ -459,15 +444,16 @@ export class JoggingStore {
|
|
|
459
444
|
this.incrementJogInProgress = incrementJog
|
|
460
445
|
}
|
|
461
446
|
|
|
462
|
-
setVelocityFromSlider(velocity: number) {
|
|
463
|
-
if (
|
|
464
|
-
this.translationVelocityMmPerSec = velocity
|
|
465
|
-
} else {
|
|
447
|
+
setVelocityFromSlider(velocity: number,useDegree : boolean ) {
|
|
448
|
+
if (useDegree) {
|
|
466
449
|
this.rotationVelocityDegPerSec = velocity
|
|
450
|
+
} else {
|
|
451
|
+
this.translationVelocityMmPerSec = velocity
|
|
467
452
|
}
|
|
468
453
|
}
|
|
469
454
|
|
|
470
|
-
|
|
455
|
+
|
|
456
|
+
setSelectedCartesianMotionType(type: CartesianMotionType) {
|
|
471
457
|
this.selectedCartesianMotionType = type
|
|
472
458
|
}
|
|
473
459
|
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { observer
|
|
1
|
+
import { observer} from "mobx-react-lite"
|
|
2
2
|
import { useTranslation } from "react-i18next"
|
|
3
3
|
import { VelocitySlider, VelocitySliderLabel } from "../VelocitySlider"
|
|
4
4
|
import type { JoggingStore } from "./JoggingStore"
|
|
5
5
|
|
|
6
6
|
export const JoggingVelocitySlider = observer(
|
|
7
|
-
({
|
|
7
|
+
({
|
|
8
|
+
store,
|
|
9
|
+
useDegree,
|
|
10
|
+
}: {
|
|
11
|
+
store: JoggingStore
|
|
12
|
+
useDegree: boolean
|
|
13
|
+
}) => {
|
|
14
|
+
|
|
8
15
|
const { t } = useTranslation()
|
|
9
16
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return (value: number) =>
|
|
17
|
-
`ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb", { amount: value })}`
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
}))
|
|
17
|
+
function valueLabelFormat(value: number, useDegree: boolean): string {
|
|
18
|
+
return useDegree
|
|
19
|
+
? `ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb", { amount: value })}`
|
|
20
|
+
: `v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb", { amount: value })}`
|
|
21
|
+
}
|
|
22
|
+
|
|
21
23
|
|
|
22
24
|
return (
|
|
23
25
|
<VelocitySlider
|
|
24
26
|
store={store}
|
|
25
|
-
velocity={store.velocityInDisplayUnits}
|
|
26
|
-
min={store.minVelocityInDisplayUnits}
|
|
27
|
-
max={store.maxVelocityInDisplayUnits}
|
|
27
|
+
velocity={store.velocityInDisplayUnits(useDegree)}
|
|
28
|
+
min={store.minVelocityInDisplayUnits(useDegree)}
|
|
29
|
+
max={store.maxVelocityInDisplayUnits(useDegree)}
|
|
28
30
|
onVelocityChange={store.setVelocityFromSlider}
|
|
31
|
+
useDegree={useDegree}
|
|
29
32
|
disabled={store.isLocked}
|
|
30
33
|
renderValue={(value) => (
|
|
31
34
|
<VelocitySliderLabel
|
|
32
|
-
value={
|
|
35
|
+
value={valueLabelFormat(value, useDegree)}
|
|
33
36
|
sx={{
|
|
34
37
|
minWidth: "111px",
|
|
35
38
|
span: {
|