diff --git a/communication/dataConnection.m b/communication/dataConnection.m index 3362eb5e..670ceae1 100644 --- a/communication/dataConnection.m +++ b/communication/dataConnection.m @@ -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 pnet(me.(name), 'close'); end end + me.isOpen = false; me.conn = -1; end end @@ -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 diff --git a/opticka.m b/opticka.m index a651f8e2..d83df940 100644 --- a/opticka.m +++ b/opticka.m @@ -1127,6 +1127,7 @@ function loadProtocol(me, ui) me.comment = ['Protocol: ' fileName]; me.store.protocolName = fileName; + me.store.protocolPath = p; clearStimulusList(me); clearVariableList(me); @@ -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'); diff --git a/runExperiment.m b/runExperiment.m index 587c65f4..08e077ae 100644 --- a/runExperiment.m +++ b/runExperiment.m @@ -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 @@ -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!!!')