named sds's
[mTask.git] / Tasks / mTaskTask.icl
index c36d0d2..e828257 100644 (file)
@@ -9,7 +9,7 @@ import iTasks._Framework.Serialization
 derive class iTask MTaskTask, MTaskInterval, Main, ByteCode, Stmt, Expr, BC, BCState, RWST, Identity
 
 makeTask :: String Int -> Task MTaskTask
-makeTask name ident = get currentDateTime 
+makeTask name ident = get currentDateTime
        @ \dt->{MTaskTask | name=name,ident=ident,dateAdded=dt}
 
 import StdDebug
@@ -17,9 +17,9 @@ import StdMisc
 sendTaskToDevice :: String (Main (ByteCode a Stmt)) (MTaskDevice, MTaskInterval) -> Task [MTaskDevice]
 sendTaskToDevice wta mTask (device, timeout)
 | not (trace_tn "compiling task") = undef
-# (msgs, newState) = toMessages timeout mTask device.deviceState
+# (msgs, newState=:{sdss}) = toMessages timeout mTask device.deviceState
 | not (trace_tn "Done compiling task") = undef
-# shares = [makeShare wta sdsi sdsval\\{sdsi,sdsval}<-newState.sdss, (MTSds sdsi` _)<-msgs | sdsi == sdsi`] 
+# shares = [makeShare wta "" sdsi sdsval\\{sdsi,sdsval}<-sdss, (MTSds sdsi` _)<-msgs | sdsi == sdsi`]
 = updateShares device ((++) shares)
        >>| sendMessages msgs device
        >>| makeTask wta -1
@@ -28,3 +28,9 @@ sendTaskToDevice wta mTask (device, timeout)
                addTaskUpState :: BCState MTaskTask MTaskDevice -> MTaskDevice
                addTaskUpState st task device = { MTaskDevice | device &
                        deviceState=st, deviceTasks=[task:device.deviceTasks]}
+
+//liftmTask :: String (Main (ByteCode a Stmt)) (MTaskDevice, MTaskInterval) -> Task a
+//liftmTask wta mTask (device, timeout)
+//     = sendTaskToDevice wta mTask (device, timeout)
+//     >>| wait "waiting for task to return" $ sdsFocus
+//     >>| treturn