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