Skip to content

Commit

Permalink
fix intan record command
Browse files Browse the repository at this point in the history
  • Loading branch information
iandol committed Feb 23, 2023
1 parent 2772426 commit c5c5c42
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions communication/dataConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,18 @@
status = -1;
fprintf('Couldn''t close connection %i, perhaps closed?\n',me.(list)(i));
end
me.isOpen = false;
end
else
me.status = pnet(me.(name),'status');
if me.status <=0;
me.isOpen = false;
if me.status <=0
me.salutation('close Method','Connection appears closed...');
else
try %#ok<TRYNC>
pnet(me.(name), 'close');
end
end
me.isOpen = false;
me.conn = -1;
end
end
Expand All @@ -270,6 +271,7 @@
me.salutation('closeAll Method','Failed to close all PNet connections')
me.status = -1;
end
me.isOpen = false;
status = me.status;
end

Expand Down
5 changes: 5 additions & 0 deletions opticka.m
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,7 @@ function loadProtocol(me, ui)

me.comment = ['Protocol: ' fileName];
me.store.protocolName = fileName;
me.store.protocolPath = p;

clearStimulusList(me);
clearVariableList(me);
Expand Down Expand Up @@ -1436,6 +1437,10 @@ function loadProtocol(me, ui)
me.editVariable;
me.refreshProtocolsList;
me.ui.propertiesToVariables;

me.r.comment = me.comment;
me.r.paths.protocolName = me.store.protocolName;
me.r.paths.protocolPath = me.store.protocolPath;

fprintf('---> Protocol load finished…\n');

Expand Down
5 changes: 4 additions & 1 deletion runExperiment.m
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ function runTask(me)

refreshScreen(me);
initialiseSaveFile(me); %generate a savePrefix for this run
me.comment = [me.comment ' ' me.name];
me.name = [me.subjectName '-' me.savePrefix]; %give us a run name
if isempty(me.screen) || isempty(me.task)
me.initialise; %we set up screenManager and taskSequence objects
Expand Down Expand Up @@ -859,7 +860,9 @@ function runTask(me)
if ~dC.isOpen; open(dC); end
write(dC,uint8(['set Filename.BaseFilename ' me.name]));
write(dC,uint8(['set Filename.Path ' me.paths.savedData]));
write(dC,uint8('set runmode run'));
write(dC,uint8(['set Note1 ' me.name]));
write(dC,uint8(['set Note2 ' me.comment]));
write(dC,uint8('set runmode record'));
WaitSecs(0.5);
catch
warning('runTask cannot contact intan!!!')
Expand Down

0 comments on commit c5c5c42

Please sign in to comment.