From ff14654a72e483d14807272de58c21ad03677177 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 14 Mar 2017 14:09:54 +0100 Subject: [PATCH] show share values in grid --- Shares/mTaskShare.icl | 27 +++++++++++++-------------- miTask.icl | 5 ----- 2 files changed, 13 insertions(+), 19 deletions(-) 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 (||-) -- 2.20.1