@wandelbots/wandelbots-js-react-components 2.58.0 → 2.59.0-pr.dev-fix-flaky-task.488.1957fef
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/README.md +107 -10
- package/dist/3d.cjs.js +2 -0
- package/dist/3d.cjs.js.map +1 -0
- package/dist/3d.d.ts +11 -0
- package/dist/3d.d.ts.map +1 -0
- package/dist/3d.es.js +16 -0
- package/dist/3d.es.js.map +1 -0
- package/dist/LoadingCover-6gWr11KP.js +88 -0
- package/dist/LoadingCover-6gWr11KP.js.map +1 -0
- package/dist/LoadingCover-CukpS_aj.cjs +2 -0
- package/dist/LoadingCover-CukpS_aj.cjs.map +1 -0
- package/dist/WandelscriptEditor-7eN-Yw7m.js +140 -0
- package/dist/WandelscriptEditor-7eN-Yw7m.js.map +1 -0
- package/dist/WandelscriptEditor-D6_vS5Uk.cjs +2 -0
- package/dist/WandelscriptEditor-D6_vS5Uk.cjs.map +1 -0
- package/dist/auth0-spa-js.production.esm-BMSlxZC5.js +3877 -0
- package/dist/auth0-spa-js.production.esm-BMSlxZC5.js.map +1 -0
- package/dist/auth0-spa-js.production.esm-DZ6lsBvD.cjs +5 -0
- package/dist/auth0-spa-js.production.esm-DZ6lsBvD.cjs.map +1 -0
- package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +1 -1
- package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts.map +1 -1
- package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
- package/dist/components/3d-viewport/collider/ColliderCollection.d.ts +1 -1
- package/dist/components/3d-viewport/collider/ColliderCollection.d.ts.map +1 -1
- package/dist/components/3d-viewport/collider/ColliderElement.d.ts +1 -1
- package/dist/components/3d-viewport/collider/ColliderElement.d.ts.map +1 -1
- package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts +1 -1
- package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts.map +1 -1
- package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts +1 -1
- package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts.map +1 -1
- package/dist/components/ProgramStateIndicator.d.ts +3 -3
- package/dist/components/ProgramStateIndicator.d.ts.map +1 -1
- package/dist/components/RobotCard.d.ts +5 -4
- package/dist/components/RobotCard.d.ts.map +1 -1
- package/dist/components/jogging/JoggingBlocked.d.ts +7 -0
- package/dist/components/jogging/JoggingBlocked.d.ts.map +1 -0
- package/dist/components/jogging/JoggingCartesianTab.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 +10 -5
- package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
- package/dist/components/jogging/PoseCartesianValues.d.ts +2 -2
- package/dist/components/jogging/PoseCartesianValues.d.ts.map +1 -1
- package/dist/components/jogging/PoseJointValues.d.ts +1 -2
- package/dist/components/jogging/PoseJointValues.d.ts.map +1 -1
- package/dist/components/robots/DHRobot.d.ts.map +1 -1
- package/dist/components/robots/GenericRobot.d.ts +2 -2
- package/dist/components/robots/GenericRobot.d.ts.map +1 -1
- package/dist/components/robots/Robot.d.ts +4 -2
- package/dist/components/robots/Robot.d.ts.map +1 -1
- package/dist/components/robots/RobotAnimator.d.ts +2 -2
- package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
- package/dist/components/robots/SupportedRobot.d.ts +4 -4
- package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
- package/dist/components/robots/manufacturerHomePositions.d.ts +1 -1
- package/dist/components/robots/manufacturerHomePositions.d.ts.map +1 -1
- package/dist/components/robots/robotModelLogic.d.ts +11 -1
- package/dist/components/robots/robotModelLogic.d.ts.map +1 -1
- package/dist/components/safetyBar/ControllerTypeIndicator.d.ts.map +1 -1
- package/dist/components/safetyBar/OperationModeIndicator.d.ts +2 -2
- package/dist/components/safetyBar/OperationModeIndicator.d.ts.map +1 -1
- package/dist/components/safetyBar/SafetyBar.d.ts +3 -3
- package/dist/components/safetyBar/SafetyBar.d.ts.map +1 -1
- package/dist/components/safetyBar/SafetyStateIndicator.d.ts +2 -2
- package/dist/components/safetyBar/SafetyStateIndicator.d.ts.map +1 -1
- package/dist/components/utils/errorHandling.d.ts.map +1 -1
- package/dist/components/utils/errorHandling.test.d.ts +2 -0
- package/dist/components/utils/errorHandling.test.d.ts.map +1 -0
- package/dist/core.cjs.js +2 -0
- package/dist/core.cjs.js.map +1 -0
- package/dist/core.d.ts +33 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.es.js +54 -0
- package/dist/core.es.js.map +1 -0
- package/dist/externalizeComponent-CkVWk2F_.cjs +24 -0
- package/dist/externalizeComponent-CkVWk2F_.cjs.map +1 -0
- package/dist/externalizeComponent-Dc3fViZA.js +489 -0
- package/dist/externalizeComponent-Dc3fViZA.js.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +3 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +69 -0
- package/dist/index.es.js.map +1 -0
- package/dist/interpolation-DAXKfoDS.cjs +20 -0
- package/dist/interpolation-DAXKfoDS.cjs.map +1 -0
- package/dist/interpolation-DcPbemBD.js +6924 -0
- package/dist/interpolation-DcPbemBD.js.map +1 -0
- package/dist/lib/ConnectedMotionGroup.d.ts +90 -0
- package/dist/lib/ConnectedMotionGroup.d.ts.map +1 -0
- package/dist/lib/JoggerConnection.d.ts +113 -0
- package/dist/lib/JoggerConnection.d.ts.map +1 -0
- package/dist/lib/JoggerConnection.test.d.ts +2 -0
- package/dist/lib/JoggerConnection.test.d.ts.map +1 -0
- package/dist/lib/MotionStreamConnection.d.ts +24 -0
- package/dist/lib/MotionStreamConnection.d.ts.map +1 -0
- package/dist/lib/MotionStreamConnection.test.d.ts +2 -0
- package/dist/lib/MotionStreamConnection.test.d.ts.map +1 -0
- package/dist/lib/motionStateUpdate.d.ts +7 -0
- package/dist/lib/motionStateUpdate.d.ts.map +1 -0
- package/dist/lib/motionStateUpdate.test.d.ts +2 -0
- package/dist/lib/motionStateUpdate.test.d.ts.map +1 -0
- package/dist/manufacturerHomePositions-BD6C5qZJ.js +1040 -0
- package/dist/manufacturerHomePositions-BD6C5qZJ.js.map +1 -0
- package/dist/manufacturerHomePositions-DRNjU1pU.cjs +2 -0
- package/dist/manufacturerHomePositions-DRNjU1pU.cjs.map +1 -0
- package/dist/theming-CPShzNuV.cjs +115 -0
- package/dist/theming-CPShzNuV.cjs.map +1 -0
- package/dist/theming-Hr605E6v.js +22336 -0
- package/dist/theming-Hr605E6v.js.map +1 -0
- package/dist/wandelscript.cjs.js +2 -0
- package/dist/wandelscript.cjs.js.map +1 -0
- package/dist/wandelscript.d.ts +2 -0
- package/dist/wandelscript.d.ts.map +1 -0
- package/dist/wandelscript.es.js +5 -0
- package/dist/wandelscript.es.js.map +1 -0
- package/package.json +70 -32
- package/src/3d.ts +15 -0
- package/src/components/3d-viewport/CoordinateSystemTransform.tsx +1 -1
- package/src/components/3d-viewport/SafetyZonesRenderer.tsx +1 -2
- package/src/components/3d-viewport/collider/ColliderCollection.tsx +1 -1
- package/src/components/3d-viewport/collider/ColliderElement.tsx +1 -1
- package/src/components/3d-viewport/collider/CollisionSceneRenderer.tsx +1 -1
- package/src/components/3d-viewport/collider/colliderShapeToBufferGeometry.ts +1 -1
- package/src/components/AppHeader.md +1 -1
- package/src/components/ProgramStateIndicator.tsx +3 -6
- package/src/components/RobotCard.tsx +5 -8
- package/src/components/jogging/JoggingBlocked.tsx +37 -0
- package/src/components/jogging/JoggingCartesianTab.tsx +13 -11
- package/src/components/jogging/JoggingJointLimitDetector.tsx +2 -2
- package/src/components/jogging/JoggingJointTab.tsx +4 -4
- package/src/components/jogging/JoggingOptions.tsx +6 -5
- package/src/components/jogging/JoggingPanel.tsx +6 -3
- package/src/components/jogging/JoggingStore.ts +66 -39
- package/src/components/jogging/PoseCartesianValues.tsx +3 -4
- package/src/components/jogging/PoseJointValues.tsx +3 -4
- package/src/components/robots/DHRobot.tsx +2 -3
- package/src/components/robots/GenericRobot.tsx +97 -36
- package/src/components/robots/Robot.tsx +4 -2
- package/src/components/robots/RobotAnimator.test.tsx +7 -22
- package/src/components/robots/RobotAnimator.tsx +31 -21
- package/src/components/robots/SupportedRobot.tsx +14 -9
- package/src/components/robots/manufacturerHomePositions.ts +1 -1
- package/src/components/robots/robotModelLogic.ts +75 -6
- package/src/components/safetyBar/ControllerTypeIndicator.tsx +4 -2
- package/src/components/safetyBar/OperationModeIndicator.tsx +7 -5
- package/src/components/safetyBar/SafetyBar.tsx +3 -6
- package/src/components/safetyBar/SafetyStateIndicator.tsx +9 -7
- package/src/components/utils/errorHandling.test.ts +41 -0
- package/src/components/utils/errorHandling.ts +4 -0
- package/src/core.ts +33 -0
- package/src/env.d.ts +3 -0
- package/src/i18n/locales/de/translations.json +3 -0
- package/src/i18n/locales/en/translations.json +3 -0
- package/src/index.ts +4 -43
- package/src/lib/ConnectedMotionGroup.ts +444 -0
- package/src/lib/JoggerConnection.test.ts +120 -0
- package/src/lib/JoggerConnection.ts +674 -0
- package/src/lib/MotionStreamConnection.test.ts +23 -0
- package/src/lib/MotionStreamConnection.ts +189 -0
- package/src/lib/motionStateUpdate.test.ts +28 -0
- package/src/lib/motionStateUpdate.ts +117 -0
- package/src/wandelscript.ts +2 -0
- package/dist/auth0-spa-js.production.esm-1QXzndwB.js +0 -950
- package/dist/auth0-spa-js.production.esm-1QXzndwB.js.map +0 -1
- package/dist/auth0-spa-js.production.esm-BLRAk7Yh.cjs +0 -5
- package/dist/auth0-spa-js.production.esm-BLRAk7Yh.cjs.map +0 -1
- package/dist/index.cjs +0 -155
- package/dist/index.cjs.map +0 -1
- package/dist/index.js +0 -34927
- package/dist/index.js.map +0 -1
|
@@ -1,13 +1,82 @@
|
|
|
1
|
+
import { NovaClient } from "@wandelbots/nova-js/v2"
|
|
1
2
|
import type { Object3D } from "three"
|
|
2
3
|
import type { GLTF } from "three-stdlib"
|
|
3
|
-
import { version } from "../../../package.json"
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const modelCache = new Map<string, Promise<string>>()
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Revoke a cached model's object URL to prevent memory leaks.
|
|
9
|
+
* Call this when a component unmounts or no longer needs the model.
|
|
10
|
+
*/
|
|
11
|
+
export async function revokeModelUrl(modelFromController: string): Promise<void> {
|
|
12
|
+
const urlPromise = modelCache.get(modelFromController)
|
|
13
|
+
if (!urlPromise) return
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const url = await urlPromise
|
|
17
|
+
URL.revokeObjectURL(url)
|
|
18
|
+
} catch (e) {
|
|
19
|
+
// Ignore errors - URL may already be revoked
|
|
20
|
+
}
|
|
21
|
+
modelCache.delete(modelFromController)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Revoke all cached model object URLs and clear the cache.
|
|
26
|
+
* Useful for cleanup on app teardown.
|
|
27
|
+
*/
|
|
28
|
+
export async function revokeAllModelUrls(): Promise<void> {
|
|
29
|
+
const entries = Array.from(modelCache.entries())
|
|
30
|
+
await Promise.allSettled(
|
|
31
|
+
entries.map(async ([key, urlPromise]) => {
|
|
32
|
+
try {
|
|
33
|
+
const url = await urlPromise
|
|
34
|
+
URL.revokeObjectURL(url)
|
|
35
|
+
} catch (e) {
|
|
36
|
+
// Ignore errors
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
modelCache.clear()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function defaultGetModel(modelFromController: string): Promise<string> {
|
|
44
|
+
// Check cache first
|
|
45
|
+
if (modelCache.has(modelFromController)) {
|
|
46
|
+
return modelCache.get(modelFromController)!
|
|
9
47
|
}
|
|
10
|
-
|
|
48
|
+
|
|
49
|
+
// Create the promise and cache it immediately to prevent duplicate calls
|
|
50
|
+
const modelPromise = (async () => {
|
|
51
|
+
const instanceUrl = import.meta.env.WANDELAPI_BASE_URL
|
|
52
|
+
const nova = new NovaClient({ instanceUrl })
|
|
53
|
+
|
|
54
|
+
// Configure axios to handle binary responses for GLB files
|
|
55
|
+
const apiInstance = nova.api.motionGroupModels as any
|
|
56
|
+
if (apiInstance.axios?.interceptors) {
|
|
57
|
+
apiInstance.axios.interceptors.request.use((config: any) => {
|
|
58
|
+
if (config.url?.includes('/glb')) {
|
|
59
|
+
config.responseType = 'blob'
|
|
60
|
+
}
|
|
61
|
+
return config
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
const file = await nova.api.motionGroupModels.getMotionGroupGlbModel(modelFromController)
|
|
67
|
+
|
|
68
|
+
// Create object URL from the file and return it
|
|
69
|
+
const url = URL.createObjectURL(file)
|
|
70
|
+
return url
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error("Failed to fetch model:", error)
|
|
73
|
+
throw error
|
|
74
|
+
}
|
|
75
|
+
})()
|
|
76
|
+
|
|
77
|
+
// Cache the promise
|
|
78
|
+
modelCache.set(modelFromController, modelPromise)
|
|
79
|
+
return modelPromise
|
|
11
80
|
}
|
|
12
81
|
|
|
13
82
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useTheme, type PopoverOrigin } from "@mui/material"
|
|
2
2
|
import { observer } from "mobx-react-lite"
|
|
3
|
+
import { useId } from "react"
|
|
3
4
|
import { Trans, useTranslation } from "react-i18next"
|
|
4
5
|
import ControllerTypePhysicalIcon from "./icons/controller-type-physical.svg"
|
|
5
6
|
import ControllerTypeVirtualIcon from "./icons/controller-type-virtual.svg"
|
|
@@ -22,12 +23,13 @@ export const ControllerTypeIndicator = observer(
|
|
|
22
23
|
compact,
|
|
23
24
|
}: ControllerTypeIndicatorProps) => {
|
|
24
25
|
const theme = useTheme()
|
|
26
|
+
const componentId = useId()
|
|
25
27
|
const { t } = useTranslation()
|
|
26
28
|
|
|
27
29
|
if (isVirtual) {
|
|
28
30
|
return (
|
|
29
31
|
<IndicatorWithExplanation
|
|
30
|
-
id=
|
|
32
|
+
id={`motion-group-virtual-${componentId}`}
|
|
31
33
|
icon={ControllerTypeVirtualIcon}
|
|
32
34
|
color={theme.palette.tertiary.main}
|
|
33
35
|
name={t("SafetyBar.ControllerType.Virtual.lb")}
|
|
@@ -52,7 +54,7 @@ export const ControllerTypeIndicator = observer(
|
|
|
52
54
|
|
|
53
55
|
return (
|
|
54
56
|
<IndicatorWithExplanation
|
|
55
|
-
id=
|
|
57
|
+
id={`motion-group-physical-${componentId}`}
|
|
56
58
|
icon={ControllerTypePhysicalIcon}
|
|
57
59
|
color={theme.palette.primary.main}
|
|
58
60
|
name={t("SafetyBar.ControllerType.Physical.lb")}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useTheme, type PopoverOrigin } from "@mui/material"
|
|
2
|
-
import type {
|
|
2
|
+
import type { OperationMode } from "@wandelbots/nova-js/v2"
|
|
3
3
|
import { observer } from "mobx-react-lite"
|
|
4
|
+
import { useId } from "react"
|
|
4
5
|
import { Trans, useTranslation } from "react-i18next"
|
|
5
6
|
import OperationModeAutomaticIcon from "./icons/operation-mode-automatic.svg"
|
|
6
7
|
import OperationModeErrorIcon from "./icons/operation-mode-error.svg"
|
|
@@ -8,7 +9,7 @@ import OperationModeManualIcon from "./icons/operation-mode-manual.svg"
|
|
|
8
9
|
import { IndicatorWithExplanation } from "./IndicatorWithExplanation"
|
|
9
10
|
|
|
10
11
|
interface OperationModeIndicatorProps {
|
|
11
|
-
operationMode:
|
|
12
|
+
operationMode: OperationMode
|
|
12
13
|
anchorOrigin?: PopoverOrigin
|
|
13
14
|
transformOrigin?: PopoverOrigin
|
|
14
15
|
compact: boolean
|
|
@@ -23,12 +24,13 @@ export const OperationModeIndicator = observer(
|
|
|
23
24
|
}: OperationModeIndicatorProps) => {
|
|
24
25
|
const { t } = useTranslation()
|
|
25
26
|
const theme = useTheme()
|
|
27
|
+
const componentId = useId()
|
|
26
28
|
|
|
27
29
|
switch (operationMode) {
|
|
28
30
|
case "OPERATION_MODE_AUTO":
|
|
29
31
|
return (
|
|
30
32
|
<IndicatorWithExplanation
|
|
31
|
-
id=
|
|
33
|
+
id={`operation-mode-auto-${componentId}`}
|
|
32
34
|
icon={OperationModeAutomaticIcon}
|
|
33
35
|
title={t("SafetyBar.OperationMode.ti")}
|
|
34
36
|
name={t("SafetyBar.OperationMode.Automatic.ti")}
|
|
@@ -49,7 +51,7 @@ export const OperationModeIndicator = observer(
|
|
|
49
51
|
case "OPERATION_MODE_MANUAL_T2": {
|
|
50
52
|
return (
|
|
51
53
|
<IndicatorWithExplanation
|
|
52
|
-
id=
|
|
54
|
+
id={`operation-mode-manual-${componentId}`}
|
|
53
55
|
icon={OperationModeManualIcon}
|
|
54
56
|
color={theme.palette.warning.main}
|
|
55
57
|
title={t("SafetyBar.OperationMode.ti")}
|
|
@@ -71,7 +73,7 @@ export const OperationModeIndicator = observer(
|
|
|
71
73
|
default:
|
|
72
74
|
return (
|
|
73
75
|
<IndicatorWithExplanation
|
|
74
|
-
id=
|
|
76
|
+
id={`operation-mode-error-${componentId}`}
|
|
75
77
|
icon={OperationModeErrorIcon}
|
|
76
78
|
color={theme.palette.warning.main}
|
|
77
79
|
title={t("SafetyBar.OperationMode.ti")}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { Divider, Stack, type PopoverOrigin } from "@mui/material"
|
|
2
|
-
import type {
|
|
3
|
-
RobotControllerStateOperationModeEnum,
|
|
4
|
-
RobotControllerStateSafetyStateEnum,
|
|
5
|
-
} from "@wandelbots/nova-js/v1"
|
|
2
|
+
import type { OperationMode, SafetyStateType } from "@wandelbots/nova-js/v2"
|
|
6
3
|
import { observer } from "mobx-react-lite"
|
|
7
4
|
import { externalizeComponent } from "../../externalizeComponent"
|
|
8
5
|
import { ControllerTypeIndicator } from "./ControllerTypeIndicator"
|
|
@@ -12,8 +9,8 @@ import { SafetyStateIndicator } from "./SafetyStateIndicator"
|
|
|
12
9
|
export interface SafetyBarProps {
|
|
13
10
|
isVirtual: boolean
|
|
14
11
|
motionGroupId: string
|
|
15
|
-
operationMode:
|
|
16
|
-
safetyState:
|
|
12
|
+
operationMode: OperationMode
|
|
13
|
+
safetyState: SafetyStateType
|
|
17
14
|
anchorOrigin?: PopoverOrigin
|
|
18
15
|
transformOrigin?: PopoverOrigin
|
|
19
16
|
compact?: boolean
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useTheme, type PopoverOrigin } from "@mui/material"
|
|
2
|
-
import type {
|
|
2
|
+
import type { SafetyStateType } from "@wandelbots/nova-js/v2"
|
|
3
3
|
import { observer } from "mobx-react-lite"
|
|
4
|
+
import { useId } from "react"
|
|
4
5
|
import { Trans, useTranslation } from "react-i18next"
|
|
5
6
|
import { assertUnreachable } from "../utils/errorHandling"
|
|
6
7
|
import SafetyStateErrorIcon from "./icons/safety-state-error.svg"
|
|
@@ -11,7 +12,7 @@ import SafetyStateStopIcon from "./icons/safety-state-stop.svg"
|
|
|
11
12
|
import { IndicatorWithExplanation } from "./IndicatorWithExplanation"
|
|
12
13
|
|
|
13
14
|
interface SafetyStateIndicatorProps {
|
|
14
|
-
safetyState:
|
|
15
|
+
safetyState: SafetyStateType
|
|
15
16
|
anchorOrigin?: PopoverOrigin
|
|
16
17
|
transformOrigin?: PopoverOrigin
|
|
17
18
|
compact: boolean
|
|
@@ -26,13 +27,14 @@ export const SafetyStateIndicator = observer(
|
|
|
26
27
|
}: SafetyStateIndicatorProps) => {
|
|
27
28
|
const { t } = useTranslation()
|
|
28
29
|
const theme = useTheme()
|
|
30
|
+
const componentId = useId()
|
|
29
31
|
|
|
30
32
|
switch (safetyState) {
|
|
31
33
|
// Normal state, robot can move
|
|
32
34
|
case "SAFETY_STATE_NORMAL":
|
|
33
35
|
return (
|
|
34
36
|
<IndicatorWithExplanation
|
|
35
|
-
id=
|
|
37
|
+
id={`safety-state-normal-${componentId}`}
|
|
36
38
|
title={t("SafetyBar.SafetyState.ti")}
|
|
37
39
|
name={t("SafetyBar.SafetyState.Normal.lb")}
|
|
38
40
|
label={compact ? null : t("SafetyBar.SafetyState.Normal.lb")}
|
|
@@ -54,7 +56,7 @@ export const SafetyStateIndicator = observer(
|
|
|
54
56
|
case "SAFETY_STATE_ROBOT_EMERGENCY_STOP":
|
|
55
57
|
return (
|
|
56
58
|
<IndicatorWithExplanation
|
|
57
|
-
id=
|
|
59
|
+
id={`safety-state-estop-${componentId}`}
|
|
58
60
|
title={t("SafetyBar.SafetyState.ti")}
|
|
59
61
|
name={t("SafetyBar.SafetyState.Estop.lb")}
|
|
60
62
|
label={compact ? null : t("SafetyBar.SafetyState.Estop.lb")}
|
|
@@ -81,7 +83,7 @@ export const SafetyStateIndicator = observer(
|
|
|
81
83
|
case "SAFETY_STATE_STOP":
|
|
82
84
|
return (
|
|
83
85
|
<IndicatorWithExplanation
|
|
84
|
-
id=
|
|
86
|
+
id={`safety-state-stop-${componentId}`}
|
|
85
87
|
icon={SafetyStateStopIcon}
|
|
86
88
|
title={t("SafetyBar.SafetyState.ti")}
|
|
87
89
|
name={t("SafetyBar.SafetyState.Stop.lb")}
|
|
@@ -108,7 +110,7 @@ export const SafetyStateIndicator = observer(
|
|
|
108
110
|
case "SAFETY_STATE_VIOLATION":
|
|
109
111
|
return (
|
|
110
112
|
<IndicatorWithExplanation
|
|
111
|
-
id=
|
|
113
|
+
id={`safety-state-manual-action-required-${componentId}`}
|
|
112
114
|
icon={SafetyStateManualActionRequiredIcon}
|
|
113
115
|
color={theme.palette.warning.main}
|
|
114
116
|
title={t("SafetyBar.SafetyState.ti")}
|
|
@@ -135,7 +137,7 @@ export const SafetyStateIndicator = observer(
|
|
|
135
137
|
case "SAFETY_STATE_FAULT":
|
|
136
138
|
return (
|
|
137
139
|
<IndicatorWithExplanation
|
|
138
|
-
id=
|
|
140
|
+
id={`safety-state-error-${componentId}`}
|
|
139
141
|
icon={SafetyStateErrorIcon}
|
|
140
142
|
color={theme.palette.error.main}
|
|
141
143
|
title={t("SafetyBar.SafetyState.ti")}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import axios, { AxiosError, AxiosHeaders } from "axios"
|
|
2
|
+
import { expect, test } from "vitest"
|
|
3
|
+
import { makeErrorMessage } from "./errorHandling"
|
|
4
|
+
|
|
5
|
+
test("making useful error messages", async () => {
|
|
6
|
+
// Error objects take the message
|
|
7
|
+
const someCustomError = new Error("some custom error")
|
|
8
|
+
expect(makeErrorMessage(someCustomError)).toEqual("some custom error")
|
|
9
|
+
|
|
10
|
+
// Strings go through prefixed
|
|
11
|
+
expect(makeErrorMessage("some string")).toEqual(
|
|
12
|
+
'Unexpected error: "some string"',
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
// Random objects get serialized
|
|
16
|
+
expect(makeErrorMessage({ some: "object" })).toEqual(
|
|
17
|
+
'Unexpected error: {"some":"object"}',
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
// Axios errors with a response should include the response code
|
|
21
|
+
// and url - but not for 404, we use a friendly message for that
|
|
22
|
+
try {
|
|
23
|
+
await axios.get("http://example.com/doesnt-exist")
|
|
24
|
+
expect(true).toBe(false)
|
|
25
|
+
} catch (err) {
|
|
26
|
+
expect(makeErrorMessage(err)).toMatch(
|
|
27
|
+
"Failed to connect to the server. Please check your internet connection.",
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Not sure how to reproduce CORS errors naturally in vitest environment
|
|
32
|
+
// so let's create it manually
|
|
33
|
+
const networkError = new AxiosError("Network Error", "ERR_NETWORK", {
|
|
34
|
+
url: "http://example.com/some-cors-thing",
|
|
35
|
+
method: "post",
|
|
36
|
+
headers: new AxiosHeaders(),
|
|
37
|
+
})
|
|
38
|
+
expect(makeErrorMessage(networkError)).toEqual(
|
|
39
|
+
"Failed to connect to the server. Please check your internet connection.",
|
|
40
|
+
)
|
|
41
|
+
})
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { AxiosError } from "axios"
|
|
2
2
|
import { tryStringifyJson } from "./converters"
|
|
3
3
|
|
|
4
|
+
// Please note: These helper functions also exist in nova.js
|
|
5
|
+
// (with slightly different formatting), and will be unified
|
|
6
|
+
// at some point in the future.
|
|
7
|
+
|
|
4
8
|
export function delay(ms: number) {
|
|
5
9
|
return new Promise((resolve) => setTimeout(resolve, ms))
|
|
6
10
|
}
|
package/src/core.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Core components without heavy dependencies (Three.js, Monaco, MUI X)
|
|
2
|
+
export * from "./components/AppHeader"
|
|
3
|
+
export * from "./components/CycleTimer"
|
|
4
|
+
export * from "./components/DataGrid"
|
|
5
|
+
export * from "./components/jogging/JoggingCartesianAxisControl"
|
|
6
|
+
export * from "./components/jogging/JoggingJointRotationControl"
|
|
7
|
+
export * from "./components/jogging/JoggingPanel"
|
|
8
|
+
export { JoggingStore } from "./components/jogging/JoggingStore"
|
|
9
|
+
export * from "./components/jogging/PoseCartesianValues"
|
|
10
|
+
export * from "./components/jogging/PoseJointValues"
|
|
11
|
+
export * from "./components/LoadingCover"
|
|
12
|
+
export * from "./components/LogPanel"
|
|
13
|
+
export { LogStore } from "./components/LogStore"
|
|
14
|
+
export * from "./components/LogViewer"
|
|
15
|
+
export * from "./components/modal/NoMotionGroupModal"
|
|
16
|
+
export * from "./components/ProgramControl"
|
|
17
|
+
export * from "./components/ProgramStateIndicator"
|
|
18
|
+
export * from "./components/RobotListItem"
|
|
19
|
+
export * from "./components/RobotSetupReadinessIndicator"
|
|
20
|
+
export * from "./components/safetyBar/SafetyBar"
|
|
21
|
+
export * from "./components/SelectableFab"
|
|
22
|
+
export * from "./components/TabBar"
|
|
23
|
+
export * from "./components/Timer"
|
|
24
|
+
export * from "./components/utils/hooks"
|
|
25
|
+
export * from "./components/utils/interpolation"
|
|
26
|
+
export * from "./components/VelocitySlider"
|
|
27
|
+
export * from "./i18n/config"
|
|
28
|
+
export * from "./lib/ConnectedMotionGroup"
|
|
29
|
+
export * from "./lib/JoggerConnection"
|
|
30
|
+
export * from "./lib/motionStateUpdate"
|
|
31
|
+
export * from "./lib/MotionStreamConnection"
|
|
32
|
+
export * from "./themes/themeTypes"
|
|
33
|
+
export { createNovaMuiTheme } from "./themes/theming"
|
package/src/env.d.ts
ADDED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
"Jogging.Velocity.lb": "Geschwindigkeit",
|
|
5
5
|
"General.degree.variable": "{{amount}}°",
|
|
6
6
|
"General.mm.variable": "{{amount}} mm",
|
|
7
|
+
"Jogging.Blocked.ti": "Verbindung blockiert",
|
|
8
|
+
"Jogging.Blocked.lb": "Ein anderer Client kontrolliert das Jogging.",
|
|
9
|
+
"Jogging.Blocked.Reenable.bt": "Neu verbinden",
|
|
7
10
|
"Jogging.Cartesian.MotionType.lb": "Bewegungstyp",
|
|
8
11
|
"Jogging.Cartesian.Translation.bt": "Translation",
|
|
9
12
|
"Jogging.Cartesian.Rotation.bt": "Rotation",
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
"Jogging.Velocity.lb": "Velocity",
|
|
5
5
|
"General.degree.variable": "{{amount}}°",
|
|
6
6
|
"General.mm.variable": "{{amount}} mm",
|
|
7
|
+
"Jogging.Blocked.ti": "Connection blocked",
|
|
8
|
+
"Jogging.Blocked.lb": "Another client is currently controlling the jogging.",
|
|
9
|
+
"Jogging.Blocked.Reenable.bt": "Reconnect",
|
|
7
10
|
"Jogging.Cartesian.MotionType.lb": "Motion type",
|
|
8
11
|
"Jogging.Cartesian.Translation.bt": "Translation",
|
|
9
12
|
"Jogging.Cartesian.Rotation.bt": "Rotation",
|
package/src/index.ts
CHANGED
|
@@ -1,43 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./components/AppHeader"
|
|
6
|
-
export * from "./components/CycleTimer"
|
|
7
|
-
export * from "./components/Timer"
|
|
8
|
-
export * from "./components/DataGrid"
|
|
9
|
-
export * from "./components/jogging/JoggingCartesianAxisControl"
|
|
10
|
-
export * from "./components/jogging/JoggingJointRotationControl"
|
|
11
|
-
export * from "./components/jogging/JoggingPanel"
|
|
12
|
-
export { JoggingStore } from "./components/jogging/JoggingStore"
|
|
13
|
-
export * from "./components/jogging/PoseCartesianValues"
|
|
14
|
-
export * from "./components/jogging/PoseJointValues"
|
|
15
|
-
export * from "./components/LoadingCover"
|
|
16
|
-
export * from "./components/LogPanel"
|
|
17
|
-
export { LogStore } from "./components/LogStore"
|
|
18
|
-
export * from "./components/LogViewer"
|
|
19
|
-
export * from "./components/modal/NoMotionGroupModal"
|
|
20
|
-
export * from "./components/ProgramControl"
|
|
21
|
-
export * from "./components/ProgramStateIndicator"
|
|
22
|
-
export * from "./components/RobotCard"
|
|
23
|
-
export * from "./components/RobotListItem"
|
|
24
|
-
export * from "./components/robots/AxisConfig"
|
|
25
|
-
export {
|
|
26
|
-
MANUFACTURER_HOME_CONFIGS,
|
|
27
|
-
extractManufacturer,
|
|
28
|
-
getDefaultHomeConfig,
|
|
29
|
-
} from "./components/robots/manufacturerHomePositions"
|
|
30
|
-
export * from "./components/robots/Robot"
|
|
31
|
-
export { defaultGetModel } from "./components/robots/robotModelLogic"
|
|
32
|
-
export * from "./components/robots/SupportedRobot"
|
|
33
|
-
export * from "./components/RobotSetupReadinessIndicator"
|
|
34
|
-
export * from "./components/safetyBar/SafetyBar"
|
|
35
|
-
export * from "./components/SelectableFab"
|
|
36
|
-
export * from "./components/TabBar"
|
|
37
|
-
export * from "./components/utils/hooks"
|
|
38
|
-
export * from "./components/utils/interpolation"
|
|
39
|
-
export * from "./components/VelocitySlider"
|
|
40
|
-
export * from "./components/wandelscript-editor/WandelscriptEditor"
|
|
41
|
-
export * from "./i18n/config"
|
|
42
|
-
export * from "./themes/themeTypes"
|
|
43
|
-
export { createNovaMuiTheme } from "./themes/theming"
|
|
1
|
+
// Re-export all sub-entry points
|
|
2
|
+
export * from "./3d"
|
|
3
|
+
export * from "./core"
|
|
4
|
+
export * from "./wandelscript"
|