Переглянути джерело

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






Завантаження…
Відмінити
Зберегти