This commit is contained in:
2025-06-23 09:37:53 +05:30
parent 2fbdf8ab61
commit 54b02541c1
278 changed files with 10134 additions and 7904 deletions

View File

@@ -2,7 +2,7 @@ import React, { useEffect } from 'react'
import { CompareProduct, useCompareProductDataStore, useInputValues, useMachineDowntime, useMachineUptime, useProductionCapacityData, useROISummaryData, useThroughPutData } from '../../../../store/builder/store';
import { usePlayButtonStore } from '../../../../store/usePlayButtonStore';
import { useProductContext } from '../../products/productContext';
import { useProductStore } from '../../../../store/simulation/useProductStore';
import { useSceneContext } from '../../../scene/sceneContext';
export default function ROIData() {
const { selectedProductStore } = useProductContext();
@@ -11,10 +11,11 @@ export default function ROIData() {
const { selectedProduct } = selectedProductStore();
const { isPlaying } = usePlayButtonStore();
const { setRoiSummaryData } = useROISummaryData();
const { products, getProductById } = useProductStore();
const { productStore } = useSceneContext();
const { getProductById } = productStore();
const { compareProductsData, setCompareProductsData } = useCompareProductDataStore();
const { machineActiveTime, setMachineActiveTime } = useMachineUptime();
const { machineIdleTime, setMachineIdleTime } = useMachineDowntime();
const { machineActiveTime } = useMachineUptime();
const { machineIdleTime } = useMachineDowntime();
const { throughputData } = useThroughPutData()
useEffect(() => {
@@ -49,7 +50,7 @@ export default function ROIData() {
if (!isNaN(electricityCost) && !isNaN(fixedCost) && !isNaN(laborCost) && !isNaN(maintenanceCost) &&
!isNaN(materialCost) && !isNaN(productionPeriod) && !isNaN(salvageValue) && !isNaN(sellingPrice) &&
!isNaN(shiftLength) && !isNaN(shiftsPerDay) && !isNaN(workingDaysPerYear) && productionCapacityData > 0) {
// const totalHoursPerYear = shiftLength * shiftsPerDay * workingDaysPerYear;
// const annualProductionUnits = productionCapacityData * totalHoursPerYear;
@@ -187,7 +188,7 @@ export default function ROIData() {
}, [inputValues, productionCapacityData, throughputData, isPlaying]);
useEffect(() => {
}, [compareProductsData])
return null;

View File

@@ -1,17 +1,15 @@
import { useEffect } from 'react';
import { useProductStore } from '../../../../store/simulation/useProductStore';
import { determineExecutionMachineSequences } from '../../simulator/functions/determineExecutionMachineSequences';
import { useInputValues, useMachineCount, useMachineDowntime, useMachineUptime, useMaterialCycle, useProcessBar, useThroughPutData } from '../../../../store/builder/store';
import { usePlayButtonStore } from '../../../../store/usePlayButtonStore';
import { useSceneContext } from '../../../scene/sceneContext';
import { useProductContext } from '../../products/productContext';
import { set } from 'immer/dist/internal';
export default function ThroughPutData() {
const { materialStore, armBotStore, machineStore, conveyorStore, vehicleStore, storageUnitStore } = useSceneContext();
const { materialStore, armBotStore, machineStore, conveyorStore, vehicleStore, storageUnitStore, productStore } = useSceneContext();
const { selectedProductStore } = useProductContext();
const { selectedProduct } = selectedProductStore();
const { products, getProductById } = useProductStore();
const { products, getProductById } = productStore();
const { armBots } = armBotStore();
const { vehicles } = vehicleStore();
const { machines } = machineStore();
@@ -219,7 +217,7 @@ export default function ThroughPutData() {
if (shiftLength > 0 && materialCycleTime > 0 && machineCount > 0 && isPlaying) {
const Units_per_shift = (shiftLength * 60) / (materialCycleTime / 60);
const Throughput_per_day = Units_per_shift * shiftsPerDay * (yieldRate / 100);
setThroughputData(Number(Throughput_per_day.toFixed(2))); // Keep as number
}