浏览代码

Added a channel class for Oscilloscope

publish
Wouter Horlings 8 年前
父节点
当前提交
15dde07b89
共有 2 个文件被更改,包括 31 次插入4 次删除
  1. +22
    -0
      OOequipment/Channel.m
  2. +9
    -4
      OOequipment/Oscilloscope.m

+ 22
- 0
OOequipment/Channel.m 查看文件

@@ -0,0 +1,22 @@
classdef Channel
%CHANNEL Summary of this class goes here
% Detailed explanation goes here
properties
Property1
end
methods
function obj = Channel(inputArg1,inputArg2)
%CHANNEL Construct an instance of this class
% Detailed explanation goes here
obj.Property1 = inputArg1 + inputArg2;
end
function outputArg = method1(obj,inputArg)
%METHOD1 Summary of this method goes here
% Detailed explanation goes here
outputArg = obj.Property1 + inputArg;
end
end
end

+ 9
- 4
OOequipment/Oscilloscope.m 查看文件

@@ -3,15 +3,16 @@ classdef Oscilloscope < Equipment
% Detailed explanation goes here
properties
ch1
ch2
end
methods
function obj = Oscilloscope(inputArg1,inputArg2)
function obj = Oscilloscope(ipAddress,port,nchannels)
%OSCILLOSCOPE Construct an instance of this class
% Detailed explanation goes here
obj.Property1 = inputArg1 + inputArg2;
obj@Equipment(ipAddress,port,-1);
for i = 1:nchannels
obj.(['ch',num2str(i)]) = Channel(inputArg1,inputArg2);
end
end
function outputArg = method1(obj,inputArg)
@@ -22,3 +23,7 @@ classdef Oscilloscope < Equipment
end
end






正在加载...
取消
保存