v2-ui #91
|
@ -57,7 +57,7 @@ const ZoneProperties: React.FC = () => {
|
||||||
};
|
};
|
||||||
// Call your API to update the zone
|
// Call your API to update the zone
|
||||||
let response = await zoneCameraUpdate(zonesdata, organization);
|
let response = await zoneCameraUpdate(zonesdata, organization);
|
||||||
console.log("response: ", response);
|
// console.log("response: ", response);
|
||||||
if (response.message === "updated successfully") {
|
if (response.message === "updated successfully") {
|
||||||
setZones((prevZones: any[]) =>
|
setZones((prevZones: any[]) =>
|
||||||
prevZones.map((zone) =>
|
prevZones.map((zone) =>
|
||||||
|
|
|
@ -98,6 +98,7 @@ const DropDownList: React.FC<DropDownListProps> = ({
|
||||||
assets: assetsInZone,
|
assets: assetsInZone,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
setZoneDataList(updatedZoneList);
|
setZoneDataList(updatedZoneList);
|
||||||
}, [zones, floorItems]);
|
}, [zones, floorItems]);
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import {
|
||||||
} from "../../../store/builder/store";
|
} from "../../../store/builder/store";
|
||||||
import { zoneCameraUpdate } from "../../../services/visulization/zone/zoneCameraUpdation";
|
import { zoneCameraUpdate } from "../../../services/visulization/zone/zoneCameraUpdation";
|
||||||
import { setFloorItemApi } from "../../../services/factoryBuilder/assest/floorAsset/setFloorItemApi";
|
import { setFloorItemApi } from "../../../services/factoryBuilder/assest/floorAsset/setFloorItemApi";
|
||||||
|
import OuterClick from "../../../utils/outerClick";
|
||||||
|
|
||||||
interface Asset {
|
interface Asset {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -43,13 +44,14 @@ const List: React.FC<ListProps> = ({ items = [], remove }) => {
|
||||||
const { activeModule } = useModuleStore();
|
const { activeModule } = useModuleStore();
|
||||||
const { selectedZone, setSelectedZone } = useSelectedZoneStore();
|
const { selectedZone, setSelectedZone } = useSelectedZoneStore();
|
||||||
const { zoneAssetId, setZoneAssetId } = useZoneAssetId();
|
const { zoneAssetId, setZoneAssetId } = useZoneAssetId();
|
||||||
const { zones } = useZones();
|
const { zones, setZones } = useZones();
|
||||||
const { setSubModule } = useSubModuleStore();
|
const { setSubModule } = useSubModuleStore();
|
||||||
const [expandedZones, setExpandedZones] = useState<Record<string, boolean>>(
|
const [expandedZones, setExpandedZones] = useState<Record<string, boolean>>(
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
const { setFloorItems } = useFloorItems();
|
const { setFloorItems } = useFloorItems();
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
useSelectedZoneStore.getState().setSelectedZone({
|
useSelectedZoneStore.getState().setSelectedZone({
|
||||||
zoneName: "",
|
zoneName: "",
|
||||||
|
@ -82,7 +84,6 @@ const List: React.FC<ListProps> = ({ items = [], remove }) => {
|
||||||
const organization = email?.split("@")[1]?.split(".")[0] ?? "";
|
const organization = email?.split("@")[1]?.split(".")[0] ?? "";
|
||||||
|
|
||||||
let response = await getZoneData(id, organization);
|
let response = await getZoneData(id, organization);
|
||||||
|
|
||||||
setSelectedZone({
|
setSelectedZone({
|
||||||
zoneName: response?.zoneName,
|
zoneName: response?.zoneName,
|
||||||
activeSides: response?.activeSides ?? [],
|
activeSides: response?.activeSides ?? [],
|
||||||
|
@ -125,6 +126,14 @@ const List: React.FC<ListProps> = ({ items = [], remove }) => {
|
||||||
const response = await zoneCameraUpdate(zonesdata, organization);
|
const response = await zoneCameraUpdate(zonesdata, organization);
|
||||||
if (response.message === "updated successfully") {
|
if (response.message === "updated successfully") {
|
||||||
setSelectedZone((prev) => ({ ...prev, zoneName: newName }));
|
setSelectedZone((prev) => ({ ...prev, zoneName: newName }));
|
||||||
|
|
||||||
|
setZones((prevZones: any[]) =>
|
||||||
|
prevZones.map((zone) =>
|
||||||
|
zone.zoneId === selectedZone.zoneId
|
||||||
|
? { ...zone, zoneName: newName }
|
||||||
|
: zone
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +147,7 @@ const List: React.FC<ListProps> = ({ items = [], remove }) => {
|
||||||
zoneAssetId.id,
|
zoneAssetId.id,
|
||||||
newName
|
newName
|
||||||
);
|
);
|
||||||
console.log("response: ", response);
|
// console.log("response: ", response);
|
||||||
setFloorItems((prevFloorItems: any[]) =>
|
setFloorItems((prevFloorItems: any[]) =>
|
||||||
prevFloorItems.map((floorItems) =>
|
prevFloorItems.map((floorItems) =>
|
||||||
floorItems.modelUuid === zoneAssetId.id
|
floorItems.modelUuid === zoneAssetId.id
|
||||||
|
@ -156,6 +165,69 @@ const List: React.FC<ListProps> = ({ items = [], remove }) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let drag = false;
|
||||||
|
let isLeftMouseDown = false;
|
||||||
|
|
||||||
|
const contextClassNames = ["list-wrapper", "zone-properties-container", "list-container"];
|
||||||
|
|
||||||
|
const isOutsideClick = (target: EventTarget | null) => {
|
||||||
|
if (!(target instanceof HTMLElement)) return true;
|
||||||
|
return !contextClassNames.some(className =>
|
||||||
|
target.closest(`.${className}`)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMouseDown = (evt: MouseEvent) => {
|
||||||
|
if (evt.button === 0) {
|
||||||
|
isLeftMouseDown = true;
|
||||||
|
drag = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMouseMove = () => {
|
||||||
|
if (isLeftMouseDown) {
|
||||||
|
drag = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMouseUp = (evt: MouseEvent) => {
|
||||||
|
if (evt.button === 0) {
|
||||||
|
isLeftMouseDown = false;
|
||||||
|
if (drag) return;
|
||||||
|
|
||||||
|
if (isOutsideClick(evt.target)) {
|
||||||
|
// Clear selected zone
|
||||||
|
setSelectedZone({
|
||||||
|
zoneId: '',
|
||||||
|
zoneName: '',
|
||||||
|
activeSides: [],
|
||||||
|
panelOrder: [],
|
||||||
|
lockedPanels: [],
|
||||||
|
widgets: [],
|
||||||
|
zoneViewPortTarget: [],
|
||||||
|
zoneViewPortPosition: []
|
||||||
|
});
|
||||||
|
setZoneAssetId({
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('mousedown', onMouseDown);
|
||||||
|
document.addEventListener('mousemove', onMouseMove);
|
||||||
|
document.addEventListener('mouseup', onMouseUp);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener('mousedown', onMouseDown);
|
||||||
|
document.removeEventListener('mousemove', onMouseMove);
|
||||||
|
document.removeEventListener('mouseup', onMouseUp);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{items?.length > 0 ? (
|
{items?.length > 0 ? (
|
||||||
|
@ -169,7 +241,7 @@ const List: React.FC<ListProps> = ({ items = [], remove }) => {
|
||||||
toggleZoneExpansion(item.id);
|
toggleZoneExpansion(item.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className={`list-item ${item.active ? "active" : ""}`}>
|
<div className={`list-item ${selectedZone.zoneId === item.id ? "active" : ""}`}>
|
||||||
<div className="zone-header">
|
<div className="zone-header">
|
||||||
<button className="value" id="zone-name">
|
<button className="value" id="zone-name">
|
||||||
<RenameInput
|
<RenameInput
|
||||||
|
@ -211,7 +283,7 @@ const List: React.FC<ListProps> = ({ items = [], remove }) => {
|
||||||
{item.assets.map((asset) => (
|
{item.assets.map((asset) => (
|
||||||
<li
|
<li
|
||||||
key={`asset-${asset.id}`}
|
key={`asset-${asset.id}`}
|
||||||
className="list-container asset-item"
|
className={`list-container asset-item ${zoneAssetId?.id === asset.id ? "active" : ""}`}
|
||||||
>
|
>
|
||||||
<div className="list-item">
|
<div className="list-item">
|
||||||
<button
|
<button
|
||||||
|
|
|
@ -533,7 +533,7 @@ const ZoneGroup: React.FC = () => {
|
||||||
<group
|
<group
|
||||||
key={zone.zoneId}
|
key={zone.zoneId}
|
||||||
name={zone.zoneName}
|
name={zone.zoneName}
|
||||||
visible={zone.zoneName === selectedZone.zoneName}
|
visible={zone.zoneId === selectedZone.zoneId}
|
||||||
>
|
>
|
||||||
{zone.points
|
{zone.points
|
||||||
.slice(0, -1)
|
.slice(0, -1)
|
||||||
|
|
|
@ -160,29 +160,26 @@ export function ArrowOnQuadraticBezier({
|
||||||
const arrowRadius = 0.01 * scale;
|
const arrowRadius = 0.01 * scale;
|
||||||
const arrowHeadRadius = arrowRadius * 2.5;
|
const arrowHeadRadius = arrowRadius * 2.5;
|
||||||
|
|
||||||
const curveLength = useMemo(() => fullCurve.getLength(), [fullCurve]);
|
|
||||||
const arrowHeadTOffset = useMemo(() => Math.min(arrowHeadLength / curveLength, 0.5), [arrowHeadLength, curveLength]);
|
|
||||||
|
|
||||||
const endT = 1 - arrowHeadTOffset;
|
|
||||||
|
|
||||||
const subCurve = useMemo(() => {
|
const subCurve = useMemo(() => {
|
||||||
const t1 = Math.max(0, endT - segmentSize / 2);
|
const centerT = 0.5;
|
||||||
const t2 = Math.min(1, endT + segmentSize / 2);
|
const t1 = Math.max(0, centerT - segmentSize / 2);
|
||||||
|
const t2 = Math.min(1, centerT + segmentSize / 2);
|
||||||
|
|
||||||
const divisions = 10;
|
const divisions = 10;
|
||||||
const subPoints = Array.from({ length: divisions + 1 }, (_, i) => {
|
const subPoints = Array.from({ length: divisions + 1 }, (_, i) => {
|
||||||
const t = THREE.MathUtils.lerp(t1, t2, i / divisions);
|
const t = THREE.MathUtils.lerp(t1, t2, i / divisions);
|
||||||
return fullCurve.getPoint(t);
|
return fullCurve.getPoint(t);
|
||||||
});
|
});
|
||||||
return new THREE.CatmullRomCurve3(subPoints);
|
return new THREE.CatmullRomCurve3(subPoints);
|
||||||
}, [fullCurve, endT, segmentSize]);
|
}, [fullCurve, segmentSize]);
|
||||||
|
|
||||||
const tubeGeometry = useMemo(
|
const tubeGeometry = useMemo(
|
||||||
() => new THREE.TubeGeometry(subCurve, 20, arrowRadius, 8, false),
|
() => new THREE.TubeGeometry(subCurve, 20, arrowRadius, 8, false),
|
||||||
[subCurve, arrowRadius]
|
[subCurve, arrowRadius]
|
||||||
);
|
);
|
||||||
|
|
||||||
const arrowPosition = useMemo(() => fullCurve.getPoint(1), [fullCurve]);
|
const arrowPosition = useMemo(() => subCurve.getPoint(1), [subCurve]);
|
||||||
const arrowTangent = useMemo(() => fullCurve.getTangent(1).normalize(), [fullCurve]);
|
const arrowTangent = useMemo(() => subCurve.getTangent(1).normalize(), [subCurve]);
|
||||||
|
|
||||||
const arrowRotation = useMemo(() => {
|
const arrowRotation = useMemo(() => {
|
||||||
return new THREE.Quaternion().setFromUnitVectors(new THREE.Vector3(0, 1, 0), arrowTangent);
|
return new THREE.Quaternion().setFromUnitVectors(new THREE.Vector3(0, 1, 0), arrowTangent);
|
||||||
|
|
|
@ -15,7 +15,7 @@ function PointsCreator() {
|
||||||
const { gl, raycaster, scene, pointer, camera } = useThree();
|
const { gl, raycaster, scene, pointer, camera } = useThree();
|
||||||
const { subModule } = useSubModuleStore();
|
const { subModule } = useSubModuleStore();
|
||||||
const { events, updatePoint, getPointByUuid, getEventByModelUuid } = useEventsStore();
|
const { events, updatePoint, getPointByUuid, getEventByModelUuid } = useEventsStore();
|
||||||
const { getEventByModelUuid: getEventByModelUuidFromProduct, updatePoint: updatePointFromProduct, getEventByModelUuid: getEventByModelUuidFromProduct2 } = useProductStore();
|
const { getEventByModelUuid: getEventByModelUuidFromProduct, updatePoint: updatePointFromProduct, getEventByModelUuid: getEventByModelUuidFromProduct2, getPointByUuid: getPointByUuidFromProduct } = useProductStore();
|
||||||
const { selectedProduct } = useSelectedProduct();
|
const { selectedProduct } = useSelectedProduct();
|
||||||
const { activeModule } = useModuleStore();
|
const { activeModule } = useModuleStore();
|
||||||
const transformRef = useRef<any>(null);
|
const transformRef = useRef<any>(null);
|
||||||
|
@ -76,7 +76,7 @@ function PointsCreator() {
|
||||||
}, [selectedEventSphere]);
|
}, [selectedEventSphere]);
|
||||||
|
|
||||||
const updatePointToState = (selectedEventSphere: THREE.Mesh) => {
|
const updatePointToState = (selectedEventSphere: THREE.Mesh) => {
|
||||||
let point = JSON.parse(
|
let point: PointsScheme = JSON.parse(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
getPointByUuid(
|
getPointByUuid(
|
||||||
selectedEventSphere.userData.modelUuid,
|
selectedEventSphere.userData.modelUuid,
|
||||||
|
@ -90,15 +90,30 @@ function PointsCreator() {
|
||||||
selectedEventSphere.position.y,
|
selectedEventSphere.position.y,
|
||||||
selectedEventSphere.position.z,
|
selectedEventSphere.position.z,
|
||||||
];
|
];
|
||||||
|
point.rotation = [
|
||||||
|
selectedEventSphere.rotation.x,
|
||||||
|
selectedEventSphere.rotation.y,
|
||||||
|
selectedEventSphere.rotation.z,
|
||||||
|
];
|
||||||
|
|
||||||
const event = getEventByModelUuidFromProduct(selectedProduct.productId, selectedEventSphere.userData.modelUuid);
|
const event = getEventByModelUuidFromProduct(selectedProduct.productId, selectedEventSphere.userData.modelUuid);
|
||||||
|
|
||||||
if (event && selectedProduct.productId !== '') {
|
if (event && selectedProduct.productId !== '') {
|
||||||
|
|
||||||
|
const updatedPoint = JSON.parse(
|
||||||
|
JSON.stringify(
|
||||||
|
getPointByUuidFromProduct(selectedProduct.productId, selectedEventSphere.userData.modelUuid, selectedEventSphere.userData.pointUuid)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (updatedPoint) {
|
||||||
|
updatedPoint.position = point.position;
|
||||||
|
updatedPoint.rotation = point.rotation;
|
||||||
|
|
||||||
const updatedEvent = updatePointFromProduct(
|
const updatedEvent = updatePointFromProduct(
|
||||||
selectedProduct.productId,
|
selectedProduct.productId,
|
||||||
selectedEventSphere.userData.modelUuid,
|
selectedEventSphere.userData.modelUuid,
|
||||||
selectedEventSphere.userData.pointUuid,
|
selectedEventSphere.userData.pointUuid,
|
||||||
point
|
updatedPoint
|
||||||
)
|
)
|
||||||
if (updatedEvent) {
|
if (updatedEvent) {
|
||||||
updatePoint(
|
updatePoint(
|
||||||
|
@ -115,6 +130,7 @@ function PointsCreator() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
import { useEffect, useRef } from 'react';
|
||||||
|
import { useFrame } from '@react-three/fiber';
|
||||||
|
import { useMachineStore } from '../../../../store/simulation/useMachineStore';
|
||||||
|
|
||||||
|
type MachineCallback = {
|
||||||
|
machineId: string;
|
||||||
|
callback: () => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function useMachineEventManager() {
|
||||||
|
const { getMachineById } = useMachineStore();
|
||||||
|
const callbacksRef = useRef<MachineCallback[]>([]);
|
||||||
|
const isMonitoringRef = useRef(false);
|
||||||
|
|
||||||
|
// Add a new machine to monitor
|
||||||
|
const addMachineToMonitor = (machineId: string, callback: () => void) => {
|
||||||
|
// Avoid duplicates
|
||||||
|
if (!callbacksRef.current.some((entry) => entry.machineId === machineId)) {
|
||||||
|
callbacksRef.current.push({ machineId, callback });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start monitoring if not already running
|
||||||
|
if (!isMonitoringRef.current) {
|
||||||
|
isMonitoringRef.current = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Remove a machine from monitoring
|
||||||
|
const removeMachineFromMonitor = (machineId: string) => {
|
||||||
|
callbacksRef.current = callbacksRef.current.filter(
|
||||||
|
(entry) => entry.machineId !== machineId
|
||||||
|
);
|
||||||
|
|
||||||
|
// Stop monitoring if no more machines to track
|
||||||
|
if (callbacksRef.current.length === 0) {
|
||||||
|
isMonitoringRef.current = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Check machine states every frame
|
||||||
|
useFrame(() => {
|
||||||
|
if (!isMonitoringRef.current || callbacksRef.current.length === 0) return;
|
||||||
|
|
||||||
|
callbacksRef.current.forEach(({ machineId, callback }) => {
|
||||||
|
const machine = getMachineById(machineId);
|
||||||
|
if (machine && machine.isActive === false && machine.state === 'idle' && !machine.currentAction) {
|
||||||
|
callback();
|
||||||
|
removeMachineFromMonitor(machineId); // Remove after triggering
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Cleanup on unmount
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
callbacksRef.current = [];
|
||||||
|
isMonitoringRef.current = false;
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return {
|
||||||
|
addMachineToMonitor,
|
||||||
|
removeMachineFromMonitor,
|
||||||
|
};
|
||||||
|
}
|
|
@ -10,6 +10,8 @@ import { useStorageUnitStore } from '../../../../store/simulation/useStorageUnit
|
||||||
import { useArmBotEventManager } from '../../roboticArm/eventManager/useArmBotEventManager';
|
import { useArmBotEventManager } from '../../roboticArm/eventManager/useArmBotEventManager';
|
||||||
import { useConveyorStore } from '../../../../store/simulation/useConveyorStore';
|
import { useConveyorStore } from '../../../../store/simulation/useConveyorStore';
|
||||||
import { useConveyorEventManager } from '../../conveyor/eventManager/useConveyorEventManager';
|
import { useConveyorEventManager } from '../../conveyor/eventManager/useConveyorEventManager';
|
||||||
|
import { useVehicleEventManager } from '../../vehicle/instances/eventManager/useVehicleEventManager';
|
||||||
|
import { useMachineEventManager } from '../../machine/eventManager/useMachineEventManager';
|
||||||
|
|
||||||
export function useTriggerHandler() {
|
export function useTriggerHandler() {
|
||||||
const { handleAction } = useActionHandler();
|
const { handleAction } = useActionHandler();
|
||||||
|
@ -19,6 +21,8 @@ export function useTriggerHandler() {
|
||||||
const { getConveyorById } = useConveyorStore();
|
const { getConveyorById } = useConveyorStore();
|
||||||
const { addArmBotToMonitor } = useArmBotEventManager();
|
const { addArmBotToMonitor } = useArmBotEventManager();
|
||||||
const { addConveyorToMonitor } = useConveyorEventManager();
|
const { addConveyorToMonitor } = useConveyorEventManager();
|
||||||
|
const { addVehicleToMonitor } = useVehicleEventManager();
|
||||||
|
const { addMachineToMonitor } = useMachineEventManager();
|
||||||
const { getVehicleById } = useVehicleStore();
|
const { getVehicleById } = useVehicleStore();
|
||||||
const { getMachineById } = useMachineStore();
|
const { getMachineById } = useMachineStore();
|
||||||
const { getStorageUnitById } = useStorageUnitStore();
|
const { getStorageUnitById } = useStorageUnitStore();
|
||||||
|
@ -89,7 +93,7 @@ export function useTriggerHandler() {
|
||||||
|
|
||||||
if (vehicle) {
|
if (vehicle) {
|
||||||
|
|
||||||
if (vehicle.isActive === false && vehicle.state === 'idle' && vehicle.currentLoad < vehicle.point.action.loadCapacity) {
|
if (vehicle.isActive === false && vehicle.state === 'idle' && vehicle.isPicking && vehicle.currentLoad < vehicle.point.action.loadCapacity) {
|
||||||
|
|
||||||
setIsVisible(materialId, false);
|
setIsVisible(materialId, false);
|
||||||
|
|
||||||
|
@ -98,8 +102,10 @@ export function useTriggerHandler() {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Event Manager Needed
|
// Handle current action using Event Manager
|
||||||
|
addVehicleToMonitor(vehicle.modelUuid, () => {
|
||||||
|
handleAction(action, materialId);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,7 +146,78 @@ export function useTriggerHandler() {
|
||||||
if (action) {
|
if (action) {
|
||||||
|
|
||||||
if (armBot) {
|
if (armBot) {
|
||||||
|
if (action && action.triggers.length > 0 &&
|
||||||
|
action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid &&
|
||||||
|
action.triggers[0]?.triggeredAsset?.triggeredAction?.actionUuid &&
|
||||||
|
action.triggers[0]?.triggeredAsset?.triggeredPoint?.pointUuid) {
|
||||||
|
const model = getEventByModelUuid(selectedProduct.productId, action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid);
|
||||||
|
|
||||||
|
if (model?.type === 'vehicle') {
|
||||||
|
const vehicle = getVehicleById(action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid);
|
||||||
|
if (vehicle) {
|
||||||
|
if (vehicle.isActive === false && vehicle.state === 'idle' && vehicle.isPicking && vehicle.currentLoad < vehicle.point.action.loadCapacity) {
|
||||||
|
// Handle current action from vehicle
|
||||||
|
setIsPaused(materialId, true);
|
||||||
|
handleAction(action, materialId);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Handle current action using Event Manager
|
||||||
|
setIsPaused(materialId, true);
|
||||||
|
|
||||||
|
addVehicleToMonitor(vehicle.modelUuid,
|
||||||
|
() => {
|
||||||
|
handleAction(action, materialId);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (model?.type === 'machine') {
|
||||||
|
const armBot = getArmBotById(trigger.triggeredAsset?.triggeredModel.modelUuid);
|
||||||
|
if (armBot) {
|
||||||
|
if (armBot.isActive === false && armBot.state === 'idle') {
|
||||||
|
const machine = getMachineById(action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid);
|
||||||
|
if (machine) {
|
||||||
|
if (machine.isActive === false && machine.state === 'idle' && !machine.currentAction) {
|
||||||
|
setIsPaused(materialId, true);
|
||||||
|
handleAction(action, materialId);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Handle current action using Event Manager
|
||||||
|
setIsPaused(materialId, true);
|
||||||
|
|
||||||
|
addMachineToMonitor(machine.modelUuid,
|
||||||
|
() => {
|
||||||
|
handleAction(action, materialId);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
addArmBotToMonitor(armBot.modelUuid,
|
||||||
|
() => {
|
||||||
|
const machine = getMachineById(action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid || '');
|
||||||
|
if (machine) {
|
||||||
|
if (machine.isActive === false && machine.state === 'idle' && !machine.currentAction) {
|
||||||
|
setIsPaused(materialId, true);
|
||||||
|
handleAction(action, materialId);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Handle current action using Event Manager
|
||||||
|
setIsPaused(materialId, true);
|
||||||
|
|
||||||
|
addMachineToMonitor(machine.modelUuid,
|
||||||
|
() => {
|
||||||
|
handleAction(action, materialId);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (armBot.isActive === false && armBot.state === 'idle') {
|
if (armBot.isActive === false && armBot.state === 'idle') {
|
||||||
|
|
||||||
// Handle current action from arm bot
|
// Handle current action from arm bot
|
||||||
|
@ -149,7 +226,7 @@ export function useTriggerHandler() {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Event Manager Needed
|
// Handle current action using Event Manager
|
||||||
setIsPaused(materialId, true);
|
setIsPaused(materialId, true);
|
||||||
addArmBotToMonitor(armBot.modelUuid,
|
addArmBotToMonitor(armBot.modelUuid,
|
||||||
() => handleAction(action, materialId)
|
() => handleAction(action, materialId)
|
||||||
|
@ -157,6 +234,24 @@ export function useTriggerHandler() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (armBot.isActive === false && armBot.state === 'idle') {
|
||||||
|
|
||||||
|
// Handle current action from arm bot
|
||||||
|
setIsPaused(materialId, true);
|
||||||
|
handleAction(action, materialId);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Handle current action using Event Manager
|
||||||
|
setIsPaused(materialId, true);
|
||||||
|
addArmBotToMonitor(armBot.modelUuid,
|
||||||
|
() => handleAction(action, materialId)
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,11 +429,20 @@ export function useTriggerHandler() {
|
||||||
if (model?.type === 'transfer') {
|
if (model?.type === 'transfer') {
|
||||||
const conveyor = getConveyorById(action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid || '');
|
const conveyor = getConveyorById(action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid || '');
|
||||||
if (conveyor) {
|
if (conveyor) {
|
||||||
|
const previousModel = getEventByModelUuid(selectedProduct.productId, material.previous?.modelUuid || '');
|
||||||
|
if (previousModel) {
|
||||||
|
if (previousModel.type === 'transfer' && previousModel.modelUuid === model.modelUuid) {
|
||||||
|
handleAction(action, materialId)
|
||||||
|
} else {
|
||||||
addConveyorToMonitor(conveyor.modelUuid,
|
addConveyorToMonitor(conveyor.modelUuid,
|
||||||
() => {
|
() => {
|
||||||
handleAction(action, materialId)
|
handleAction(action, materialId)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleAction(action, materialId)
|
||||||
|
}
|
||||||
// handleAction(action, materialId)
|
// handleAction(action, materialId)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -347,18 +451,28 @@ export function useTriggerHandler() {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Event Manager Needed
|
// Handle current action using Event Manager
|
||||||
|
|
||||||
addArmBotToMonitor(armBot.modelUuid,
|
addArmBotToMonitor(armBot.modelUuid,
|
||||||
() => {
|
() => {
|
||||||
const model = getEventByModelUuid(selectedProduct.productId, action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid || '');
|
const model = getEventByModelUuid(selectedProduct.productId, action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid || '');
|
||||||
if (model?.type === 'transfer') {
|
if (model?.type === 'transfer') {
|
||||||
const conveyor = getConveyorById(action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid || '');
|
const conveyor = getConveyorById(action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid || '');
|
||||||
if (conveyor) {
|
if (conveyor) {
|
||||||
|
const previousModel = getEventByModelUuid(selectedProduct.productId, material.previous?.modelUuid || '');
|
||||||
|
if (previousModel) {
|
||||||
|
if (previousModel.type === 'transfer' && previousModel.modelUuid === model.modelUuid) {
|
||||||
|
handleAction(action, materialId)
|
||||||
|
} else {
|
||||||
addConveyorToMonitor(conveyor.modelUuid,
|
addConveyorToMonitor(conveyor.modelUuid,
|
||||||
() => {
|
() => {
|
||||||
handleAction(action, materialId)
|
handleAction(action, materialId)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleAction(action, materialId)
|
||||||
|
}
|
||||||
// handleAction(action, materialId)
|
// handleAction(action, materialId)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -432,17 +546,54 @@ export function useTriggerHandler() {
|
||||||
|
|
||||||
if (vehicle) {
|
if (vehicle) {
|
||||||
|
|
||||||
if (vehicle.isActive === false && vehicle.state === 'idle' && vehicle.currentLoad < vehicle.point.action.loadCapacity) {
|
if (vehicle.isActive === false && vehicle.state === 'idle' && vehicle.isPicking && vehicle.currentLoad < vehicle.point.action.loadCapacity) {
|
||||||
|
|
||||||
|
setPreviousLocation(material.materialId, {
|
||||||
|
modelUuid: material.current.modelUuid,
|
||||||
|
pointUuid: material.current.pointUuid,
|
||||||
|
actionUuid: material.current.actionUuid,
|
||||||
|
})
|
||||||
|
|
||||||
|
setCurrentLocation(material.materialId, {
|
||||||
|
modelUuid: action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid || '',
|
||||||
|
pointUuid: action.triggers[0]?.triggeredAsset?.triggeredPoint?.pointUuid || '',
|
||||||
|
actionUuid: action.triggers[0]?.triggeredAsset?.triggeredAction?.actionUuid || '',
|
||||||
|
});
|
||||||
|
|
||||||
|
setNextLocation(material.materialId, null);
|
||||||
|
|
||||||
setIsVisible(materialId, false);
|
setIsVisible(materialId, false);
|
||||||
|
setIsPaused(materialId, false);
|
||||||
|
|
||||||
// Handle current action from vehicle
|
// Handle current action from vehicle
|
||||||
handleAction(nextAction, materialId);
|
handleAction(nextAction, materialId);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Event Manager Needed
|
// Handle current action using Event Manager
|
||||||
|
setIsPaused(materialId, true);
|
||||||
|
|
||||||
|
addVehicleToMonitor(vehicle.modelUuid,
|
||||||
|
() => {
|
||||||
|
setPreviousLocation(material.materialId, {
|
||||||
|
modelUuid: material.current.modelUuid,
|
||||||
|
pointUuid: material.current.pointUuid,
|
||||||
|
actionUuid: material.current.actionUuid,
|
||||||
|
})
|
||||||
|
|
||||||
|
setCurrentLocation(material.materialId, {
|
||||||
|
modelUuid: action.triggers[0]?.triggeredAsset?.triggeredModel.modelUuid || '',
|
||||||
|
pointUuid: action.triggers[0]?.triggeredAsset?.triggeredPoint?.pointUuid || '',
|
||||||
|
actionUuid: action.triggers[0]?.triggeredAsset?.triggeredAction?.actionUuid || '',
|
||||||
|
});
|
||||||
|
|
||||||
|
setNextLocation(material.materialId, null);
|
||||||
|
|
||||||
|
setIsPaused(materialId, false);
|
||||||
|
setIsVisible(materialId, false);
|
||||||
|
handleAction(nextAction, materialId);
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -491,7 +642,7 @@ export function useTriggerHandler() {
|
||||||
|
|
||||||
if (vehicle) {
|
if (vehicle) {
|
||||||
|
|
||||||
if (vehicle.isActive === false && vehicle.state === 'idle' && vehicle.currentLoad < vehicle.point.action.loadCapacity) {
|
if (vehicle.isActive === false && vehicle.state === 'idle' && vehicle.isPicking && vehicle.currentLoad < vehicle.point.action.loadCapacity) {
|
||||||
|
|
||||||
setIsVisible(materialId, false);
|
setIsVisible(materialId, false);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
import { useEffect, useRef } from 'react';
|
||||||
|
import { useFrame } from '@react-three/fiber';
|
||||||
|
import { useVehicleStore } from '../../../../../store/simulation/useVehicleStore';
|
||||||
|
|
||||||
|
type VehicleCallback = {
|
||||||
|
vehicleId: string;
|
||||||
|
callback: () => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function useVehicleEventManager() {
|
||||||
|
const { getVehicleById } = useVehicleStore();
|
||||||
|
const callbacksRef = useRef<VehicleCallback[]>([]);
|
||||||
|
const isMonitoringRef = useRef(false);
|
||||||
|
|
||||||
|
// Add a new vehicle to monitor
|
||||||
|
const addVehicleToMonitor = (vehicleId: string, callback: () => void) => {
|
||||||
|
// Avoid duplicates
|
||||||
|
if (!callbacksRef.current.some((entry) => entry.vehicleId === vehicleId)) {
|
||||||
|
callbacksRef.current.push({ vehicleId, callback });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start monitoring if not already running
|
||||||
|
if (!isMonitoringRef.current) {
|
||||||
|
isMonitoringRef.current = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Remove a vehicle from monitoring
|
||||||
|
const removeVehicleFromMonitor = (vehicleId: string) => {
|
||||||
|
callbacksRef.current = callbacksRef.current.filter(
|
||||||
|
(entry) => entry.vehicleId !== vehicleId
|
||||||
|
);
|
||||||
|
|
||||||
|
// Stop monitoring if no more vehicles to track
|
||||||
|
if (callbacksRef.current.length === 0) {
|
||||||
|
isMonitoringRef.current = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Check vehicle states every frame
|
||||||
|
useFrame(() => {
|
||||||
|
if (!isMonitoringRef.current || callbacksRef.current.length === 0) return;
|
||||||
|
|
||||||
|
callbacksRef.current.forEach(({ vehicleId, callback }) => {
|
||||||
|
const vehicle = getVehicleById(vehicleId);
|
||||||
|
if (vehicle && vehicle.isActive === false && vehicle.state === 'idle' && vehicle.isPicking && vehicle.currentLoad < vehicle.point.action.loadCapacity) {
|
||||||
|
callback();
|
||||||
|
removeVehicleFromMonitor(vehicleId); // Remove after triggering
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Cleanup on unmount
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
callbacksRef.current = [];
|
||||||
|
isMonitoringRef.current = false;
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return {
|
||||||
|
addVehicleToMonitor,
|
||||||
|
removeVehicleFromMonitor,
|
||||||
|
};
|
||||||
|
}
|
|
@ -41,6 +41,7 @@ export default function Dropped3dWidgets() {
|
||||||
const { raycaster, gl, scene, mouse, camera }: ThreeState = useThree();
|
const { raycaster, gl, scene, mouse, camera }: ThreeState = useThree();
|
||||||
const { widgetSubOption } = useWidgetSubOption();
|
const { widgetSubOption } = useWidgetSubOption();
|
||||||
const { selectedZone } = useSelectedZoneStore();
|
const { selectedZone } = useSelectedZoneStore();
|
||||||
|
let lastClientY = useRef<number | null>(null);
|
||||||
const { top, setTop } = useTopData();
|
const { top, setTop } = useTopData();
|
||||||
const { left, setLeft } = useLeftData();
|
const { left, setLeft } = useLeftData();
|
||||||
const { rightSelect, setRightSelect } = useRightSelected();
|
const { rightSelect, setRightSelect } = useRightSelected();
|
||||||
|
@ -412,6 +413,7 @@ export default function Dropped3dWidgets() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleMouseMove = (event: MouseEvent) => {
|
const handleMouseMove = (event: MouseEvent) => {
|
||||||
if (!rightClickSelected || !rightSelect) return;
|
if (!rightClickSelected || !rightSelect) return;
|
||||||
const selectedZoneId = Object.keys(zoneWidgetData).find(
|
const selectedZoneId = Object.keys(zoneWidgetData).find(
|
||||||
|
@ -465,18 +467,51 @@ export default function Dropped3dWidgets() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (rightSelect === "Vertical Move") {
|
||||||
|
// // console.log('rightSelect: ', rightSelect);
|
||||||
|
|
||||||
|
// // console.log('floorPlanesVertical: ', floorPlanesVertical);
|
||||||
|
// // console.log('planeIntersect.current: ', planeIntersect.current);
|
||||||
|
// // const intersect = raycaster.ray.intersectPlane(
|
||||||
|
// // floorPlanesVertical,
|
||||||
|
// // planeIntersect.current
|
||||||
|
// // );
|
||||||
|
// // console.log('intersect: ', intersect);
|
||||||
|
|
||||||
|
// let intersect = event.clientY
|
||||||
|
|
||||||
|
// if (intersect && typeof intersectcontextmenu === "number") {
|
||||||
|
// console.log('intersect: ', intersect);
|
||||||
|
// const diff = intersect - intersectcontextmenu;
|
||||||
|
// const unclampedY = selectedWidget.position[1] + diff;
|
||||||
|
// const newY = Math.max(0, unclampedY); // Prevent going below floor (y=0)
|
||||||
|
|
||||||
|
// setintersectcontextmenu(intersect);
|
||||||
|
|
||||||
|
// const newPosition: [number, number, number] = [
|
||||||
|
// selectedWidget.position[0],
|
||||||
|
// newY,
|
||||||
|
// selectedWidget.position[2],
|
||||||
|
// ];
|
||||||
|
// console.log('newPosition: ', newPosition);
|
||||||
|
|
||||||
|
|
||||||
|
// updateWidgetPosition(selectedZoneId, rightClickSelected, newPosition);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
if (rightSelect === "Vertical Move") {
|
if (rightSelect === "Vertical Move") {
|
||||||
const intersect = raycaster.ray.intersectPlane(
|
if (lastClientY.current === null) {
|
||||||
floorPlanesVertical,
|
lastClientY.current = event.clientY;
|
||||||
planeIntersect.current
|
return;
|
||||||
);
|
}
|
||||||
|
|
||||||
if (intersect && typeof intersectcontextmenu === "number") {
|
const diff = lastClientY.current - event.clientY; // dragging up = increase Y
|
||||||
const diff = intersect.y - intersectcontextmenu;
|
const scaleFactor = 0.05; // tune this based on your scene scale
|
||||||
const unclampedY = selectedWidget.position[1] + diff;
|
|
||||||
const newY = Math.max(0, unclampedY); // Prevent going below floor (y=0)
|
|
||||||
|
|
||||||
setintersectcontextmenu(intersect.y);
|
const unclampedY = selectedWidget.position[1] + diff * scaleFactor;
|
||||||
|
const newY = Math.max(0, unclampedY);
|
||||||
|
|
||||||
|
lastClientY.current = event.clientY;
|
||||||
|
|
||||||
const newPosition: [number, number, number] = [
|
const newPosition: [number, number, number] = [
|
||||||
selectedWidget.position[0],
|
selectedWidget.position[0],
|
||||||
|
@ -486,7 +521,6 @@ export default function Dropped3dWidgets() {
|
||||||
|
|
||||||
updateWidgetPosition(selectedZoneId, rightClickSelected, newPosition);
|
updateWidgetPosition(selectedZoneId, rightClickSelected, newPosition);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (rightSelect?.startsWith("Rotate")) {
|
if (rightSelect?.startsWith("Rotate")) {
|
||||||
const axis = rightSelect.slice(-1).toLowerCase(); // "x", "y", or "z"
|
const axis = rightSelect.slice(-1).toLowerCase(); // "x", "y", or "z"
|
||||||
|
@ -668,9 +702,12 @@ export default function Dropped3dWidgets() {
|
||||||
|
|
||||||
raycaster.setFromCamera(mouse, camera);
|
raycaster.setFromCamera(mouse, camera);
|
||||||
|
|
||||||
|
const up = new THREE.Vector3(0, 1, 0);
|
||||||
const cameraDirection = new THREE.Vector3();
|
const cameraDirection = new THREE.Vector3();
|
||||||
camera.getWorldDirection(cameraDirection);
|
camera.getWorldDirection(cameraDirection);
|
||||||
const verticalPlane = new THREE.Plane(cameraDirection);
|
const right = new THREE.Vector3().crossVectors(up, cameraDirection).normalize();
|
||||||
|
const verticalPlane = new THREE.Plane(right, 0);
|
||||||
|
// const verticalPlane = new THREE.Plane(cameraDirection);
|
||||||
setFloorPlanesVertical(verticalPlane);
|
setFloorPlanesVertical(verticalPlane);
|
||||||
|
|
||||||
const intersectPoint = raycaster.ray.intersectPlane(
|
const intersectPoint = raycaster.ray.intersectPlane(
|
||||||
|
|
|
@ -198,31 +198,31 @@ const ProductionCapacity: React.FC<ProductionCapacityProps> = ({
|
||||||
useEffect(() => { }, [rotation]);
|
useEffect(() => { }, [rotation]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<Html
|
<Html
|
||||||
|
// data
|
||||||
position={position}
|
position={position}
|
||||||
scale={[0.5, 0.5, 0.5]}
|
scale={[0.5, 0.5, 0.5]}
|
||||||
rotation={rotation}
|
rotation={rotation}
|
||||||
|
// class
|
||||||
|
wrapperClass="pointer-none"
|
||||||
|
// other
|
||||||
transform
|
transform
|
||||||
sprite={true}
|
|
||||||
zIndexRange={[1, 0]}
|
zIndexRange={[1, 0]}
|
||||||
// style={{
|
prepend
|
||||||
// transform: transformStyle.transform,
|
// sprite
|
||||||
// transformStyle: "preserve-3d",
|
distanceFactor={20}
|
||||||
// transition: "transform 0.1s ease-out",
|
// events
|
||||||
// }}
|
|
||||||
onDragOver={(e) => {
|
onDragOver={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}}
|
}}
|
||||||
onDrop={(e) => {
|
onDrop={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// e.stopPropagation();
|
|
||||||
}}
|
}}
|
||||||
wrapperClass="pointer-none"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`productionCapacity-wrapper card ${
|
className={`productionCapacity-wrapper card ${selectedChartId?.id === id ? "activeChart" : ""
|
||||||
selectedChartId?.id === id ? "activeChart" : ""
|
|
||||||
}`}
|
}`}
|
||||||
onClick={() => setSelectedChartId({ id: id, type: type })}
|
onClick={() => setSelectedChartId({ id: id, type: type })}
|
||||||
onContextMenu={onContextMenu}
|
onContextMenu={onContextMenu}
|
||||||
|
|
|
@ -242,12 +242,12 @@ const ReturnOfInvestment: React.FC<ReturnOfInvestmentProps> = ({
|
||||||
rotation={rotation}
|
rotation={rotation}
|
||||||
scale={[0.5, 0.5, 0.5]}
|
scale={[0.5, 0.5, 0.5]}
|
||||||
transform
|
transform
|
||||||
sprite={true}
|
zIndexRange={[1, 0]}
|
||||||
// style={{
|
prepend
|
||||||
// transform: transformStyle.transform,
|
distanceFactor={20}
|
||||||
// transformStyle: "preserve-3d",
|
|
||||||
// transition: "transform 0.1s ease-out",
|
|
||||||
// }}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`returnOfInvestment card ${
|
className={`returnOfInvestment card ${
|
||||||
|
|
|
@ -121,7 +121,9 @@ const StateWorking: React.FC<StateWorkingProps> = ({
|
||||||
scale={[0.5, 0.5, 0.5]}
|
scale={[0.5, 0.5, 0.5]}
|
||||||
transform
|
transform
|
||||||
zIndexRange={[1, 0]}
|
zIndexRange={[1, 0]}
|
||||||
sprite={true}
|
// sprite={true}
|
||||||
|
prepend
|
||||||
|
distanceFactor={20}
|
||||||
// style={{
|
// style={{
|
||||||
// transform: transformStyle.transform,
|
// transform: transformStyle.transform,
|
||||||
// transformStyle: "preserve-3d",
|
// transformStyle: "preserve-3d",
|
||||||
|
|
|
@ -223,7 +223,9 @@ const Throughput: React.FC<ThroughputProps> = ({
|
||||||
scale={[0.5, 0.5, 0.5]}
|
scale={[0.5, 0.5, 0.5]}
|
||||||
transform
|
transform
|
||||||
zIndexRange={[1, 0]}
|
zIndexRange={[1, 0]}
|
||||||
sprite={true}
|
prepend
|
||||||
|
distanceFactor={20}
|
||||||
|
// sprite={true}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`throughput-wrapper card ${selectedChartId?.id === id ? "activeChart" : ""
|
className={`throughput-wrapper card ${selectedChartId?.id === id ? "activeChart" : ""
|
||||||
|
|
|
@ -478,7 +478,6 @@ const DroppedObjects: React.FC = () => {
|
||||||
|
|
||||||
const widthMultiplier = parseFloat(containerWidth) * 0.13;
|
const widthMultiplier = parseFloat(containerWidth) * 0.13;
|
||||||
|
|
||||||
console.log('zone?.objects: ', zone?.objects);
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
onPointerMove={handlePointerMove}
|
onPointerMove={handlePointerMove}
|
||||||
|
|
|
@ -176,7 +176,7 @@ const DisplayZone: React.FC<DisplayZoneProps> = ({
|
||||||
const email = localStorage.getItem("email") || "";
|
const email = localStorage.getItem("email") || "";
|
||||||
const organization = email?.split("@")[1]?.split(".")[0];
|
const organization = email?.split("@")[1]?.split(".")[0];
|
||||||
let response = await getSelect2dZoneData(zoneId, organization);
|
let response = await getSelect2dZoneData(zoneId, organization);
|
||||||
console.log("response: ", response);
|
|
||||||
let res = await getFloatingZoneData(zoneId, organization);
|
let res = await getFloatingZoneData(zoneId, organization);
|
||||||
console.log("res: ", res);
|
console.log("res: ", res);
|
||||||
|
|
||||||
|
|
|
@ -85,3 +85,12 @@
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.list-container.active {
|
||||||
|
.list-item {
|
||||||
|
background: var(--highlight-accent-color);
|
||||||
|
.input-value {
|
||||||
|
color: var(--highlight-text-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -105,6 +105,7 @@
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
|
outline: 1px solid transparent;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
outline: 1px solid var(--border-color);
|
outline: 1px solid var(--border-color);
|
||||||
|
|
Loading…
Reference in New Issue