Skip to content
Snippets Groups Projects
Commit 87f86bc0 authored by Tim Stadtmann's avatar Tim Stadtmann
Browse files

Fix redundant value readings when displaying

parent 879220a1
Branches
Tags
No related merge requests found
......@@ -471,9 +471,10 @@ classdef EV3 < MaskedHandle
warning('off', 'all'); % Turn off warnings while reading values
for i = 1:length(props)
p = props{i};
if strcmp(class(ev3.(p)),'Sensor') || strcmp(class(ev3.(p)), 'Motor')
fprintf('\t%15s [Type: %s]\n', p, char(ev3.(p).type));
member = ev3.(p);
if strcmp(class(member),'Sensor') || strcmp(class(member), 'Motor')
fprintf('\t%15s [Type: %s]\n', p, char(member.type));
end
end
warning('on', 'all');
......
......@@ -46,15 +46,15 @@ for i = 1:length(dependentProps)
value = device.(p);
if ~isempty(enumeration(value)) % Test if parameter is enumeration
fprintf('\t%15s: %s\n', p, char(value));
elseif isnumeric(device.(p)) || islogical(value)
elseif isnumeric(value) || islogical(value)
if isfloat(value)
fprintf('\t%15s: %1.1f\n', p, value);
else
fprintf('\t%15s: %d\n', p, value);
end
elseif ischar(device.(p))
elseif ischar(value)
fprintf('\t%15s: %s\n', p, value);
elseif islogical(device.(p))
elseif islogical(value)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment