140304

Completed calculations and data import!

3/4/14

cfgParams.m:
- Added ‘load’.
- uigetfile
- try/catch
- xlsread
- Some data checking because of text/numeric data
- Moved to CFG.importedData
- Populate:
- trialTypeVector
- targetCodeVector
- initial.t0
- final.t0
- trialXPosVector
- Set CFG.expLoaded = true;
- Refresh cfgShow;
- Under ‘init’:
- Added CFG.expLoaded = false;
- Removed initial.latency, final.latency
- Removed distTargVector

cfgParams.m/cfgExpCalc:
- Output: Saccadic Reaction Time (ms), Time-to-peak (from target; ms),
and distance from target (pix)
- Input: Initial/Final, Trial Number, start index (relative), end index
(relative)
- Performed on both “Select” and “Add/Modify”
- Still need to calculate absolute index for the purposes of getting an
absolute velocity vector (to calculate index of vPeak, not passed from
cfgIlabJavaInterface).  Redundant, I know.
- Peak index calculated with [vPeak, iPeak] = max(vabs).
- iPeak is first  maximum index (same way as calculated by ILAB)
- Shift iPeak to start index
- Determine target index from loaded data (converted from ms to samples)
- Subtract start and targe tindex for Saccade Reaction Time and
Time-to-peak, respectively.
- Subtract end of trial-X data (another reason to calculate absolute PP
index) from loaded X-position data of target.  Absolute difference
reported as Distance from Target (pix)

cfgShow.m:
- Added check for CFG.expLoaded, to switch ‘on’ ‘Enable’ property
- Most UI functions disabled until CFG.expLoaded set as true

cfgIlabJavaInterface.m:
- Fixed bug in calculating default values back to indices. (Removed
division by acqIntvl.)
- Fixed bug where trackBuffer would be ignored is original default
values are already below minimum slider value (which is trackBuffer)

ToDo:

Necessary features:

- Add “Exit” function
- Add Save/Load
- Add clear saccade data function
- cfgConfirmJFrame.m:
- Pop-up occurrence
- Modify for other functions
- Include “Are you sure?” text if selected saccade already has saccade
data inputted for that initial/final trial.  Do same for Modify, Add,
Select, and Clear
- Checking for “NaN”, or never modified/cleared saccades.
- This will allow “Modify” to function, and also prevent overwrite.
- Export data as is

UI safe handling:

- Add saccade function mode to window title, when active.
- cfgSaccCB.m:
- Add better state-in-use warning
- Disable cfg_datatool close function
- Event specific?
- cfgConfirmJFrame.m:
- Callback to bring into focus when slider is dragged
- Don’t interrupt slider function
- Handling loaded experimental data.
- Add file string to data structure.
- Add ui text to “General Info”.  Edit CFG.CFG_TAGS.
- Maybe modify menu item (Import trial data)

Debug overview:

- Fix double-click bug
- QA mid-state function usage
- Closing cfg_datatool
- Closing Saccade Results window
cfgConfirmJFrame.m/updateFrameLocation:
- Handle if no frame (SaccadeResults closed)?
- Re-direct clean-up to separate function