diff --git a/app/src/components/layout/sidebarRight/analysis/Analysis.tsx b/app/src/components/layout/sidebarRight/analysis/Analysis.tsx index 0e88e18..1ad18a0 100644 --- a/app/src/components/layout/sidebarRight/analysis/Analysis.tsx +++ b/app/src/components/layout/sidebarRight/analysis/Analysis.tsx @@ -14,9 +14,9 @@ const Analysis: React.FC = () => { const AnalysisPresets: AnalysisPresetsType = { "Throughput time": [ - { type: "default", inputs: { label: "Cycle time", activeOption: "s" } }, - { type: "default", inputs: { label: "machines / lines", activeOption: "item" } }, - { type: "default", inputs: { label: "Machine uptime", activeOption: "%" } }, + // { type: "default", inputs: { label: "Cycle time", activeOption: "s" } }, + // { type: "default", inputs: { label: "machines / lines", activeOption: "item" } }, + // { type: "default", inputs: { label: "Machine uptime", activeOption: "%" } }, ], "Production capacity": [ { type: "default", inputs: { label: "Shift length", activeOption: "hr" } }, diff --git a/app/src/components/layout/sidebarRight/properties/ZoneProperties.tsx b/app/src/components/layout/sidebarRight/properties/ZoneProperties.tsx index 35f3bb5..2cad712 100644 --- a/app/src/components/layout/sidebarRight/properties/ZoneProperties.tsx +++ b/app/src/components/layout/sidebarRight/properties/ZoneProperties.tsx @@ -9,6 +9,7 @@ import { usezoneTarget, } from "../../../../store/builder/store"; import { zoneCameraUpdate } from "../../../../services/visulization/zone/zoneCameraUpdation"; +import { useParams } from "react-router-dom"; const ZoneProperties: React.FC = () => { const { Edit, setEdit } = useEditPosition(); @@ -16,6 +17,7 @@ const ZoneProperties: React.FC = () => { const { zonePosition, setZonePosition } = usezonePosition(); const { zoneTarget, setZoneTarget } = usezoneTarget(); const { zones, setZones } = useZones(); + const { projectId } = useParams() useEffect(() => { setZonePosition(selectedZone.zoneViewPortPosition); @@ -33,7 +35,8 @@ const ZoneProperties: React.FC = () => { viewPortCenter: zoneTarget, }; - let response = await zoneCameraUpdate(zonesdata, organization); + let response = await zoneCameraUpdate(zonesdata, organization,projectId); + console.log('response: ', response); if (response.message === "updated successfully") { setEdit(false); } else { @@ -56,7 +59,8 @@ const ZoneProperties: React.FC = () => { zoneName: newName, }; // Call your API to update the zone - let response = await zoneCameraUpdate(zonesdata, organization); + let response = await zoneCameraUpdate(zonesdata, organization,projectId); + console.log('response: ', response); // console.log("response: ", response); if (response.message === "updated successfully") { setZones((prevZones: any[]) => diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/BarChartInput.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/BarChartInput.tsx index b0b328d..4e2ff22 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/BarChartInput.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/BarChartInput.tsx @@ -8,6 +8,7 @@ import { useWidgetStore } from "../../../../../store/useWidgetStore"; import axios from "axios"; import RenameInput from "../../../../ui/inputs/RenameInput"; import { useParams } from "react-router-dom"; +import { useSocketStore } from "../../../../../store/builder/store"; type Props = {}; @@ -26,6 +27,7 @@ const BarChartInput = (props: Props) => { const organization = email?.split("@")[1]?.split(".")[0]; const [isLoading, setLoading] = useState(true); const { projectId } = useParams(); + const { visualizationSocket } = useSocketStore(); useEffect(() => { @@ -92,6 +94,25 @@ const BarChartInput = (props: Props) => { inputDuration: any, inputName: any ) => { + // const userId = localStorage.getItem("userId"); + // let newWidget = { + // id: selectedChartId.id, + // panel: selectedChartId.panel, + // widgetName: inputName, + // Data: { + // measurements: inputMeasurement, + // duration: inputDuration, + // } + // } + // const adding3dWidget = { + // organization: organization, + // widget: newWidget, + // zoneUuid: selectedZone.zoneUuid, + // projectId, userId + // }; + // if (visualizationSocket) { + // visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget); + // } try { const response = await axios.post( `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/LineGrapInput.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/LineGrapInput.tsx index 912b7d1..be67fcd 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/LineGrapInput.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/LineGrapInput.tsx @@ -124,6 +124,7 @@ import { useWidgetStore } from "../../../../../store/useWidgetStore"; import axios from "axios"; import RenameInput from "../../../../ui/inputs/RenameInput"; import { useParams } from "react-router-dom"; +import { useSocketStore } from "../../../../../store/builder/store"; type Props = {}; @@ -142,6 +143,7 @@ const LineGrapInput = (props: Props) => { const organization = email?.split("@")[1]?.split(".")[0]; const [isLoading, setLoading] = useState(true); const { projectId } = useParams(); + const { visualizationSocket } = useSocketStore(); useEffect(() => { const fetchZoneData = async () => { @@ -207,6 +209,25 @@ const LineGrapInput = (props: Props) => { inputDuration: any, inputName: any ) => { + // const userId = localStorage.getItem("userId"); + // let newWidget = { + // id: selectedChartId.id, + // panel: selectedChartId.panel, + // widgetName: inputName, + // Data: { + // measurements: inputMeasurement, + // duration: inputDuration, + // } + // } + // const adding3dWidget = { + // organization: organization, + // widget: newWidget, + // zoneUuid: selectedZone.zoneUuid, + // projectId, userId + // }; + // if (visualizationSocket) { + // visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget); + // } try { const response = await axios.post( `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/PieChartInput.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/PieChartInput.tsx index 8136c70..875baa2 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/PieChartInput.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/PieChartInput.tsx @@ -8,6 +8,7 @@ import { useWidgetStore } from "../../../../../store/useWidgetStore"; import axios from "axios"; import RenameInput from "../../../../ui/inputs/RenameInput"; import { useParams } from "react-router-dom"; +import { useSocketStore } from "../../../../../store/builder/store"; type Props = {}; @@ -26,6 +27,7 @@ const PieChartInput = (props: Props) => { const organization = email?.split("@")[1]?.split(".")[0]; const [isLoading, setLoading] = useState(true); const { projectId } = useParams(); + const { visualizationSocket } = useSocketStore(); useEffect(() => { @@ -92,6 +94,26 @@ const PieChartInput = (props: Props) => { inputDuration: any, inputName: any ) => { + + // const userId = localStorage.getItem("userId"); + // let newWidget = { + // id: selectedChartId.id, + // panel: selectedChartId.panel, + // widgetName: inputName, + // Data: { + // measurements: inputMeasurement, + // duration: inputDuration, + // }, + // } + // const adding3dWidget = { + // organization: organization, + // widget: newWidget, + // zoneUuid: selectedZone.zoneUuid, + // projectId, userId + // }; + // if (visualizationSocket) { + // visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget); + // } try { const response = await axios.post( `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress1Input.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress1Input.tsx index 8647df7..1f4832e 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress1Input.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress1Input.tsx @@ -8,6 +8,7 @@ import { useWidgetStore } from "../../../../../store/useWidgetStore"; import axios from "axios"; import RenameInput from "../../../../ui/inputs/RenameInput"; import { useParams } from "react-router-dom"; +import { useSocketStore } from "../../../../../store/builder/store"; type Props = {}; @@ -26,6 +27,7 @@ const Progress1Input = (props: Props) => { const organization = email?.split("@")[1]?.split(".")[0]; const [isLoading, setLoading] = useState(true); const { projectId } = useParams(); + const { visualizationSocket } = useSocketStore(); useEffect(() => { @@ -92,6 +94,25 @@ const Progress1Input = (props: Props) => { inputDuration: any, inputName: any ) => { + // const userId = localStorage.getItem("userId"); + // let newWidget = { + // id: selectedChartId.id, + // panel: selectedChartId.panel, + // widgetName: inputName, + // Data: { + // measurements: inputMeasurement, + // duration: inputDuration, + // }, + // } + // const adding3dWidget = { + // organization: organization, + // widget: newWidget, + // zoneUuid: selectedZone.zoneUuid, + // projectId, userId + // }; + // if (visualizationSocket) { + // visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget); + // } try { const response = await axios.post( `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, diff --git a/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress2Input.tsx b/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress2Input.tsx index 8765751..06a4282 100644 --- a/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress2Input.tsx +++ b/app/src/components/layout/sidebarRight/visualization/IotInputCards/Progress2Input.tsx @@ -8,6 +8,7 @@ import { useWidgetStore } from "../../../../../store/useWidgetStore"; import axios from "axios"; import RenameInput from "../../../../ui/inputs/RenameInput"; import { useParams } from "react-router-dom"; +import { useSocketStore } from "../../../../../store/builder/store"; type Props = {}; @@ -26,6 +27,7 @@ const Progress2Input = (props: Props) => { const organization = email?.split("@")[1]?.split(".")[0]; const [isLoading, setLoading] = useState(true); const { projectId } = useParams(); + const { visualizationSocket } = useSocketStore(); useEffect(() => { @@ -92,6 +94,25 @@ const Progress2Input = (props: Props) => { inputDuration: any, inputName: any ) => { + // const userId = localStorage.getItem("userId"); + // let newWidget = { + // id: selectedChartId.id, + // panel: selectedChartId.panel, + // widgetName: inputName, + // Data: { + // measurements: inputMeasurement, + // duration: inputDuration, + // } + // } + // const adding3dWidget = { + // organization: organization, + // widget: newWidget, + // zoneUuid: selectedZone.zoneUuid, + // projectId, userId + // }; + // if (visualizationSocket) { + // visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget); + // } try { const response = await axios.post( `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}/api/V1/widget/save`, diff --git a/app/src/components/ui/analysis/ProductionCapacity.tsx b/app/src/components/ui/analysis/ProductionCapacity.tsx index 0bc8b91..7c2e883 100644 --- a/app/src/components/ui/analysis/ProductionCapacity.tsx +++ b/app/src/components/ui/analysis/ProductionCapacity.tsx @@ -91,7 +91,8 @@ const ThroughputSummary: React.FC = () => { const [isLoading, setIsLoading] = useState(true); useEffect(() => { - if (productionCapacityData >= 0) { + // console.log('productionCapacityData > 0: ', productionCapacityData > 0); + if (productionCapacityData > 0) { setIsLoading(false); console.log("productionCapacityData: ", productionCapacityData); } else { @@ -100,91 +101,93 @@ const ThroughputSummary: React.FC = () => { }, [productionCapacityData]); return ( -
-
-
-
-
Production Capacity
-
- {timeRange.startTime} - {timeRange.endTime} + <> + {!isLoading &&
+
+
+
+
Production Capacity
+
+ {timeRange.startTime} - {timeRange.endTime} +
+
+
+
-
- -
-
- {!isLoading ? ( - <> -
-
- {productionCapacityData}{" "} - Units/hour -
-
-
-
Asset usage
-
{parseFloat(inputValues["Yield rate"])}%
+ {!isLoading ? ( + <> +
+
+ {productionCapacityData}{" "} + Units/hour
- -
-
- -
-
-
Energy Consumption
-
-
- +
+
+
Asset usage
+
{parseFloat(inputValues["Yield rate"])}%
-
-
- {energyConsumption.energyConsumed} + +
+
+ +
+
+
Energy Consumption
+
+
+
-
{energyConsumption.unit}
-
-
-
-
-
Shift Utilization
-
-
{throughputData.assetUsage}%
- -
- {/* Dynamically create progress bars based on shiftUtilization array */} - {shiftUtilization.map((shift, index) => ( -
- ))} -
- -
- {/* Dynamically create shift indicators with random colors */} - {shiftUtilization.map((shift, index) => ( -
- - +
+
+ {energyConsumption.energyConsumed}
- ))} +
{energyConsumption.unit}
+
+
+
+
+
Shift Utilization
+
+
{throughputData.assetUsage}%
+ +
+ {/* Dynamically create progress bars based on shiftUtilization array */} + {shiftUtilization.map((shift, index) => ( +
+ ))} +
+ +
+ {/* Dynamically create shift indicators with random colors */} + {shiftUtilization.map((shift, index) => ( +
+ + +
+ ))} +
-
- - ) : ( - - )} -
-
+ + ) : ( + + )} +
+
} + ); }; diff --git a/app/src/components/ui/analysis/ROISummary.tsx b/app/src/components/ui/analysis/ROISummary.tsx index dc33663..a03b15c 100644 --- a/app/src/components/ui/analysis/ROISummary.tsx +++ b/app/src/components/ui/analysis/ROISummary.tsx @@ -83,136 +83,142 @@ const ROISummary = ({ const [isLoading, setIsLoading] = useState(false); const { roiSummary } = useROISummaryData(); + useEffect(() => { - if (roiSummary && typeof roiSummary === "object") { - setIsLoading(false); // Data loaded + if (roiSummary.productName) { + // If productName is set, assume data is loaded + setIsLoading(false); } else { - setIsLoading(true); // Show skeleton while loading + // If productName is empty, assume still loading + setIsLoading(true); } }, [roiSummary]); return ( -
-
-
-
-
ROI Summary
-
From {getCurrentDate()}
-
-
- -
-
- {!isLoading ? ( - <> -
- -
Product :
-
{roiSummary.productName}
-
-
- -
-
- {roiSummary.roiPercentage}% ROI with payback - in just {roiSummary.paybackPeriod} months + <> + + { + !isLoading &&
+
+
+
+
ROI Summary
+
From {getCurrentDate()}
+
+
+
-
-
- -
- you're on track to hit it by -
July 2029
+ {!isLoading ? ( + <> +
+ +
Product :
+
{roiSummary.productName}
-
-
-
-
- Total Cost Incurred - - - {roiSummary.totalCost} +
+ +
+
+ {roiSummary.roiPercentage}% ROI with payback + in just {roiSummary.paybackPeriod} months +
+
+
+
+ +
+ you're on track to hit it by +
July 2029
+
+
+
+
+
+ Total Cost Incurred + + + {roiSummary.totalCost} + +
+
+ Revenue Generated + + + + {roiSummary.revenueGenerated} + +
+
+
0 ? "profit" : "loss"}`} + > +
+ + Net Profit +
+
+ + {roiSummary.netProfit > 0 + ? roiSummary.netProfit + : roiSummary.netLoss} +
+
+
+
+
+
+
+ + Cost Breakdown +
+ + +
-
- Revenue Generated - - - - {roiSummary.revenueGenerated} - +
+ + + + + + + + + + + + {roiSummaryData.costBreakdown.map((row, index) => ( + + + + + + + + ))} + +
ItemUnit CostLabor CostTotal CostSelling Price
{row.item}{row.unitCost}{row.laborCost}{row.totalCost}{row.sellingPrice}
-
0 ? "profit" : "loss"}`} - > -
- - Net Profit -
-
- - {roiSummary.netProfit > 0 - ? roiSummary.netProfit - : roiSummary.netLoss} -
-
-
-
-
-
-
- - Cost Breakdown -
- - - - -
-
- - - - - - - - - - - - {roiSummaryData.costBreakdown.map((row, index) => ( - - - - - - - - ))} - -
ItemUnit CostLabor CostTotal CostSelling Price
{row.item}{row.unitCost}{row.laborCost}{row.totalCost}{row.sellingPrice}
-
-
- {/*
+ {/*
@@ -232,13 +238,14 @@ const ROISummary = ({
Get ROI Boost Tips
*/} - - ) : ( - - //
No Data
- )} -
-
+ + ) : ( + + //
No Data
+ )} +
+
} + ); }; diff --git a/app/src/components/ui/analysis/ThroughputSummary.tsx b/app/src/components/ui/analysis/ThroughputSummary.tsx index bf570f9..a01ac61 100644 --- a/app/src/components/ui/analysis/ThroughputSummary.tsx +++ b/app/src/components/ui/analysis/ThroughputSummary.tsx @@ -30,72 +30,79 @@ const ProductionCapacity = ({ const [isLoading, setIsLoading] = useState(false); useEffect(() => { - if (throughputData >= 0) { + console.log('typeof throughputData:', typeof throughputData); + console.log('throughputData > 0: ', throughputData > 0); + if (throughputData > 0) { // console.log('machineActiveTime: ', machineActiveTime); // console.log('materialCycleTime: ', materialCycleTime); // console.log('throughputData: ', throughputData); // console.log('productionCapacityData: ', productionCapacityData); + setIsLoading(false); + } else { setIsLoading(true); } }, [throughputData]) return ( -
-
-
-
-
Throughput Summary
-
- {timeRange.startTime} - {timeRange.endTime} + <> + + {!isLoading &&
+
+
+
+
Throughput Summary
+
+ {timeRange.startTime} - {timeRange.endTime} +
+
+
+
-
- -
+ {isLoading ? ( + <> +
+
+ {throughputData} Units/hour + +
+ + {/* Dynamic Progress Bar */} +
+ {[...Array(totalBars)].map((_, i) => ( +
+ {i < barsToFill ? ( +
+ ) : i === barsToFill ? ( +
+ ) : null} +
+ ))} +
+
+ +
+
+ Avg. Process Time + {materialCycleTime} secs/unit +
+
+ Machine Utilization + {machineActiveTime} + {/* {machineActiveTime} */} +
+
+ + ) : ( + + )}
- {isLoading ? ( - <> -
-
- {throughputData} Units/hour - -
- - {/* Dynamic Progress Bar */} -
- {[...Array(totalBars)].map((_, i) => ( -
- {i < barsToFill ? ( -
- ) : i === barsToFill ? ( -
- ) : null} -
- ))} -
-
- -
-
- Avg. Process Time - {materialCycleTime} secs/unit -
-
- Machine Utilization - {machineActiveTime} - {/* {machineActiveTime} */} -
-
- - ) : ( - - )} -
-
+
} + ); }; diff --git a/app/src/components/ui/list/List.tsx b/app/src/components/ui/list/List.tsx index a6aaa10..8136a18 100644 --- a/app/src/components/ui/list/List.tsx +++ b/app/src/components/ui/list/List.tsx @@ -125,7 +125,8 @@ const List: React.FC = ({ items = [], remove }) => { zoneName: newName, }; - const response = await zoneCameraUpdate(zonesdata, organization); + const response = await zoneCameraUpdate(zonesdata, organization,projectId); + console.log('response: ', response); if (response.message === "updated successfully") { setSelectedZone((prev) => ({ ...prev, zoneName: newName })); diff --git a/app/src/components/ui/simulation/simulationPlayer.tsx b/app/src/components/ui/simulation/simulationPlayer.tsx index e2f1c9d..1002a9b 100644 --- a/app/src/components/ui/simulation/simulationPlayer.tsx +++ b/app/src/components/ui/simulation/simulationPlayer.tsx @@ -165,7 +165,7 @@ const SimulationPlayer: React.FC = () => {
-
Hourly Simulation
+
ThroughPut Data
{ const organization = email.split("@")[1].split(".")[0]; const data = await getZonesApi(organization, projectId); - console.log('data: ', data); + // console.log('data: ', data); if (data.length > 0) { const fetchedZones = data.map((zone: any) => ({ diff --git a/app/src/modules/collaboration/camera/collabCams.tsx b/app/src/modules/collaboration/camera/collabCams.tsx index 5ede303..e1c6442 100644 --- a/app/src/modules/collaboration/camera/collabCams.tsx +++ b/app/src/modules/collaboration/camera/collabCams.tsx @@ -144,6 +144,7 @@ const CamModelsGroup = () => { }); socket.on("v1:camera:Response:update", (data: any) => { + // console.log('data: ', data); if ( !groupRef.current || socket.id === data.socketId || diff --git a/app/src/modules/collaboration/socket/socketResponses.dev.tsx b/app/src/modules/collaboration/socket/socketResponses.dev.tsx index 6ff1ab5..79b9a56 100644 --- a/app/src/modules/collaboration/socket/socketResponses.dev.tsx +++ b/app/src/modules/collaboration/socket/socketResponses.dev.tsx @@ -84,6 +84,7 @@ export default function SocketResponses({ }); socket.on("v1:camera:Response:update", (data: any) => { + console.log('dataCamera: ', data); // }); @@ -172,7 +173,7 @@ export default function SocketResponses({ }); socket.on("v1:Line:response:update", (data: any) => { - console.log('data: ', data); + // console.log('data: ', data); if (socket.id === data.socketId) { return; } @@ -214,7 +215,7 @@ export default function SocketResponses({ }); socket.on("v1:Line:response:delete", (data: any) => { - console.log('data: ', data); + // console.log('data: ', data); if (socket.id === data.socketId) { return; } @@ -337,7 +338,7 @@ export default function SocketResponses({ }); socket.on("v1:Line:response:delete:layer", async (data: any) => { - console.log('data: ', data); + // console.log('data: ', data); if (socket.id === data.socketId) { return; } @@ -669,7 +670,7 @@ export default function SocketResponses({ const organization = email!.split("@")[1].split(".")[0]; socket.on("v1:Line:response:create", async (data: any) => { - console.log('data: ', data); + // console.log('data: ', data); // if (socket.id === data.socketId) { return; @@ -788,7 +789,7 @@ export default function SocketResponses({ const organization = email!.split("@")[1].split(".")[0]; socket.on("v1:zone:response:updates", (data: any) => { - console.log('data: ', data); + // console.log('data: ', data); if (socket.id === data.socketId) { return; } @@ -834,7 +835,7 @@ export default function SocketResponses({ }); socket.on("v1:zone:response:delete", (data: any) => { - console.log('data: ', data); + // console.log('data: ', data); if (socket.id === data.socketId) { return; } diff --git a/app/src/modules/scene/camera/updateCameraPosition.ts b/app/src/modules/scene/camera/updateCameraPosition.ts index faeefe3..5698b53 100644 --- a/app/src/modules/scene/camera/updateCameraPosition.ts +++ b/app/src/modules/scene/camera/updateCameraPosition.ts @@ -22,6 +22,7 @@ export default function updateCamPosition( socketId: socket.id, projectId }; + // console.log('CameracamData: ', camData); socket.emit("v1:Camera:set", camData); localStorage.setItem("cameraPosition", JSON.stringify(position)); localStorage.setItem("controlTarget", JSON.stringify(new THREE.Vector3(target.x, 0, target.z))); diff --git a/app/src/modules/scene/controls/controls.tsx b/app/src/modules/scene/controls/controls.tsx index eb64881..da85988 100644 --- a/app/src/modules/scene/controls/controls.tsx +++ b/app/src/modules/scene/controls/controls.tsx @@ -67,6 +67,7 @@ export default function Controls() { socketId: socket.id, projectId }; + // console.log('CameracamData: ', camData); socket.emit('v1:Camera:set', camData) setResetCamera(false); diff --git a/app/src/modules/scene/controls/selectionControls/copyPasteControls.tsx b/app/src/modules/scene/controls/selectionControls/copyPasteControls.tsx index 701f1b1..1e30d10 100644 --- a/app/src/modules/scene/controls/selectionControls/copyPasteControls.tsx +++ b/app/src/modules/scene/controls/selectionControls/copyPasteControls.tsx @@ -363,6 +363,7 @@ const CopyPasteControls = ({ projectId }; + // console.log('data: ', data); socket.emit("v1:model-asset:add", data); obj.userData = { @@ -418,6 +419,7 @@ const CopyPasteControls = ({ userId }; + // console.log('data: ', data); socket.emit("v1:model-asset:add", data); const asset: Asset = { diff --git a/app/src/modules/scene/controls/selectionControls/duplicationControls.tsx b/app/src/modules/scene/controls/selectionControls/duplicationControls.tsx index 24bcdd5..8ef9e24 100644 --- a/app/src/modules/scene/controls/selectionControls/duplicationControls.tsx +++ b/app/src/modules/scene/controls/selectionControls/duplicationControls.tsx @@ -338,6 +338,7 @@ const DuplicationControls = ({ userId }; + // console.log('data: ', data); socket.emit("v1:model-asset:add", data); const asset: Asset = { @@ -387,6 +388,7 @@ const DuplicationControls = ({ projectId }; + // console.log('data: ', data);/ socket.emit("v1:model-asset:add", data); const asset: Asset = { diff --git a/app/src/modules/scene/controls/selectionControls/moveControls.tsx b/app/src/modules/scene/controls/selectionControls/moveControls.tsx index 7a244f4..f0eb5a5 100644 --- a/app/src/modules/scene/controls/selectionControls/moveControls.tsx +++ b/app/src/modules/scene/controls/selectionControls/moveControls.tsx @@ -314,6 +314,7 @@ function MoveControls({ userId }; + // console.log('data: ', data); socket.emit("v1:model-asset:add", data); AssetGroup.current.add(obj); diff --git a/app/src/modules/scene/controls/selectionControls/rotateControls.tsx b/app/src/modules/scene/controls/selectionControls/rotateControls.tsx index 0b42a0e..6d78846 100644 --- a/app/src/modules/scene/controls/selectionControls/rotateControls.tsx +++ b/app/src/modules/scene/controls/selectionControls/rotateControls.tsx @@ -273,6 +273,7 @@ function RotateControls({ userId }; + // console.log('data: ', data); socket.emit("v1:model-asset:add", data); AssetGroup.current.add(obj); diff --git a/app/src/modules/scene/controls/transformControls/transformControls.tsx b/app/src/modules/scene/controls/transformControls/transformControls.tsx index 86a29c8..17c2b3c 100644 --- a/app/src/modules/scene/controls/transformControls/transformControls.tsx +++ b/app/src/modules/scene/controls/transformControls/transformControls.tsx @@ -134,6 +134,7 @@ export default function TransformControl() { projectId }; + // console.log('data: ', data); socket.emit("v1:model-asset:add", data); } } diff --git a/app/src/modules/visualization/widgets/3d/Dropped3dWidget.tsx b/app/src/modules/visualization/widgets/3d/Dropped3dWidget.tsx index a5811ad..56ec30c 100644 --- a/app/src/modules/visualization/widgets/3d/Dropped3dWidget.tsx +++ b/app/src/modules/visualization/widgets/3d/Dropped3dWidget.tsx @@ -361,10 +361,7 @@ export default function Dropped3dWidgets() { } }, [rightSelect, rightClickSelected]); - function isPointInPolygon( - point: [number, number], - polygon: Array<[number, number]> - ): boolean { + function isPointInPolygon(point: [number, number], polygon: Array<[number, number]>): boolean { const [x, z] = point; let inside = false; @@ -434,8 +431,6 @@ export default function Dropped3dWidgets() { } } }; - - const handleMouseMove = (event: MouseEvent) => { if (!rightClickSelected || !rightSelect) return; const selectedzoneUuid = Object.keys(zoneWidgetData).find( diff --git a/app/src/services/factoryBuilder/environment/setEnvironment.ts b/app/src/services/factoryBuilder/environment/setEnvironment.ts index 063ce23..b0bb82a 100644 --- a/app/src/services/factoryBuilder/environment/setEnvironment.ts +++ b/app/src/services/factoryBuilder/environment/setEnvironment.ts @@ -31,7 +31,6 @@ export const setEnvironment = async ( renderDistance, limitDistance, projectId - }), } ); diff --git a/app/src/services/visulization/zone/zoneCameraUpdation.ts b/app/src/services/visulization/zone/zoneCameraUpdation.ts index 4c219f5..e7dbdde 100644 --- a/app/src/services/visulization/zone/zoneCameraUpdation.ts +++ b/app/src/services/visulization/zone/zoneCameraUpdation.ts @@ -1,17 +1,17 @@ let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`; // let url_Backend_dwinzo = `http://192.168.0.102:5000`; -export const zoneCameraUpdate = async (zonesdata: {}, organization: string) => { +export const zoneCameraUpdate = async (zoneData: {}, organization: string, projectId?: string) => { try { const response = await fetch(`${url_Backend_dwinzo}/api/V1/zones`, { method: "POST", - headers: { - Authorization: "Bearer ", + headers: { + Authorization: "Bearer ", // Replace with actual token "Content-Type": "application/json", token: localStorage.getItem("token") || "", refresh_token: localStorage.getItem("refreshToken") || "", }, - body: JSON.stringify({ zonesdata, organization }), + body: JSON.stringify({ zoneData,projectId }), }); if (!response.ok) {