revert back to old itasks, add sds support in bytecode
[mTask.git] / mTaskSimulation.icl
index 6fed084..ae7ddfb 100644 (file)
@@ -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))]
@@ -73,6 +74,7 @@ defEval2 v f =
 instance sds Eval where
   sds f = defEval f
   con f = defEval f
+//  pub _ = undef
 
 defEval :: ((Eval t p)->In t (Main (Eval u q))) -> (Main (Eval u q)) | dyn t
 defEval f = 
@@ -155,22 +157,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 =