X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTaskSimulation.icl;h=d52fa9a359d67c8bf177e43b335a627f06b68336;hb=0d7dc6966d2f428cd7543708e220aa4315d64978;hp=6fed0842fcc164b0c2459571d06dd73031717ccb;hpb=7a67ef5e2af69cb14011be201fe67f755b91a788;p=mTask.git diff --git a/mTaskSimulation.icl b/mTaskSimulation.icl index 6fed084..d52fa9a 100644 --- a/mTaskSimulation.icl +++ b/mTaskSimulation.icl @@ -3,6 +3,7 @@ implementation module mTaskSimulation import iTasks import gdynamic, gCons, GenEq, StdMisc, StdArray import mTask +derive class iTask Display eval :: (Main (Eval t p)) -> [String] | toString t eval {main=(E f)} = [toString (fst (f Rd zero))] @@ -155,22 +156,22 @@ derive class iTask DigitalPin, AnalogPin, Dyn, StateInterface, DisplayVar, Pin simulate :: (Main (Eval a p)) -> Task () simulate {main=(E f)} = setup zero where setup s = - updateInformation "State" [] (toView s) - >>* [ OnAction ActionFinish (always shutDown) - , OnAction (Action "setup" []) (hasValue - (\si.simloop (snd (f Rd (mergeView s si))))) - ] + updateInformation "State" [] (toView s) @! () +// >>* [ OnAction ActionFinish (always shutDown) +// , OnAction (Action "setup" []) (hasValue +// (\si.simloop (snd (f Rd (mergeView s si))))) +// ] simloop s = - updateInformation "State" [] (toView s) - >>* [ OnAction ActionFinish (always shutDown) - , OnAction (Action "clear serial" []) (always (simloop {s & serial = []})) - , OnAction ActionNew (always (setup zero)) - : if (isEmpty s.tasks) - [] - [OnAction (Action "loop" []) (hasValue - \si.simloop (step` (mergeView s si))) - ] - ] + updateInformation "State" [] (toView s) @!() +// >>* [ OnAction ActionFinish (always shutDown) +// , OnAction (Action "clear serial" []) (always (simloop {s & serial = []})) +// , OnAction ActionNew (always (setup zero)) +// : if (isEmpty s.tasks) +// [] +// [OnAction (Action "loop" []) (hasValue +// \si.simloop (step` (mergeView s si))) +// ] +// ] toView :: State` -> StateInterface toView s =