updated loading page in new window
This commit is contained in:
@@ -39,12 +39,6 @@ export interface CompareProduct {
|
|||||||
simulationTime?: number;
|
simulationTime?: number;
|
||||||
simulationCost?: number;
|
simulationCost?: number;
|
||||||
efficiencyScore?: number;
|
efficiencyScore?: number;
|
||||||
// totalCost: number;
|
|
||||||
// revenueGenerated: number;
|
|
||||||
// costPerUnit: number;
|
|
||||||
//workingDaysPerYear: number;
|
|
||||||
//shiftLength: number;
|
|
||||||
//shiftsPerDay: number;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
export const createCompareProduct = (
|
export const createCompareProduct = (
|
||||||
|
|||||||
@@ -27,7 +27,11 @@ const LoadingPage: React.FC<LoadingPageProps> = ({
|
|||||||
const content = (
|
const content = (
|
||||||
<div
|
<div
|
||||||
className={`loading-wrapper ${
|
className={`loading-wrapper ${
|
||||||
comparisonScene != null && !returnDefault ? "comparisionLoading" : ""
|
comparisonScene != null
|
||||||
|
? returnDefault
|
||||||
|
? "newWindowLoading"
|
||||||
|
: "comparisionLoading"
|
||||||
|
: ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="loading-container">
|
<div className="loading-container">
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ const Button = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleOpenInNewWindow = () => {
|
const handleOpenInNewWindow = () => {
|
||||||
// setLoadingProgress(0);
|
|
||||||
setCreateNewWindow(true);
|
setCreateNewWindow(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -142,25 +142,6 @@ const ComparisonResult = () => {
|
|||||||
(compareProductsData[1]?.simulationData?.machineIdleTime ?? 0))) *
|
(compareProductsData[1]?.simulationData?.machineIdleTime ?? 0))) *
|
||||||
100;
|
100;
|
||||||
|
|
||||||
const product1IdlePercentage =
|
|
||||||
((comparedProducts[0]?.simulationData?.machineIdleTime ?? 0) /
|
|
||||||
((compareProductsData[0]?.simulationData?.machineActiveTime ?? 0) +
|
|
||||||
(compareProductsData[0]?.simulationData?.machineIdleTime ?? 0))) *
|
|
||||||
100;
|
|
||||||
console.log(
|
|
||||||
"product1IdlePercentage: ",
|
|
||||||
compareProductsData[0]?.simulationData?.machineIdleTime
|
|
||||||
);
|
|
||||||
const product2IdlePercentage =
|
|
||||||
((comparedProducts[1]?.simulationData?.machineIdleTime ?? 0) /
|
|
||||||
((compareProductsData[1]?.simulationData?.machineActiveTime ?? 0) +
|
|
||||||
(compareProductsData[1]?.simulationData?.machineIdleTime ?? 0))) *
|
|
||||||
100;
|
|
||||||
console.log(
|
|
||||||
"product2IdlePercentage: ",
|
|
||||||
compareProductsData[1]?.simulationData?.machineIdleTime
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="compare-result-container">
|
<div className="compare-result-container">
|
||||||
<div className="header">Performance Comparison</div>
|
<div className="header">Performance Comparison</div>
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ const NewWindowScene = () => {
|
|||||||
>
|
>
|
||||||
{/* Wait a tick to access child window */}
|
{/* Wait a tick to access child window */}
|
||||||
<Scene layout="Comparison Layout" />
|
<Scene layout="Comparison Layout" />
|
||||||
{
|
{loadingProgress > 0 && (
|
||||||
<LoadingPage
|
<LoadingPage
|
||||||
progress={loadingProgress}
|
progress={loadingProgress}
|
||||||
renderOver={false}
|
renderOver={false}
|
||||||
returnDefault={true}
|
returnDefault={true}
|
||||||
/>
|
/>
|
||||||
}
|
)}
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ export default function Builder() {
|
|||||||
const csgRef = useRef<any>(null);
|
const csgRef = useRef<any>(null);
|
||||||
|
|
||||||
const { toggleView } = useToggleView();
|
const { toggleView } = useToggleView();
|
||||||
const { toolMode, setToolMode } = useToolMode();
|
const { setToolMode } = useToolMode();
|
||||||
const { setRoofVisibility } = useRoofVisibility();
|
const { setRoofVisibility } = useRoofVisibility();
|
||||||
const { setWallVisibility } = useWallVisibility();
|
const { setWallVisibility } = useWallVisibility();
|
||||||
const { setShadows } = useShadows();
|
const { setShadows } = useShadows();
|
||||||
const { setRenderDistance } = useRenderDistance();
|
const { setRenderDistance } = useRenderDistance();
|
||||||
const { limitDistance, setLimitDistance } = useLimitDistance();
|
const { setLimitDistance } = useLimitDistance();
|
||||||
const { projectId } = useParams();
|
const { projectId } = useParams();
|
||||||
const { scene: storeScene, camera: storeCamera, controls: storeControls } = useSceneContext();
|
const { scene: storeScene, camera: storeCamera, controls: storeControls } = useSceneContext();
|
||||||
const { setHoveredPoint, setHoveredLine } = useBuilderStore();
|
const { setHoveredPoint, setHoveredLine } = useBuilderStore();
|
||||||
@@ -58,6 +58,7 @@ export default function Builder() {
|
|||||||
storeScene.current = scene;
|
storeScene.current = scene;
|
||||||
storeCamera.current = camera;
|
storeCamera.current = camera;
|
||||||
storeControls.current = controls as CameraControls;
|
storeControls.current = controls as CameraControls;
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [scene, camera, controls]);
|
}, [scene, camera, controls]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -67,6 +68,7 @@ export default function Builder() {
|
|||||||
gl.domElement.style.cursor = "default";
|
gl.domElement.style.cursor = "default";
|
||||||
setToolMode("cursor");
|
setToolMode("cursor");
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [toggleView, gl]);
|
}, [toggleView, gl]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -80,7 +82,8 @@ export default function Builder() {
|
|||||||
setRenderDistance(data.renderDistance);
|
setRenderDistance(data.renderDistance);
|
||||||
setLimitDistance(data.limitDistance);
|
setLimitDistance(data.limitDistance);
|
||||||
});
|
});
|
||||||
}, [projectId, toolMode]);
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [projectId]);
|
||||||
|
|
||||||
useFrame(() => {
|
useFrame(() => {
|
||||||
if (csgRef.current) {
|
if (csgRef.current) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
import { Canvas, useThree } from "@react-three/fiber";
|
import { Canvas } from "@react-three/fiber";
|
||||||
import { KeyboardControls } from "@react-three/drei";
|
import { KeyboardControls } from "@react-three/drei";
|
||||||
import { useSceneContext } from "./sceneContext";
|
import { useSceneContext } from "./sceneContext";
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
height: 10px;
|
height: 100vh;
|
||||||
width: 10px;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-container {
|
.loading-container {
|
||||||
|
|||||||
6
package-lock.json
generated
Normal file
6
package-lock.json
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "Dwinzo_Demo",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user