From: Mart Lubbers Date: Fri, 19 May 2017 14:27:44 +0000 (+0200) Subject: separate share updates X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=a9e2b5a0fbabf17796a88efc7ab0862948e33e0a;p=mTask.git separate share updates --- diff --git a/Shares/mTaskShare.dcl b/Shares/mTaskShare.dcl index c505362..0963b51 100644 --- a/Shares/mTaskShare.dcl +++ b/Shares/mTaskShare.dcl @@ -27,7 +27,7 @@ cleanSharesTask :: Int MTaskDevice -> Task [MTaskShare] //cleanSharesTask :: Int MTaskDevice -> Task [MTaskShare] //Clean out shares when a device has been removed -updateShare :: MTaskDevice Int BCValue -> Task [MTaskShare] +updateShareFromPublish :: MTaskDevice Int BCValue -> Task [MTaskShare] //updateShare :: Int BCValue -> Task [MTaskShare] getRealShare :: MTaskDevice BCShare -> Shared BCValue diff --git a/Shares/mTaskShare.icl b/Shares/mTaskShare.icl index 9960f4e..a360bf8 100644 --- a/Shares/mTaskShare.icl +++ b/Shares/mTaskShare.icl @@ -66,8 +66,8 @@ makeShare withTask identifier value = {MTaskShare ,value=value } -updateShare :: MTaskDevice Int BCValue -> Task [MTaskShare] -updateShare dev ident val = updateShares dev $ map $ up ident val +updateShareFromPublish :: MTaskDevice Int BCValue -> Task [MTaskShare] +updateShareFromPublish dev ident val = updateShares dev $ map $ up ident val where up :: Int BCValue MTaskShare -> MTaskShare up i v s = if (s.identifier == i) {MTaskShare | s & value=val} s diff --git a/miTask.icl b/miTask.icl index e16d3c0..fd5dac5 100644 --- a/miTask.icl +++ b/miTask.icl @@ -66,7 +66,7 @@ mTaskManager = startupDevices >>| anyTask proc [m:ms] = traceValue (toString m) >>| (case m of // MTSDSAck i = traceValue (toString m) @! () // MTSDSDelAck i = traceValue (toString m) @! () - MTPub i val = updateShare device i val @! () + MTPub i val = updateShareFromPublish device i val @! () MTTaskAck i mem = deviceTaskAcked device i mem MTTaskDelAck i = deviceTaskDeleteAcked device i @! () MTDevSpec s = deviceAddSpec device s @! ()