Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test class hierarchy #11

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c753719
New branch which supports multiple AWGs.
terrorfisch Mar 3, 2015
507bd65
Remove outdated files and documentation.
terrorfisch Mar 3, 2015
c640540
Began implementation of driver test.
terrorfisch Mar 3, 2015
7468699
Implemented isPlaybackInProgress in class PXDAC (for PXDAC4800).
lumip Mar 4, 2015
2e56693
Merge pull request #1 from lumip/multiawg
terrorfisch Mar 10, 2015
5471e06
remove unnecessary files.
terrorfisch Mar 10, 2015
f8231ce
Merge branch 'multiawg' of https://github.com/qutech/special-measure.…
terrorfisch Mar 10, 2015
49a4596
correlation tool for the data analysis
j340m3 Mar 10, 2015
0e0e22b
introduced comparison of performance for the pulstab to waveform func…
j340m3 Mar 10, 2015
7dbfa37
Removed debug output in plstowf and fixed call to interp1.
lumip Mar 10, 2015
3f5bf3b
Merge pull request #3 from lumip/multiawg
terrorfisch Mar 10, 2015
38bc028
Fixed minor bugs and implemented correct virtual channel support
terrorfisch Mar 10, 2015
b56799f
Merge branch 'multiawg' of https://github.com/qutech/special-measure.…
terrorfisch Mar 10, 2015
46ce45e
Restructuring of hardwarePulseTest. It is now object oriented which i…
lumip Mar 10, 2015
5ba5bf8
Merge pull request #4 from terrorfisch/multiawg
terrorfisch Mar 10, 2015
141f8f4
Merge branch 'multiawg' into OOTests. Conflicts in /hardwarePulseTest…
lumip Mar 10, 2015
fbb001f
Implemented DSIOTestSetup and RSAIOTestSetup.
lumip Mar 10, 2015
023271b
Changes to the test class, to make it more suitable for experiments,
pbethke Mar 13, 2015
e34aa72
Merge pull request #1 from pbethke/OOTests
lumip Mar 13, 2015
d50d448
Moved implementation of evaluate method as well as specific propertie…
lumip Mar 15, 2015
8f43212
Created script InitializePulseData which initializes the global plsda…
lumip Mar 15, 2015
fc3facb
MeasuredData is now a property of the DefaultTestSetup class to allow…
lumip Mar 15, 2015
82432bb
DSIOTestSetup and RSAIOTestSetup now configure the DAC correctly for …
lumip Mar 15, 2015
b925676
Ignored Matlabs autosave files (.asv).
lumip Mar 15, 2015
0416f76
add a second error criterion: a threshold for the tolerable single sa…
pbethke Mar 16, 2015
855f89f
ignore backup files and binaries in all directories
pbethke Mar 16, 2015
1b05050
add test for table mask
pbethke Mar 16, 2015
316a52a
reformat DSIOTestSetup pulse initialization for readability
pbethke Mar 16, 2015
364694f
Merge pull request #2 from pbethke/OOTests
lumip Mar 16, 2015
9a5d9c0
Begun implementation of revised test hierarchy (issue #6).
lumip Mar 18, 2015
ad2f279
Implemented TestPulseBuilder for the downsampling and repetitive sign…
lumip Mar 24, 2015
1b03f93
Removed old classes and adapted the hardwarePulseTest.m to use the ne…
lumip Mar 24, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Windows default autosave extension
**/*.asv
# OSX / *nix default autosave extension
**/*.m~
# Compiled MEX binaries (all platforms)
**/*.mex*
12 changes: 0 additions & 12 deletions .hgignore

This file was deleted.

159 changes: 159 additions & 0 deletions @AWG/AWG.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
classdef AWG < handle & matlab.mixin.Heterogeneous
% AWG interface class which provides a generic interface to any
% arbitrary wavfeform generetor. The hardware specific implementation
% is done in derived classes. By deriving from the SuperClass handle
% an AWG instance is always a reference to an object.

% defining properties of an harware instrument
properties (Constant,Abstract,GetAccess = public)
nChannels
possibleResolutions
end

% object specific generic AWG properties
properties (GetAccess = public, SetAccess=protected)
identifier;

%pulse to waveform conversion settings
resolution; %in bits
clk;
offset;
scale;

storedPulsegroups = AWGSTORAGE();
activePulsegroup = 'none';

end

properties (GetAccess = public, SetAccess = ?VAWG)
%virtual channel assigned to each hardware channel.
%0 means no virtual channel assigned to the channel
virtualChannels;
end

% hardware specific methods
methods (Abstract)
%make this pulsegroup playable by AWG
addPulseGroup(self,grpdef);

%remove this pulsegroup from memory and forget about it
removePulseGroup(self,name);

%update the changed pulses
updatePulseGroup(self,grpdef);

%wait for trigger
arm(self);

%this function is for debugging purposes
issueSoftwareTrigger(self);

val = isPlaybackInProgress(self);

% %add a pulsegroup by name to the pulsegroups playable by this
% %machineuse is/ deprecated
% add(self,pulsegroup)
%
% load(self,grp, ind)
%
% erase(self,groups,options)
%
% syncwaveforms(self)
%
% rm(self,grp, ctrl)
end

% Set methods controlling if argument is valid
methods
function obj = AWG(id)
obj.identifier = id;

obj.virtualChannels = zeros(1,obj.nChannels);

obj.offset = zeros(1,obj.nChannels);
obj.scale = ones(1,obj.nChannels);
obj.resolution = obj.possibleResolutions(1);
end

function virtChan = getVirtualChannel(self,chan)
virtChan = self.virtualChannels(chan);
if virtChan == 0
virtChan = [];
end
end

function hardwareChannels = getHardwareChannel(self,virtualChannel)
if ~isscalar(virtualChannel)
error('Can not convert multiple virt channels at once, since one may refer to multiple harware channels.');
end
hardwareChannels = find( self.virtualChannels == virtualChannel );
end

function setActivePulseGroup(self,pulsegroupName)
if isKey(self.storedPulsegroups,pulsegroupName)
self.activePulsegroup = pulsegroupName;
else
error('Can not activate pulsegroup "%s". Since it is not known',sequenceName);
end
end

% set mapping function: output = scale * x + offset
function setVoltageMapping(this,channel,newScale,newOffset)
if channel>this.nChannels
error('Unknown channel %i',channel);
end
this.scale(channel) = newScale;
this.offset(channel) = newOffset;
end

% set output resolution to bits if it is allowed
function setResolution(self,bits)

if find(self.possibleResolutions==bits)
self.resolution = bits;
else
disp(bits)
error('%s does not support this resolution.',self.type)
end
end

% set zerolen to positive pulselength if pulse is zero, otherwise
% to negative pulselength
function zerolen = zeroLength(self,grp,ind,zerolen)

if isempty(ind)
ind = 1:length(grp.pulses);
end

epsilon = self.scale/2^(self.resolution-1);
for i = 1:length(grp.pulses)

dind = find([grp.pulses(i).data.clk] == self.clk);
npts = size(grp.pulses(i).data(dind).wf, 2);

for virtChan=1:size(grp.pulses(i).data(dind).wf,1)

hardChan = self.getHardwareChannel(grp.chan(virtChan));

if hardChan

if any(abs(grp.pulses(i).data(dind).wf(virtChan,:)) > epsilon(hardChan) )
zerolen(ind(i),virtChan) = -npts;
else
zerolen(ind(i),virtChan) = npts;
end

end
end

end

end

end

methods (Static)

end

end
Empty file added @AWG/waveforms.m
Empty file.
Loading