feat: Add state filtering methods for ArmBot, Conveyor, Machine, StorageUnit, and Vehicle stores
This commit is contained in:
@@ -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<VehiclesStore>()(
|
||||
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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user