From: Mart Lubbers Date: Mon, 27 Feb 2017 09:55:54 +0000 (+0100) Subject: mTasks can now be built with normal taskss X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=cf006df4dfd44845b6e5459d81bfe34a187884a9;p=mTask.git mTasks can now be built with normal taskss --- diff --git a/Tasks/mTaskTask.dcl b/Tasks/mTaskTask.dcl index 0a89129..2e3458e 100644 --- a/Tasks/mTaskTask.dcl +++ b/Tasks/mTaskTask.dcl @@ -1,8 +1,9 @@ definition module Tasks.mTaskTask +import mTask import iTasks -derive class iTask MTaskTask +derive class iTask MTaskTask, Main, ByteCode, Stmt, Expr, BC, BCState :: MTaskTask = { name :: String, diff --git a/Tasks/mTaskTask.icl b/Tasks/mTaskTask.icl index 1af27ba..584dc34 100644 --- a/Tasks/mTaskTask.icl +++ b/Tasks/mTaskTask.icl @@ -1,8 +1,11 @@ implementation module Tasks.mTaskTask +import mTask import iTasks -derive class iTask MTaskTask +import iTasks._Framework.Serialization + +derive class iTask MTaskTask, Main, ByteCode, Stmt, Expr, BC, BCState makeTask :: String Int -> Task MTaskTask makeTask name ident = get currentDateTime diff --git a/Utils/SDS.dcl b/Utils/SDS.dcl index 7020451..b33045a 100644 --- a/Utils/SDS.dcl +++ b/Utils/SDS.dcl @@ -4,7 +4,7 @@ import Shares.mTaskShare import Devices.mTaskDevice import iTasks -derive class iTask MTaskShare, BCState +derive class iTask MTaskShare memoryShare :: String a -> Shared a | iTask a diff --git a/Utils/SDS.icl b/Utils/SDS.icl index 27ebeb7..8e78cf0 100644 --- a/Utils/SDS.icl +++ b/Utils/SDS.icl @@ -8,7 +8,7 @@ import Tasks.Examples import qualified Data.Map as DM from Data.Func import $ -derive class iTask MTaskShare, BCState +derive class iTask MTaskShare memoryShare :: String a -> Shared a | iTask a memoryShare s d = sdsFocus s $ memoryStore "" $ Just d diff --git a/miTask.icl b/miTask.icl index dfdcd30..a2ef345 100644 --- a/miTask.icl +++ b/miTask.icl @@ -42,21 +42,18 @@ mTaskManager = anyTask , arrangeSplit Vertical True ] - viewmTasks = listmTasks + viewmTasks :: Task String + viewmTasks = enterChoiceWithShared "Available mTasks" [ChooseFromList id] mTaskTaskStore >&^ \sh->whileUnchanged sh $ \mi->forever (case mi of Nothing = viewInformation "No task selected" [] () Just mTaskTask = get deviceStore >>= \devices->case devices of [] = viewInformation "No devices yet" [] () - ds = sendmTask mTaskTask ds @! ()) - where - listmTasks :: Task String - listmTasks = enterChoiceWithShared "Available mTasks" [ChooseFromList id] mTaskTaskStore - - sendmTask mTaskId ds = fromJust ('DM'.get mTaskId allmTasks) -// >>= \bc->(enterChoice "Choose Device" [ChooseFromDropdown \t->t.deviceName] ds -// -&&- enterInformation "Timeout, 0 for one-shot" []) -// >>* [OnAction (Action "Send") (withValue $ Just o sendToDevice bc)] + ds = fromJust ('DM'.get mTaskTask allmTasks) + >>= \bc->(enterChoice "Choose Device" [ChooseFromDropdown \t->t.deviceName] ds + -&&- enterInformation "Timeout, 0 for one-shot" [] + ) >>* [OnAction (Action "Send") (withValue $ Just o sendToDevice mTaskTask bc)] + ) process :: MTaskDevice (Shared Channels) -> Task () process device ch = forever (watch ch >>* [OnValue (