diff --git a/source/EV3.m b/source/EV3.m index 610693e852f655a5e09a9fca81926d7b296d5faa..91b118b5baecbc2d809bb7ab1c574f2db5b2bb05 100644 --- a/source/EV3.m +++ b/source/EV3.m @@ -1,4 +1,4 @@ -classdef EV3 < MaskedHandle +classdef EV3 < Device % High-level class to work with physical bricks. % % This is the 'central' class (from user's view) when working with this toolbox. It @@ -53,14 +53,6 @@ classdef EV3 < MaskedHandle % batteryMode (string in {'Percentage', 'Voltage'}): Mode for reading battery charge. [WRITABLE] % See also BATTERYVALUE batteryMode; - - % debug (numeric in {0,1,2}): Debug mode. [WRITABLE] - % - 0: Debug turned off - % - 1: (High-level-) Debug turned on for EV3-object - enables feedback in the - % console about what firmware-commands have been called when using a method - % - 2: Low-level-Debug turned on - each packet sent and received is printed to the - % console - debug; end properties (Dependent) % Parameters to be read directly from physical brick @@ -101,18 +93,16 @@ classdef EV3 < MaskedHandle sensor4; end - properties (Access = private) + properties (Hidden, Access = protected) % Hidden properties for internal use only + % init (bool): Indicates init-phase (i.e. constructor is running). + init = true; + % commInterface (CommunicationInterface): Interface to communication layer % All commands sent to the Brick are created and written through this object. Each % Motor- and Sensor-object has a reference to it. commInterface = 0; end - properties (Hidden, Access = private) % Hidden properties for internal use only - % init (bool): Indicates init-phase (i.e. constructor is running). - init = true; - end - methods % Standard methods %% Constructor function ev3 = EV3(varargin) @@ -394,8 +384,8 @@ classdef EV3 < MaskedHandle ev3.batteryMode = batteryMode; end - - function set.debug(ev3, debug) + + function setDebug(ev3, debug) if ~isBool(debug) && debug ~= 2 error('EV3::set.debug: Given parameter is not a bool.'); end diff --git a/source/Motor.m b/source/Motor.m index b9887d67297fc49dbc69cb8316bda253072267c7..d359d571a31077eafaf6bed8048f44359d270e8e 100644 --- a/source/Motor.m +++ b/source/Motor.m @@ -1,4 +1,4 @@ -classdef Motor < MaskedHandle & dynamicprops +classdef Motor < Device & dynamicprops % High-level class to work with motors. % % This class is supposed to ease the use of the brick's motors. It is possible to set all @@ -91,11 +91,6 @@ classdef Motor < MaskedHandle & dynamicprops % If 'Coast', the motor will (at tacholimit, if ~=0) coast to a stop. If 'Brake', % the motor will stop immediately (at tacholimit, if ~=0) and hold the brake. brakeMode; - - % debug (bool): Debug turned on or off. [WRITABLE] - % In debug mode, everytime a command is passed to the sublayer ('communication - % layer'), there is feedback in the console about what command has been called. - debug; end properties (Dependent) % Read-only parameters to be read directly from physical brick @@ -115,7 +110,7 @@ classdef Motor < MaskedHandle & dynamicprops type; end - properties (Hidden, Access = private) % Hidden properties for internal use only + properties (Hidden, Access = protected) % Hidden properties for internal use only % commInterface (CommunicationInterface): Commands are created and sent via the % communication interface class. commInterface; @@ -791,14 +786,6 @@ classdef Motor < MaskedHandle & dynamicprops motor.commInterface = comm; end - function set.debug(motor, debug) - if ~isBool(debug) - error('Motor::set.debug: Given parameter is not a bool.'); - end - - motor.debug = str2bool(debug); - end - function setProperties(motor, varargin) % Sets multiple Motor properties at once using MATLAB's inputParser. % diff --git a/source/Sensor.m b/source/Sensor.m index f89b80f8c8460d1e3c1e6031ab8c469fc5bbc1e8..d980e976569a1d1901aa5db30ce1c51b0c4a8325 100644 --- a/source/Sensor.m +++ b/source/Sensor.m @@ -1,4 +1,4 @@ -classdef Sensor < MaskedHandle +classdef Sensor < Device % High-level class to work with sensors. % % The Sensor-class facilitates the communication with sensors. This mainly consists of @@ -160,11 +160,6 @@ classdef Sensor < MaskedHandle % * DeviceMode.HTColor.All % See also SENSOR.VALUE, SENSOR.TYPE mode; - - % debug (bool): Debug turned on or off. In debug mode, everytime a command is passed to - % the sublayer ('communication layer'), there is feedback in the console about what - % command has been called. [WRITABLE] - debug; end properties (Dependent) % Parameters to be read directly from physical brick @@ -197,7 +192,7 @@ classdef Sensor < MaskedHandle type; end - properties (Hidden, Access = private) % Hidden properties for internal use only + properties (Hidden, Access = protected) % Hidden properties for internal use only % commInterface (CommunicationInterface): Commands are created and sent via the % communication interface class. commInterface; @@ -282,15 +277,6 @@ classdef Sensor < MaskedHandle end end - function set.debug(sensor, debug) - % Check if debug is valid and set sensor.debug if it is. - if ~isBool(debug) - error('Sensor::set.debug: Given parameter is not a bool.'); - end - - sensor.debug = str2bool(debug); - end - function set.port(sensor, port) if ~isPortStrValid(class(sensor),port) error('Sensor::set.port: Given port is not a valid port.');