Merge remote-tracking branch 'origin/main-dev' into main-demo
This commit is contained in:
@@ -17,7 +17,7 @@ function CraneMechanics() {
|
|||||||
|
|
||||||
const { selectedEventData } = useSelectedEventData();
|
const { selectedEventData } = useSelectedEventData();
|
||||||
const { productStore } = useSceneContext();
|
const { productStore } = useSceneContext();
|
||||||
const { getPointByUuid, updateAction, addAction, removeAction } = productStore();
|
const { getPointByUuid, addAction, removeAction } = productStore();
|
||||||
const { selectedProductStore } = useProductContext();
|
const { selectedProductStore } = useProductContext();
|
||||||
const { selectedProduct } = selectedProductStore();
|
const { selectedProduct } = selectedProductStore();
|
||||||
const { selectedAction, setSelectedAction, clearSelectedAction } = useSelectedAction();
|
const { selectedAction, setSelectedAction, clearSelectedAction } = useSelectedAction();
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ function HumanMechanics() {
|
|||||||
if (point?.actions?.length) {
|
if (point?.actions?.length) {
|
||||||
setSelectedPointData(point);
|
setSelectedPointData(point);
|
||||||
const firstAction = point.actions[0];
|
const firstAction = point.actions[0];
|
||||||
|
setSelectedAction(firstAction.actionUuid, firstAction.actionName);
|
||||||
setCurrentAction(firstAction);
|
setCurrentAction(firstAction);
|
||||||
setSpeed((
|
setSpeed((
|
||||||
getEventByModelUuid(
|
getEventByModelUuid(
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function RoboticArmMechanics() {
|
|||||||
const { projectId } = useParams();
|
const { projectId } = useParams();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedEventData) {
|
if (selectedEventData && selectedEventData.data.type === 'roboticArm') {
|
||||||
const point = getPointByUuid(
|
const point = getPointByUuid(
|
||||||
selectedProduct.productUuid,
|
selectedProduct.productUuid,
|
||||||
selectedEventData.data.modelUuid,
|
selectedEventData.data.modelUuid,
|
||||||
|
|||||||
@@ -48,15 +48,8 @@ function StorageMechanics() {
|
|||||||
setCurrentCapacity(eventData?.storageCapacity?.toString() || "1");
|
setCurrentCapacity(eventData?.storageCapacity?.toString() || "1");
|
||||||
setSpawnedCount(eventData?.storageCount?.toString() || "0");
|
setSpawnedCount(eventData?.storageCount?.toString() || "0");
|
||||||
setSpawnedMaterial(eventData?.materialType?.toString() || "Default material");
|
setSpawnedMaterial(eventData?.materialType?.toString() || "Default material");
|
||||||
|
setSelectedAction(firstAction.actionUuid, firstAction.actionName);
|
||||||
const actionUuid = selectedAction.actionId || firstAction.actionUuid;
|
setActiveOption(firstAction.actionType === "retrieve" ? "spawn" : "store");
|
||||||
const newCurrentAction = getActionByUuid(selectedProduct.productUuid, actionUuid);
|
|
||||||
|
|
||||||
if (newCurrentAction) {
|
|
||||||
const uiOption = newCurrentAction.actionType === "retrieve" ? "spawn" : "store";
|
|
||||||
setActiveOption(uiOption);
|
|
||||||
setSelectedAction(newCurrentAction.actionUuid, newCurrentAction.actionName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
clearSelectedAction();
|
clearSelectedAction();
|
||||||
|
|||||||
Reference in New Issue
Block a user