@wandelbots/wandelbots-js-react-components 5.4.1 → 5.4.2-pr.ci-pr-preview.586.f684aae
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/3d.cjs.js +1 -1
- package/dist/3d.d.ts +1 -1
- package/dist/3d.d.ts.map +1 -1
- package/dist/3d.es.js +1 -1
- package/dist/MotionGroupVisualizer-B-e22qXF.cjs +2 -0
- package/dist/MotionGroupVisualizer-B-e22qXF.cjs.map +1 -0
- package/dist/MotionGroupVisualizer-CIASsBC6.js +1433 -0
- package/dist/MotionGroupVisualizer-CIASsBC6.js.map +1 -0
- package/dist/Setup.d.ts +1 -1
- package/dist/Setup.d.ts.map +1 -1
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts +1 -1
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
- package/dist/components/3d-viewport/collider/ColliderCollection.d.ts.map +1 -1
- package/dist/components/AppHeader.d.ts +1 -1
- package/dist/components/AppHeader.d.ts.map +1 -1
- package/dist/components/ConsoleFilter.d.ts +1 -1
- package/dist/components/ConsoleFilter.d.ts.map +1 -1
- package/dist/components/CopyableText.d.ts.map +1 -1
- package/dist/components/CycleTimer/DefaultVariant.d.ts.map +1 -1
- package/dist/components/CycleTimer/SmallVariant.d.ts.map +1 -1
- package/dist/components/DataGrid.d.ts +1 -1
- package/dist/components/DataGrid.d.ts.map +1 -1
- package/dist/components/LoadingCover.d.ts.map +1 -1
- package/dist/components/LogPanel.d.ts +1 -1
- package/dist/components/LogPanel.d.ts.map +1 -1
- package/dist/components/LogViewer.d.ts +1 -1
- package/dist/components/LogViewer.d.ts.map +1 -1
- package/dist/components/ProgramControl.d.ts.map +1 -1
- package/dist/components/ProgramStateIndicator.d.ts.map +1 -1
- package/dist/components/RobotCard.d.ts.map +1 -1
- package/dist/components/RobotListItem.d.ts.map +1 -1
- package/dist/components/RobotSetupReadinessIndicator.d.ts.map +1 -1
- package/dist/components/SelectableFab.d.ts +1 -1
- package/dist/components/SelectableFab.d.ts.map +1 -1
- package/dist/components/TabBar.d.ts +1 -1
- package/dist/components/TabBar.d.ts.map +1 -1
- package/dist/components/ThemeSelect.d.ts +1 -1
- package/dist/components/ThemeSelect.d.ts.map +1 -1
- package/dist/components/Timer/TimerDefaultVariant.d.ts.map +1 -1
- package/dist/components/Timer/TimerSmallVariant.d.ts.map +1 -1
- package/dist/components/TransparentOverlay.d.ts +2 -2
- package/dist/components/TransparentOverlay.d.ts.map +1 -1
- package/dist/components/VelocitySlider.d.ts +1 -1
- package/dist/components/VelocitySlider.d.ts.map +1 -1
- package/dist/components/experimental/utils/AdornedSelect.d.ts +1 -1
- package/dist/components/experimental/utils/AdornedSelect.d.ts.map +1 -1
- package/dist/components/jogging/JoggingBlocked.d.ts +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/JoggingFreedriveTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts +1 -1
- package/dist/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts +2 -2
- package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointValueControl.d.ts.map +1 -1
- package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts +1 -1
- package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/components/jogging/JoggingStore.d.ts +1 -1
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/jogging/JoggingToggleButtonGroup.d.ts +1 -1
- package/dist/components/jogging/JoggingToggleButtonGroup.d.ts.map +1 -1
- package/dist/components/jogging/JoggingVelocitySlider.d.ts +1 -1
- package/dist/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
- package/dist/components/jogging/PoseCartesianValues.d.ts.map +1 -1
- package/dist/components/jogging/PoseJointValues.d.ts.map +1 -1
- package/dist/components/modal/NoMotionGroupModal.d.ts.map +1 -1
- package/dist/components/robots/DHLinearAxis.d.ts.map +1 -1
- package/dist/components/robots/DHRobot.d.ts.map +1 -1
- package/dist/components/robots/GenericRobot.d.ts +1 -1
- package/dist/components/robots/GenericRobot.d.ts.map +1 -1
- package/dist/components/robots/LinearAxisAnimator.d.ts +1 -1
- package/dist/components/robots/LinearAxisAnimator.d.ts.map +1 -1
- package/dist/components/robots/MotionGroupVisualizer.d.ts +2 -2
- package/dist/components/robots/MotionGroupVisualizer.d.ts.map +1 -1
- package/dist/components/robots/RobotAnimator.d.ts +1 -1
- package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
- package/dist/components/robots/SupportedLinearAxis.d.ts.map +1 -1
- package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
- package/dist/components/robots/robotModelLogic.d.ts.map +1 -1
- package/dist/components/safetyBar/ControllerTypeIndicator.d.ts +1 -1
- package/dist/components/safetyBar/ControllerTypeIndicator.d.ts.map +1 -1
- package/dist/components/safetyBar/IndicatorWithExplanation.d.ts +2 -1
- package/dist/components/safetyBar/IndicatorWithExplanation.d.ts.map +1 -1
- package/dist/components/safetyBar/OperationModeIndicator.d.ts +1 -1
- package/dist/components/safetyBar/OperationModeIndicator.d.ts.map +1 -1
- package/dist/components/safetyBar/SafetyBar.d.ts +1 -1
- package/dist/components/safetyBar/SafetyBar.d.ts.map +1 -1
- package/dist/components/safetyBar/SafetyStateIndicator.d.ts +1 -1
- package/dist/components/safetyBar/SafetyStateIndicator.d.ts.map +1 -1
- package/dist/components/utils/converters.d.ts +2 -2
- package/dist/components/utils/converters.d.ts.map +1 -1
- package/dist/components/utils/hooks.d.ts.map +1 -1
- package/dist/components/utils/interpolation.d.ts.map +1 -1
- package/dist/core.cjs.js +1 -1
- package/dist/core.es.js +2 -2
- package/dist/externalizeComponent.d.ts.map +1 -1
- package/dist/icons/DropdownArrowIcon.d.ts +1 -1
- package/dist/icons/DropdownArrowIcon.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +3 -3
- package/dist/interpolation-BIB6FC35.cjs +198 -0
- package/dist/interpolation-BIB6FC35.cjs.map +1 -0
- package/dist/interpolation-lSTX6ZXZ.js +14559 -0
- package/dist/interpolation-lSTX6ZXZ.js.map +1 -0
- package/dist/lib/JoggerConnection.d.ts +1 -1
- package/dist/lib/JoggerConnection.d.ts.map +1 -1
- package/dist/themes/createDarkTheme.d.ts +1 -1
- package/dist/themes/createDarkTheme.d.ts.map +1 -1
- package/dist/themes/createLightTheme.d.ts +1 -1
- package/dist/themes/createLightTheme.d.ts.map +1 -1
- package/dist/theming-D_pShDEg.js +32236 -0
- package/dist/theming-D_pShDEg.js.map +1 -0
- package/dist/theming-L5E8VSae.cjs +84 -0
- package/dist/theming-L5E8VSae.cjs.map +1 -0
- package/package.json +4 -3
- package/src/3d.ts +2 -2
- package/src/Setup.tsx +2 -6
- package/src/components/3d-viewport/PresetEnvironment.tsx +1 -0
- package/src/components/3d-viewport/SafetyZonesRenderer.tsx +43 -23
- package/src/components/3d-viewport/TrajectoryRenderer.tsx +1 -1
- package/src/components/3d-viewport/collider/ColliderCollection.tsx +3 -2
- package/src/components/AppHeader.tsx +9 -12
- package/src/components/ConsoleFilter.tsx +1 -1
- package/src/components/CopyableText.tsx +4 -1
- package/src/components/CycleTimer/DefaultVariant.tsx +8 -5
- package/src/components/CycleTimer/SmallVariant.tsx +3 -1
- package/src/components/DataGrid.tsx +4 -1
- package/src/components/LoadingCover.tsx +4 -1
- package/src/components/LogPanel.tsx +1 -1
- package/src/components/LogViewer.tsx +13 -17
- package/src/components/ProgramControl.tsx +7 -2
- package/src/components/ProgramStateIndicator.tsx +3 -2
- package/src/components/RobotCard.tsx +6 -1
- package/src/components/RobotListItem.tsx +4 -1
- package/src/components/RobotSetupReadinessIndicator.tsx +4 -2
- package/src/components/SelectableFab.tsx +2 -2
- package/src/components/TabBar.tsx +7 -3
- package/src/components/ThemeSelect.tsx +2 -1
- package/src/components/Timer/TimerDefaultVariant.tsx +9 -6
- package/src/components/Timer/TimerSmallVariant.tsx +2 -1
- package/src/components/Timer/useTimerLogic.ts +9 -9
- package/src/components/TransparentOverlay.tsx +2 -2
- package/src/components/VelocitySlider.tsx +3 -1
- package/src/components/experimental/utils/AdornedSelect.tsx +4 -8
- package/src/components/jogging/JoggingBlocked.tsx +6 -2
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +5 -7
- package/src/components/jogging/JoggingCartesianTab.tsx +6 -8
- package/src/components/jogging/JoggingFreedriveTab.tsx +1 -2
- package/src/components/jogging/JoggingJointLimitDetector.tsx +41 -43
- package/src/components/jogging/JoggingJointTab.tsx +12 -20
- package/src/components/jogging/JoggingJointValueControl.tsx +44 -30
- package/src/components/jogging/JoggingOptions.tsx +143 -139
- package/src/components/jogging/JoggingPanel.test.tsx +77 -85
- package/src/components/jogging/JoggingPanel.tsx +10 -13
- package/src/components/jogging/JoggingStore.ts +18 -13
- package/src/components/jogging/JoggingToggleButtonGroup.tsx +3 -3
- package/src/components/jogging/JoggingVelocitySlider.tsx +2 -10
- package/src/components/jogging/PoseCartesianValues.tsx +2 -1
- package/src/components/jogging/PoseJointValues.tsx +2 -1
- package/src/components/jogging/__fixtures__/motionStreamMockData.ts +0 -1
- package/src/components/modal/NoMotionGroupModal.tsx +7 -10
- package/src/components/robots/DHLinearAxis.tsx +62 -45
- package/src/components/robots/DHRobot.tsx +47 -45
- package/src/components/robots/GenericRobot.tsx +24 -24
- package/src/components/robots/LinearAxis.tsx +0 -1
- package/src/components/robots/LinearAxisAnimator.tsx +4 -1
- package/src/components/robots/MotionGroupVisualizer.tsx +53 -53
- package/src/components/robots/RobotAnimator.test.tsx +2 -2
- package/src/components/robots/RobotAnimator.tsx +4 -1
- package/src/components/robots/SupportedLinearAxis.tsx +10 -3
- package/src/components/robots/SupportedRobot.tsx +10 -3
- package/src/components/robots/robotModelLogic.ts +22 -11
- package/src/components/safetyBar/ControllerTypeIndicator.tsx +2 -1
- package/src/components/safetyBar/IndicatorWithExplanation.tsx +13 -11
- package/src/components/safetyBar/OperationModeIndicator.tsx +2 -1
- package/src/components/safetyBar/SafetyBar.tsx +3 -1
- package/src/components/safetyBar/SafetyStateIndicator.tsx +2 -1
- package/src/components/utils/converters.ts +10 -7
- package/src/components/utils/errorHandling.ts +1 -1
- package/src/components/utils/hooks.tsx +1 -0
- package/src/components/utils/interpolation.test.ts +53 -38
- package/src/components/utils/interpolation.ts +1 -0
- package/src/externalizeComponent.tsx +3 -1
- package/src/icons/DropdownArrowIcon.tsx +1 -2
- package/src/lib/JoggerConnection.ts +24 -24
- package/src/themes/createDarkTheme.ts +2 -3
- package/dist/MotionGroupVisualizer-1twp8wG6.js +0 -1328
- package/dist/MotionGroupVisualizer-1twp8wG6.js.map +0 -1
- package/dist/MotionGroupVisualizer-Dq_KWGsa.cjs +0 -2
- package/dist/MotionGroupVisualizer-Dq_KWGsa.cjs.map +0 -1
- package/dist/interpolation-B3pbgXYX.cjs +0 -42
- package/dist/interpolation-B3pbgXYX.cjs.map +0 -1
- package/dist/interpolation-D4ATdkEg.js +0 -7912
- package/dist/interpolation-D4ATdkEg.js.map +0 -1
- package/dist/theming-BJ6pB6jG.cjs +0 -115
- package/dist/theming-BJ6pB6jG.cjs.map +0 -1
- package/dist/theming-LwkvEF-K.js +0 -22417
- package/dist/theming-LwkvEF-K.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Box from "@mui/material/Box"
|
|
2
|
+
import MenuItem from "@mui/material/MenuItem"
|
|
2
3
|
import { observer } from "mobx-react-lite"
|
|
3
4
|
import { useId } from "react"
|
|
4
5
|
import { useTranslation } from "react-i18next"
|
|
@@ -10,150 +11,153 @@ import {
|
|
|
10
11
|
type OrientationId,
|
|
11
12
|
} from "./JoggingStore"
|
|
12
13
|
|
|
13
|
-
export const JoggingOptions = observer(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export const JoggingOptions = observer(
|
|
15
|
+
({ store, useDegree }: { store: JoggingStore; useDegree: boolean }) => {
|
|
16
|
+
const { t } = useTranslation()
|
|
17
|
+
const componentId = useId()
|
|
18
|
+
const joggingOptions: React.ReactElement[] = []
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
function translateOrientation(orientation: OrientationId): string {
|
|
21
|
+
switch (orientation) {
|
|
22
|
+
case "coordsys":
|
|
23
|
+
return t("Jogging.Orientation.coordsys")
|
|
24
|
+
case "tool":
|
|
25
|
+
return t("Jogging.Orientation.tool")
|
|
26
|
+
default:
|
|
27
|
+
return orientation
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
|
-
}
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
if (store.showCoordSystemSelect) {
|
|
32
|
+
joggingOptions.push(
|
|
33
|
+
<AdornedSelect
|
|
34
|
+
key="coord"
|
|
35
|
+
labelId={`jogging-coord-select-${componentId}`}
|
|
36
|
+
labelValue={t("Jogging.CoordinateSystem.hlb")}
|
|
37
|
+
value={store.selectedCoordSystemId}
|
|
38
|
+
size="small"
|
|
39
|
+
variant="filled"
|
|
40
|
+
displayEmpty={true}
|
|
41
|
+
onChange={(event) =>
|
|
42
|
+
store.setSelectedCoordSystemId(event.target.value as string)
|
|
43
|
+
}
|
|
44
|
+
disabled={store.isLocked}
|
|
45
|
+
>
|
|
46
|
+
{store.coordSystems.map((cs) => (
|
|
47
|
+
<MenuItem key={cs.coordinate_system} value={cs.coordinate_system}>
|
|
48
|
+
{cs.name && store.coordSystemCountByName[cs.name] > 1
|
|
49
|
+
? `${cs.name} / ${cs.coordinate_system}`
|
|
50
|
+
: cs.name || cs.coordinate_system}
|
|
51
|
+
</MenuItem>
|
|
52
|
+
))}
|
|
53
|
+
</AdornedSelect>,
|
|
54
|
+
)
|
|
55
|
+
}
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
57
|
+
if (store.showTcpSelect) {
|
|
58
|
+
joggingOptions.push(
|
|
59
|
+
<AdornedSelect
|
|
60
|
+
key="tcp"
|
|
61
|
+
labelId={`jogging-tcp-select-${componentId}`}
|
|
62
|
+
labelValue="TCP"
|
|
63
|
+
value={store.selectedTcpId}
|
|
64
|
+
size="small"
|
|
65
|
+
variant="filled"
|
|
66
|
+
onChange={(event) =>
|
|
67
|
+
store.setSelectedTcpId(event.target.value as string)
|
|
68
|
+
}
|
|
69
|
+
disabled={store.isLocked}
|
|
70
|
+
>
|
|
71
|
+
{store.tcps.map((tcp) => (
|
|
72
|
+
<MenuItem key={tcp.id} value={tcp.id}>
|
|
73
|
+
{tcp.id}
|
|
74
|
+
</MenuItem>
|
|
75
|
+
))}
|
|
76
|
+
</AdornedSelect>,
|
|
77
|
+
)
|
|
78
|
+
}
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
80
|
+
if (store.showOrientationSelect) {
|
|
81
|
+
joggingOptions.push(
|
|
82
|
+
<AdornedSelect
|
|
83
|
+
key="orientation"
|
|
84
|
+
labelValue={t("Jogging.Cartesian.Orientation.lb")}
|
|
85
|
+
labelId={`orientation-select-${componentId}`}
|
|
86
|
+
value={store.selectedOrientation}
|
|
87
|
+
onChange={(event) =>
|
|
88
|
+
store.setSelectedOrientation(event.target.value as OrientationId)
|
|
89
|
+
}
|
|
90
|
+
disabled={store.isLocked}
|
|
91
|
+
>
|
|
92
|
+
{ORIENTATION_IDS.map((orientationId) => (
|
|
93
|
+
<MenuItem key={orientationId} value={orientationId}>
|
|
94
|
+
{translateOrientation(orientationId)}
|
|
95
|
+
</MenuItem>
|
|
96
|
+
))}
|
|
97
|
+
</AdornedSelect>,
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (store.showIncrementSelect) {
|
|
102
|
+
joggingOptions.push(
|
|
103
|
+
<AdornedSelect
|
|
104
|
+
key="increment"
|
|
105
|
+
labelValue={t("Jogging.Increment.hlb")}
|
|
106
|
+
labelId={`jogging-increment-select-${componentId}`}
|
|
107
|
+
size="small"
|
|
108
|
+
variant="filled"
|
|
109
|
+
value={store.activeDiscreteIncrement?.id || "continuous"}
|
|
110
|
+
onChange={(event) =>
|
|
111
|
+
store.setSelectedIncrementId(
|
|
112
|
+
event.target.value as IncrementOptionId,
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
disabled={store.isLocked}
|
|
116
|
+
>
|
|
117
|
+
<MenuItem key="continuous" value="continuous">
|
|
118
|
+
{t("Jogging.Increment.Continuous.dd")}
|
|
93
119
|
</MenuItem>
|
|
94
|
-
))}
|
|
95
|
-
</AdornedSelect>,
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
120
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
store.setSelectedIncrementId(event.target.value as IncrementOptionId)
|
|
110
|
-
}
|
|
111
|
-
disabled={store.isLocked}
|
|
112
|
-
>
|
|
113
|
-
<MenuItem key="continuous" value="continuous">
|
|
114
|
-
{t("Jogging.Increment.Continuous.dd")}
|
|
115
|
-
</MenuItem>
|
|
121
|
+
{store.selectedOrientation === "tool"
|
|
122
|
+
? null
|
|
123
|
+
: store.discreteIncrementOptions.map((inc) => (
|
|
124
|
+
<MenuItem key={inc.id} value={inc.id}>
|
|
125
|
+
{useDegree ? `${inc.degrees}°` : `${inc.mm}mm`}
|
|
126
|
+
</MenuItem>
|
|
127
|
+
))}
|
|
128
|
+
</AdornedSelect>,
|
|
129
|
+
)
|
|
130
|
+
}
|
|
116
131
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
132
|
+
return (
|
|
133
|
+
<Box
|
|
134
|
+
component="div"
|
|
135
|
+
data-testid="jogging-options"
|
|
136
|
+
aria-label="jogging-options"
|
|
137
|
+
sx={{
|
|
138
|
+
display: "grid",
|
|
139
|
+
gap: "16px",
|
|
140
|
+
gridTemplateColumns: "1fr 1fr",
|
|
141
|
+
gridAutoRows: "min-content",
|
|
142
|
+
"& label": { opacity: 0.7, fontSize: "12px", marginBottom: "4px" },
|
|
143
|
+
}}
|
|
144
|
+
>
|
|
145
|
+
{joggingOptions.map((select, idx) => (
|
|
146
|
+
<Box
|
|
147
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: pre-biome code
|
|
148
|
+
key={idx}
|
|
149
|
+
sx={{
|
|
150
|
+
gridColumn:
|
|
151
|
+
joggingOptions.length % 2 === 1 &&
|
|
152
|
+
idx === joggingOptions.length - 1
|
|
153
|
+
? "span 2"
|
|
154
|
+
: "auto",
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
{select}
|
|
158
|
+
</Box>
|
|
159
|
+
))}
|
|
160
|
+
</Box>
|
|
127
161
|
)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<Box
|
|
132
|
-
component="div"
|
|
133
|
-
data-testid="jogging-options"
|
|
134
|
-
aria-label="jogging-options"
|
|
135
|
-
sx={{
|
|
136
|
-
display: "grid",
|
|
137
|
-
gap: "16px",
|
|
138
|
-
gridTemplateColumns: "1fr 1fr",
|
|
139
|
-
gridAutoRows: "min-content",
|
|
140
|
-
"& label": { opacity: 0.7, fontSize: "12px", marginBottom: "4px" },
|
|
141
|
-
}}
|
|
142
|
-
>
|
|
143
|
-
{joggingOptions.map((select, idx) => (
|
|
144
|
-
<Box
|
|
145
|
-
key={idx}
|
|
146
|
-
sx={{
|
|
147
|
-
gridColumn:
|
|
148
|
-
joggingOptions.length % 2 === 1 &&
|
|
149
|
-
idx === joggingOptions.length - 1
|
|
150
|
-
? "span 2"
|
|
151
|
-
: "auto",
|
|
152
|
-
}}
|
|
153
|
-
>
|
|
154
|
-
{select}
|
|
155
|
-
</Box>
|
|
156
|
-
))}
|
|
157
|
-
</Box>
|
|
158
|
-
)
|
|
159
|
-
})
|
|
162
|
+
},
|
|
163
|
+
)
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import { render, screen, within } from "@testing-library/react"
|
|
2
|
-
import userEvent from "@testing-library/user-event"
|
|
3
|
-
import { describe, expect, it, vi, beforeEach } from "vitest"
|
|
4
|
-
import { JointTypeEnum } from "@wandelbots/nova-js/v2"
|
|
5
2
|
import type {
|
|
6
3
|
CoordinateSystem,
|
|
7
4
|
MotionGroupDescription,
|
|
8
5
|
MotionGroupState,
|
|
9
6
|
RobotTcp,
|
|
10
|
-
DHParameter,
|
|
11
7
|
} from "@wandelbots/nova-js/v2"
|
|
12
|
-
import {
|
|
13
|
-
import { JoggingJointTab } from "./JoggingJointTab"
|
|
14
|
-
import { JoggingCartesianTab } from "./JoggingCartesianTab"
|
|
8
|
+
import { JointTypeEnum } from "@wandelbots/nova-js/v2"
|
|
15
9
|
import { I18nextProvider } from "react-i18next"
|
|
10
|
+
import { beforeEach, describe, expect, it, vi } from "vitest"
|
|
16
11
|
import { i18n } from "../../i18n/config"
|
|
17
|
-
import { JoggerConnection } from "../../lib/JoggerConnection"
|
|
18
12
|
import type { JoggerConnection as JoggerConnectionType } from "../../lib/JoggerConnection"
|
|
13
|
+
import { JoggerConnection } from "../../lib/JoggerConnection"
|
|
19
14
|
import type { MotionStreamConnection } from "../../lib/MotionStreamConnection"
|
|
20
15
|
import {
|
|
21
|
-
ur5eMotionGroupState,
|
|
22
|
-
ur5eDescription,
|
|
23
|
-
turnMockMotionGroupState,
|
|
24
|
-
turnMockDescription,
|
|
25
|
-
linearAxisMotionGroupState,
|
|
26
16
|
linearAxisDescription,
|
|
17
|
+
linearAxisMotionGroupState,
|
|
18
|
+
turnMockDescription,
|
|
19
|
+
turnMockMotionGroupState,
|
|
20
|
+
ur5eDescription,
|
|
21
|
+
ur5eMotionGroupState,
|
|
27
22
|
} from "./__fixtures__/motionStreamMockData"
|
|
23
|
+
import { JoggingCartesianTab } from "./JoggingCartesianTab"
|
|
24
|
+
import { JoggingJointTab } from "./JoggingJointTab"
|
|
25
|
+
import { JoggingStore } from "./JoggingStore"
|
|
28
26
|
|
|
29
27
|
// ---------- helpers ----------
|
|
30
28
|
|
|
@@ -36,8 +34,8 @@ function createMockMotionStream(
|
|
|
36
34
|
const jointPositions = motionGroupState.joint_position as number[]
|
|
37
35
|
|
|
38
36
|
return {
|
|
39
|
-
nova: {}
|
|
40
|
-
controller: { controller: motionGroupState.controller }
|
|
37
|
+
nova: {},
|
|
38
|
+
controller: { controller: motionGroupState.controller },
|
|
41
39
|
motionGroup: {
|
|
42
40
|
...motionGroupState,
|
|
43
41
|
tcp: tcpOverride,
|
|
@@ -48,7 +46,7 @@ function createMockMotionStream(
|
|
|
48
46
|
addEventListener: vi.fn(),
|
|
49
47
|
changeUrl: vi.fn(),
|
|
50
48
|
close: vi.fn(),
|
|
51
|
-
}
|
|
49
|
+
},
|
|
52
50
|
rapidlyChangingMotionState: { ...motionGroupState },
|
|
53
51
|
motionGroupId: motionGroupState.motion_group,
|
|
54
52
|
controllerId: motionGroupState.controller,
|
|
@@ -86,7 +84,10 @@ function createJoggingStore(opts: {
|
|
|
86
84
|
description: MotionGroupDescription
|
|
87
85
|
inverseSolver?: string | null | undefined
|
|
88
86
|
}): JoggingStore {
|
|
89
|
-
const motionStream = createMockMotionStream(
|
|
87
|
+
const motionStream = createMockMotionStream(
|
|
88
|
+
opts.motionGroupState,
|
|
89
|
+
opts.description,
|
|
90
|
+
)
|
|
90
91
|
const jogger = createMockJogger(motionStream)
|
|
91
92
|
|
|
92
93
|
const coordSystems: CoordinateSystem[] = [
|
|
@@ -150,7 +151,7 @@ describe("JoggingPanel", () => {
|
|
|
150
151
|
it("hides Cartesian tab when inverseSolver is null (explicitly no solver)", () => {
|
|
151
152
|
const store = createUr5eStore(null)
|
|
152
153
|
expect(store.tabs).toHaveLength(1)
|
|
153
|
-
expect(store.tabs[0]
|
|
154
|
+
expect(store.tabs[0]?.id).toBe("joint")
|
|
154
155
|
expect(store.tabs.map((t) => t.id)).not.toContain("cartesian")
|
|
155
156
|
})
|
|
156
157
|
|
|
@@ -183,15 +184,9 @@ describe("JoggingPanel", () => {
|
|
|
183
184
|
})
|
|
184
185
|
|
|
185
186
|
it("displays 6 joint controls in the joint tab", () => {
|
|
186
|
-
renderWithI18n(
|
|
187
|
-
<JoggingJointTab store={store}>
|
|
188
|
-
<></>
|
|
189
|
-
</JoggingJointTab>,
|
|
190
|
-
)
|
|
187
|
+
renderWithI18n(<JoggingJointTab store={store}></JoggingJointTab>)
|
|
191
188
|
|
|
192
|
-
const wrapper = screen.getByTestId(
|
|
193
|
-
"jogging-joint-value-controls-wrapper",
|
|
194
|
-
)
|
|
189
|
+
const wrapper = screen.getByTestId("jogging-joint-value-controls-wrapper")
|
|
195
190
|
for (let i = 0; i < 6; i++) {
|
|
196
191
|
expect(
|
|
197
192
|
within(wrapper).getByTestId(`jogging-joint-value-control-${i}`),
|
|
@@ -200,31 +195,17 @@ describe("JoggingPanel", () => {
|
|
|
200
195
|
})
|
|
201
196
|
|
|
202
197
|
it("renders the joint tab", () => {
|
|
203
|
-
renderWithI18n(
|
|
204
|
-
<JoggingJointTab store={store}>
|
|
205
|
-
<></>
|
|
206
|
-
</JoggingJointTab>,
|
|
207
|
-
)
|
|
198
|
+
renderWithI18n(<JoggingJointTab store={store}></JoggingJointTab>)
|
|
208
199
|
expect(screen.getByTestId("jogging-joint-tab")).toBeInTheDocument()
|
|
209
200
|
})
|
|
210
201
|
|
|
211
202
|
it("renders the cartesian tab with translate/rotate toggle", () => {
|
|
212
|
-
renderWithI18n(
|
|
213
|
-
|
|
214
|
-
<></>
|
|
215
|
-
</JoggingCartesianTab>,
|
|
216
|
-
)
|
|
217
|
-
expect(
|
|
218
|
-
screen.getByTestId("jogging-cartesian-tab"),
|
|
219
|
-
).toBeInTheDocument()
|
|
203
|
+
renderWithI18n(<JoggingCartesianTab store={store}></JoggingCartesianTab>)
|
|
204
|
+
expect(screen.getByTestId("jogging-cartesian-tab")).toBeInTheDocument()
|
|
220
205
|
})
|
|
221
206
|
|
|
222
207
|
it("shows X, Y, Z axis controls in cartesian tab", () => {
|
|
223
|
-
renderWithI18n(
|
|
224
|
-
<JoggingCartesianTab store={store}>
|
|
225
|
-
<></>
|
|
226
|
-
</JoggingCartesianTab>,
|
|
227
|
-
)
|
|
208
|
+
renderWithI18n(<JoggingCartesianTab store={store}></JoggingCartesianTab>)
|
|
228
209
|
for (const axis of ["x", "y", "z"]) {
|
|
229
210
|
expect(
|
|
230
211
|
screen.getByTestId(`jogging-cartesian-axis-control-${axis}`),
|
|
@@ -256,25 +237,18 @@ describe("JoggingPanel", () => {
|
|
|
256
237
|
|
|
257
238
|
it("only shows joint tab (no cartesian) when solver is null", () => {
|
|
258
239
|
expect(store.tabs).toHaveLength(1)
|
|
259
|
-
expect(store.tabs[0]
|
|
240
|
+
expect(store.tabs[0]?.id).toBe("joint")
|
|
260
241
|
})
|
|
261
242
|
|
|
262
243
|
it("uses mm/s as velocity unit for prismatic joints", () => {
|
|
263
|
-
const useDegree =
|
|
264
|
-
store.jointType === JointTypeEnum.RevoluteJoint
|
|
244
|
+
const useDegree = store.jointType === JointTypeEnum.RevoluteJoint
|
|
265
245
|
expect(useDegree).toBe(false)
|
|
266
246
|
})
|
|
267
247
|
|
|
268
248
|
it("renders 1 joint control for single-axis prismatic group", () => {
|
|
269
|
-
renderWithI18n(
|
|
270
|
-
<JoggingJointTab store={store}>
|
|
271
|
-
<></>
|
|
272
|
-
</JoggingJointTab>,
|
|
273
|
-
)
|
|
249
|
+
renderWithI18n(<JoggingJointTab store={store}></JoggingJointTab>)
|
|
274
250
|
|
|
275
|
-
const wrapper = screen.getByTestId(
|
|
276
|
-
"jogging-joint-value-controls-wrapper",
|
|
277
|
-
)
|
|
251
|
+
const wrapper = screen.getByTestId("jogging-joint-value-controls-wrapper")
|
|
278
252
|
expect(
|
|
279
253
|
within(wrapper).getByTestId("jogging-joint-value-control-0"),
|
|
280
254
|
).toBeInTheDocument()
|
|
@@ -302,15 +276,9 @@ describe("JoggingPanel", () => {
|
|
|
302
276
|
})
|
|
303
277
|
|
|
304
278
|
it("displays exactly 2 joint controls", () => {
|
|
305
|
-
renderWithI18n(
|
|
306
|
-
<JoggingJointTab store={store}>
|
|
307
|
-
<></>
|
|
308
|
-
</JoggingJointTab>,
|
|
309
|
-
)
|
|
279
|
+
renderWithI18n(<JoggingJointTab store={store}></JoggingJointTab>)
|
|
310
280
|
|
|
311
|
-
const wrapper = screen.getByTestId(
|
|
312
|
-
"jogging-joint-value-controls-wrapper",
|
|
313
|
-
)
|
|
281
|
+
const wrapper = screen.getByTestId("jogging-joint-value-controls-wrapper")
|
|
314
282
|
expect(
|
|
315
283
|
within(wrapper).getByTestId("jogging-joint-value-control-0"),
|
|
316
284
|
).toBeInTheDocument()
|
|
@@ -398,6 +366,7 @@ describe("JoggingPanel", () => {
|
|
|
398
366
|
|
|
399
367
|
it("falls back to first tab when selected tab is invalid", () => {
|
|
400
368
|
const store = createUr5eStore(null)
|
|
369
|
+
// biome-ignore lint/suspicious/noExplicitAny: intentionally setting invalid tab id to test fallback
|
|
401
370
|
store.selectedTabId = "cartesian" as any
|
|
402
371
|
expect(store.currentTab.id).toBe("joint")
|
|
403
372
|
})
|
|
@@ -509,11 +478,7 @@ describe("JoggingPanel", () => {
|
|
|
509
478
|
})
|
|
510
479
|
store.showJointsLegend = true
|
|
511
480
|
|
|
512
|
-
renderWithI18n(
|
|
513
|
-
<JoggingJointTab store={store}>
|
|
514
|
-
<></>
|
|
515
|
-
</JoggingJointTab>,
|
|
516
|
-
)
|
|
481
|
+
renderWithI18n(<JoggingJointTab store={store}></JoggingJointTab>)
|
|
517
482
|
|
|
518
483
|
expect(screen.getByText("G1")).toBeInTheDocument()
|
|
519
484
|
expect(screen.getByText("G2")).toBeInTheDocument()
|
|
@@ -526,11 +491,7 @@ describe("JoggingPanel", () => {
|
|
|
526
491
|
})
|
|
527
492
|
store.showJointsLegend = false
|
|
528
493
|
|
|
529
|
-
renderWithI18n(
|
|
530
|
-
<JoggingJointTab store={store}>
|
|
531
|
-
<></>
|
|
532
|
-
</JoggingJointTab>,
|
|
533
|
-
)
|
|
494
|
+
renderWithI18n(<JoggingJointTab store={store}></JoggingJointTab>)
|
|
534
495
|
|
|
535
496
|
expect(screen.queryByText("G1")).not.toBeInTheDocument()
|
|
536
497
|
})
|
|
@@ -540,7 +501,10 @@ describe("JoggingPanel", () => {
|
|
|
540
501
|
|
|
541
502
|
describe("Dispose", () => {
|
|
542
503
|
it("disposes the jogger connection when store is disposed", () => {
|
|
543
|
-
const motionStream = createMockMotionStream(
|
|
504
|
+
const motionStream = createMockMotionStream(
|
|
505
|
+
ur5eMotionGroupState,
|
|
506
|
+
ur5eDescription,
|
|
507
|
+
)
|
|
544
508
|
const jogger = createMockJogger(motionStream)
|
|
545
509
|
|
|
546
510
|
const store = new JoggingStore(
|
|
@@ -597,10 +561,18 @@ describe("JoggingPanel", () => {
|
|
|
597
561
|
it("minVelocityInDisplayUnits and maxVelocityInDisplayUnits return correct bounds", () => {
|
|
598
562
|
const store = createUr5eStore("solver")
|
|
599
563
|
|
|
600
|
-
expect(store.minVelocityInDisplayUnits(false)).toBe(
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
expect(store.maxVelocityInDisplayUnits(
|
|
564
|
+
expect(store.minVelocityInDisplayUnits(false)).toBe(
|
|
565
|
+
store.minTranslationVelocityMmPerSec,
|
|
566
|
+
)
|
|
567
|
+
expect(store.maxVelocityInDisplayUnits(false)).toBe(
|
|
568
|
+
store.maxTranslationVelocityMmPerSec,
|
|
569
|
+
)
|
|
570
|
+
expect(store.minVelocityInDisplayUnits(true)).toBe(
|
|
571
|
+
store.minRotationVelocityDegPerSec,
|
|
572
|
+
)
|
|
573
|
+
expect(store.maxVelocityInDisplayUnits(true)).toBe(
|
|
574
|
+
store.maxRotationVelocityDegPerSec,
|
|
575
|
+
)
|
|
604
576
|
})
|
|
605
577
|
})
|
|
606
578
|
|
|
@@ -608,37 +580,58 @@ describe("JoggingPanel", () => {
|
|
|
608
580
|
|
|
609
581
|
describe("JoggerConnection TCP resolution", () => {
|
|
610
582
|
it("6-joint revolute defaults to 'Flange' TCP from motionGroup.tcp", () => {
|
|
611
|
-
const ms = createMockMotionStream(
|
|
583
|
+
const ms = createMockMotionStream(
|
|
584
|
+
ur5eMotionGroupState,
|
|
585
|
+
ur5eDescription,
|
|
586
|
+
"Flange",
|
|
587
|
+
)
|
|
612
588
|
const jogger = new JoggerConnection(ms)
|
|
613
589
|
expect(jogger.tcp).toBe("Flange")
|
|
614
590
|
})
|
|
615
591
|
|
|
616
592
|
it("1-joint prismatic without motionGroup.tcp gets undefined (NO_TCP)", () => {
|
|
617
|
-
const ms = createMockMotionStream(
|
|
593
|
+
const ms = createMockMotionStream(
|
|
594
|
+
linearAxisMotionGroupState,
|
|
595
|
+
linearAxisDescription,
|
|
596
|
+
)
|
|
618
597
|
const jogger = new JoggerConnection(ms)
|
|
619
598
|
expect(jogger.tcp).toBeUndefined()
|
|
620
599
|
})
|
|
621
600
|
|
|
622
601
|
it("1-joint prismatic with motionGroup.tcp keeps tcp", () => {
|
|
623
|
-
const ms = createMockMotionStream(
|
|
602
|
+
const ms = createMockMotionStream(
|
|
603
|
+
linearAxisMotionGroupState,
|
|
604
|
+
linearAxisDescription,
|
|
605
|
+
"PrismaticTCP",
|
|
606
|
+
)
|
|
624
607
|
const jogger = new JoggerConnection(ms)
|
|
625
608
|
expect(jogger.tcp).toBe("PrismaticTCP")
|
|
626
609
|
})
|
|
627
610
|
|
|
628
611
|
it("2-joint revolute without motionGroup.tcp gets undefined (NO_TCP)", () => {
|
|
629
|
-
const ms = createMockMotionStream(
|
|
612
|
+
const ms = createMockMotionStream(
|
|
613
|
+
turnMockMotionGroupState,
|
|
614
|
+
turnMockDescription,
|
|
615
|
+
)
|
|
630
616
|
const jogger = new JoggerConnection(ms)
|
|
631
617
|
expect(jogger.tcp).toBeUndefined()
|
|
632
618
|
})
|
|
633
619
|
|
|
634
620
|
it("explicit tcp option overrides any default", () => {
|
|
635
|
-
const ms = createMockMotionStream(
|
|
621
|
+
const ms = createMockMotionStream(
|
|
622
|
+
linearAxisMotionGroupState,
|
|
623
|
+
linearAxisDescription,
|
|
624
|
+
)
|
|
636
625
|
const jogger = new JoggerConnection(ms, { tcp: "MyCustomTool" })
|
|
637
626
|
expect(jogger.tcp).toBe("MyCustomTool")
|
|
638
627
|
})
|
|
639
628
|
|
|
640
629
|
it("6-joint revolute with explicit tcp option uses the provided value", () => {
|
|
641
|
-
const ms = createMockMotionStream(
|
|
630
|
+
const ms = createMockMotionStream(
|
|
631
|
+
ur5eMotionGroupState,
|
|
632
|
+
ur5eDescription,
|
|
633
|
+
"Flange",
|
|
634
|
+
)
|
|
642
635
|
const jogger = new JoggerConnection(ms, { tcp: "GripperTCP" })
|
|
643
636
|
expect(jogger.tcp).toBe("GripperTCP")
|
|
644
637
|
})
|
|
@@ -650,4 +643,3 @@ describe("JoggingPanel", () => {
|
|
|
650
643
|
})
|
|
651
644
|
})
|
|
652
645
|
})
|
|
653
|
-
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import MoveIcon from "@mui/icons-material/OpenWith"
|
|
2
2
|
import ShareIcon from "@mui/icons-material/Share"
|
|
3
|
-
import {
|
|
3
|
+
import type { SxProps } from "@mui/material/styles"
|
|
4
|
+
import Stack from "@mui/material/Stack"
|
|
5
|
+
import Tab from "@mui/material/Tab"
|
|
6
|
+
import Tabs from "@mui/material/Tabs"
|
|
4
7
|
import { NovaClient } from "@wandelbots/nova-js/v2"
|
|
5
8
|
import { isString } from "lodash-es"
|
|
6
9
|
import { runInAction } from "mobx"
|
|
@@ -74,6 +77,7 @@ export const JoggingPanel = externalizeComponent(
|
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
|
|
80
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: pre-biome code
|
|
77
81
|
useEffect(() => {
|
|
78
82
|
init()
|
|
79
83
|
return props.store
|
|
@@ -106,10 +110,9 @@ export const JoggingPanel = externalizeComponent(
|
|
|
106
110
|
}}
|
|
107
111
|
>
|
|
108
112
|
{state.joggingStore ? (
|
|
109
|
-
<JoggingPanelInner
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
></JoggingPanelInner>
|
|
113
|
+
<JoggingPanelInner store={state.joggingStore}>
|
|
114
|
+
{props.children}
|
|
115
|
+
</JoggingPanelInner>
|
|
113
116
|
) : (
|
|
114
117
|
<LoadingCover message="Loading jogging" error={state.loadingError} />
|
|
115
118
|
)}
|
|
@@ -132,16 +135,10 @@ const JoggingPanelInner = observer(
|
|
|
132
135
|
function renderTabContent() {
|
|
133
136
|
if (store.currentTab.id === "cartesian") {
|
|
134
137
|
return (
|
|
135
|
-
|
|
136
|
-
<JoggingCartesianTab store={store}>{children}</JoggingCartesianTab>
|
|
137
|
-
</>
|
|
138
|
+
<JoggingCartesianTab store={store}>{children}</JoggingCartesianTab>
|
|
138
139
|
)
|
|
139
140
|
} else if (store.currentTab.id === "joint") {
|
|
140
|
-
return
|
|
141
|
-
<>
|
|
142
|
-
<JoggingJointTab store={store}>{children}</JoggingJointTab>
|
|
143
|
-
</>
|
|
144
|
-
)
|
|
141
|
+
return <JoggingJointTab store={store}>{children}</JoggingJointTab>
|
|
145
142
|
}
|
|
146
143
|
}
|
|
147
144
|
|