@wandelbots/wandelbots-js-react-components 2.24.2 → 2.25.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.
@@ -33,6 +33,7 @@ interface NovaComponentsExtension {
33
33
  X?: AxisControlComponentColors;
34
34
  Y?: AxisControlComponentColors;
35
35
  Z?: AxisControlComponentColors;
36
+ CustomRotation?: AxisControlComponentColors;
36
37
  };
37
38
  };
38
39
  JoggingJoint?: {
@@ -1 +1 @@
1
- {"version":3,"file":"themeTypes.d.ts","sourceRoot":"","sources":["../../src/themes/themeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,KAAK,yBAAyB,GAAG;IAC/B,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE;YACR,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,QAAQ,CAAC,EAAE,MAAM,CAAA;YACjB,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,YAAY,CAAC,EAAE,MAAM,CAAA;YACrB,aAAa,CAAC,EAAE,MAAM,CAAA;SACvB,CAAA;QACD,SAAS,CAAC,EAAE;YACV,KAAK,CAAC,EAAE,MAAM,CAAA;SACf,CAAA;KACF,CAAA;CACF,CAAA;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,qBAAqB,CAAC,EAAE;QACtB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,uBAAuB;IAC/B,aAAa,CAAC,EAAE;QACd,YAAY,CAAC,EAAE;YACb,g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AE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,OAAO;QACf,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QAC5B,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;KACpD;IAED,UAAU,cAAc;QACtB,QAAQ,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;QACpC,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;KACpD;IAED,UAAU,KAAM,SAAQ,uBAAuB,EAAE,yBAAyB;KAAG;IAE7E,UAAU,YACR,SAAQ,uBAAuB,EAC7B,yBAAyB;KAAG;CACjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wandelbots/wandelbots-js-react-components",
3
- "version": "2.24.2",
3
+ "version": "2.25.0",
4
4
  "description": "React UI toolkit for building applications on top of the Wandelbots platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -4,6 +4,7 @@ import {
4
4
  ToggleButton,
5
5
  Typography,
6
6
  useTheme,
7
+ type Theme,
7
8
  } from "@mui/material"
8
9
  import { degreesToRadians, radiansToDegrees } from "@wandelbots/nova-js"
9
10
  import { observer } from "mobx-react-lite"
@@ -140,21 +141,38 @@ export const JoggingCartesianTab = observer(
140
141
  await store.deactivate()
141
142
  }
142
143
 
144
+ function getAxisColors(
145
+ axisId: "X" | "Y" | "Z",
146
+ motionType: "translate" | "rotate",
147
+ theme: Theme,
148
+ ) {
149
+ const axisColors =
150
+ theme.componentsExt?.JoggingPanel?.JoggingCartesian?.Axis
151
+
152
+ if (!axisColors) return undefined
153
+
154
+ if (motionType === "translate") {
155
+ return axisColors[axisId]
156
+ }
157
+
158
+ return axisColors.CustomRotation ?? axisColors[axisId]
159
+ }
160
+
143
161
  const axisList = [
144
162
  {
145
163
  id: "x",
146
- colors: theme.componentsExt?.JoggingPanel?.JoggingCartesian?.Axis?.X,
147
164
  icon: <XAxisIcon />,
165
+ colors: getAxisColors("X", store.selectedCartesianMotionType, theme),
148
166
  },
149
167
  {
150
168
  id: "y",
151
- colors: theme.componentsExt?.JoggingPanel?.JoggingCartesian?.Axis?.Y,
152
169
  icon: <YAxisIcon />,
170
+ colors: getAxisColors("Y", store.selectedCartesianMotionType, theme),
153
171
  },
154
172
  {
155
173
  id: "z",
156
- colors: theme.componentsExt?.JoggingPanel?.JoggingCartesian?.Axis?.Z,
157
174
  icon: <ZAxisIcon />,
175
+ colors: getAxisColors("Z", store.selectedCartesianMotionType, theme),
158
176
  },
159
177
  ] as const
160
178
 
@@ -1,4 +1,4 @@
1
- import { Divider, Stack } from "@mui/material"
1
+ import { Divider, Stack, Typography, useTheme } from "@mui/material"
2
2
  import { radiansToDegrees } from "@wandelbots/nova-js"
3
3
  import { observer } from "mobx-react-lite"
4
4
  import type { ReactNode } from "react"
@@ -9,6 +9,7 @@ import { JoggingVelocitySlider } from "./JoggingVelocitySlider"
9
9
 
10
10
  export const JoggingJointTab = observer(
11
11
  ({ store, children }: { store: JoggingStore; children: ReactNode }) => {
12
+ const theme = useTheme()
12
13
  async function startJointJogging(opts: {
13
14
  joint: number
14
15
  direction: "-" | "+"
@@ -52,27 +53,47 @@ export const JoggingJointTab = observer(
52
53
  : undefined
53
54
 
54
55
  return (
55
- <JoggingJointRotationControl
56
+ <Stack
56
57
  key={`joint-${joint.index}`}
57
- disabled={store.isLocked}
58
- lowerLimitDegs={lowerLimitDegs}
59
- upperLimitDegs={upperLimitDegs}
60
- getValueDegs={() => {
61
- const value =
62
- store.jogger.motionStream.rapidlyChangingMotionState.state
63
- .joint_position.joints[joint.index]
64
- return value !== undefined
65
- ? radiansToDegrees(value)
66
- : undefined
67
- }}
68
- startJogging={(direction: "-" | "+") =>
69
- startJointJogging({
70
- joint: joint.index,
71
- direction,
72
- })
73
- }
74
- stopJogging={stopJointJogging}
75
- />
58
+ direction="row"
59
+ alignItems="center"
60
+ justifyContent={"center"}
61
+ spacing={1.5}
62
+ width={"100%"}
63
+ >
64
+ {store.showJointsLegend && (
65
+ <Typography
66
+ color={
67
+ store.isLocked
68
+ ? theme.palette.text.disabled
69
+ : theme.palette.text.secondary
70
+ }
71
+ >
72
+ {`G${joint.index + 1}`}
73
+ </Typography>
74
+ )}
75
+
76
+ <JoggingJointRotationControl
77
+ disabled={store.isLocked}
78
+ lowerLimitDegs={lowerLimitDegs}
79
+ upperLimitDegs={upperLimitDegs}
80
+ getValueDegs={() => {
81
+ const value =
82
+ store.jogger.motionStream.rapidlyChangingMotionState
83
+ .state.joint_position.joints[joint.index]
84
+ return value !== undefined
85
+ ? radiansToDegrees(value)
86
+ : undefined
87
+ }}
88
+ startJogging={(direction: "-" | "+") =>
89
+ startJointJogging({
90
+ joint: joint.index,
91
+ direction,
92
+ })
93
+ }
94
+ stopJogging={stopJointJogging}
95
+ />
96
+ </Stack>
76
97
  )
77
98
  })}
78
99
  </Stack>
@@ -125,6 +125,9 @@ export class JoggingStore {
125
125
  /** Whether to show the legend before the slider */
126
126
  showVelocityLegend: boolean = false
127
127
 
128
+ /** Whether to show the legend before the joints */
129
+ showJointsLegend: boolean = false
130
+
128
131
  disposers: IReactionDisposer[] = []
129
132
 
130
133
  /**
@@ -36,6 +36,7 @@ interface NovaComponentsExtension {
36
36
  X?: AxisControlComponentColors
37
37
  Y?: AxisControlComponentColors
38
38
  Z?: AxisControlComponentColors
39
+ CustomRotation?: AxisControlComponentColors
39
40
  }
40
41
  }
41
42
  JoggingJoint?: {