X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=miTask.icl;h=5a65116f18945012a6ae2026a67313b59d789c4f;hb=e37402e7672352aa3642df4c1183417a72f59641;hp=a2ef345b38690d5db21dacce05e09623ae1a5460;hpb=cf006df4dfd44845b6e5459d81bfe34a187884a9;p=mTask.git diff --git a/miTask.icl b/miTask.icl index a2ef345..5a65116 100644 --- a/miTask.icl +++ b/miTask.icl @@ -24,24 +24,20 @@ import iTasks._Framework.Serialization import TTY, iTasksTTY -derive class iTask UserLED - Start :: *World -> *World Start world = startEngine (mTaskManager >>* [OnAction (Action "Shutdown") (always $ shutDown)]) world mTaskManager :: Task () -mTaskManager = anyTask +mTaskManager = startupDevices >>| anyTask [ viewmTasks @! () - , whileUnchanged sdsStore viewShares + , whileUnchanged sdsStore manageShares , whileUnchanged deviceStore $ manageDevices process - ] <<@ ApplyLayout layout - where - layout = sequenceLayouts + ] <<@ ApplyLayout (sequenceLayouts [ arrangeWithSideBar 0 LeftSide 260 True , arrangeSplit Vertical True - ] - + ]) + where viewmTasks :: Task String viewmTasks = enterChoiceWithShared "Available mTasks" [ChooseFromList id] mTaskTaskStore >&^ \sh->whileUnchanged sh $ \mi->forever (case mi of @@ -51,8 +47,9 @@ mTaskManager = anyTask [] = viewInformation "No devices yet" [] () ds = fromJust ('DM'.get mTaskTask allmTasks) >>= \bc->(enterChoice "Choose Device" [ChooseFromDropdown \t->t.deviceName] ds - -&&- enterInformation "Timeout, 0 for one-shot" [] + -&&- enterInformation "Timeout" [] ) >>* [OnAction (Action "Send") (withValue $ Just o sendToDevice mTaskTask bc)] + @! () ) process :: MTaskDevice (Shared Channels) -> Task () @@ -65,7 +62,7 @@ mTaskManager = anyTask proc [m:ms] = (case m of // 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 @! () +// MTPub i val = getSDSRecord i >>= set (toInt val.[0]*256 + toInt val.[1]) o getSDSStore @! () MTTaskAck i = deviceTaskAcked device i MTTaskDelAck i = deviceTaskDeleteAcked device i @! () MTEmpty = treturn ()