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

Fix some typos and comments

parent 912bb027
No related branches found
No related tags found
No related merge requests found
......@@ -2202,7 +2202,7 @@ classdef Command < handle
cmd.GV0(speed);
end
function opOUTPUT_TEST(cmd,layer,nos,value)
function opOUTPUT_TEST(cmd,layer,nos,busy)
% Command.opOUTPUT_TEST Add a opOUTPUT_TEST
%
% Command.opOUTPUT_READ(layer,nos) adds a opOUTPUT_TEST opcode
......@@ -2222,7 +2222,7 @@ classdef Command < handle
cmd.addDirectCommand(ByteCodes.OutputTest);
cmd.LC0(layer);
cmd.LC0(nos);
cmd.GV0(value);
cmd.GV0(busy);
end
function opOUTPUT_READY(cmd,layer,nos)
......
......@@ -96,14 +96,14 @@ classdef Motor < MaskedHandle & dynamicprops
%% Miscallenous flags
connectedToBrick = false; % Connection to physical Brick?
connectedToBrick = false; % Connection to physical Brick?
sendPowerOnNextStart = false; % Indicates whether current power parameter should be sent
% to the Brick right before starting it next time
sendPowerOnSet = false; % Indicates whether power parameter should be sent to the Brick
% immediately after setting it
limitSetToZero = false; % Indicates whether limitValue has been set to zero
% (workaround for a bug, see motor.start, Note 2)
init = true; % Indicates 'init-phase' (True as long as constructor is running)
init = true; % Indicates 'init-phase' (True as long as constructor is running)
end
properties (Hidden, Dependent, Access = 'private') % Hidden, dependent properties for internal use only
......@@ -175,6 +175,10 @@ classdef Motor < MaskedHandle & dynamicprops
if motor.brakeMode_ == BrakeMode.Coast
motor.reset();
end
% if motor.internalTachoCount ~= 0
% motor.reset();
% end
% Call right function in commInterface depending on limitValue and limitMode
if motor.limitValue==0
......@@ -440,16 +444,16 @@ classdef Motor < MaskedHandle & dynamicprops
% -> No need to check if motor is connected as speed correctly
% returns 0 if it's not
%
if ~motor.connectedToBrick
error(['Motor::waitFor: Motor-Object not connected to comm handle.',...
'You have to call motor.connect(commInterface) first!']);
end
pause(0.1);
while motor.isRunning
pause(0.03);
end
motor.commInterface.outputReady(0, motor.port);
% % if ~motor.connectedToBrick
% % error(['Motor::waitFor: Motor-Object not connected to comm handle.',...
% % 'You have to call motor.connect(commInterface) first!']);
% % end
% %
% % pause(0.1);
% % while motor.isRunning
% % pause(0.03);
% % end
% elseif ~motor.limitValue
% error(['Motor::waitFor: Motor has no tacho limit. ' ,...
% 'Can''t reliably determine whether it is running or not.']);
......@@ -561,11 +565,6 @@ classdef Motor < MaskedHandle & dynamicprops
error('Motor::set.smoothStart: Smooth start steps are out of bounds.');
end
% if ~isempty(motor.limitValue) && steps>motor.limitValue
% warning(['Motor::set.smoothStart: Smooth start steps are greater than ',...
% 'limitValue.']);
% end
motor.smoothStart = steps;
end
......@@ -577,11 +576,6 @@ classdef Motor < MaskedHandle & dynamicprops
error('Motor::set.smoothStop: Smooth stop steps are out of bounds.');
end
% if ~isempty(motor.limitValue) && steps>motor.limitValue
% error(['Motor::set.smoothStop: Smooth stop steps are greater than ',...
% 'limitValue.']);
% end
motor.smoothStop = steps;
end
......@@ -777,6 +771,7 @@ classdef Motor < MaskedHandle & dynamicprops
function running = get.isRunning(motor)
running = (motor.currentSpeed~=0);
%running = motor.commInterface.outputTest(0, motor.port);
end
function synced = get.isSynced(motor)
......@@ -961,8 +956,7 @@ classdef Motor < MaskedHandle & dynamicprops
'comm handle is invalid. Deleting invalid handle and ' ,...
'resetting Motor.connectedToBrick now...']);
motor.commInterface = 0;
motor.connectedToBrick = false;
motor.disconnect();
error('Motor::connect: Disconnected due to internal error.');
end
......
......@@ -180,7 +180,7 @@ classdef btBrickIO < BrickIO
id = [ID(), ':', 'UnknownError'];
newException = MException(id, msg);
newException = addCause(newException, ME);
throw(newException);b.bee
throw(newException);
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment