diff --git a/Packages/MIES/MIES_MiesUtilities.ipf b/Packages/MIES/MIES_MiesUtilities.ipf index ba3f3ce31c..c7bd6114d7 100644 --- a/Packages/MIES/MIES_MiesUtilities.ipf +++ b/Packages/MIES/MIES_MiesUtilities.ipf @@ -2971,14 +2971,23 @@ Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WA // waves per channel type for(j = 0; j < numVertWaves; j += 1) - ttlBit = channelType == XOP_CHANNEL_TYPE_TTL && tgs.splitTTLBits ? j : NaN + ttlBit = channelType == XOP_CHANNEL_TYPE_TTL && isTTLSplitted ? j : NaN if(channelType == XOP_CHANNEL_TYPE_TTL) - guiChannelNumber = channelMapHWToGUI[chan][IsNaN(ttlBit) ? 0 : ttlBit] + if(isTTLSplitted) + guiChannelNumber = channelMapHWToGUI[chan][ttlBit] + name = channelID + num2istr(guiChannelNumber) + else + Duplicate/FREE/RMD=[chan][] channelMapHWToGUI, channelMapSingle + WAVE channelMapSingleZapped = ZapNaNs(channelMapSingle) + ASSERT(DimSize(channelMapSingleZapped, ROWS), "No GUI channel found for HW channel " + num2istr(chan)) + guiChannelNumber = channelMapSingleZapped[0] + name = channelID + "C" + RemoveEnding(NumericWaveToList(channelMapSingleZapped, "_"), "_") + endif else guiChannelNumber = chan + name = channelID + num2istr(guiChannelNumber) endif - name = channelID + num2istr(guiChannelNumber) DFREF singleSweepDFR = GetSingleSweepFolder(sweepDFR, sweepNo) @@ -3341,6 +3350,7 @@ End /// @param channelType [optional, empty by default] The channel type for non-associated channels, currently only XOP_CHANNEL_TYPE_TTL is evaluated /// @param channelNumber [optional, empty by default] For plotting "TTL" channels only, GUI channel number /// @param isSplitted [optional, default 1] For plotting "TTL" channels only, Flag if the color for a splitted or unsplitted channel should be returned +/// For the case isSplitted == 0, then channelNumber must be a GUI channel number from the specific TTL rack range Function [STRUCT RGBColor s] GetHeadstageColor(variable headstage, [variable channelType, variable channelNumber, variable isSplitted]) string str diff --git a/Packages/tests/HistoricData/UTF_HistoricData.ipf b/Packages/tests/HistoricData/UTF_HistoricData.ipf index 492287380a..395e237ae6 100644 --- a/Packages/tests/HistoricData/UTF_HistoricData.ipf +++ b/Packages/tests/HistoricData/UTF_HistoricData.ipf @@ -20,6 +20,7 @@ static StrConstant HTTP_FOLDER_URL = "https://www.byte-physics.de/Downloads/alle // keep sorted #include "UTF_HistoricDashboard" +#include "UTF_HistoricDatabrowserChannelCheckboxes" #include "UTF_HistoricEpochClipping" // Entry point for UTF @@ -83,6 +84,7 @@ Function RunWithOpts([string testcase, string testsuite, variable allowdebug, va // sorted list list = AddListItem("UTF_HistoricDashboard.ipf", list, ";", inf) list = AddListItem("UTF_HistoricEpochClipping.ipf", list, ";", inf) + list = AddListItem("UTF_HistoricDatabrowserChannelCheckboxes.ipf", list, ";", inf) if(ParamIsDefault(testsuite)) testsuite = list @@ -178,7 +180,9 @@ Function/WAVE GetHistoricDataFiles() "Pvalb-IRES-Cre;Ai14-646904.13.03.02.pxp", \ "Sst-IRES-Cre;Ai14-554002.08.06.02.pxp", \ "Sst-IRES-Cre;Th-P2A-FlpO;Ai65-561491.09.09.02.pxp", \ - "epoch_clipping_2022_03_08_140256.pxp"} + "epoch_clipping_2022_03_08_140256.pxp", \ + "DB_ChannelTypeCheckboxes.pxp" \ + } /// @TODO use hashes to verify files once IP supports strings > 2GB diff --git a/Packages/tests/HistoricData/UTF_HistoricDatabrowserChannelCheckboxes.ipf b/Packages/tests/HistoricData/UTF_HistoricDatabrowserChannelCheckboxes.ipf new file mode 100644 index 0000000000..1031914cbb --- /dev/null +++ b/Packages/tests/HistoricData/UTF_HistoricDatabrowserChannelCheckboxes.ipf @@ -0,0 +1,65 @@ +#pragma TextEncoding = "UTF-8" +#pragma rtGlobals=3 // Use modern global access method and strict wave access. +#pragma rtFunctionErrors=1 +#pragma ModuleName=DatabrowserChannelCheckboxes + +/// UTF_TD_GENERATOR GetHistoricDataFiles +static Function TestChannelCheckboxes([string str]) + + string abWin, sweepBrowsers, file, bsPanel, sbWin + variable jsonId + + file = "input:" + str + + [abWin, sweepBrowsers] = OpenAnalysisBrowser({file}, loadSweeps = 1) + sbWin = StringFromList(0, sweepBrowsers) + CHECK_PROPER_STR(sbWin) + bsPanel = BSP_GetPanel(sbWin) + + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_ADC", val = 0) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_ADC", val = 1) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_ADC", val = 0) + CHECK_NO_RTE() + + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_DAC", val = 0) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_DAC", val = 1) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_DAC", val = 0) + CHECK_NO_RTE() + + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_TTL", val = 0) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_TTL", val = 1) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_TTL", val = 0) + CHECK_NO_RTE() + + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_TTL", val = 1) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_splitTTL", val = 0) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_splitTTL", val = 1) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_splitTTL", val = 0) + CHECK_NO_RTE() + + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_DAC", val = 1) + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_ADC", val = 1) + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_TTL", val = 1) + + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_VisEpochs", val = 0) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_VisEpochs", val = 1) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_VisEpochs", val = 0) + CHECK_NO_RTE() + + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_splitTTL", val = 1) + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_VisEpochs", val = 1) + CHECK_NO_RTE() + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_VisEpochs", val = 0) + CHECK_NO_RTE() +End