implementation module Utils.SDS import iTasks import iTasks._Framework.Store import Devices.mTaskDevice import Shares.mTaskShare from Data.Func import $ derive class iTask MTaskShare, BCState memoryShare :: String a -> Shared a | iTask a memoryShare s d = sdsFocus s $ memoryStore "" $ Just d deviceStore :: Shared [MTaskDevice] deviceStore = sharedStore "mTaskDevices" [] sdsStore :: Shared [MTaskShare] sdsStore = memoryShare "mTaskShares" [] bcStateStore :: Shared BCState bcStateStore = memoryShare "mTaskBCState" zero mTaskTaskStore :: Shared [String] mTaskTaskStore = memoryShare "mTaskTasks" ["count", "ledon", "ledoff"] getSDSStore :: MTaskShare -> Shared Int getSDSStore sh = memoryShare sh.realShare 0 getSDSRecord :: Int -> Task MTaskShare getSDSRecord i = get sdsStore @ \l->hd [s\\s<-l | s.identifier == i]