X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTaskSimulation.icl;h=3f88aeeb72dddd1faefcea60a2cef68cb048abdc;hb=848595d1288804d6de43625f9e6f1cf76295c285;hp=ae7ddfb5122d2646aa497a449ec6c16c0f4300e9;hpb=93cabbcd5d18b7b45d6f43a6ff39f94cfcb95522;p=mTask.git diff --git a/mTaskSimulation.icl b/mTaskSimulation.icl index ae7ddfb..3f88aee 100644 --- a/mTaskSimulation.icl +++ b/mTaskSimulation.icl @@ -1,9 +1,12 @@ implementation module mTaskSimulation +import Generics.gdynamic +import Generics.gCons + import iTasks -import gdynamic, gCons, GenEq, StdMisc, StdArray +import GenEq, StdMisc, StdArray import mTask -//derive class iTask Display +derive class iTask Display eval :: (Main (Eval t p)) -> [String] | toString t eval {main=(E f)} = [toString (fst (f Rd zero))] @@ -74,7 +77,6 @@ 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 = @@ -152,7 +154,7 @@ instance writePinD AnalogPin where // ----- Interactive Simulation ----- // -derive class iTask DigitalPin, AnalogPin, Dyn, StateInterface, DisplayVar, Pin +derive class iTask StateInterface, DisplayVar simulate :: (Main (Eval a p)) -> Task () simulate {main=(E f)} = setup zero where @@ -252,8 +254,8 @@ instance stringQuotes String where stringQuotes x = c "\"" +.+ x +.+ c "\"" instance stringQuotes t where stringQuotes x = x -derive toGenDynamic (), MTask, DigitalPin, AnalogPin, Pin, [], Long//, Servo -derive fromGenDynamic (), MTask, DigitalPin, AnalogPin, Pin, [], Long//, Servo +derive toGenDynamic (), MTask, DigitalPin, AnalogPin, Pin, [], Long, UserLED//, Servo +derive fromGenDynamic (), MTask, DigitalPin, AnalogPin, Pin, [], Long, UserLED//, Servo instance == () where (==) _ _ = True