Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Param ui #119

Merged
merged 16 commits into from
Mar 20, 2019
Merged

Param ui #119

merged 16 commits into from
Mar 20, 2019

Conversation

k1o0
Copy link
Contributor

@k1o0 k1o0 commented Mar 11, 2019

  • Added new integrated parameter editor
  • Added test class for editor
  • Added test class for Parameters
  • Added performance test
  • Comment the ParamEditor, FieldPanel and ConditionTable classes
  • Deleted ParamEditor_old
  • Restored param description and unit functionality
  • Restored label formatting

@todo
Copy link

todo bot commented Mar 11, 2019

Add sort by column

% TODO Add sort by column
% TODO Add set condition idx
% TODO Use tags for menu items
properties
ConditionTable


This comment was generated by todo based on a TODO comment in 9babd51 in #119. cc @cortex-lab.

@todo
Copy link

todo bot commented Mar 11, 2019

Add set condition idx

% TODO Add set condition idx
% TODO Use tags for menu items
properties
ConditionTable
MinWidth = 80


This comment was generated by todo based on a TODO comment in 9babd51 in #119. cc @cortex-lab.

@todo
Copy link

todo bot commented Mar 11, 2019

. See also EXP.PARAMETERS.

% TODO. See also EXP.PARAMETERS.
%
% Part of Rigbox
% 2012-11 CB created
% 2017-03 MW/NS Made global panel scrollable & improved performance of


This comment was generated by todo based on a TODO comment in 9babd51 in #119. cc @cortex-lab.

@todo
Copy link

todo bot commented Mar 12, 2019

Maybe use exp.Parameters/ui

Rigbox/+eui/FieldPanel.m

Lines 38 to 43 in 29266f0

% TODO Maybe use exp.Parameters/ui
if isempty(obj.ContextMenu)
obj.ContextMenu = uicontextmenu;
uimenu(obj.ContextMenu, 'Label', 'Make Conditional', ...
'MenuSelectedFcn', @(~,~)obj.makeConditional);
end


This comment was generated by todo based on a TODO comment in 29266f0 in #119. cc @cortex-lab.

@cortex-lab cortex-lab deleted a comment from todo bot Mar 13, 2019
@cortex-lab cortex-lab deleted a comment from todo bot Mar 13, 2019
@cortex-lab cortex-lab deleted a comment from todo bot Mar 13, 2019
@cortex-lab cortex-lab deleted a comment from todo bot Mar 13, 2019
@k1o0 k1o0 marked this pull request as ready for review March 13, 2019 20:14
@k1o0
Copy link
Contributor Author

k1o0 commented Mar 13, 2019

  • Building new ParamEditor window with parameters loaded takes < 0.4s and to load in a new set of parameters < 0.3s
  • There are numerous bug fixes uncovered by the test class
  • numRepeats can now be a global parameter. This changes the way the trial conditions are repeated giving the user more flexibility
  • Trial conditions can now be fixed, i.e. the user can choose not to randomize the trials within the GUI
  • There are now tests for the ParamEditor class and Parameters class
  • ParamEditor and Parameters classes are more thoroughly documented

Still left to do for another day:

  • Properly integrate string params: currently they're converted to char when made conditional. This isn't necessary.
  • Add test for set values method
  • Add method for sorting trial conditions by a column
  • Add method for setting specific trial condition order (i.e. adding conditionIdx param functionality into SignalsExp)

This was referenced Mar 13, 2019
% See also EUI.PARAMEDITOR, EUI.FIELDPANEL
obj.ParamEditor = ParamEditor;
obj.UIPanel = uix.VBox('Parent', f);
% obj.UIPanel.BackgroundColor = 'white';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may recall that the editor was originally white, which I think looks nicer. MC is still all grey by default. I can't be arsed to change everything to white so the short answer is yes, let's remove all of these BackgroundColor lines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha hmm well you're right the white background does look nicer...

@@ -0,0 +1,229 @@
classdef FieldPanel < handle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why call this 'FieldPanel' instead of something like 'GlobalPanel'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what Chris originally called it. It's a panel that generates UI fields. I suppose it's more functionally clear than 'global' which is a less concrete name

+eui/MControl.m Outdated
@@ -247,10 +247,11 @@ function saveParamProfile(obj) % Called by 'Save...' button press, save a new pa
end

function loadParamProfile(obj, profile)
tic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can the 'tic' and subsequent 'toc' be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shit, yes. I think there's a toc at the bottom of the script. This was done before I wrote the performance test class

% Loads validation data
% Graph data is a cell array where each element is the graph number
% (1:3) and within each element is a cell of X- and Y- axis values
% respecively
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Member

@jkbhagatio jkbhagatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, yeah just really minor fixes for you as commented above. Also, did you not want to include tests specifically for 'ConditionPanel' and 'FieldPanel' ? and can we keep the '_test' convention even for class tests?

also, 'ParamEditorTest' and its perf test failed. I put them the test results variable in your 'zserver' 'share' folder. The first 15 elements of the variable are the ones that failed.

@k1o0
Copy link
Contributor Author

k1o0 commented Mar 14, 2019

  1. The ConditionPanel and FieldPanel classes aren't really standalone so standalone tests aren't useful. All the functionality of these two classes is tested by the ParamEditor test.
  2. Okay
  3. These errors aren't really informative, could we run then test together tomorrow?

@k1o0 k1o0 requested a review from jkbhagatio March 14, 2019 19:09
@k1o0
Copy link
Contributor Author

k1o0 commented Mar 14, 2019

Before merging, let's make sure the tests run on a real rig, double-check everything works properly within mc and also delete the +eui/ParamEditor_old.m file.

@k1o0
Copy link
Contributor Author

k1o0 commented Mar 14, 2019

Oh and the .github/config.yml didn't seem to do anything. I suppose we just delete it, unless I made a typo somewhere?

@jkbhagatio
Copy link
Member

Ok, I may have time to test it on the behaviour rigs after upgrading the hardware, while I'm installing the new MATLABs. Would late afternoon work for you? Yeah the .yml file looks right... I'll also look into it

end

methods
function obj = ConditionPanel(f, ParamEditor, varargin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there a varargin arg here?

@jkbhagatio
Copy link
Member

I've reorganized the test folder structure and think I found a way to safely test with "dat.paths" (and any other folder/file we may need to shadow"). Let me know what you think

@k1o0
Copy link
Contributor Author

k1o0 commented Mar 18, 2019

Example of shared fixtures. All it really affords you is fewer lines of code as you don't have to manually add the taredown routine.

@jkbhagatio
Copy link
Member

ok, i will merge this now, but keep parameditor_old around, and keep this branch open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants