@wandelbots/wandelbots-js-react-components 1.29.2 → 1.30.0
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/index.cjs +29 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4845 -4736
- package/dist/index.js.map +1 -1
- package/dist/src/components/CopyableText.d.ts.map +1 -1
- package/dist/src/components/LoadingCover.d.ts.map +1 -1
- package/dist/src/components/VelocitySlider.d.ts +8 -1
- package/dist/src/components/VelocitySlider.d.ts.map +1 -1
- package/dist/src/components/experimental/utils/AdornedSelect.d.ts +8 -0
- package/dist/src/components/experimental/utils/AdornedSelect.d.ts.map +1 -0
- package/dist/src/components/jogging/JoggingCartesianAxisControl.d.ts +3 -2
- package/dist/src/components/jogging/JoggingCartesianAxisControl.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingJointLimitDetector.d.ts +1 -1
- package/dist/src/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingJointRotationControl.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingJointTab.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingOptions.d.ts +1 -1
- package/dist/src/components/jogging/JoggingOptions.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingPanel.d.ts +3 -0
- package/dist/src/components/jogging/JoggingPanel.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingStore.d.ts +5 -3
- package/dist/src/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/src/components/jogging/JoggingToggleButtonGroup.d.ts +2 -0
- package/dist/src/components/jogging/JoggingToggleButtonGroup.d.ts.map +1 -0
- package/dist/src/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
- package/dist/src/components/jogging/PoseCartesianValues.d.ts +7 -0
- package/dist/src/components/jogging/PoseCartesianValues.d.ts.map +1 -0
- package/dist/src/components/jogging/PoseJointValues.d.ts +7 -0
- package/dist/src/components/jogging/PoseJointValues.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/themes/createDarkTheme.d.ts.map +1 -1
- package/dist/src/themes/themeTypes.d.ts +6 -1
- package/dist/src/themes/themeTypes.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/CopyableText.tsx +69 -12
- package/src/components/LoadingCover.tsx +4 -2
- package/src/components/VelocitySlider.tsx +47 -18
- package/src/components/experimental/utils/AdornedSelect.tsx +42 -0
- package/src/components/jogging/JoggingCartesianAxisControl.tsx +84 -51
- package/src/components/jogging/JoggingCartesianTab.tsx +97 -107
- package/src/components/jogging/JoggingJointLimitDetector.tsx +4 -1
- package/src/components/jogging/JoggingJointRotationControl.tsx +41 -22
- package/src/components/jogging/JoggingJointTab.tsx +34 -43
- package/src/components/jogging/JoggingOptions.tsx +110 -136
- package/src/components/jogging/JoggingPanel.tsx +17 -9
- package/src/components/jogging/JoggingStore.ts +5 -2
- package/src/components/jogging/JoggingToggleButtonGroup.tsx +25 -0
- package/src/components/jogging/JoggingVelocitySlider.tsx +18 -20
- package/src/components/jogging/PoseCartesianValues.tsx +43 -0
- package/src/components/jogging/PoseJointValues.tsx +40 -0
- package/src/i18n/locales/de/translations.json +3 -1
- package/src/i18n/locales/en/translations.json +3 -1
- package/src/icons/jog-minus.svg +5 -0
- package/src/icons/jog-plus.svg +9 -0
- package/src/index.ts +2 -0
- package/src/themes/createDarkTheme.ts +19 -4
- package/src/themes/themeTypes.ts +6 -1
- package/dist/src/components/jogging/JoggingCartesianValues.d.ts +0 -7
- package/dist/src/components/jogging/JoggingCartesianValues.d.ts.map +0 -1
- package/dist/src/components/jogging/JoggingJointValues.d.ts +0 -7
- package/dist/src/components/jogging/JoggingJointValues.d.ts.map +0 -1
- package/src/components/jogging/JoggingCartesianValues.tsx +0 -50
- package/src/components/jogging/JoggingJointValues.tsx +0 -45
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IconButton, Typography } from "@mui/material"
|
|
1
|
+
import { IconButton, Typography, useTheme } from "@mui/material"
|
|
3
2
|
import Stack from "@mui/material/Stack"
|
|
4
3
|
import { observer } from "mobx-react-lite"
|
|
5
|
-
import { useRef, type ReactNode } from "react"
|
|
4
|
+
import React, { useRef, useState, type ReactNode } from "react"
|
|
6
5
|
import { externalizeComponent } from "../../externalizeComponent"
|
|
6
|
+
import JogMinus from "../../icons/jog-minus.svg"
|
|
7
|
+
import JogPlus from "../../icons/jog-plus.svg"
|
|
7
8
|
import type { AxisControlComponentColors } from "../../themes/themeTypes"
|
|
8
9
|
import { useAnimationFrame } from "../utils/hooks"
|
|
9
10
|
|
|
11
|
+
type Direction = "+" | "-"
|
|
12
|
+
|
|
10
13
|
type JoggingCartesianAxisControlProps = {
|
|
11
14
|
colors?: AxisControlComponentColors
|
|
12
15
|
label: ReactNode
|
|
13
16
|
getDisplayedValue: () => string
|
|
14
|
-
startJogging: (direction:
|
|
17
|
+
startJogging: (direction: Direction) => void
|
|
15
18
|
stopJogging: () => void
|
|
16
19
|
disabled?: boolean
|
|
17
20
|
} & React.ComponentProps<typeof Stack>
|
|
@@ -35,54 +38,76 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
35
38
|
|
|
36
39
|
element.textContent = displayValue
|
|
37
40
|
})
|
|
41
|
+
const theme = useTheme()
|
|
42
|
+
const [borderColor, setBorderColor] = useState(colors?.borderColor)
|
|
38
43
|
|
|
39
44
|
const valueContainerRef = useRef<HTMLParagraphElement>(null)
|
|
40
45
|
|
|
41
|
-
function onPointerDownMinus(ev: React.PointerEvent) {
|
|
42
|
-
if (disabled) return
|
|
43
|
-
|
|
44
|
-
// Stop right click from triggering jog
|
|
45
|
-
if (ev.button === 0) startJogging("-")
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function onPointerDownPlus(ev: React.PointerEvent) {
|
|
49
|
-
if (disabled) return
|
|
50
|
-
|
|
51
|
-
if (ev.button === 0) startJogging("+")
|
|
52
|
-
}
|
|
53
|
-
|
|
54
46
|
if (!colors) {
|
|
55
47
|
colors = {
|
|
56
48
|
color: "#fff",
|
|
57
49
|
backgroundColor: "#000",
|
|
58
50
|
borderColor: "#000",
|
|
59
|
-
buttonBackgroundColor:
|
|
51
|
+
buttonBackgroundColor: {
|
|
52
|
+
disabled: "#000",
|
|
53
|
+
default: "#000",
|
|
54
|
+
hovered: "#000",
|
|
55
|
+
pressed: "#000",
|
|
56
|
+
},
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
|
|
60
|
+
const SxAxisControlButton = {
|
|
61
|
+
width: "55px",
|
|
62
|
+
backgroundColor: colors.buttonBackgroundColor?.default,
|
|
63
|
+
color: colors.color,
|
|
64
|
+
alignContent: "center",
|
|
65
|
+
fontSize: "37px",
|
|
66
|
+
"&:hover": {
|
|
67
|
+
backgroundColor: colors.buttonBackgroundColor?.hovered,
|
|
68
|
+
},
|
|
69
|
+
"&:active": {
|
|
70
|
+
backgroundColor: colors.buttonBackgroundColor?.pressed,
|
|
71
|
+
},
|
|
72
|
+
":disabled": {
|
|
73
|
+
backgroundColor: colors.buttonBackgroundColor?.disabled,
|
|
74
|
+
"svg path": { fill: theme.palette.action.disabled },
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function onPointerDown(ev: React.PointerEvent, direction: Direction) {
|
|
79
|
+
if (disabled) {
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
setBorderColor(colors?.buttonBackgroundColor?.pressed)
|
|
83
|
+
if (ev.button === 0) {
|
|
84
|
+
startJogging(direction)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function onPointerUpOrOut() {
|
|
89
|
+
setBorderColor(colors?.borderColor)
|
|
90
|
+
stopJogging()
|
|
91
|
+
}
|
|
92
|
+
|
|
63
93
|
return (
|
|
64
|
-
<Stack height="
|
|
94
|
+
<Stack height="64px" direction="row" justifyContent="center" {...rest}>
|
|
65
95
|
<IconButton
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
96
|
+
disabled={disabled}
|
|
97
|
+
disableRipple
|
|
98
|
+
onPointerDown={(ev: React.PointerEvent) => onPointerDown(ev, "-")}
|
|
99
|
+
onPointerUp={onPointerUpOrOut}
|
|
100
|
+
onPointerOut={onPointerUpOrOut}
|
|
69
101
|
size="large"
|
|
70
102
|
sx={{
|
|
71
|
-
|
|
72
|
-
backgroundColor: colors.buttonBackgroundColor,
|
|
73
|
-
color: colors.color,
|
|
74
|
-
alignContent: "center",
|
|
75
|
-
fontSize: "37px",
|
|
103
|
+
...SxAxisControlButton,
|
|
76
104
|
borderRadius: "16px 0px 0px 16px",
|
|
77
|
-
borderLeft: `2px solid ${
|
|
78
|
-
borderBottom: `2px solid ${
|
|
79
|
-
borderTop: `2px solid ${
|
|
80
|
-
":hover": {
|
|
81
|
-
backgroundColor: colors.buttonBackgroundColor,
|
|
82
|
-
},
|
|
105
|
+
borderLeft: `2px solid ${borderColor ?? "#fff"}`,
|
|
106
|
+
borderBottom: `2px solid ${borderColor ?? "#fff"}`,
|
|
107
|
+
borderTop: `2px solid ${borderColor ?? "#fff"}`,
|
|
83
108
|
}}
|
|
84
109
|
>
|
|
85
|
-
<
|
|
110
|
+
<JogMinus />
|
|
86
111
|
</IconButton>
|
|
87
112
|
|
|
88
113
|
<Stack
|
|
@@ -93,6 +118,8 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
93
118
|
alignItems: "center",
|
|
94
119
|
justifyContent: "center",
|
|
95
120
|
opacity: "0.9",
|
|
121
|
+
borderBottom: `2px solid ${borderColor ?? "#fff"}`,
|
|
122
|
+
borderTop: `2px solid ${borderColor ?? "#fff"}`,
|
|
96
123
|
}}
|
|
97
124
|
>
|
|
98
125
|
<Stack
|
|
@@ -101,7 +128,17 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
101
128
|
alignItems="center"
|
|
102
129
|
justifyItems="center"
|
|
103
130
|
spacing={1}
|
|
104
|
-
sx={{
|
|
131
|
+
sx={{
|
|
132
|
+
userSelect: "none",
|
|
133
|
+
color: colors.color,
|
|
134
|
+
".MuiTypography-root": {
|
|
135
|
+
fontWeight: 700,
|
|
136
|
+
...(disabled ? { color: theme.palette.action.disabled } : {}),
|
|
137
|
+
},
|
|
138
|
+
...(disabled
|
|
139
|
+
? { "svg path": { fill: theme.palette.action.disabled } }
|
|
140
|
+
: {}),
|
|
141
|
+
}}
|
|
105
142
|
>
|
|
106
143
|
{label}
|
|
107
144
|
</Stack>
|
|
@@ -109,7 +146,8 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
109
146
|
height="22px"
|
|
110
147
|
sx={{
|
|
111
148
|
fontSize: "15px",
|
|
112
|
-
color: colors.color,
|
|
149
|
+
color: disabled ? theme.palette.action.disabled : colors.color,
|
|
150
|
+
fontWeight: 700,
|
|
113
151
|
}}
|
|
114
152
|
ref={valueContainerRef}
|
|
115
153
|
>
|
|
@@ -118,26 +156,21 @@ export const JoggingCartesianAxisControl = externalizeComponent(
|
|
|
118
156
|
</Stack>
|
|
119
157
|
|
|
120
158
|
<IconButton
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
159
|
+
disableRipple
|
|
160
|
+
disabled={disabled}
|
|
161
|
+
onPointerDown={(ev: React.PointerEvent) => onPointerDown(ev, "+")}
|
|
162
|
+
onPointerUp={onPointerUpOrOut}
|
|
163
|
+
onPointerOut={onPointerUpOrOut}
|
|
124
164
|
size="large"
|
|
125
165
|
sx={{
|
|
126
|
-
|
|
127
|
-
backgroundColor: colors.buttonBackgroundColor,
|
|
128
|
-
color: colors.color,
|
|
129
|
-
alignContent: "center",
|
|
130
|
-
fontSize: "37px",
|
|
166
|
+
...SxAxisControlButton,
|
|
131
167
|
borderRadius: "0px 16px 16px 0px",
|
|
132
|
-
borderRight: `2px solid ${
|
|
133
|
-
borderBottom: `2px solid ${
|
|
134
|
-
borderTop: `2px solid ${
|
|
135
|
-
":hover": {
|
|
136
|
-
backgroundColor: colors.buttonBackgroundColor,
|
|
137
|
-
},
|
|
168
|
+
borderRight: `2px solid ${borderColor ?? "#fff"}`,
|
|
169
|
+
borderBottom: `2px solid ${borderColor ?? "#fff"}`,
|
|
170
|
+
borderTop: `2px solid ${borderColor ?? "#fff"}`,
|
|
138
171
|
}}
|
|
139
172
|
>
|
|
140
|
-
<
|
|
173
|
+
<JogPlus />
|
|
141
174
|
</IconButton>
|
|
142
175
|
</Stack>
|
|
143
176
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Divider,
|
|
2
3
|
Stack,
|
|
3
4
|
ToggleButton,
|
|
4
|
-
ToggleButtonGroup,
|
|
5
5
|
Typography,
|
|
6
6
|
useTheme,
|
|
7
7
|
} from "@mui/material"
|
|
@@ -15,10 +15,10 @@ import RotationIcon from "../../icons/rotation.svg"
|
|
|
15
15
|
import { useReaction } from "../utils/hooks"
|
|
16
16
|
import { JoggingActivationRequired } from "./JoggingActivationRequired"
|
|
17
17
|
import { JoggingCartesianAxisControl } from "./JoggingCartesianAxisControl"
|
|
18
|
-
import { JoggingCartesianValues } from "./JoggingCartesianValues"
|
|
19
18
|
import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
|
|
20
19
|
import { JoggingOptions } from "./JoggingOptions"
|
|
21
20
|
import type { DiscreteIncrementOption, JoggingStore } from "./JoggingStore"
|
|
21
|
+
import { JoggingToggleButtonGroup } from "./JoggingToggleButtonGroup"
|
|
22
22
|
import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
|
|
23
23
|
|
|
24
24
|
type JoggingCartesianOpts = {
|
|
@@ -152,26 +152,26 @@ export const JoggingCartesianTab = observer(
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
return (
|
|
155
|
-
<Stack flexGrow={1} gap={
|
|
156
|
-
<Stack>
|
|
157
|
-
{/* Show Wandelscript string for the current coords */}
|
|
158
|
-
<JoggingCartesianValues store={store} />
|
|
159
|
-
|
|
155
|
+
<Stack flexGrow={1} gap={2} sx={{ padding: "18px 24px" }}>
|
|
156
|
+
<Stack gap={2}>
|
|
160
157
|
{/* Jogging options */}
|
|
161
158
|
<JoggingOptions store={store} />
|
|
159
|
+
|
|
160
|
+
{/* Velocity slider */}
|
|
161
|
+
<JoggingVelocitySlider store={store} />
|
|
162
|
+
<Divider />
|
|
162
163
|
</Stack>
|
|
163
164
|
|
|
164
165
|
<Stack
|
|
165
|
-
|
|
166
|
-
maxWidth="296px"
|
|
166
|
+
//maxWidth="296px"
|
|
167
167
|
marginLeft="auto"
|
|
168
168
|
marginRight="auto"
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
gap="24px"
|
|
170
|
+
justifyContent="center"
|
|
171
|
+
sx={{ flexGrow: "1" }}
|
|
172
172
|
>
|
|
173
173
|
{/* Translate or rotate toggle */}
|
|
174
|
-
<
|
|
174
|
+
<JoggingToggleButtonGroup
|
|
175
175
|
value={store.selectedCartesianMotionType}
|
|
176
176
|
onChange={onMotionTypeChange}
|
|
177
177
|
exclusive
|
|
@@ -184,105 +184,95 @@ export const JoggingCartesianTab = observer(
|
|
|
184
184
|
<ToggleButton value="rotate">
|
|
185
185
|
{t("Jogging.Cartesian.Rotation.bt")}
|
|
186
186
|
</ToggleButton>
|
|
187
|
-
</
|
|
188
|
-
</Stack>
|
|
187
|
+
</JoggingToggleButtonGroup>
|
|
189
188
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
axis: axis.id,
|
|
229
|
-
motionType: "translate",
|
|
230
|
-
direction,
|
|
231
|
-
})
|
|
232
|
-
}
|
|
233
|
-
stopJogging={stopJogging}
|
|
234
|
-
/>
|
|
235
|
-
))}
|
|
189
|
+
<JoggingActivationRequired store={store}>
|
|
190
|
+
<Stack alignItems="center" gap="24px" sx={{ flexGrow: 1 }}>
|
|
191
|
+
{/* Cartesian translate jogging */}
|
|
192
|
+
{store.selectedCartesianMotionType === "translate" &&
|
|
193
|
+
axisList.map((axis) => (
|
|
194
|
+
<JoggingCartesianAxisControl
|
|
195
|
+
key={axis.id}
|
|
196
|
+
colors={axis.colors}
|
|
197
|
+
disabled={store.isLocked}
|
|
198
|
+
label={
|
|
199
|
+
<>
|
|
200
|
+
{axis.icon}
|
|
201
|
+
<Typography
|
|
202
|
+
sx={{
|
|
203
|
+
fontSize: "24px",
|
|
204
|
+
color: theme.palette.text.primary,
|
|
205
|
+
}}
|
|
206
|
+
>
|
|
207
|
+
{axis.id.toUpperCase()}
|
|
208
|
+
</Typography>
|
|
209
|
+
</>
|
|
210
|
+
}
|
|
211
|
+
getDisplayedValue={() =>
|
|
212
|
+
formatMM(
|
|
213
|
+
store.jogger.motionStream.rapidlyChangingMotionState
|
|
214
|
+
.tcp_pose?.position[axis.id] || 0,
|
|
215
|
+
)
|
|
216
|
+
}
|
|
217
|
+
startJogging={(direction: "-" | "+") =>
|
|
218
|
+
startCartesianJogging({
|
|
219
|
+
axis: axis.id,
|
|
220
|
+
motionType: "translate",
|
|
221
|
+
direction,
|
|
222
|
+
})
|
|
223
|
+
}
|
|
224
|
+
stopJogging={stopJogging}
|
|
225
|
+
/>
|
|
226
|
+
))}
|
|
236
227
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
228
|
+
{/* Cartesian rotate jogging */}
|
|
229
|
+
{store.selectedCartesianMotionType === "rotate" &&
|
|
230
|
+
axisList.map((axis) => (
|
|
231
|
+
<JoggingCartesianAxisControl
|
|
232
|
+
key={axis.id}
|
|
233
|
+
colors={axis.colors}
|
|
234
|
+
disabled={store.isLocked}
|
|
235
|
+
label={
|
|
236
|
+
<>
|
|
237
|
+
<RotationIcon />
|
|
238
|
+
<Typography
|
|
239
|
+
sx={{
|
|
240
|
+
fontSize: "24px",
|
|
241
|
+
color: theme.palette.text.primary,
|
|
242
|
+
}}
|
|
243
|
+
>
|
|
244
|
+
{axis.id.toUpperCase()}
|
|
245
|
+
</Typography>
|
|
246
|
+
</>
|
|
247
|
+
}
|
|
248
|
+
getDisplayedValue={() =>
|
|
249
|
+
formatDegrees(
|
|
250
|
+
store.jogger.motionStream.rapidlyChangingMotionState
|
|
251
|
+
.tcp_pose?.orientation?.[axis.id] || 0,
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
startJogging={(direction: "-" | "+") =>
|
|
255
|
+
startCartesianJogging({
|
|
256
|
+
axis: axis.id,
|
|
257
|
+
motionType: "rotate",
|
|
258
|
+
direction,
|
|
259
|
+
})
|
|
260
|
+
}
|
|
261
|
+
stopJogging={stopJogging}
|
|
262
|
+
/>
|
|
263
|
+
))}
|
|
264
|
+
</Stack>
|
|
265
|
+
</JoggingActivationRequired>
|
|
266
|
+
</Stack>
|
|
275
267
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
<JoggingJointLimitDetector store={store} />
|
|
268
|
+
{/* Show message if joint limits reached */}
|
|
269
|
+
<JoggingJointLimitDetector store={store} />
|
|
279
270
|
|
|
280
|
-
|
|
281
|
-
<JoggingVelocitySlider store={store} />
|
|
271
|
+
{children && <Divider />}
|
|
282
272
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
273
|
+
{/* Custom content */}
|
|
274
|
+
|
|
275
|
+
{children}
|
|
286
276
|
</Stack>
|
|
287
277
|
)
|
|
288
278
|
},
|
|
@@ -38,13 +38,16 @@ export const JoggingJointLimitDetector = ({
|
|
|
38
38
|
if (limitReached) jointLimitReachedIndices.push(index)
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
if (jointLimitReachedIndices.length === 0) {
|
|
42
|
+
return null
|
|
43
|
+
}
|
|
41
44
|
return (
|
|
42
45
|
<Typography
|
|
43
46
|
color="error"
|
|
44
47
|
sx={{
|
|
45
48
|
margin: "0.5rem 1rem",
|
|
46
49
|
textAlign: "center",
|
|
47
|
-
visibility: jointLimitReachedIndices.length ? "visible" : "
|
|
50
|
+
visibility: jointLimitReachedIndices.length ? "visible" : "collapse",
|
|
48
51
|
}}
|
|
49
52
|
>
|
|
50
53
|
{t("Jogging.JointLimitsReached.lb", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ChevronLeft from "@mui/icons-material/ChevronLeft"
|
|
2
2
|
import ChevronRight from "@mui/icons-material/ChevronRight"
|
|
3
|
-
import { IconButton, Slider, Typography } from "@mui/material"
|
|
3
|
+
import { IconButton, Slider, Typography, useTheme } from "@mui/material"
|
|
4
4
|
import Stack from "@mui/material/Stack"
|
|
5
5
|
import throttle from "lodash-es/throttle"
|
|
6
6
|
import { observer, useLocalObservable } from "mobx-react-lite"
|
|
@@ -33,6 +33,12 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
33
33
|
}: JoggingJointRotationControlProps) => {
|
|
34
34
|
const { t } = useTranslation()
|
|
35
35
|
const [currentValue, setCurrentValue] = useState<number | undefined>()
|
|
36
|
+
const theme = useTheme()
|
|
37
|
+
|
|
38
|
+
const pressedButtonStyle = {
|
|
39
|
+
background: theme.palette.backgroundPaperElevation?.[4],
|
|
40
|
+
color: theme.palette.backgroundPaperElevation?.[11],
|
|
41
|
+
}
|
|
36
42
|
|
|
37
43
|
const state = useLocalObservable(() => ({
|
|
38
44
|
activeJoggingDir: null as "-" | "+" | null,
|
|
@@ -92,23 +98,31 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
92
98
|
<Stack
|
|
93
99
|
height="64px"
|
|
94
100
|
width="100%"
|
|
95
|
-
maxWidth="
|
|
101
|
+
maxWidth="260px"
|
|
96
102
|
direction="row"
|
|
97
103
|
{...rest}
|
|
98
104
|
sx={{
|
|
99
105
|
"& .MuiIconButton-root": {
|
|
100
106
|
width: "52px",
|
|
101
|
-
color:
|
|
107
|
+
color: theme.palette.text.primary,
|
|
102
108
|
alignContent: "center",
|
|
103
|
-
backgroundColor:
|
|
104
|
-
"&:disabled": {
|
|
105
|
-
opacity: 0.5,
|
|
106
|
-
backgroundColor: "#38445A",
|
|
107
|
-
},
|
|
109
|
+
backgroundColor: theme.palette.backgroundPaperElevation?.[11],
|
|
108
110
|
"& svg": {
|
|
109
111
|
width: "42px",
|
|
110
112
|
height: "42px",
|
|
111
113
|
},
|
|
114
|
+
|
|
115
|
+
"&.Mui-disabled": {
|
|
116
|
+
backgroundColor: theme.palette.backgroundPaperElevation?.[11],
|
|
117
|
+
color: theme.palette.action.disabled,
|
|
118
|
+
opacity: 1,
|
|
119
|
+
},
|
|
120
|
+
"&:hover": {
|
|
121
|
+
backgroundColor: theme.palette.backgroundPaperElevation?.[9],
|
|
122
|
+
},
|
|
123
|
+
"&:active": {
|
|
124
|
+
...pressedButtonStyle,
|
|
125
|
+
},
|
|
112
126
|
},
|
|
113
127
|
}}
|
|
114
128
|
>
|
|
@@ -117,10 +131,10 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
117
131
|
onPointerUp={onPointerUp}
|
|
118
132
|
onPointerOut={onPointerOut}
|
|
119
133
|
disabled={disabled}
|
|
134
|
+
disableRipple
|
|
120
135
|
sx={{
|
|
121
136
|
borderRadius: "16px 0px 0px 16px",
|
|
122
|
-
|
|
123
|
-
state.activeJoggingDir === "-" ? "#495975" : undefined,
|
|
137
|
+
...(state.activeJoggingDir === "-" ? pressedButtonStyle : {}),
|
|
124
138
|
}}
|
|
125
139
|
>
|
|
126
140
|
<ChevronLeft />
|
|
@@ -134,10 +148,8 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
134
148
|
borderStyle: "solid",
|
|
135
149
|
borderLeftWidth: 0,
|
|
136
150
|
borderRightWidth: 0,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
backgroundColor: "#38445A",
|
|
140
|
-
borderColor: "#38445A",
|
|
151
|
+
border: "none",
|
|
152
|
+
backgroundColor: theme.palette.backgroundPaperElevation?.[11],
|
|
141
153
|
paddingLeft: "20px",
|
|
142
154
|
paddingRight: "20px",
|
|
143
155
|
zIndex: 1,
|
|
@@ -146,9 +158,13 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
146
158
|
<Typography
|
|
147
159
|
sx={{
|
|
148
160
|
fontSize: "15px",
|
|
161
|
+
fontWeight: 700,
|
|
149
162
|
position: "relative",
|
|
150
163
|
top: "5px",
|
|
151
|
-
|
|
164
|
+
|
|
165
|
+
color: disabled
|
|
166
|
+
? theme.palette.action.disabled
|
|
167
|
+
: theme.palette.text.primary,
|
|
152
168
|
}}
|
|
153
169
|
>
|
|
154
170
|
{formatDegrees(currentValue)}
|
|
@@ -167,16 +183,21 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
167
183
|
},
|
|
168
184
|
"& .MuiSlider-thumb": {
|
|
169
185
|
width: "5px",
|
|
170
|
-
height: "
|
|
186
|
+
height: "12px",
|
|
171
187
|
borderRadius: "2px",
|
|
188
|
+
color: disabled
|
|
189
|
+
? theme.palette.action.disabled
|
|
190
|
+
: theme.palette.text.primary,
|
|
172
191
|
},
|
|
173
192
|
"& .MuiSlider-markLabel": {
|
|
174
193
|
top: "20px",
|
|
175
194
|
fontSize: "12px",
|
|
176
|
-
color:
|
|
195
|
+
color: disabled
|
|
196
|
+
? theme.palette.action.disabled
|
|
197
|
+
: theme.palette.text.secondary,
|
|
177
198
|
},
|
|
178
199
|
"& .MuiSlider-rail": {
|
|
179
|
-
backgroundColor:
|
|
200
|
+
backgroundColor: theme.palette.backgroundPaperElevation?.[5],
|
|
180
201
|
opacity: 1,
|
|
181
202
|
},
|
|
182
203
|
}}
|
|
@@ -201,12 +222,10 @@ export const JoggingJointRotationControl = externalizeComponent(
|
|
|
201
222
|
onPointerUp={onPointerUp}
|
|
202
223
|
onPointerOut={onPointerOut}
|
|
203
224
|
disabled={disabled}
|
|
225
|
+
disableRipple
|
|
204
226
|
sx={{
|
|
205
227
|
borderRadius: "0px 16px 16px 0px",
|
|
206
|
-
|
|
207
|
-
state.activeJoggingDir === "+"
|
|
208
|
-
? "#495975 !important"
|
|
209
|
-
: "#38445A",
|
|
228
|
+
...(state.activeJoggingDir === "+" ? pressedButtonStyle : {}),
|
|
210
229
|
}}
|
|
211
230
|
>
|
|
212
231
|
<ChevronRight />
|