@! ()
where
sharename i = device.deviceChannels +++ "-" +++ toString i
- toSDSRecords st = sequence "" [makeShare wta sdsi sdsbc\\{sdsi,sdspub,sdsbc}<-st.sdss]// | sdspub]
+ toSDSRecords st = sequence "" [makeShare wta sdsi sdsval\\{sdsi,sdspub,sdsval}<-st.sdss]// | sdspub]
addTask :: MTaskTask MTaskDevice -> MTaskDevice
addTask task device = {device & deviceTasks=[task:device.deviceTasks]}
import iTasks
import iTasks._Framework.Serialization
+import mTask
derive class iTask MTaskShareType
{withTask :: String
,identifier :: Int
,realShare :: MTaskShareType
- ,value :: String
- ,dynvalue :: Dynamic
+ ,value :: BCValue
}
manageShares :: [MTaskShare] -> Task ()
///makeShare :: String Int Dynamic -> Task MTaskShare
-makeShare :: String Int String -> Task MTaskShare
+makeShare :: String Int BCValue -> Task MTaskShare
viewShares sh = anyTask (map viewShare sh) <<@ ArrangeHorizontal
>>| return (hd sh)
-viewShare :: MTaskShare -> Task String
+viewShare :: MTaskShare -> Task BCValue
viewShare m = viewSharedInformation "" [] (getSDSShare m)
<<@ Title ("SDS: " +++ toString m.identifier)
-getSDSShare :: MTaskShare -> Shared String
+getSDSShare :: MTaskShare -> Shared BCValue
getSDSShare s=:{realShare=(MTaskWithShare id)}
= memoryShare id s.MTaskShare.value
-makeShare :: String Int String -> Task MTaskShare
+makeShare :: String Int BCValue -> Task MTaskShare
makeShare withTask identifier value = treturn
{MTaskShare
|withTask=withTask
,identifier=identifier
,value=value
- ,dynvalue=dynamic value
,realShare=MTaskWithShare $ "mTaskSDS-" +++ toString identifier
} >>= \sh->set value (getSDSShare sh) >>| treturn sh
:: BCShare = {
sdsi :: Int,
sdspub :: Bool,
- sdsval :: Dynamic,
- sdsbc :: String
+ sdsval :: BCValue
}
:: BCState = {
>>= \(v In bdy)->modify (addSDS sds v) >>| unBC (unMain bdy)}
// >>= \(v In bdy)->modify (addSDS sds (toByteCode v)) >>| unBC (unMain bdy)}
where
- addSDS i v s = {s & sdss=[{sdsi=i,sdspub=False,sdsval=(dynamic v),sdsbc=toByteCode v}:s.sdss]}
+ addSDS i v s = {s & sdss=[{sdsi=i,sdspub=False,sdsval=(BCValue v)}:s.sdss]}
con f = undef
pub (BC x) = BC $ censor (\[BCSdsFetch s]->[BCSdsPublish s])
toMessages :: MTaskInterval (String, BCState) -> ([MTaskMSGSend], BCState)
toMessages interval (bytes, st=:{sdss}) = (
- [MTSds s.sdsi s.sdsbc\\s<-sdss] ++
+ [MTSds sdsi $ toByteCode e\\{sdsi,sdsval=(BCValue e)}<-sdss] ++
[MTTask interval bytes], st)
toSDSUpdate :: Int Int -> [MTaskMSGSend]