Commit ba5ddd29 authored by Marco Berzborn's avatar Marco Berzborn

Merge branch 'MCE_sens_device_list' into 'master'

Fix calibration of custom measurement chain elements

See merge request !7
parents be847687 7635983a
function varargout = ita_device_list_ITA(mode,token,varargin)
% ITA_DEVICE_LIST - the ITA device List
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PLEASE BE VERY CAREFUL WHEN EDITING THE DEVICE LIST
% BY HAND, CONSULT PDI OR MMT BEFORE MAKING CHANGES
% PLEASE BE VERY CAREFUL WHEN EDITING THE DEVICE LIST BY HAND, PLEASE
% CONSULT THE ITA-TOOLBOX DEVELOPER TEAM BEFORE MAKING ANY CHANGES
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Syntax:
% res = ita_device_list() returns all devices in a cell
......@@ -31,12 +31,6 @@ function varargout = ita_device_list_ITA(mode,token,varargin)
% </ITA-Toolbox>
% if exist('ita_device_list_ITA.m','file')
% varargout = ita_device_list_ITA(mode,token,varargin{:});
% return;
% end
if nargin == 3
hwch = varargin{1};
else
......@@ -49,7 +43,7 @@ if nargin >= 1 && isa(mode,'itaMeasurementChainElements')
MCE = mode;
devHandle = ita_device_list_handle;
list = devHandle(); %get entire list
[elementfound idx] = ismember(MCE.name,list(:,1)); %find element
[elementfound, idx] = ismember(MCE.name,list(:,1)); %find element
if elementfound
sens = list{idx,2};
% picModel = ita_model2picture(list{idx,3});
......@@ -64,7 +58,7 @@ if nargin >= 1 && isa(mode,'itaMeasurementChainElements')
% MCE.picModel = picModel;
end
else
ita_verbose_info('Element not in list',1);
ita_verbose_info(['Element not found in the device list: ', MCE.name], 1);
end
......@@ -111,29 +105,25 @@ if nargin >= 2
start_idx = strfind(token,'[');
end_idx = strfind(token,']');
if ~isempty(start_idx) && ~isempty(end_idx)
token = token(start_idx+1:end_idx-1); %get the name
name = token(start_idx+1:end_idx-1); %get the name
else
name = token;
end
name = token;
for idx = 1:size(device,1)
if strcmpi(token,device{idx,1})
if strcmpi(name,device{idx,1})
res = itaValue(device{idx,2});
break
end
end
% % etwas schoener
% idxDevice = find(strcmpi(device(:,1), token));
% if ~isempty(idxDevice)
% res = itaValue(device{idxDevice,2});
% end
start_idx = strfind(token,'(');
end_idx = strfind(token,')');
if ~isempty(start_idx) && ~isempty(end_idx)
res = itaValue(token(start_idx+1:end_idx-1));
end
if isempty(res)
res = itaValue(-1);
disp(['element not in list: ' token '.'])
ita_verbose_info(['Element not found in the device list: ', token], 1)
start_idx = strfind(token,'(');
end_idx = strfind(token,')');
if ~isempty(start_idx) && ~isempty(end_idx)
res = itaValue(token(start_idx+1:end_idx-1));
else
res = itaValue(-1);
end
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment