repositories
/
mTask.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
small update
[mTask.git]
/
miTask.icl
diff --git
a/miTask.icl
b/miTask.icl
index
71b8911
..
0e7a631
100644
(file)
--- a/
miTask.icl
+++ b/
miTask.icl
@@
-24,21
+24,22
@@
import iTasks._Framework.Serialization
import TTY, iTasksTTY
import TTY, iTasksTTY
-derive class iTask UserLED
+Start world = startEngine [
+ publish "/manage" $ const $ mTaskManager
+ >>* [OnAction (Action "Shutdown") (always $ shutDown)],
+ publish "/" $ const demo
+ ] world
-Start :: *World -> *World
-Start world = startEngine (mTaskManager
- >>* [OnAction (Action "Shutdown") (always $ shutDown)]) world
+demo = viewInformation "" [] "Hello world"
mTaskManager :: Task ()
mTaskManager = startupDevices >>| anyTask
[ viewmTasks @! ()
, whileUnchanged sdsStore manageShares
, whileUnchanged deviceStore $ manageDevices process
mTaskManager :: Task ()
mTaskManager = startupDevices >>| anyTask
[ viewmTasks @! ()
, whileUnchanged sdsStore manageShares
, whileUnchanged deviceStore $ manageDevices process
- ] <<@ ApplyLayout (sequenceLayouts
- [ arrangeWithSideBar 0 LeftSide 260 True
- , arrangeSplit Vertical True
- ])
+ ] <<@ ApplyLayout (sequenceLayouts
+ [arrangeWithSideBar 0 LeftSide 260 True
+ ,arrangeSplit Vertical True])
where
viewmTasks :: Task String
viewmTasks = enterChoiceWithShared "Available mTasks" [ChooseFromList id] mTaskTaskStore
where
viewmTasks :: Task String
viewmTasks = enterChoiceWithShared "Available mTasks" [ChooseFromList id] mTaskTaskStore
@@
-50,7
+51,7
@@
mTaskManager = startupDevices >>| anyTask
ds = fromJust ('DM'.get mTaskTask allmTasks)
>>= \bc->(enterChoice "Choose Device" [ChooseFromDropdown \t->t.deviceName] ds
-&&- enterInformation "Timeout" []
ds = fromJust ('DM'.get mTaskTask allmTasks)
>>= \bc->(enterChoice "Choose Device" [ChooseFromDropdown \t->t.deviceName] ds
-&&- enterInformation "Timeout" []
- ) >>* [OnAction (Action "Send") (withValue $ Just o sendToDevice mTaskTask bc)]
+ ) >>* [OnAction (Action "Send") (withValue $ Just o sendT
askT
oDevice mTaskTask bc)]
@! ()
)
@! ()
)
@@
-61,17
+62,13
@@
mTaskManager = startupDevices >>| anyTask
where
proc :: [MTaskMSGRecv] -> Task ()
proc [] = treturn ()
where
proc :: [MTaskMSGRecv] -> Task ()
proc [] = treturn ()
- proc [m:ms] = (case m of
+ proc [MTEmpty:ms] = proc ms
+ proc [m:ms] = traceValue (toString m) >>| (case m of
// MTSDSAck i = traceValue (toString m) @! ()
// MTSDSDelAck i = traceValue (toString m) @! ()
// MTSDSAck i = traceValue (toString m) @! ()
// MTSDSDelAck i = traceValue (toString m) @! ()
- MTPub i val =
getSDSRecord i >>= set (toInt val.[0]*256 + toInt val.[1]) o getSDSStore @! ()
- MTTaskAck i
= deviceTaskAcked device i
+ MTPub i val =
updateShare i val
+ MTTaskAck i
mem = deviceTaskAcked device i mem
MTTaskDelAck i = deviceTaskDeleteAcked device i @! ()
MTTaskDelAck i = deviceTaskDeleteAcked device i @! ()
- MT
Empty = treturn
()
- _ = tr
aceValue (toString m) @!
()
+ MT
DevSpec s = deviceAddSpec device s @!
()
+ _ = tr
eturn
()
) >>| proc ms
) >>| 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 (||-)