Skip to content

Commit

Permalink
Support custom clock in Registry logging (final)
Browse files Browse the repository at this point in the history
Add support for custom clocking function to sig.node.Signal.log(...)
  • Loading branch information
Chris Burgess authored Sep 7, 2016
1 parent 4331e5b commit e7f0e2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions +sig/+node/Signal.m
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,11 @@
tr = sig.node.Signal(node);
end

function l = log(this)
node = sig.node.Node(this.Node, 'sig.transfer.log', @GetSecs, true);
function l = log(this, clockFun)
if nargin < 2
clockFun = @GetSecs
end
node = sig.node.Node(this.Node, 'sig.transfer.log', clockFun, true);
node.FormatSpec = '%s.log()';
l = sig.node.Signal(node);
l.Node.CurrValue = struct('time', {}, 'value', {});
Expand Down

0 comments on commit e7f0e2e

Please sign in to comment.