Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
%}

PortArrayCal = BpodLib.calibration.liquid.ValveDataManagerClass();

for moduleNumber = 1:BpodSystem.Modules.nModules
nModules = numel(BpodSystem.Modules.Connected);
for moduleNumber = 1:nModules
for valveIndex = 1:8 % Todo: Only the connected PA's?
PortArrayCal.createValve(sprintf('PA%i_%i', moduleNumber, valveIndex));
end
Expand Down
2 changes: 1 addition & 1 deletion Functions/+BpodLib/+utils/getCurrentCOM.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
%}

if ~isfield(BpodSystem, 'SerialPort')
if ~isprop(BpodSystem, 'SerialPort') || isempty(BpodSystem.SerialPort)
comport = 'EMU';
else
comport = BpodSystem.SerialPort.PortName;
Expand Down
17 changes: 9 additions & 8 deletions Tests/BpodLib/calibration/liquid/test_save.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,28 @@ function setup(testCase)
valveManager.loadData(fullfile(testDataFolder, 'ExpectedLiquidCalibration.json'))
testCase.TestData.mockValveDataManager = valveManager;

% Create various filesetups
mockBpod = struct();
mockBpod.SerialPort.PortName = 'COM13';
mockBpod.CalibrationTables.LiquidCal = valveManager;
% Create various file setups
% Regular setup
mockBpod_regular = BpodLib.BpodObject.MockBpodObject('COM13');
mockBpod_regular.CalibrationTables.LiquidCal = valveManager;
folderPath = fullfile(rootPath, 'CF Regular');
mockBpod.Path.LocalDir = folderPath;
mockBpod_regular.Path.LocalDir = folderPath;
mkdir(folderPath)
folderPath = fullfile(folderPath, 'Config');
mkdir(folderPath);
testCase.TestData.regularBpod = mockBpod;
testCase.TestData.regularBpod = mockBpod_regular;

% Regular multi
mockBpod_multi = BpodLib.BpodObject.MockBpodObject('COM13');
mockBpod_multi.CalibrationTables.LiquidCal = valveManager;
folderPath = fullfile(rootPath, 'CF Multi');
mkdir(folderPath)
mockBpod.Path.LocalDir = folderPath;
mockBpod_multi.Path.LocalDir = folderPath;
folderPath = fullfile(folderPath, 'Config');
mkdir(folderPath);
mkdir(fullfile(folderPath, 'Machine-COM13'))
mkdir(fullfile(folderPath, 'Machine-COM5'))
testCase.TestData.multiBpod = mockBpod;
testCase.TestData.multiBpod = mockBpod_multi;
end

function teardown(testCase)
Expand Down
3 changes: 1 addition & 2 deletions Tests/BpodLib/utils/test_utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ function setup(testCase)
testCase.TestData.rootPath = rootPath;
mkdir(testCase.TestData.rootPath)

mockBpod = struct();
mockBpod.SerialPort.PortName = 'COM13';
mockBpod = BpodLib.BpodObject.MockBpodObject('COM13');
mockBpod.Path.LocalDir = testCase.TestData.rootPath;
testCase.TestData.mockBpod = mockBpod;
end
Expand Down