From: Mart Lubbers Date: Tue, 14 Mar 2017 13:09:54 +0000 (+0100) Subject: show share values in grid X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=ff14654a72e483d14807272de58c21ad03677177;p=mTask.git show share values in grid --- diff --git a/Shares/mTaskShare.icl b/Shares/mTaskShare.icl index 76f676a..e438a4a 100644 --- a/Shares/mTaskShare.icl +++ b/Shares/mTaskShare.icl @@ -12,7 +12,7 @@ derive class iTask MTaskShareType, MTaskShare manageShares :: [MTaskShare] -> Task () manageShares shares = forever $ - /*viewSharesGrid shares -|| */viewShares shares @! () + viewSharesGrid shares @! () // >&^ \st->whileUnchanged st $ \msh->case msh of // Nothing = viewShares shares @@ -25,25 +25,24 @@ manageShares shares = forever $ // ) @! () -viewShares :: [MTaskShare] -> Task BCValue -viewShares shares = anyTask (map viewShare shares) - -viewAndDelete :: [MTaskShare] -> Task () -viewAndDelete shares - = enterChoice "Choose share to update" [ChooseFromGrid id] shares @! () +//viewShares :: [MTaskShare] -> Task BCValue +//viewShares shares = anyTask (map viewShare shares) +// +//viewAndDelete :: [MTaskShare] -> Task () +//viewAndDelete shares +// = enterChoice "Choose share to update" [ChooseFromGrid id] shares @! () //updateShare :: MTaskShare a -> Task MTaskShare | toByteCode, iTask a //updateShare sh=:{withTask,identifier} a = getDeviceByName withTask // >>= sendMessages [MTUpd identifier $ toString $ toByteCode a] // >>| treturn sh -//viewSharesGrid :: [MTaskShare] -> Task [MTaskShare] -//viewSharesGrid sh = allTasks [whileUnchanged (get $ getSDSShare m) (\s->treturn (m, s))\\m<-sh] -// @ map (\(s,v)->{MTaskShare|s&value=v}) -// >>= enterChoice "Choose share" [ChooseFromGrid id] -// >>= \s->treturn [s] -//{anyTask (map viewShare sh) <<@ ArrangeHorizontal -// >>| return (hd sh) +viewSharesGrid :: [MTaskShare] -> Task [BCValue] +viewSharesGrid sh = allTasks [watch (getSDSShare m)\\m<-sh] + >&^ \st->whileUnchanged st $ \mshs->enterChoice "" [ChooseFromGrid id] + [{MTaskShare|ss&value=s}\\s<-fromJust mshs & ss<-sh] + @! fromJust mshs +// /*enterChoice "" [ChooseFromGrid id]*/viewInformation "" [] o fromJust viewShare :: MTaskShare -> Task BCValue viewShare m = viewSharedInformation "" [] (getSDSShare m) diff --git a/miTask.icl b/miTask.icl index 2b9d4e0..e14f9e3 100644 --- a/miTask.icl +++ b/miTask.icl @@ -68,8 +68,3 @@ mTaskManager = startupDevices >>| anyTask MTTaskDelAck i = deviceTaskDeleteAcked device i @! () _ = treturn () ) >>| proc ms - - mapPar :: (a -> Task a) [a] -> Task () - mapPar f l = foldr1 (\x y->f x ||- y) l <<@ ArrangeWithTabs @! () - allAtOnce t = foldr1 (||-) t @! () - //allAtOnce = (flip (@!) ()) o foldr1 (||-)