From 21b5a08066efa0b0e0f8edc0aef223fe32b386ca Mon Sep 17 00:00:00 2001
From: Federico Felici <federico.felici@epfl.ch>
Date: Tue, 16 Jun 2020 16:52:36 +0200
Subject: [PATCH] Fix unit test problem

---
 code/functions/SCDconf_createstructfrombus.m | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/code/functions/SCDconf_createstructfrombus.m b/code/functions/SCDconf_createstructfrombus.m
index dc8b235..63d4f29 100644
--- a/code/functions/SCDconf_createstructfrombus.m
+++ b/code/functions/SCDconf_createstructfrombus.m
@@ -5,9 +5,19 @@
 % and with zero data of the correct kind
 % This is enough for passing a ctrl-D with from Workspace bus kind blocks
 
-function [out] = SCDconf_createstructfrombus(dd,busname)
+function [out] = SCDconf_createstructfrombus(varargin)
+% Create data structure matching a bus signature
+% From either a datadictionary+busname or from a bus directly
+% [out] = SCDconf_createstructfrombus(dd,busname)
+% [out] = SCDconf_createstructfrombus(bus)
 
-bus=dd.getEntry(busname).getValue; % get from data dictionary
+if nargin==1
+  bus = varargin{1};
+else
+  dd = varargin{1};
+  busname = varargin{2};
+  bus=dd.getEntry(busname).getValue; % get from data dictionary
+end
 bussize=size(bus.Elements);
 signalssize=bussize(1);
 
-- 
GitLab