diff --git a/app/src/store/simulation/useArmBotStore.ts b/app/src/store/simulation/useArmBotStore.ts index 7795290..7dd4716 100644 --- a/app/src/store/simulation/useArmBotStore.ts +++ b/app/src/store/simulation/useArmBotStore.ts @@ -33,6 +33,7 @@ interface ArmBotStore { getArmBotById: (modelUuid: string) => ArmBotStatus | undefined; getArmBotsByProduct: (productId: string) => ArmBotStatus[]; + getArmBotsByState: (state: string) => ArmBotStatus[]; getActiveArmBots: () => ArmBotStatus[]; getIdleArmBots: () => ArmBotStatus[]; getArmBotsByCurrentAction: (actionUuid: string) => ArmBotStatus[]; @@ -141,6 +142,10 @@ export const useArmBotStore = create()( return get().armBots.filter(a => a.productId === productId); }, + getArmBotsByState: (state) => { + return get().armBots.filter(a => a.state === state); + }, + getActiveArmBots: () => { return get().armBots.filter(a => a.isActive); }, diff --git a/app/src/store/simulation/useConveyorStore.ts b/app/src/store/simulation/useConveyorStore.ts index 72f8400..059e76b 100644 --- a/app/src/store/simulation/useConveyorStore.ts +++ b/app/src/store/simulation/useConveyorStore.ts @@ -26,6 +26,7 @@ interface ConveyorStore { getConveyorById: (modelUuid: string) => ConveyorStatus | undefined; getConveyorsByProduct: (productId: string) => ConveyorStatus[]; + getConveyorsByState: (state: string) => ConveyorStatus[]; getActiveConveyors: () => ConveyorStatus[]; getIdleConveyors: () => ConveyorStatus[]; } @@ -106,6 +107,10 @@ export const useConveyorStore = create()( return get().conveyors.filter(c => c.productId === productId); }, + getConveyorsByState: (state) => { + return get().conveyors.filter(c => c.state === state); + }, + getActiveConveyors: () => { return get().conveyors.filter(c => c.isActive); }, diff --git a/app/src/store/simulation/useMachineStore.ts b/app/src/store/simulation/useMachineStore.ts index 913b374..15997b9 100644 --- a/app/src/store/simulation/useMachineStore.ts +++ b/app/src/store/simulation/useMachineStore.ts @@ -30,6 +30,7 @@ interface MachineStore { // Helpers getMachineById: (modelUuid: string) => MachineStatus | undefined; getMachinesByProduct: (productId: string) => MachineStatus[]; + getMachinesBystate: (state: string) => MachineStatus[]; getActiveMachines: () => MachineStatus[]; getIdleMachines: () => MachineStatus[]; } @@ -114,6 +115,10 @@ export const useMachineStore = create()( return get().machines.filter(m => m.productId === productId); }, + getMachinesBystate: (state) => { + return get().machines.filter(m => m.state === state); + }, + getActiveMachines: () => { return get().machines.filter(m => m.isActive); }, diff --git a/app/src/store/simulation/useStorageUnitStore.ts b/app/src/store/simulation/useStorageUnitStore.ts index 6cf87e4..52e4185 100644 --- a/app/src/store/simulation/useStorageUnitStore.ts +++ b/app/src/store/simulation/useStorageUnitStore.ts @@ -34,6 +34,7 @@ interface StorageUnitStore { // Helpers getStorageUnitById: (modelUuid: string) => StorageUnitStatus | undefined; getStorageUnitsByProduct: (productId: string) => StorageUnitStatus[]; + getStorageUnitsBystate: (state: string) => StorageUnitStatus[]; getActiveStorageUnits: () => StorageUnitStatus[]; getIdleStorageUnits: () => StorageUnitStatus[]; getFullStorageUnits: () => StorageUnitStatus[]; @@ -131,6 +132,10 @@ export const useStorageUnitStore = create()( return get().storageUnits.filter(s => s.productId === productId); }, + getStorageUnitsBystate: (state) => { + return get().storageUnits.filter(s => s.state === state); + }, + getActiveStorageUnits: () => { return get().storageUnits.filter(s => s.isActive); }, diff --git a/app/src/store/simulation/useVehicleStore.ts b/app/src/store/simulation/useVehicleStore.ts index c12fcd9..4eba3f5 100644 --- a/app/src/store/simulation/useVehicleStore.ts +++ b/app/src/store/simulation/useVehicleStore.ts @@ -28,6 +28,7 @@ interface VehiclesStore { getVehicleById: (modelUuid: string) => VehicleStatus | undefined; getVehiclesByProduct: (productId: string) => VehicleStatus[]; + getVehiclesByState: (state: string) => VehicleStatus[]; getActiveVehicles: () => VehicleStatus[]; getIdleVehicles: () => VehicleStatus[]; } @@ -118,6 +119,10 @@ export const useVehicleStore = create()( return get().vehicles.filter(v => v.productId === productId); }, + getVehiclesByState: (state) => { + return get().vehicles.filter(v => v.state === state); + }, + getActiveVehicles: () => { return get().vehicles.filter(v => v.isActive); },