Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ev3-toolbox-matlab
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mindstorms
ev3-toolbox-matlab
Commits
0987153a
Commit
0987153a
authored
7 years ago
by
Tim Stadtmann
Browse files
Options
Downloads
Patches
Plain Diff
Rename handleCommand-argument for clarification
parent
78b368d2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
source/EV3.m
+4
-4
4 additions, 4 deletions
source/EV3.m
source/Motor.m
+4
-4
4 additions, 4 deletions
source/Motor.m
source/Sensor.m
+4
-4
4 additions, 4 deletions
source/Sensor.m
with
12 additions
and
12 deletions
source/EV3.m
+
4
−
4
View file @
0987153a
...
@@ -452,7 +452,7 @@ classdef EV3 < MaskedHandle
...
@@ -452,7 +452,7 @@ classdef EV3 < MaskedHandle
end
end
methods
(
Access
=
private
)
% Private brick functions that are wrapped by dependent params
methods
(
Access
=
private
)
% Private brick functions that are wrapped by dependent params
function
varargout
=
handleCommand
(
ev3
,
command
Handle
,
varargin
)
function
varargout
=
handleCommand
(
ev3
,
command
,
varargin
)
% Execute a CommunicationInterface-method given as a handle
% Execute a CommunicationInterface-method given as a handle
%
%
% As those methods have different, fixed numbers of output arguments, this quantity
% As those methods have different, fixed numbers of output arguments, this quantity
...
@@ -467,16 +467,16 @@ classdef EV3 < MaskedHandle
...
@@ -467,16 +467,16 @@ classdef EV3 < MaskedHandle
end
end
if
ev3
.
debug
if
ev3
.
debug
fprintf
(
'(DEBUG) Sending %s\n'
,
func2str
(
command
Handle
));
fprintf
(
'(DEBUG) Sending %s\n'
,
func2str
(
command
));
end
end
% Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
% Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
% do this ugly workaround using strings. See
% 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
% 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
(
command
Handle
)));
nOut
=
nargout
(
strcat
(
'CommunicationInterface>CommunicationInterface.'
,
func2str
(
command
)));
try
try
[
varargout
{
1
:
nOut
}]
=
command
Handle
(
ev3
.
commInterface
,
varargin
{:});
[
varargout
{
1
:
nOut
}]
=
command
(
ev3
.
commInterface
,
varargin
{:});
catch
ME
catch
ME
%ev3.detectedCommError(ME.identifier, ME.message);
%ev3.detectedCommError(ME.identifier, ME.message);
if
~
isempty
(
strfind
(
exceptionID
,
'CommError'
))
if
~
isempty
(
strfind
(
exceptionID
,
'CommError'
))
...
...
This diff is collapsed.
Click to expand it.
source/Motor.m
+
4
−
4
View file @
0987153a
...
@@ -885,7 +885,7 @@ classdef Motor < MaskedHandle & dynamicprops
...
@@ -885,7 +885,7 @@ classdef Motor < MaskedHandle & dynamicprops
end
end
methods
(
Access
=
private
)
% Private functions that directly interact with commLayer
methods
(
Access
=
private
)
% Private functions that directly interact with commLayer
function
varargout
=
handleCommand
(
motor
,
command
Handle
,
checkDevice
,
varargin
)
function
varargout
=
handleCommand
(
motor
,
command
,
checkDevice
,
varargin
)
% Execute a CommunicationInterface-method given as a handle
% Execute a CommunicationInterface-method given as a handle
%
%
% As those methods have different, fixed numbers of output arguments, this quantity
% As those methods have different, fixed numbers of output arguments, this quantity
...
@@ -905,15 +905,15 @@ classdef Motor < MaskedHandle & dynamicprops
...
@@ -905,15 +905,15 @@ classdef Motor < MaskedHandle & dynamicprops
end
end
if
motor
.
debug
if
motor
.
debug
fprintf
(
'(DEBUG) Sending %s\n'
,
func2str
(
command
Handle
));
fprintf
(
'(DEBUG) Sending %s\n'
,
func2str
(
command
));
end
end
% Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
% Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
% do this ugly workaround using strings. See
% 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
% 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
(
command
Handle
)));
nOut
=
nargout
(
strcat
(
'CommunicationInterface>CommunicationInterface.'
,
func2str
(
command
)));
try
try
[
varargout
{
1
:
nOut
}]
=
command
Handle
(
motor
.
commInterface
,
varargin
{:});
[
varargout
{
1
:
nOut
}]
=
command
(
motor
.
commInterface
,
varargin
{:});
catch
ME
catch
ME
if
~
isempty
(
strfind
(
ME
.
identifier
,
'CommError'
))
if
~
isempty
(
strfind
(
ME
.
identifier
,
'CommError'
))
warning
(
'Lost connection to the Brick!'
);
warning
(
'Lost connection to the Brick!'
);
...
...
This diff is collapsed.
Click to expand it.
source/Sensor.m
+
4
−
4
View file @
0987153a
...
@@ -444,7 +444,7 @@ classdef Sensor < MaskedHandle
...
@@ -444,7 +444,7 @@ classdef Sensor < MaskedHandle
end
end
end
end
function
varargout
=
handleCommand
(
sensor
,
command
Handle
,
checkDevice
,
varargin
)
function
varargout
=
handleCommand
(
sensor
,
command
,
checkDevice
,
varargin
)
% Execute a CommunicationInterface-method given as a handle
% Execute a CommunicationInterface-method given as a handle
%
%
% As those methods have different, fixed numbers of output arguments, this quantity
% As those methods have different, fixed numbers of output arguments, this quantity
...
@@ -464,15 +464,15 @@ classdef Sensor < MaskedHandle
...
@@ -464,15 +464,15 @@ classdef Sensor < MaskedHandle
end
end
if
sensor
.
debug
if
sensor
.
debug
fprintf
(
'(DEBUG) Sending %s\n'
,
func2str
(
command
Handle
));
fprintf
(
'(DEBUG) Sending %s\n'
,
func2str
(
command
));
end
end
% Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
% Note: Arrg. MATLAB does not support nargout for class methods directly, so I have to
% do this ugly workaround using strings. See
% 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
% 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
(
command
Handle
)));
nOut
=
nargout
(
strcat
(
'CommunicationInterface>CommunicationInterface.'
,
func2str
(
command
)));
try
try
[
varargout
{
1
:
nOut
}]
=
command
Handle
(
sensor
.
commInterface
,
varargin
{:});
[
varargout
{
1
:
nOut
}]
=
command
(
sensor
.
commInterface
,
varargin
{:});
catch
ME
catch
ME
%sensor.ev3Handle.detectedCommError(ME.identifier, ME.message);
%sensor.ev3Handle.detectedCommError(ME.identifier, ME.message);
if
~
isempty
(
strfind
(
ME
.
identifier
,
'CommError'
))
if
~
isempty
(
strfind
(
ME
.
identifier
,
'CommError'
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment