1 implementation module Shares.mTaskShare
7 from Data.Func import $
9 manageShares :: [MTaskShare] -> Task ()
10 manageShares shares = forever (enterChoice "Choose share to update" [ChooseFromGrid id] shares
11 >&^ \st->whileUnchanged st $ \msh->case msh of
12 Nothing = viewShares shares @! zero
14 viewSharedInformation "View value" [] (getSDSStore sh)
15 >>* [OnAction (Action "Update") (withValue (Just o updateInformation "New value" []))]
21 updateShare :: MTaskShare a -> Task MTaskShare | toByteCode a
22 updateShare sh=:{withTask,identifier} a = getDeviceByName withTask
23 >>= sendMessages [MTUpd identifier $ toString $ toByteCode a]
27 viewShares :: [MTaskShare] -> Task ()
28 viewShares sh = anyTask (map viewShare sh) <<@ ArrangeHorizontal @! ()
30 viewShare :: MTaskShare -> Task ()
31 viewShare m = viewSharedInformation "" [] (getSDSStore m)
32 <<@ Title ("SDS: " +++ toString m.identifier) @! ()
34 instance zero MTaskShare where
35 zero = {initValue=0,withTask="",identifier=0,realShare=""}