Skip to content

Commit

Permalink
Merge pull request #931 from AllenInstitute/feature/931-sweepbrowser-…
Browse files Browse the repository at this point in the history
…dashboard

Sweepbrowser dashboard
  • Loading branch information
t-b authored Apr 30, 2021
2 parents ff6f51a + d3f3d93 commit 9fef787
Show file tree
Hide file tree
Showing 11 changed files with 1,177 additions and 1,056 deletions.
1 change: 1 addition & 0 deletions Packages/MIES/MIES_AnalysisBrowser.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2352,6 +2352,7 @@ Function AB_ButtonProc_LoadSweeps(ba) : ButtonControl
oneValidSweep = AB_LoadFromFile(AB_LOAD_SWEEP, sweepBrowserDFR = dfr)
SVAR/SDFR=dfr graph
if(oneValidSweep)
AD_Update(graph)
panel = BSP_GetSweepControlsPanel(graph)
PGC_SetAndActivateControl(panel, "button_SweepControl_PrevSweep")
else
Expand Down
33 changes: 26 additions & 7 deletions Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,27 @@ Function/S SB_GetSweepList(win)
WAVE/T map = SB_GetSweepBrowserMapFromGraph(win)

numRows = GetNumberFromWaveNote(map, NOTE_INDEX)
for(i = 0; i < numRows; i += 1)
sprintf str, "Sweep %d [%s.%s]", str2num(map[i][%Sweep]), ReplaceString(";", GetBaseName(map[i][%FileName]), "_"), GetFileSuffix(map[i][%FileName])
list = AddListItem(str, list, ";", Inf)
endfor

if(!numRows)
return ""
endif

Duplicate/FREE/RMD=[0, numRows - 1][FindDimlabel(map, COLS, "FileName")] map, filenames

WAVE/T uniqueEntries = GetUniqueEntries(filenames)

// all sweeps are from the same experiment, use a less verbose list format
if(DimSize(uniqueEntries, ROWS) == 1)
for(i = 0; i < numRows; i += 1)
sprintf str, "Sweep %d", str2num(map[i][%Sweep])
list = AddListItem(str, list, ";", Inf)
endfor
else
for(i = 0; i < numRows; i += 1)
sprintf str, "Sweep %d [%s.%s]", str2num(map[i][%Sweep]), ReplaceString(";", GetBaseName(map[i][%FileName]), "_"), GetFileSuffix(map[i][%FileName])
list = AddListItem(str, list, ";", Inf)
endfor
endif

return list
End
Expand Down Expand Up @@ -517,16 +534,18 @@ Function SB_PopupMenuSelectSweep(pa) : PopupMenuControl
STRUCT WMPopupAction &pa

string win, scPanel
variable newSweep
variable newSweep, newIndex

switch(pa.eventCode)
case 2: // mouse up
win = pa.win
newSweep = pa.popNum - 1
WAVE sweeps = SB_GetPlainSweepList(win)
newIndex = pa.popNum - 1
newSweep = sweeps[newIndex]
SetSetVariable(win, "setvar_SweepControl_SweepNo", newSweep)

if(OVS_IsActive(win))
OVS_ChangeSweepSelectionState(win, CHECKBOX_SELECTED, index=newSweep)
OVS_ChangeSweepSelectionState(win, CHECKBOX_SELECTED, index=newIndex)
else
UpdateSweepPlot(win)
endif
Expand Down
Loading

0 comments on commit 9fef787

Please sign in to comment.