Skip to content

Commit 1bd4f97

Browse files
k1o0Jai Bhagat
andauthored
Signals exp test (#231)
* Tiny changes to appease MATLAB * Started installation section * Added matlabdomain extension * Added infomation for remote location in reposPath * Started a setup page * Added parameters walkthrough * HOTFIX changed Alyx Panel login timer to 90 mins * 2.3 <- 2.2.1 (#198) * updated signals submodule * updated signals submodule (eb71b1f) * Added test for ensureCell * Fix'd typo in ensureCell_test * Future-proofing runall to ignore tests with specific hardware requirements * Added tests for nop, iff and emptyElems * Added tests for cellsprintf and num2cellstr; bug fix in num2cellstr * Submodule update * mapToCell test * Removed complete todos * Added test for dat.expExists * Restore changes made in commit 247060a * Expanded test for dispWaterReq * assert -> verifyMatches * Added catStructs test * Added tabulateArgs test * superSave test added * added an informative error message in the case that dat.paths is missing * Attempting to construct a branch that doesn't differ from dev in its submodules * Revert "Attempting to construct a branch that doesn't differ from dev in its submodules" Reverting a commit that should have been to dev_kevin, not to dev * Revert "added an informative error message in the case that dat.paths is missing" Reverting a commit that should have been to dev_kevin, not to dev This reverts commit a492bd2. * Added file package test * Added test for pick * Added test for namedArg * Added varName test * Added back tolerance change * Dev kevin (#192) * added an informative error message when dat.paths is not present * added an identifier to the error message * Added warnings and errors to deal with the case that hardware.mat is not found * fixed identifier * Changed error identifiers following Miles' suggestion of module:package:function:error * added more info to error for empty rig * added more info to no dat.paths error * Bug fix in namedArg test * Removed old function -> now a method of Alyx * Started +fun package test; added fileFunction test * No longer using 'which' to assert function existence * Bug fixes for tests * Bug fix for wiringInfo method * Added KeyedSeq test * Added docs for apply and applyForce * Added loadVar test * Issue #168 * Added mergeStructs test * Added performance tests; reorganized tests; updated changelog * Added parameters walkthrough * Added timeline walkthrough; bug fix for wiringInfo in Timeline * added informative error messages to calibration code * Added documentation for setting up Window; documentation for Window class; Minor bug fixes * Added a few examples to hardware docs * Added Viewing model walkthrough and expanded FAQ * Updated changelog * Updates to docs * Added test for +hw/calibrate.m * deleted exp.construct * Added documentation for calibration test * Updated docs; added services guide * Updates docs * Fix for Communicator WTF mode; increased test coverage for iff * Update to changelog and signals * HOTFIX changed Alyx Panel login timer to 90 mins * Removed readthedocs, updated submodules * Update Shields * HOTFIX: Correct location of docs in README; Stronger wording in install instructions * Added issue templates (#179) * Added troubleshooting docs and error id list * Using signals error handling branch; added troubleshooting doc * Re-factoring SignalsExp for test subclassing * Started expServer tests * Added more tests; bug fix for older versions * Removed validation functions for old MATLAB versions; added documentation * More coverage, documentation * Draws text to screen during calibration #128 * Fix for #4 * Added structAssign test; rewardId tests * Typo fix in structAssign_test * Finished tests for expServer * #156 * Returned listener delete to cleanup * Stricter tolerance in AlyxPanel_test; bug fix for rounding negative numbers * Update alyx-matlab submodule * Minor changes to documentation * Update CHANGELOG.md * Added tests for tl.bindMpepServer and pnet spy * Fixture path fix * Moved audioDevices default to devices mock * WIP * #100 #202 * Updated tests with share fixtures; added pause/resume to SignalsExp; added further tests for SignalsExp; updated tests README; SessionURL fetched from database when necessary * Added better update of keyboard input signal * Potential fix for #213 * Updates to submodules * Update to alyx-matlab * Context menu for hiding event updates in ExpPenel * trialCondition index can be reset with signal * Improvements to test UI * Documentation * README for +eui package (#156) * WIP * Removed warning from updateLogEntry when Alyx deactivated #202 * Added hide option for ExpPanel; ExpPanel guide in docs * Added utils; started docs * #218 * Support for ids in errOnFail * Removed old commented-out code * Scale port closed on errors * Added brief PTB install instructions (#228) * cleanup * Documentation; #229 * More flags for addRigboxPaths * started updating README after Anwar's comments * updated some instructions in README * Revert "started updating README after Anwar's comments" This reverts commit 9f5a456. * Updated documentation * Removed PTBDebug call and added example to docstring * Update to CHANGELOG and signals * #205 - refactored * Update to tests * Warning supression in tests * CHANGELOG Co-authored-by: Jai Bhagat <j.bhagat@ucl.ac.uk>
1 parent 17c757b commit 1bd4f97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3678
-671
lines changed

+dat/expFilePath.m

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,36 @@
2020

2121
% 2013-03 CB created
2222

23-
assert(length(varargin) > 1, 'Error: Not enough arguments supplied.')
23+
assert(length(varargin) > 1, 'Rigbox:dat:expFilePath:NotEnoughInputs',...
24+
'Not enough input arguments.')
2425

2526
parsed = catStructs(regexp(varargin{1}, dat.expRefRegExp, 'names'));
2627
if isempty(parsed) % Subject, not ref
27-
if nargin > 4
28+
if nargin < 3
29+
error('Rigbox:dat:expFilePath:NotEnoughInputs', ...
30+
['Not enough input arguments; check expRef formatted correcly ' ...
31+
'or enter subject, date and sequence as separate arguments'])
32+
elseif nargin == 3
33+
error('Rigbox:dat:expFilePath:NotEnoughInputs', ...
34+
'Not enough input arguments; missing file type')
35+
elseif nargin > 4
2836
location = varargin{5};
2937
varargin(5) = [];
3038
else
3139
location = {};
3240
end
3341
typeIdx = 4;
3442
else % Ref, not subject
35-
typeIdx = 2;
36-
if nargin > 2
43+
if nargin < 2
44+
error('Rigbox:dat:expFilePath:NotEnoughInputs', ...
45+
'Not enough input arguments; missing file type')
46+
elseif nargin > 2
3747
location = varargin{3};
3848
varargin(3) = [];
3949
else
4050
location = {};
4151
end
52+
typeIdx = 2;
4253
end
4354

4455
% tabulate the args to get complete rows

+dat/expPath.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
reposArgs = varargin(end);
2424
varargin = varargin(1:end - 1);
2525
else
26+
% Check for minimum inputs
27+
assert(nargin > 2, ...
28+
'Rigbox:dat:expPath:NotEnoughInputs', 'Must provide repo location')
2629
reposArgs = varargin((end - 1):end);
2730
varargin = varargin(1:end - 2);
2831
end

+dat/reposPath.m

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@
44
% repository specified by 'name'.
55
%
66
% Each repository can have multiple locations with one location being the
7-
% "master" copy and others considered backups (e.g. copies on local
8-
% machines). Users of this function wanting to *save* data should do so
9-
% in all locations. To *load* data, the master may be the only location
10-
% containing all data (i.e. because local copies will only be on specific
11-
% machines). The optional 'location' parameter specifies one or more
12-
% locations, with "all" being the default that returns all locations for
13-
% that repository, and "master" will return the path to the master
14-
% location.
7+
% 'master' copy and others considered backups or archives (e.g. copies on
8+
% local machines). Users of this function wanting to *save* data should
9+
% do so in all locations (i.e. master and local). To *load* data, the
10+
% remote locations (i.e. master and archives) should be used (i.e.
11+
% because local copies will only be on specific machines). The optional
12+
% 'location' parameter specifies one or more locations, with 'all' being
13+
% the default that returns the master and local locations for that
14+
% repository, 'master' will return the path to the master location, and
15+
% 'remote' will return the master and archive/alternate paths (in that
16+
% order).
1517
%
16-
% e.g. to get all paths you should save to for the "main" repository:
17-
% savePaths = DAT.REPOSPATH('main') % savePaths is a string cell array
18+
% e.g. to get all paths you should save to for the 'main' repository:
19+
% savePaths = DAT.REPOSPATH('main') % savePaths is a cell string
1820
%
19-
% To get the master location for the "main" repository:
21+
% To get the master location for the 'main' repository:
2022
% loadPath = DAT.REPOSPATH('main', 'master') % loadPath is a string
2123
%
24+
% When data are spread across multiple remote locations such as archives:
25+
% loadPath = DAT.REPOSPATH('main', 'remote') % loadPath is a cell string
26+
%
2227
% Part of Rigbox
2328

2429
% 2013-03 CB created

+dat/updateLogEntry.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function updateLogEntry(subject, id, newEntry)
1010

1111
% 2013-03 CB created
1212

13-
if isfield(newEntry, 'AlyxInstance')
13+
if isfield(newEntry, 'AlyxInstance') && ~isempty(getOr(dat.paths, 'databaseURL'))
1414
% Update session narrative on Alyx
1515
if ~isempty(newEntry.comments) && ~strcmp(subject, 'default')
1616
try

+eui/Contents.m

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
% +EUI Experiment UI package
2+
%
3+
% This +eui package contains all code pertaining to graphical user
4+
% interfaces in Rigbox. There are five base classes in this folder:
5+
%
6+
% 1. MControl - The class behind the Master Control (MC) GUI.
7+
% 2. ExpPanel - The superclass for UI panels that process and plot remote
8+
% experiment event updates (i.e. the panels under the Current
9+
% Experiments tab of MC).
10+
% 3. Log - UI control for viewing experiment log entries (the table under
11+
% the Log tab of MC).
12+
% 4. AlyxPanel - UI for interacting with the Alyx database (the Alyx panel
13+
% in the New Experiments tab of MC). Can be run as a stand-alone GUI.
14+
% 5. ParamEditor - UI for viewing and editing parameters (the Parameter
15+
% panel in the New Experiments table of MC). Can be run as a
16+
% stand-alone GUI.
17+
%
18+
% Files
19+
% AlyxPanel - A GUI for interating with the Alyx database
20+
% ChoiceExpPanel - UI control for monitoring a 2AFC experiment
21+
% ConditionPanel - Deals with formatting trial conditions UI table
22+
% ExpPanel - Basic UI control for monitoring an experiment
23+
% FieldPanel - Deals with formatting global parameter UI elements
24+
% Log - UI control for viewing experiment log entries
25+
% MappingExpPanel - Preliminary UI for monitoring a mapping experiment
26+
% MControl - GUI for the control of experiments
27+
% ParamEditor - GUI for visualizing and editing experiment parameters
28+
% SignalsTest - A GUI for testing SignalsExp experiment definitions
29+
% SqueakExpPanel - Basic UI control for monitoring a Signals experiment
30+
%
31+
% See Also
32+
% docs/html/using_mc.m, docs/html/using_ParamEditor.m

+eui/MControl.m

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,20 +201,16 @@ function delParamProfile(obj) % Called when 'Delete...' button is pressed next t
201201
profiles = obj.NewExpParamProfile.Option; % Get parameter profile
202202
obj.NewExpParamProfile.Option = profiles(~strcmp(profiles, profile)); % Set new list without deleted profile
203203
%log the parameters as being deleted
204-
obj.log('Deleted parameters as ''%s''', profile);
204+
obj.log('Deleted parameter set ''%s''', profile);
205205
end
206206
end
207207

208208
function saveParamProfile(obj) % Called by 'Save...' button press, save a new parameter profile
209209
selProfile = obj.NewExpParamProfile.Selected; % Find which set is currently selected
210-
if selProfile(1) ~= '<' % This statement is for autofilling the save as input dialog
211-
%default value is currently selected profile name
212-
def = selProfile;
213-
else
214-
%begins with left bracket: a special case profile is selected
215-
%no default value
216-
def = '';
217-
end
210+
% This statement is for autofilling the save as input dialog; default
211+
% value is currently selected profile name, however if a special case
212+
% profile is selected there is no default value
213+
def = iff(selProfile(1) ~= '<', selProfile, '');
218214
ipt = inputdlg('Enter a name for the parameters profile', 'Name', 1, {def});
219215
if isempty(ipt)
220216
return
@@ -240,6 +236,7 @@ function saveParamProfile(obj) % Called by 'Save...' button press, save a new pa
240236
if ~any(strcmp(obj.NewExpParamProfile.Option, validName))
241237
obj.NewExpParamProfile.Option = [profiles; validName];
242238
end
239+
obj.NewExpParamProfile.Selected = validName;
243240
%set label for loaded profile
244241
set(obj.ParamProfileLabel, 'String', validName, 'ForegroundColor', [0 0 0]);
245242
obj.log('Saved parameters as ''%s''', validName);

+eui/ParamEditor.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ function onResize(obj)
392392
rethrow(ex);
393393
end
394394
end
395-
elseif iscellstr(currParam)
395+
elseif iscellstr(currParam) %#ok<ISCLSTR>
396396
C = textscan(data, '%s',...
397397
'ReturnOnError', false,...
398398
'delimiter', {' ', ','}, 'MultipleDelimsAsOne', 1);

+eui/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Experiment UI Package (+eui):
2+
This `+eui` package contains all code pertaining to graphical user interfaces in Rigbox.
3+
There are five base classes in this folder:
4+
5+
1. `eui.MControl` - The class behind the Master Control (MC) GUI.
6+
2. `eui.ExpPanel` - The superclass for UI panels that process and plot remote experiment event updates (i.e. the panels under the Current Experiments tab of MC).
7+
3. `eui.Log` - UI control for viewing experiment log entries (the table under the Log tab of MC).
8+
4. `eui.AlyxPanel` - UI for interacting with the Alyx database (the Alyx panel in the New Experiments tab of MC). Can be run as a stand-alone GUI.
9+
5. `eui.ParamEditor` - UI for viewing and editing parameters (the Parameter panel in the New Experiments table of MC). Can be run as a stand-alone GUI.
10+
11+
## Contents:
12+
13+
Below is a list of all files present:
14+
15+
- `MControl.m` - Whatever it is, take control of your experiments from this GUI
16+
- `AlyxPanel.m` - A GUI for interating with the Alyx database.
17+
- `SignalsTest.m` - A GUI for testing a Signals Experiment.
18+
- `ExpPanel.m` - Basic UI control for monitoring an experiment.
19+
- `SqueakExpPanel.m` - Basic UI control for monitoring a Signals Experiment.
20+
- `ChoiceExpPanel.m` - An eui.ExpPanel subclass for monitoring ChoiceWorld experiments.
21+
- `MappingExpPanel.m` - Preliminary UI for monitoring a mapping experiment.
22+
- `ParamEditor.m` - GUI for visualizing and editing experiment parameters.
23+
- `ConditionPanel.m` - A class for displaying the trial condition parameters in eui.ParamEditor.
24+
- `FieldPanel.m` - A class for displaying global parameters in eui.ParamEditor.
25+
- `Log.m` - UI control for viewing experiment log entries.
26+
27+
## See Also:
28+
29+
- `docs/html/using_mc.m` - A guide to using MC.
30+
- `docs/html/using_ParamEditor.m` - A guide to using the eui.ParamEditor UI.

0 commit comments

Comments
 (0)