@wandelbots/wandelbots-js-react-components 1.17.6 → 1.17.8
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/JoggingCartesianTab.d.ts +3 -1
- package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
- package/dist/components/jogging/JoggingJointTab.d.ts +3 -1
- package/dist/components/jogging/JoggingJointTab.d.ts.map +1 -1
- package/dist/index.cjs +19 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +405 -394
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TransparentOverlay.tsx +1 -1
- package/src/components/VelocitySlider.tsx +1 -1
- package/src/components/jogging/JoggingCartesianTab.tsx +106 -88
- package/src/components/jogging/JoggingJointTab.tsx +3 -2
- package/src/components/jogging/JoggingPanel.tsx +2 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Typography, useTheme } from "@mui/material"
|
|
1
2
|
import Slider from "@mui/material/Slider"
|
|
2
3
|
import isNumber from "lodash-es/isNumber"
|
|
3
4
|
import { observer } from "mobx-react-lite"
|
|
4
|
-
import { Typography, useTheme } from "@mui/material"
|
|
5
5
|
|
|
6
6
|
type VelocitySliderProps = {
|
|
7
7
|
min: number
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from "@mui/material"
|
|
7
7
|
import { degreesToRadians, radiansToDegrees } from "@wandelbots/wandelbots-js"
|
|
8
8
|
import { observer } from "mobx-react-lite"
|
|
9
|
+
import type { ReactNode } from "react"
|
|
9
10
|
import { useTranslation } from "react-i18next"
|
|
10
11
|
import XAxisIcon from "../../icons/axis-x.svg"
|
|
11
12
|
import YAxisIcon from "../../icons/axis-y.svg"
|
|
@@ -27,7 +28,7 @@ type JoggingCartesianOpts = {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export const JoggingCartesianTab = observer(
|
|
30
|
-
({ store }: { store: JoggingStore }) => {
|
|
31
|
+
({ store, children }: { store: JoggingStore; children?: ReactNode }) => {
|
|
31
32
|
const { t } = useTranslation()
|
|
32
33
|
|
|
33
34
|
function onMotionTypeChange(
|
|
@@ -144,18 +145,22 @@ export const JoggingCartesianTab = observer(
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
return (
|
|
147
|
-
<Stack>
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
<Stack flexGrow={1} justifyContent="space-between">
|
|
149
|
+
<Stack>
|
|
150
|
+
{/* Show Wandelscript string for the current coords */}
|
|
151
|
+
<JoggingCartesianValues store={store} />
|
|
150
152
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
{/* Jogging options */}
|
|
154
|
+
<JoggingOptions store={store} />
|
|
155
|
+
</Stack>
|
|
153
156
|
|
|
154
157
|
<Stack
|
|
155
158
|
width="80%"
|
|
156
159
|
maxWidth="296px"
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
marginLeft="auto"
|
|
161
|
+
marginRight="auto"
|
|
162
|
+
marginTop="8px"
|
|
163
|
+
marginBottom="8px"
|
|
159
164
|
gap="12px"
|
|
160
165
|
>
|
|
161
166
|
{/* Translate or rotate toggle */}
|
|
@@ -172,91 +177,104 @@ export const JoggingCartesianTab = observer(
|
|
|
172
177
|
{t("Jogging.Cartesian.Rotation.bt")}
|
|
173
178
|
</ToggleButton>
|
|
174
179
|
</ToggleButtonGroup>
|
|
180
|
+
</Stack>
|
|
175
181
|
|
|
176
|
-
|
|
182
|
+
<JoggingActivationRequired store={store}>
|
|
183
|
+
<Stack
|
|
184
|
+
width="80%"
|
|
185
|
+
maxWidth="296px"
|
|
186
|
+
marginLeft="auto"
|
|
187
|
+
marginRight="auto"
|
|
188
|
+
marginTop="8px"
|
|
189
|
+
marginBottom="8px"
|
|
190
|
+
gap="12px"
|
|
191
|
+
>
|
|
177
192
|
{/* Cartesian translate jogging */}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
))}
|
|
193
|
+
{store.selectedCartesianMotionType === "translate" &&
|
|
194
|
+
axisList.map((axis) => (
|
|
195
|
+
<JoggingCartesianAxisControl
|
|
196
|
+
key={axis.id}
|
|
197
|
+
color={axis.color}
|
|
198
|
+
disabled={store.isLocked}
|
|
199
|
+
label={
|
|
200
|
+
<>
|
|
201
|
+
{axis.icon}
|
|
202
|
+
<Typography
|
|
203
|
+
sx={{
|
|
204
|
+
fontSize: "24px",
|
|
205
|
+
color: "white",
|
|
206
|
+
}}
|
|
207
|
+
>
|
|
208
|
+
{axis.id.toUpperCase()}
|
|
209
|
+
</Typography>
|
|
210
|
+
</>
|
|
211
|
+
}
|
|
212
|
+
getDisplayedValue={() =>
|
|
213
|
+
formatMM(
|
|
214
|
+
store.jogger.motionStream.rapidlyChangingMotionState
|
|
215
|
+
.tcp_pose?.position[axis.id] || 0,
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
startJogging={(direction: "-" | "+") =>
|
|
219
|
+
startCartesianJogging({
|
|
220
|
+
axis: axis.id,
|
|
221
|
+
motionType: "translate",
|
|
222
|
+
direction,
|
|
223
|
+
})
|
|
224
|
+
}
|
|
225
|
+
stopJogging={stopJogging}
|
|
226
|
+
/>
|
|
227
|
+
))}
|
|
214
228
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
229
|
+
{/* Cartesian rotate jogging */}
|
|
230
|
+
{store.selectedCartesianMotionType === "rotate" &&
|
|
231
|
+
axisList.map((axis) => (
|
|
232
|
+
<JoggingCartesianAxisControl
|
|
233
|
+
key={axis.id}
|
|
234
|
+
color={axis.color}
|
|
235
|
+
disabled={store.isLocked}
|
|
236
|
+
label={
|
|
237
|
+
<>
|
|
238
|
+
<RotationIcon />
|
|
239
|
+
<Typography
|
|
240
|
+
sx={{
|
|
241
|
+
fontSize: "24px",
|
|
242
|
+
color: "white",
|
|
243
|
+
}}
|
|
244
|
+
>
|
|
245
|
+
{axis.id.toUpperCase()}
|
|
246
|
+
</Typography>
|
|
247
|
+
</>
|
|
248
|
+
}
|
|
249
|
+
getDisplayedValue={() =>
|
|
250
|
+
formatDegrees(
|
|
251
|
+
store.jogger.motionStream.rapidlyChangingMotionState
|
|
252
|
+
.tcp_pose?.orientation?.[axis.id] || 0,
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
startJogging={(direction: "-" | "+") =>
|
|
256
|
+
startCartesianJogging({
|
|
257
|
+
axis: axis.id,
|
|
258
|
+
motionType: "rotate",
|
|
259
|
+
direction,
|
|
260
|
+
})
|
|
261
|
+
}
|
|
262
|
+
stopJogging={stopJogging}
|
|
263
|
+
/>
|
|
264
|
+
))}
|
|
265
|
+
</Stack>
|
|
266
|
+
</JoggingActivationRequired>
|
|
267
|
+
|
|
268
|
+
<Stack>
|
|
269
|
+
{/* Show message if joint limits reached */}
|
|
270
|
+
<JoggingJointLimitDetector store={store} />
|
|
254
271
|
|
|
255
|
-
|
|
256
|
-
|
|
272
|
+
{/* Velocity slider */}
|
|
273
|
+
<JoggingVelocitySlider store={store} />
|
|
257
274
|
|
|
258
|
-
|
|
259
|
-
|
|
275
|
+
{/* Custom content */}
|
|
276
|
+
{children}
|
|
277
|
+
</Stack>
|
|
260
278
|
</Stack>
|
|
261
279
|
)
|
|
262
280
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Stack, Typography } from "@mui/material"
|
|
2
2
|
import { radiansToDegrees } from "@wandelbots/wandelbots-js"
|
|
3
3
|
import { observer } from "mobx-react-lite"
|
|
4
|
+
import type { ReactNode } from "react"
|
|
4
5
|
import { JoggingActivationRequired } from "./JoggingActivationRequired"
|
|
5
6
|
import { JoggingJointLimitDetector } from "./JoggingJointLimitDetector"
|
|
6
7
|
import { JoggingJointRotationControl } from "./JoggingJointRotationControl"
|
|
@@ -9,7 +10,7 @@ import type { JoggingStore } from "./JoggingStore"
|
|
|
9
10
|
import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
|
|
10
11
|
|
|
11
12
|
export const JoggingJointTab = observer(
|
|
12
|
-
({ store }: { store: JoggingStore }) => {
|
|
13
|
+
({ store, children }: { store: JoggingStore; children: ReactNode }) => {
|
|
13
14
|
async function startJointJogging(opts: {
|
|
14
15
|
joint: number
|
|
15
16
|
direction: "-" | "+"
|
|
@@ -26,7 +27,7 @@ export const JoggingJointTab = observer(
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
|
-
<Stack>
|
|
30
|
+
<Stack flexGrow={1} justifyContent="space-between">
|
|
30
31
|
<JoggingJointValues store={store} />
|
|
31
32
|
|
|
32
33
|
<Stack marginTop="0.8rem" />
|
|
@@ -151,15 +151,13 @@ const JoggingPanelInner = observer(
|
|
|
151
151
|
if (store.currentTab.id === "cartesian") {
|
|
152
152
|
return (
|
|
153
153
|
<>
|
|
154
|
-
<JoggingCartesianTab store={store}
|
|
155
|
-
{children}
|
|
154
|
+
<JoggingCartesianTab store={store}>{children}</JoggingCartesianTab>
|
|
156
155
|
</>
|
|
157
156
|
)
|
|
158
157
|
} else if (store.currentTab.id === "joint") {
|
|
159
158
|
return (
|
|
160
159
|
<>
|
|
161
|
-
<JoggingJointTab store={store}
|
|
162
|
-
{children}
|
|
160
|
+
<JoggingJointTab store={store}>{children}</JoggingJointTab>
|
|
163
161
|
</>
|
|
164
162
|
)
|
|
165
163
|
}
|