-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdddeca
commit 8f34ce6
Showing
41 changed files
with
158 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +0,0 @@ | ||
% this returns the path to the directory above this directory | ||
function BCorePath=getBCorePath() | ||
% DO U SEE ME? | ||
[pathstr, ~, ~] = fileparts(mfilename('fullpath')); | ||
BCorePath = fileparts(pathstr); | ||
BCorePath = [BCorePath filesep]; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
classdef BCoreUtil | ||
properties | ||
end | ||
|
||
methods (Static) | ||
|
||
function BCorePath=getBCorePath() | ||
[pathstr, ~, ~] = fileparts(mfilename('fullpath')); | ||
[pathstr, ~, ~] = fileparts(pathstr); | ||
BCorePath = fileparts(pathstr); | ||
BCorePath = [BCorePath filesep]; | ||
end | ||
|
||
function BasePath = getBasePath() | ||
p = BCoreUtil.getBCorePath(); | ||
[BasePath, ~, ~] = fileparts(p); | ||
end | ||
|
||
function ServerDataPath = getServerDataPath() | ||
p = BCoreUtil.getBasePath(); | ||
p = fullfile(p,'BCoreData'); | ||
ServerDataPath = fullfile(p,'ServerData'); | ||
end | ||
|
||
function rx = createDefaultBCore() | ||
try | ||
[success, mac]=getMACaddress(); | ||
if ~success | ||
mac='000000000000'; | ||
end | ||
catch | ||
mac='000000000000'; | ||
end | ||
|
||
machines={{'1U',mac,[1 1 1]}}; | ||
rx=createBCoreWithDefaultStations(machines,dataPath,'localTimed'); | ||
permStorePath=fullfile(dataPath,'PermanentTrialRecordStore'); | ||
mkdir(permStorePath); | ||
rx.standAlonePath=permStorePath; | ||
fprintf('created new BCore\n') | ||
end | ||
|
||
function [success, mac]=getMACaddress() | ||
success=false; | ||
switch computer | ||
case {'PCWIN64','PCWIN32'} | ||
macidcom = fullfile(PsychtoolboxRoot,'PsychContributed','macid'); | ||
[rc, mac] = system(macidcom); | ||
mac=mac(~isstrprop(mac,'wspace')); | ||
if rc==0 && isMACaddress(mac) | ||
success=true; | ||
end | ||
case {'GLNXA64','MACI64'} | ||
error('BCoreUtil:getMACAddress:unsupportedSystem','This system: %s is not supported', computer); | ||
compinfo = Screen('Computer'); | ||
if isfield(compinfo, 'MACAddress') | ||
mac = compinfo.MACAddress; | ||
% Remove the : that are a part of the string | ||
mac = mac(mac~=':'); | ||
if isMACaddress(mac) | ||
success = true; | ||
end | ||
end | ||
otherwise | ||
error('BCoreUtil:getMACAddress:unsupportedSystem','In getMACaddress() unknown OS'); | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.