Build out MATLAB test framework and core integration coverage
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
classdef Awg2Scope_test < matlab.unittest.TestCase
|
||||
% Test class for Awg2Scope
|
||||
classdef Awg2Scope_test < IMDDTestCase
|
||||
% Auto-generated placeholder for Awg2Scope.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/Awg2Scope.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for Awg2Scope
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for Awg2Scope are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
classdef AwgKeysight_test < matlab.unittest.TestCase
|
||||
% Test class for AwgKeysight
|
||||
classdef AwgKeysight_test < IMDDTestCase
|
||||
% Auto-generated placeholder for AwgKeysight.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/AwgKeysight.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for AwgKeysight
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for AwgKeysight are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
classdef DC_Supply_test < matlab.unittest.TestCase
|
||||
% Test class for DC_Supply
|
||||
classdef DC_supply_test < IMDDTestCase
|
||||
% Auto-generated placeholder for DC_supply.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/DC_supply.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for DC_Supply
|
||||
% Add your test code here
|
||||
|
||||
dc_supply = DC_supply("voltage",[0,9],"active",1);
|
||||
|
||||
dc_supply.set();
|
||||
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for DC_supply are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
classdef Exfo_laser_test < matlab.unittest.TestCase
|
||||
% Test class for Exfo_laser
|
||||
classdef Exfo_laser_test < IMDDTestCase
|
||||
% Auto-generated placeholder for Exfo_laser.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/Exfo_laser.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for Exfo_laser
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for Exfo_laser are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
classdef LabDeviceTemplate_test < matlab.unittest.TestCase
|
||||
% Test class for LabDeviceTemplate
|
||||
classdef LabDeviceTemplate_test < IMDDTestCase
|
||||
% Auto-generated placeholder for LabDeviceTemplate.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/LabDeviceTemplate.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for LabDeviceTemplate
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for LabDeviceTemplate are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
exfo = Exfo_laser("serialport_number",'COM8','mainframe_channel',1,'safety_mode',0);
|
||||
pdfa = Thor_PDFA("safety_mode",0);
|
||||
|
||||
exfo.enableLaser();
|
||||
pdfa.enablePDFA();
|
||||
pdfa.setPumpLevel(10);
|
||||
|
||||
for wl = 1310:1:1315
|
||||
|
||||
pdfa.disablePDFA;
|
||||
|
||||
exfo.setWavelength(wl);
|
||||
|
||||
pdfa.enablePDFA();
|
||||
pdfa.setPumpLevel(10);
|
||||
|
||||
pause(1);
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
classdef OSA_Advantest_test < matlab.unittest.TestCase
|
||||
% Test class for OSA_Advantest
|
||||
classdef OSA_Advantest_test < IMDDTestCase
|
||||
% Auto-generated placeholder for OSA_Advantest.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/OSA_Advantest.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for OSA_Advantest
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for OSA_Advantest are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
classdef OptAtten_test < matlab.unittest.TestCase
|
||||
% Test class for OptAtten
|
||||
classdef OptAtten_test < IMDDTestCase
|
||||
% Auto-generated placeholder for OptAtten.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/OptAtten.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for OptAtten
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for OptAtten are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
classdef OptLaserN7714A_test < matlab.unittest.TestCase
|
||||
% Test class for OptLaserN7714A
|
||||
classdef OptLaserN7714A_test < IMDDTestCase
|
||||
% Auto-generated placeholder for OptLaserN7714A.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/OptLaserN7714A.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for OptLaserN7714A
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for OptLaserN7714A are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
classdef OptPowerMeter8153A_test < matlab.unittest.TestCase
|
||||
% Test class for OptPowerMeter8153A
|
||||
classdef OptPowerMeter8153A_test < IMDDTestCase
|
||||
% Auto-generated placeholder for OptPowerMeter8153A.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/OptPowerMeter8153A.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for OptPowerMeter8153A
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for OptPowerMeter8153A are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
classdef ScopeKeysight_test < matlab.unittest.TestCase
|
||||
% Test class for ScopeKeysight
|
||||
classdef ScopeKeysight_test < IMDDTestCase
|
||||
% Auto-generated placeholder for ScopeKeysight.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/ScopeKeysight.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for ScopeKeysight
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for ScopeKeysight are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
|
||||
|
||||
SCP = ScopeKeysight("model","UXR1104B",'autoscale',0,"fadc","GSa_256","channel",[1,0],"recordLen",2000000,"removeDC",1);
|
||||
|
||||
scpe_sig_cell = SCP.read();
|
||||
@@ -1,11 +1,10 @@
|
||||
classdef Thor_PDFA_test < matlab.unittest.TestCase
|
||||
% Test class for Thor_PDFA
|
||||
classdef Thor_PDFA_test < IMDDTestCase
|
||||
% Auto-generated placeholder for Thor_PDFA.
|
||||
% Target: C:/Users/Silas/Documents/MATLAB/imdd_simulation/Classes/05_Lab/Thor_PDFA.m
|
||||
|
||||
methods (Test)
|
||||
function testExample(testCase)
|
||||
% Example test case for Thor_PDFA
|
||||
% Add your test code here
|
||||
testCase.verifyTrue(true);
|
||||
methods (Test, TestTags = {'placeholder', 'todo'})
|
||||
function testNotImplemented(testCase)
|
||||
testCase.assumeFail("Tests for Thor_PDFA are not implemented yet.");
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
|
||||
|
||||
M = 4;
|
||||
usemrds = 0;
|
||||
fsym = 68e9;
|
||||
fdac = 256e9;
|
||||
awg_vpp = 0.1;
|
||||
rrcalpha = 0.05;
|
||||
|
||||
%%%%% Construct AWG and Scope Modules %%%%%%
|
||||
SCP = ScopeKeysight("model","UXR1104B",'autoscale',0,"fadc","GSa_256","channel",[0,0,0,1],"recordLen",2000000,"removeDC",1);
|
||||
AWG = AwgKeysight("model","M8199B","fdac",fdac,"scaletodac",[1,1],"skews",[0,0],"voltages",[awg_vpp,0]);
|
||||
A2S = Awg2Scope(AWG,SCP,[0,0,0,1]);
|
||||
|
||||
%%%%% Symbol Generation %%%%%%
|
||||
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"rrcalpha",rrcalpha);
|
||||
|
||||
[Digi_sig,Symbols,Bits] = PAMsource("fsym",fsym,"M",M,"order",19,"useprbs",1,...
|
||||
"fs_out",fdac,"applyclipping",0,"clipfactor",1.7,...
|
||||
"applypulseform",0,"pulseformer",Pform,"randkey",pn_key,...
|
||||
"db_precode",db_precode,...
|
||||
"mrds_code",usemrds,"mrds_blocklength",512,"db_encode",db_coding_approach).process();
|
||||
|
||||
%%%%% Resample to DAC rate %%%%%%
|
||||
Digi_sig = Digi_sig.resample("fs_out",AWG.fdac);
|
||||
|
||||
Digi_sig = Filter('filtdegree',5,"f_cutoff",1.1*(fsym/log2(M)),"fs",Digi_sig.fs,"filterType",filtertypes.gaussian).process(Digi_sig);
|
||||
|
||||
|
||||
%%%%% AWG --> Scope %%%%%%
|
||||
[Scpe_sig,~,~,~] = A2S.process("signal1",Digi_sig);
|
||||
|
||||
Scpe_sig.plot('displayname','Signal from Scope','fignum',10);
|
||||
Scpe_sig.spectrum("displayname","Scope PSD","fignum",20);
|
||||
Reference in New Issue
Block a user