Skip to content

Commit a73999b

Browse files
committed
Restore instrument at test method setup.
1 parent 1d7359c commit a73999b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/commonSetupTests.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ function setupBossdevice(testCase)
3636
end
3737
end
3838

39+
methods (TestMethodSetup)
40+
function restoreInstrument(testCase)
41+
testCase.bd.restoreInstrument;
42+
end
43+
end
44+
3945
methods (TestClassTeardown)
4046
function resetSgPath(testCase)
4147
if testCase.isSGinstalled

toolbox/src/bossdevice.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,13 @@ function createRecording(obj, recordingDuration)
483483
bossapi.inst.createRecording(recordingDuration, obj.targetObject);
484484
end
485485

486+
function restoreInstrument(obj)
487+
obj.removeAllInstruments;
488+
hInst = slrealtime.Instrument(obj.firmwareFilepath);
489+
hInst.addInstrumentedSignals;
490+
obj.addInstrument(hInst);
491+
end
492+
486493

487494
%% Target object wrappers
488495
function addInstrument(obj, inst)

0 commit comments

Comments
 (0)