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