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