Skip to content

Commit

Permalink
Restore instrument at test method setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
pablorcum committed Sep 8, 2024
1 parent 1d7359c commit a73999b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/commonSetupTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ function setupBossdevice(testCase)
end
end

methods (TestMethodSetup)
function restoreInstrument(testCase)
testCase.bd.restoreInstrument;
end
end

methods (TestClassTeardown)
function resetSgPath(testCase)
if testCase.isSGinstalled
Expand Down
7 changes: 7 additions & 0 deletions toolbox/src/bossdevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,13 @@ function createRecording(obj, recordingDuration)
bossapi.inst.createRecording(recordingDuration, obj.targetObject);
end

function restoreInstrument(obj)
obj.removeAllInstruments;
hInst = slrealtime.Instrument(obj.firmwareFilepath);
hInst.addInstrumentedSignals;
obj.addInstrument(hInst);
end


%% Target object wrappers
function addInstrument(obj, inst)
Expand Down

0 comments on commit a73999b

Please sign in to comment.