X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=Shares%2FmTaskShare.icl;fp=Shares%2FmTaskShare.icl;h=481d3ad9fa6f1a74a049f46793a6c0b8f957bc21;hb=7d9088b54956fe56c36ca8d01ec386b48f0a1c47;hp=68b519e32a24065692d738835f585b609294f30d;hpb=5bb47d85ee13e4c0907a82971a907657511211cc;p=mTask.git diff --git a/Shares/mTaskShare.icl b/Shares/mTaskShare.icl index 68b519e..481d3ad 100644 --- a/Shares/mTaskShare.icl +++ b/Shares/mTaskShare.icl @@ -90,22 +90,24 @@ cleanSharesTask taskid d = updateShares d id //TODO // up :: [String] MTaskShare -> MTaskShare // up ns s = {MTaskShare | s & withTask=[t\\t<-s.withTask|not (isMember t ns)]} -getRealShare :: MTaskDevice BCShare -> Shared BCValue -getRealShare dev {sdsi} = SDSSource {SDSSource - | name = "mTaskShareMap-" +++ toString sdsi, read=rr, write=ww} +getRealShare :: MTaskDevice MTaskShare -> Shared BCValue +getRealShare dev {identifier} = SDSSource {SDSSource + | name = "mTaskShareMap-" +++ toString identifier, read=rr, write=ww} where rr name iworld = case read deviceStore iworld of (Error e, iworld) = (Error e, iworld) (Ok devices, iworld) = case find ((==)dev) devices of Nothing = (Error $ exception "Device doesn't exist anymore", iworld) - Just {deviceShares} = case find (\s->s.identifier == sdsi) deviceShares of + Just {deviceShares} = case find (\s->s.identifier == identifier) deviceShares of Nothing = (Error $ exception "Share doesn't exist", iworld) Just share = (Ok share.MTaskShare.value, iworld) // Also send messages - ww name value iworld = case modify (\r->((), map (modFun value) r)) deviceStore iworld of + ww name value iworld + | not (trace_tn ("Update to: " +++ printToString value)) = undef + = case modify (\r->((), map (modFun value) r)) deviceStore iworld of (Error e, iworld) = (Error e, iworld) - (Ok _, iworld) = case sendMessagesIW [MTUpd sdsi value] dev iworld of + (Ok _, iworld) = case sendMessagesIW [MTUpd identifier value] dev iworld of (Error e, iworld) = (Error e, iworld) (Ok _, iworld) = (Ok $ const True, iworld) @@ -116,5 +118,5 @@ getRealShare dev {sdsi} = SDSSource {SDSSource //Selects the correct share modFun2 value share - | sdsi == share.MTaskShare.identifier = {MTaskShare | share & value=value} + | identifier == share.MTaskShare.identifier = {MTaskShare | share & value=value} = share