Skip to content

Commit

Permalink
Rename get methods to match convention
Browse files Browse the repository at this point in the history
Signed-off-by: Apelete Seketeli <[email protected]>
  • Loading branch information
apelete committed Sep 21, 2023
1 parent e3f00b7 commit 82b9b21
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
25 changes: 12 additions & 13 deletions +adi/+AD2S1210/Rx.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,36 +78,35 @@
obj.BufferTypeConversionEnable = true;
end

%% Flush the buffer
function flush(obj)
flushBuffers(obj);
end

%% Check Angle
function getAngle(obj)
function rValue = get.Angle(obj)
if obj.ConnectedToDevice
obj.Angle = obj.getAttributeRAW('angl0', 'raw', obj.isOutput);
rValue = obj.getAttributeRAW('angl0', 'raw', obj.isOutput);
obj.Angle = rValue;
end
end

%% Check Angular Scale
function getAngleScale(obj)
function rValue = get.AngleScale(obj)
if obj.ConnectedToDevice
obj.AngleScale = obj.getAttributeDouble('angl0', 'scale', obj.isOutput);
rValue = obj.getAttributeDouble('angl0', 'scale', obj.isOutput);
obj.AngleScale = rValue;
end
end

%% Check Velocity
function getVelocity(obj)
function rValue = get.Velocity(obj)
if obj.ConnectedToDevice
obj.Velocity = obj.getAttributeRAW('anglvel0','raw', obj.isOutput);
rValue = obj.getAttributeRAW('anglvel0','raw', obj.isOutput);
obj.Velocity = rValue;
end
end

%% Check Velocity Scale
function getVelocityScale(obj)
function rValue = get.VelocityScale(obj)
if obj.ConnectedToDevice
obj.VelocityScale = obj.getAttributeDouble('anglvel0', 'scale', obj.isOutput);
rValue = obj.getAttributeDouble('anglvel0', 'scale', obj.isOutput);
obj.VelocityScale = rValue;
end
end
end
Expand Down
10 changes: 5 additions & 5 deletions examples/ad2s1210_DataCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
% Connect to device and initialize data
rx();

% Retrieve resolver angle and angular velocity
rx.getAngle();
rx.getAngleScale();
rx.getVelocity();
rx.getVelocityScale();
% Retrieve and print resolver angle, angular velocity and scale
rx.Angle();
rx.AngleScale();
rx.Velocity();
rx.VelocityScale();

% Print system object properties
rx
Expand Down

0 comments on commit 82b9b21

Please sign in to comment.