Skip to content

Commit

Permalink
Merge pull request #2134 from AllenInstitute/bugfix/2134-sweepbrowser…
Browse files Browse the repository at this point in the history
…-ttl-display-issue

Fix Sweepbrowser display issue with TTL data but no TTL epoch info
  • Loading branch information
t-b authored Jun 14, 2024
2 parents b529a9a + 3a69dec commit 0c75283
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Packages/MIES/MIES_MiesUtilities.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2684,7 +2684,7 @@ Function LayoutGraph(string win, STRUCT TiledGraphSettings &tgs)
// TTLs
for(i = 0; i < numBlocksTTL; i += 1)

if(tgs.visualizeEpochs && tgs.splitTTLBits)
if(tgs.visualizeEpochs && tgs.splitTTLBits && numBlocksEpochTTL > 0)
regex = DB_AXIS_PART_EPOCHS + "_" + ttlsWithBits[i]
WAVE/T/Z axes = GrepWave(allVerticalAxes, regex)
ASSERT(WaveExists(axes), "Unexpected number of matches")
Expand Down
2 changes: 1 addition & 1 deletion Packages/MIES/MIES_NeuroDataWithoutBorders.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ threadsafe Function NWB_ConvertToStandardTTLBit(variable value)
ASSERT_TS(IsInteger(value) && value > 0, "Expected positive integer value")

bit = FindRightMostHighBit(value)
ASSERT_TS(bit > 0 && bit < NUM_ITC_TTL_BITS_PER_RACK, "Invalid TTL bit")
ASSERT_TS(bit >= 0 && bit < NUM_ITC_TTL_BITS_PER_RACK, "Invalid TTL bit")

return bit
End
Expand Down
11 changes: 11 additions & 0 deletions Packages/tests/HistoricData/UTF_HistoricData.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static StrConstant HTTP_FOLDER_URL = "https://www.byte-physics.de/Downloads/alle
#include "UTF_EpochRecreation"
#include "UTF_HistoricDashboard"
#include "UTF_HistoricEpochClipping"
#include "UTF_HistoricSweepBrowser"
#include "UTF_HistoricSweepUpgrade"

// Entry point for UTF
Expand Down Expand Up @@ -89,6 +90,7 @@ Function RunWithOpts([string testcase, string testsuite, variable allowdebug, va
list = AddListItem("UTF_EpochRecreation.ipf", list, ";", Inf)
list = AddListItem("UTF_HistoricDashboard.ipf", list, ";", Inf)
list = AddListItem("UTF_HistoricEpochClipping.ipf", list, ";", Inf)
list = AddListItem("UTF_HistoricSweepBrowser.ipf", list, ";", Inf)
list = AddListItem("UTF_HistoricSweepUpgrade.ipf", list, ";", Inf)

if(ParamIsDefault(testsuite))
Expand Down Expand Up @@ -239,6 +241,15 @@ Function/WAVE GetHistoricDataFilesPXP()
return files
End

Function/WAVE GetHistoricDataFilesWithTTLData()

Make/FREE/T files = {"C57BL6J-684963.02.04.01_pislocin_puff_2023_07_19_141829-compressed.nwb"}
DownloadFilesIfRequired(files)
SetLabelsForDGWave(files)

return files
End

Function/WAVE GetHistoricDataFilesNWB()

Make/FREE/T files = {"nwb2_H17.03.016.11.09.01.nwb", \
Expand Down
25 changes: 25 additions & 0 deletions Packages/tests/HistoricData/UTF_HistoricSweepBrowser.ipf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma TextEncoding="UTF-8"
#pragma rtGlobals=3 // Use modern global access method and strict wave access.
#pragma rtFunctionErrors=1
#pragma ModuleName=SweepBrowserTests

/// UTF_TD_GENERATOR GetHistoricDataFilesWithTTLData
static Function TestTTLDisplayWithNoEpochInfo([string str])

string file, abWin, sweepBrowsers, win

file = "input:" + str

[abWin, sweepBrowsers] = OpenAnalysisBrowser({file}, loadSweeps = 1, loadStimsets = 1)

win = BSP_GetPanel(StringFromList(0, sweepBrowsers))
PGC_SetAndActivateControl(win, "check_BrowserSettings_DAC", val = 1)
PGC_SetAndActivateControl(win, "check_BrowserSettings_ADC", val = 1)
PGC_SetAndActivateControl(win, "check_BrowserSettings_TTL", val = 1)
PGC_SetAndActivateControl(win, "check_BrowserSettings_VisEpochs", val = 1)

PGC_SetAndActivateControl(win, "check_BrowserSettings_OVS", val = 1)
PGC_SetAndActivateControl(win, "popup_overlaySweeps_select", str = "All")

CHECK_NO_RTE()
End

0 comments on commit 0c75283

Please sign in to comment.