From 0987153ac75aa6618f8a0d50e40d09be68054b89 Mon Sep 17 00:00:00 2001
From: Tim Stadtmann <tim.stadtmann@rwth-aachen.de>
Date: Wed, 7 Jun 2017 10:15:07 +0200
Subject: [PATCH] Rename handleCommand-argument for clarification

---
 source/EV3.m    | 8 ++++----
 source/Motor.m  | 8 ++++----
 source/Sensor.m | 8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/source/EV3.m b/source/EV3.m
index 0832ca4..0ec3e5b 100644
--- a/source/EV3.m
+++ b/source/EV3.m
@@ -452,7 +452,7 @@ classdef EV3 < MaskedHandle
     end
 
     methods (Access = private)  % Private brick functions that are wrapped by dependent params
-        function varargout = handleCommand(ev3, commandHandle, varargin)
+        function varargout = handleCommand(ev3, command, varargin)
             % Execute a CommunicationInterface-method given as a handle
             %
             % As those methods have different, fixed numbers of output arguments, this quantity
@@ -467,16 +467,16 @@ classdef EV3 < MaskedHandle
             end            
             
             if ev3.debug
-                fprintf('(DEBUG) Sending %s\n', func2str(commandHandle));
+                fprintf('(DEBUG) Sending %s\n', func2str(command));
             end
 
             % Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
             % do this ugly workaround using strings. See
             % https://de.mathworks.com/matlabcentral/answers/96617-how-can-i-use-nargin-nargout-to-determine-the-number-of-input-output-arguments-of-an-object-method
-            nOut = nargout(strcat('CommunicationInterface>CommunicationInterface.', func2str(commandHandle)));
+            nOut = nargout(strcat('CommunicationInterface>CommunicationInterface.', func2str(command)));
             
             try
-                [varargout{1:nOut}] = commandHandle(ev3.commInterface, varargin{:});
+                [varargout{1:nOut}] = command(ev3.commInterface, varargin{:});
             catch ME
                 %ev3.detectedCommError(ME.identifier, ME.message);
                 if ~isempty(strfind(exceptionID, 'CommError'))
diff --git a/source/Motor.m b/source/Motor.m
index c70b203..2953b39 100644
--- a/source/Motor.m
+++ b/source/Motor.m
@@ -885,7 +885,7 @@ classdef Motor < MaskedHandle & dynamicprops
     end
     
     methods (Access = private)  % Private functions that directly interact with commLayer
-        function varargout = handleCommand(motor, commandHandle, checkDevice, varargin)
+        function varargout = handleCommand(motor, command, checkDevice, varargin)
             % Execute a CommunicationInterface-method given as a handle
             %
             % As those methods have different, fixed numbers of output arguments, this quantity
@@ -905,15 +905,15 @@ classdef Motor < MaskedHandle & dynamicprops
             end
             
             if motor.debug
-                fprintf('(DEBUG) Sending %s\n', func2str(commandHandle));
+                fprintf('(DEBUG) Sending %s\n', func2str(command));
             end
             
             % Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
             % do this ugly workaround using strings. See 
             % https://de.mathworks.com/matlabcentral/answers/96617-how-can-i-use-nargin-nargout-to-determine-the-number-of-input-output-arguments-of-an-object-method
-            nOut = nargout(strcat('CommunicationInterface>CommunicationInterface.', func2str(commandHandle)));
+            nOut = nargout(strcat('CommunicationInterface>CommunicationInterface.', func2str(command)));
             try
-                [varargout{1:nOut}] = commandHandle(motor.commInterface, varargin{:});
+                [varargout{1:nOut}] = command(motor.commInterface, varargin{:});
             catch ME
                 if ~isempty(strfind(ME.identifier, 'CommError'))
                     warning('Lost connection to the Brick!');
diff --git a/source/Sensor.m b/source/Sensor.m
index 8950775..ce63f10 100644
--- a/source/Sensor.m
+++ b/source/Sensor.m
@@ -444,7 +444,7 @@ classdef Sensor < MaskedHandle
             end
         end
         
-        function varargout = handleCommand(sensor, commandHandle, checkDevice, varargin)
+        function varargout = handleCommand(sensor, command, checkDevice, varargin)
             % Execute a CommunicationInterface-method given as a handle
             %
             % As those methods have different, fixed numbers of output arguments, this quantity
@@ -464,15 +464,15 @@ classdef Sensor < MaskedHandle
             end
             
             if sensor.debug
-                fprintf('(DEBUG) Sending %s\n', func2str(commandHandle));
+                fprintf('(DEBUG) Sending %s\n', func2str(command));
             end
             
             % Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
             % do this ugly workaround using strings. See 
             % https://de.mathworks.com/matlabcentral/answers/96617-how-can-i-use-nargin-nargout-to-determine-the-number-of-input-output-arguments-of-an-object-method
-            nOut = nargout(strcat('CommunicationInterface>CommunicationInterface.', func2str(commandHandle)));
+            nOut = nargout(strcat('CommunicationInterface>CommunicationInterface.', func2str(command)));
             try
-                [varargout{1:nOut}] = commandHandle(sensor.commInterface, varargin{:});
+                [varargout{1:nOut}] = command(sensor.commInterface, varargin{:});
             catch ME
                 %sensor.ev3Handle.detectedCommError(ME.identifier, ME.message);
                 if ~isempty(strfind(ME.identifier, 'CommError'))
-- 
GitLab