Skip to content

Commit 5d181dd

Browse files
committed
start work on phase monitor class
1 parent 4432469 commit 5d181dd

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

code/+vidrio/+sync/phaseMonitor.m

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
classdef phaseMonitor < handle
2+
% Plot the relative phase of two AO tasks on different boards
3+
%
4+
% vidrio.sync.phaseMonitor
5+
%
6+
%
7+
% Hook up AO0 of DAQ_a to AI0 of DAQ_a and AO0 of DAQ_b to AI1 of DAQ_a
8+
%
9+
%
10+
% Also see:
11+
% vidrio.sync.sine_AO_AI, vidrio.mixed.AOandAI, vidrio.mixed.AOandAI_OO,
12+
13+
14+
properties
15+
taskA
16+
taskB
17+
end %close properties block
18+
19+
properties (Hidden)
20+
listeners
21+
end
22+
23+
24+
methods
25+
26+
function obj=phaseMonitor(DAQ_ID_A, DAQ_ID_B)
27+
28+
obj.taskA=vidrio.sync.sine_AO_AI(DAQ_ID_A);
29+
obj.taskB=vidrio.sync.sine_AO_AI(DAQ_ID_B);
30+
31+
32+
addlistener(obj.taskA,'acquiredData', @obj.plotIt(src,eventData)); %TODO: confirm that's valic
33+
34+
35+
obj.taskA.startAcquisition;
36+
obj.taskB.startAcquisition;
37+
38+
end % close constructor
39+
40+
41+
function delete(obj)
42+
delete(obj.taskA)
43+
delete(obj.taskB)
44+
end %close destructor
45+
46+
47+
function plotIt(obj,src,eventData)
48+
%TODO: plot both chans
49+
end
50+
51+
52+
end %close methods block
53+
54+
end %close the vidrio.mixed.AOandAI_OO class definition

code/basicConcepts/listenerExample.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
% In the case above, we pass the source object and the event object. These aren't used for anything
5050
% here, but I show the full form above. If you wanted to ignore them, you could just do:
5151
% addlistener(obj,'examplePropertyPopulated', @(~,~) obj.plotIt);
52+
% or:
53+
% addlistener(obj,'examplePropertyPopulated', @obj.plotIt);
5254
end %close listenerExample constructor
5355

5456

0 commit comments

Comments
 (0)