Skip to content

Commit 9fef787

Browse files
authored
Merge pull request #931 from AllenInstitute/feature/931-sweepbrowser-dashboard
Sweepbrowser dashboard
2 parents ff6f51a + d3f3d93 commit 9fef787

11 files changed

+1177
-1056
lines changed

Packages/MIES/MIES_AnalysisBrowser.ipf

+1
Original file line numberDiff line numberDiff line change
@@ -2352,6 +2352,7 @@ Function AB_ButtonProc_LoadSweeps(ba) : ButtonControl
23522352
oneValidSweep = AB_LoadFromFile(AB_LOAD_SWEEP, sweepBrowserDFR = dfr)
23532353
SVAR/SDFR=dfr graph
23542354
if(oneValidSweep)
2355+
AD_Update(graph)
23552356
panel = BSP_GetSweepControlsPanel(graph)
23562357
PGC_SetAndActivateControl(panel, "button_SweepControl_PrevSweep")
23572358
else

Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf

+26-7
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,27 @@ Function/S SB_GetSweepList(win)
425425
WAVE/T map = SB_GetSweepBrowserMapFromGraph(win)
426426

427427
numRows = GetNumberFromWaveNote(map, NOTE_INDEX)
428-
for(i = 0; i < numRows; i += 1)
429-
sprintf str, "Sweep %d [%s.%s]", str2num(map[i][%Sweep]), ReplaceString(";", GetBaseName(map[i][%FileName]), "_"), GetFileSuffix(map[i][%FileName])
430-
list = AddListItem(str, list, ";", Inf)
431-
endfor
428+
429+
if(!numRows)
430+
return ""
431+
endif
432+
433+
Duplicate/FREE/RMD=[0, numRows - 1][FindDimlabel(map, COLS, "FileName")] map, filenames
434+
435+
WAVE/T uniqueEntries = GetUniqueEntries(filenames)
436+
437+
// all sweeps are from the same experiment, use a less verbose list format
438+
if(DimSize(uniqueEntries, ROWS) == 1)
439+
for(i = 0; i < numRows; i += 1)
440+
sprintf str, "Sweep %d", str2num(map[i][%Sweep])
441+
list = AddListItem(str, list, ";", Inf)
442+
endfor
443+
else
444+
for(i = 0; i < numRows; i += 1)
445+
sprintf str, "Sweep %d [%s.%s]", str2num(map[i][%Sweep]), ReplaceString(";", GetBaseName(map[i][%FileName]), "_"), GetFileSuffix(map[i][%FileName])
446+
list = AddListItem(str, list, ";", Inf)
447+
endfor
448+
endif
432449

433450
return list
434451
End
@@ -517,16 +534,18 @@ Function SB_PopupMenuSelectSweep(pa) : PopupMenuControl
517534
STRUCT WMPopupAction &pa
518535

519536
string win, scPanel
520-
variable newSweep
537+
variable newSweep, newIndex
521538

522539
switch(pa.eventCode)
523540
case 2: // mouse up
524541
win = pa.win
525-
newSweep = pa.popNum - 1
542+
WAVE sweeps = SB_GetPlainSweepList(win)
543+
newIndex = pa.popNum - 1
544+
newSweep = sweeps[newIndex]
526545
SetSetVariable(win, "setvar_SweepControl_SweepNo", newSweep)
527546

528547
if(OVS_IsActive(win))
529-
OVS_ChangeSweepSelectionState(win, CHECKBOX_SELECTED, index=newSweep)
548+
OVS_ChangeSweepSelectionState(win, CHECKBOX_SELECTED, index=newIndex)
530549
else
531550
UpdateSweepPlot(win)
532551
endif

0 commit comments

Comments
 (0)