www.gusucode.com > ros 工具箱 matlab源码程序 > ros/+robotics/+ros/+msggen/+applanix_msgs/GNSSDGPSChannelStatus.m
classdef GNSSDGPSChannelStatus < robotics.ros.Message %GNSSDGPSChannelStatus MATLAB implementation of applanix_msgs/GNSSDGPSChannelStatus % This class was automatically generated by % robotics.ros.msg.internal.gen.MessageClassGenerator. % Copyright 2014-2016 The MathWorks, Inc. %#ok<*INUSD> properties (Constant) MessageType = 'applanix_msgs/GNSSDGPSChannelStatus' % The ROS message type end properties (Constant, Hidden) MD5Checksum = '8441bd37d9364590ce86273785774816' % The MD5 Checksum of the message definition end properties (Access = protected) JavaMessage % The Java message object end properties (Dependent) Frequency AcquisitionMode Status Rtcm Snr DataRate Lock DgpsSourceAutoSwitching Provider end properties (Constant, Hidden) PropertyList = {'AcquisitionMode', 'DataRate', 'DgpsSourceAutoSwitching', 'Frequency', 'Lock', 'Provider', 'Rtcm', 'Snr', 'Status'} % List of non-constant message properties ROSPropertyList = {'acquisition_mode', 'data_rate', 'dgps_source_auto_switching', 'frequency', 'lock', 'provider', 'rtcm', 'snr', 'status'} % List of non-constant ROS message properties end methods function obj = GNSSDGPSChannelStatus(msg) %GNSSDGPSChannelStatus Construct the message object GNSSDGPSChannelStatus import com.mathworks.toolbox.robotics.ros.message.MessageInfo; % Support default constructor if nargin == 0 obj.JavaMessage = obj.createNewJavaMessage; return; end % Construct appropriate empty array if isempty(msg) obj = obj.empty(0,1); return; end % Make scalar construction fast if isscalar(msg) % Check for correct input class if ~MessageInfo.compareTypes(msg(1), obj.MessageType) error(message('robotics:ros:message:NoTypeMatch', obj.MessageType, ... char(MessageInfo.getType(msg(1))) )); end obj.JavaMessage = msg(1); return; end % Check that this is a vector of scalar messages. Since this % is an object array, use arrayfun to verify. if ~all(arrayfun(@isscalar, msg)) error(message('robotics:ros:message:MessageArraySizeError')); end % Check that all messages in the array have the correct type if ~all(arrayfun(@(x) MessageInfo.compareTypes(x, obj.MessageType), msg)) error(message('robotics:ros:message:NoTypeMatchArray', obj.MessageType)); end % Construct array of objects if necessary objType = class(obj); for i = 1:length(msg) obj(i,1) = feval(objType, msg(i)); %#ok<AGROW> end end function frequency = get.Frequency(obj) %get.Frequency Get the value for property Frequency frequency = double(obj.JavaMessage.getFrequency); end function set.Frequency(obj, frequency) %set.Frequency Set the value for property Frequency validateattributes(frequency, {'numeric'}, {'nonempty', 'scalar'}, 'GNSSDGPSChannelStatus', 'Frequency'); obj.JavaMessage.setFrequency(frequency); end function acquisitionmode = get.AcquisitionMode(obj) %get.AcquisitionMode Get the value for property AcquisitionMode acquisitionmode = typecast(int8(obj.JavaMessage.getAcquisitionMode), 'uint8'); end function set.AcquisitionMode(obj, acquisitionmode) %set.AcquisitionMode Set the value for property AcquisitionMode validateattributes(acquisitionmode, {'numeric'}, {'nonempty', 'scalar'}, 'GNSSDGPSChannelStatus', 'AcquisitionMode'); obj.JavaMessage.setAcquisitionMode(acquisitionmode); end function status = get.Status(obj) %get.Status Get the value for property Status status = typecast(int8(obj.JavaMessage.getStatus), 'uint8'); end function set.Status(obj, status) %set.Status Set the value for property Status validateattributes(status, {'numeric'}, {'nonempty', 'scalar'}, 'GNSSDGPSChannelStatus', 'Status'); obj.JavaMessage.setStatus(status); end function rtcm = get.Rtcm(obj) %get.Rtcm Get the value for property Rtcm rtcm = typecast(int8(obj.JavaMessage.getRtcm), 'uint8'); end function set.Rtcm(obj, rtcm) %set.Rtcm Set the value for property Rtcm validateattributes(rtcm, {'numeric'}, {'nonempty', 'scalar'}, 'GNSSDGPSChannelStatus', 'Rtcm'); obj.JavaMessage.setRtcm(rtcm); end function snr = get.Snr(obj) %get.Snr Get the value for property Snr snr = typecast(int8(obj.JavaMessage.getSnr), 'uint8'); end function set.Snr(obj, snr) %set.Snr Set the value for property Snr validateattributes(snr, {'numeric'}, {'nonempty', 'scalar'}, 'GNSSDGPSChannelStatus', 'Snr'); obj.JavaMessage.setSnr(snr); end function datarate = get.DataRate(obj) %get.DataRate Get the value for property DataRate datarate = typecast(int8(obj.JavaMessage.getDataRate), 'uint8'); end function set.DataRate(obj, datarate) %set.DataRate Set the value for property DataRate validateattributes(datarate, {'numeric'}, {'nonempty', 'scalar'}, 'GNSSDGPSChannelStatus', 'DataRate'); obj.JavaMessage.setDataRate(datarate); end function lock = get.Lock(obj) %get.Lock Get the value for property Lock lock = typecast(int8(obj.JavaMessage.getLock), 'uint8'); end function set.Lock(obj, lock) %set.Lock Set the value for property Lock validateattributes(lock, {'numeric'}, {'nonempty', 'scalar'}, 'GNSSDGPSChannelStatus', 'Lock'); obj.JavaMessage.setLock(lock); end function dgpssourceautoswitching = get.DgpsSourceAutoSwitching(obj) %get.DgpsSourceAutoSwitching Get the value for property DgpsSourceAutoSwitching dgpssourceautoswitching = typecast(int8(obj.JavaMessage.getDgpsSourceAutoSwitching), 'uint8'); end function set.DgpsSourceAutoSwitching(obj, dgpssourceautoswitching) %set.DgpsSourceAutoSwitching Set the value for property DgpsSourceAutoSwitching validateattributes(dgpssourceautoswitching, {'numeric'}, {'nonempty', 'scalar'}, 'GNSSDGPSChannelStatus', 'DgpsSourceAutoSwitching'); obj.JavaMessage.setDgpsSourceAutoSwitching(dgpssourceautoswitching); end function provider = get.Provider(obj) %get.Provider Get the value for property Provider provider = typecast(int8(obj.JavaMessage.getProvider), 'uint8'); end function set.Provider(obj, provider) %set.Provider Set the value for property Provider validateattributes(provider, {'numeric'}, {'nonempty', 'scalar'}, 'GNSSDGPSChannelStatus', 'Provider'); obj.JavaMessage.setProvider(provider); end end methods (Access = protected) function cpObj = copyElement(obj) %copyElement Implements deep copy behavior for message % Call default copy method for shallow copy cpObj = copyElement@robotics.ros.Message(obj); % Create a new Java message object cpObj.JavaMessage = obj.createNewJavaMessage; % Iterate over all primitive properties cpObj.Frequency = obj.Frequency; cpObj.AcquisitionMode = obj.AcquisitionMode; cpObj.Status = obj.Status; cpObj.Rtcm = obj.Rtcm; cpObj.Snr = obj.Snr; cpObj.DataRate = obj.DataRate; cpObj.Lock = obj.Lock; cpObj.DgpsSourceAutoSwitching = obj.DgpsSourceAutoSwitching; cpObj.Provider = obj.Provider; end function reload(obj, strObj) %reload Called by loadobj to assign properties obj.Frequency = strObj.Frequency; obj.AcquisitionMode = strObj.AcquisitionMode; obj.Status = strObj.Status; obj.Rtcm = strObj.Rtcm; obj.Snr = strObj.Snr; obj.DataRate = strObj.DataRate; obj.Lock = strObj.Lock; obj.DgpsSourceAutoSwitching = strObj.DgpsSourceAutoSwitching; obj.Provider = strObj.Provider; end end methods (Access = ?robotics.ros.Message) function strObj = saveobj(obj) %saveobj Implements saving of message to MAT file % Return an empty element if object array is empty if isempty(obj) strObj = struct.empty; return end strObj.Frequency = obj.Frequency; strObj.AcquisitionMode = obj.AcquisitionMode; strObj.Status = obj.Status; strObj.Rtcm = obj.Rtcm; strObj.Snr = obj.Snr; strObj.DataRate = obj.DataRate; strObj.Lock = obj.Lock; strObj.DgpsSourceAutoSwitching = obj.DgpsSourceAutoSwitching; strObj.Provider = obj.Provider; end end methods (Static, Access = {?matlab.unittest.TestCase, ?robotics.ros.Message}) function obj = loadobj(strObj) %loadobj Implements loading of message from MAT file % Return an empty object array if the structure element is not defined if isempty(strObj) obj = robotics.ros.msggen.applanix_msgs.GNSSDGPSChannelStatus.empty(0,1); return end % Create an empty message object obj = robotics.ros.msggen.applanix_msgs.GNSSDGPSChannelStatus; obj.reload(strObj); end end end