Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise sweepformula select operation #2109

Merged
merged 38 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6df5e1f
AF: Move workaround for PSQ_RHEOBASE sweepQC determination to own AFH…
MichaelHuth May 23, 2024
2445fcc
SF: Add data type to sweeps and channels operation output
MichaelHuth May 13, 2024
b00cb11
SFH: Added a variant of SFH_ResolveDatasetElementFromJSON that also r…
MichaelHuth May 15, 2024
a2a4729
SF: Fix prefix of function SFH_GetNumericVarArgs to SF
MichaelHuth Oct 2, 2024
83713dd
SF Implement new select operation
MichaelHuth Oct 2, 2024
c6e5d92
SF: Add meta tag /DoNotPlot flag to suppress plotting of data
MichaelHuth May 29, 2024
ac7cf22
SF: Add custom legend for plotting select result
MichaelHuth May 29, 2024
3fb1ac2
ANA: Adapt SF formula used by analysisfunctions
MichaelHuth Jun 18, 2024
67c18e7
SF: Adapt Tests to new select operation
MichaelHuth Jun 13, 2024
41bc06f
SF: Adapt SF default formula
MichaelHuth Oct 4, 2024
543a003
DB: Recreate DB macro to have a working formula on open
MichaelHuth Oct 4, 2024
d7f14e9
BP: Move file description header to top of file
MichaelHuth Oct 4, 2024
300bdd1
BP: Adapt CreateTiledChannelGraph for multi-device-exp support
MichaelHuth Oct 4, 2024
92ae1ec
SB/DB: Add specific utility functions to retrieve the correct sweepDF
MichaelHuth Oct 4, 2024
feb3bfd
SF: Add utility function SF_GetSweepMapIndices
MichaelHuth Oct 4, 2024
bf1279e
SF: Add utility function SF_MatchSweepMapColumn
MichaelHuth Oct 4, 2024
01317c5
SFH: Add utility function to retrieve the correct LNB and sweepDF fro…
MichaelHuth Oct 4, 2024
efb0a1e
Bugfix: SF use proper handling of sweepMap for SB
MichaelHuth Oct 4, 2024
131dbb5
SF: Add selection operation selexp and seldev
MichaelHuth Oct 4, 2024
690d054
BSP: Adapt AddTracesForEpochs to work in SweepBrowser
MichaelHuth Jun 25, 2024
4935cc3
SF: Add selexpandsci, selexpandrac operations for use with select
MichaelHuth Jun 25, 2024
f6d4cd4
SF: Add operation selsetcyclecount, selsetsweepcount
MichaelHuth Jul 1, 2024
2d04575
SF: Add operation selRACIndex, selSCIIndex
MichaelHuth Jul 2, 2024
1433572
SF: Unify select returning a null wave for selection for no results
MichaelHuth Sep 17, 2024
840b138
SF: Handle empty result from selsweeps() in select() properly
MichaelHuth Sep 17, 2024
43bf105
SF: Add Tests, direct use some select filters, some with select
MichaelHuth Oct 4, 2024
dd39911
SB: Add testing assertion in SB_GetSweepIndexFromMap for multi device…
MichaelHuth Jun 24, 2024
259c113
SF: Updating docu
MichaelHuth Jun 20, 2024
304863d
SF: Update SF help notebook
MichaelHuth Sep 19, 2024
c17a25d
Tests: Fix speed dependent fail in PS_PB6 test
MichaelHuth Sep 23, 2024
a3c1e23
SF: Use correct LNBs SFH_GetStimsetName
MichaelHuth Oct 4, 2024
01c0062
SF: Use LNB directly for sweepQC and setQC filter
MichaelHuth Oct 4, 2024
fa3060c
SF: Moved SFH_GetAnalysisFunctionType as generic helper to MIES_MiesU…
MichaelHuth Oct 4, 2024
fd5ee28
SF: Use correct LNB getter in SF_GetTraceColor
MichaelHuth Oct 4, 2024
e724808
SF: Introduce constant for default select formula
MichaelHuth Oct 9, 2024
528f1f3
SF: Add documentation to SF_SelectParameters structure
MichaelHuth Oct 9, 2024
6bdda34
SFH_NewSelectDataWave: Initialize wave to NaN
t-b Oct 14, 2024
bf10c95
MIES_SweepFormula_PSX.ipf: Handle sweepbrowser labnotebooks correctly
t-b Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 58 additions & 11 deletions Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,27 @@ Function SB_TranslateSBMapIndexToABMapIndex(string win, variable sbIndex)
return V_row
End

/// @brief Return the sweep data folder
static Function SB_GetSweepIndexFromMap(WAVE/T sweepMap, variable sweepNo)

variable cIndex

cIndex = FindDimLabel(sweepMap, COLS, "Sweep")
FindValue/RMD=[][cIndex]/TEXT=(num2istr(sweepNo))/TXOP=4 sweepMap

#ifdef AUTOMATED_TESTING
variable dummy = V_row
if(V_row >= 0)
FindValue/RMD=[dummy + 1,][cIndex]/TEXT=(num2istr(sweepNo))/TXOP=4 sweepMap
ASSERT(V_row == -1, "Found results for multiple experiments")
endif
V_row = dummy
#endif

return V_row == -1 ? NaN : V_row
End

/// @brief Return the sweep data folder for either a given index or sweepNo
/// If a sweepNo is given then the result for the first sweep found with that number is returned
Function/DF SB_GetSweepDataFolder(WAVE/T sweepMap, [variable sweepNo, variable index])

string dataFolder, device
Expand All @@ -42,14 +62,10 @@ Function/DF SB_GetSweepDataFolder(WAVE/T sweepMap, [variable sweepNo, variable i
if(!ParamIsDefault(index) && ParamIsDefault(sweepNo))
ASSERT(index >= 0 && index < DimSize(sweepMap, ROWS), "Invalid index")
elseif(ParamIsDefault(index) && !ParamIsDefault(sweepNo))
cIndex = FindDimLabel(sweepMap, COLS, "Sweep")
FindValue/RMD=[][cIndex]/TEXT=(num2istr(sweepNo))/TXOP=4 sweepMap

if(V_row == -1)
index = SB_GetSweepIndexFromMap(sweepMap, sweepNo)
if(IsNaN(index))
return $""
endif

index = V_row
endif

dataFolder = sweepMap[index][%DataFolder]
Expand Down Expand Up @@ -346,8 +362,8 @@ Function SB_UpdateSweepPlot(win)
DFREF sweepDFR = GetAnalysisSweepPath(dataFolder, device)
WAVE configWave = GetAnalysisConfigWave(dataFolder, device, sweepNo)

CreateTiledChannelGraph(graph, configWave, sweepNo, numericalValues, textualValues, tgs, sweepDFR, \
axisLabelCache, traceIndex, experiment, sweepChannelSel)
CreateTiledChannelGraph(graph, configWave, sweepNo, numericalValues, textualValues, tgs, sweepDFR, \
axisLabelCache, traceIndex, experiment, sweepChannelSel, device, mapIndex = mapIndex)
AR_UpdateTracesIfReq(graph, sweepDFR, sweepNo)
endfor

Expand Down Expand Up @@ -691,8 +707,39 @@ Function SB_AddSweepToGraph(string win, variable index)
WAVE axisLabelCache = GetAxisLabelCacheWave()

traceIndex = GetNextTraceIndex(graph)
CreateTiledChannelGraph(graph, config, sweepNo, numericalValues, textualValues, tgs, sweepDFR, \
axisLabelCache, traceIndex, experiment, sweepChannelSel)
CreateTiledChannelGraph(graph, config, sweepNo, numericalValues, textualValues, tgs, sweepDFR, \
axisLabelCache, traceIndex, experiment, sweepChannelSel, device, mapIndex = index)

AR_UpdateTracesIfReq(graph, dfr, sweepNo)
End

Function/WAVE SB_GetSweepMap(string win)

DFREF sweepBrowserDFR = SB_GetSweepBrowserFolder(win)
WAVE/T sweepMap = GetSweepBrowserMap(sweepBrowserDFR)

return sweepMap
End

Function [WAVE/Z numericalValues, WAVE/Z textualValues] SB_GetLabNotebooks(WAVE/T sweepMap, variable mapIndex)

string dataFolder, device

dataFolder = sweepMap[mapIndex][%DataFolder]
device = sweepMap[mapIndex][%Device]
WAVE/Z numericalValues = GetAnalysLBNumericalValues(dataFolder, device)
WAVE/Z textualValues = GetAnalysLBTextualValues(dataFolder, device)

return [numericalValues, textualValues]
End

Function/DF SB_GetSweepDF(string win, variable mapIndex)

ASSERT(BSP_IsSweepBrowser(win), "Requires window to be a SweepBrowser")

WAVE/T sweepMap = SB_GetSweepMap(win)
DFREF deviceDFR = SB_GetSweepDataFolder(sweepMap, index = mapIndex)
DFREF sweepDFR = GetSingleSweepFolder(deviceDFR, str2num(sweepMap[mapIndex][%Sweep]))

return sweepDFR
End
34 changes: 34 additions & 0 deletions Packages/MIES/MIES_AnalysisFunctionHelpers.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1180,3 +1180,37 @@ Function/S AFH_GetAnaFuncParamsFromLNB(WAVE numericalValues, WAVE/T textualValue

return WaveText(settings, row = index)
End

/// @brief Only for PSQ_RHEOBASE, returns a wave with passing and failing sweep numbers for sweepQC with all sweep numbers of the same SCI range
/// This is a workaround and uses a different approach as for other analysis functions.
///
/// @param numericalValues numerical LNB
/// @param sweepNo sweep number
/// @param headstage headstage number
/// @param sweepsSCI numerical wave with all sweep numbers from the SCI where sweepNo is part of, @ref AFH_GetSweepsFromSameSCI
/// @param passedSetQC flag that indicates if for this sweepNo the setQC passed, @ref GetLastSettingIndepSCI for PSQ_FMT_LBN_SET_PASS
///
/// @retval passingSweeps numerical wave containing the sweep numbers of the sweeps from this SCI that passed the sweepQC
/// @retval failingSweeps numerical wave containing the sweep numbers of the sweeps from this SCI that failed the sweepQC
Function [WAVE passingSweeps, WAVE failingSweeps] AFH_GetRheobaseSweepsSCISweepQCSplitted(WAVE numericalValues, variable sweepNo, variable headstage, WAVE sweepsSCI, variable passedSetQC)

variable firstValid, lastValid
string key

key = CreateAnaFuncLBNKey(PSQ_RHEOBASE, PSQ_FMT_LBN_SPIKE_DETECT, query = 1)
if(passedSetQC)
WAVE spikeDetection = GetLastSettingEachSCI(numericalValues, sweepNo, key, headstage, UNKNOWN_MODE)
ASSERT(DimSize(sweepsSCI, ROWS) == DimSize(spikeDetection, ROWS), "Unexpected wave sizes")

firstValid = DimSize(spikeDetection, ROWS) - 2
lastValid = DimSize(spikeDetection, ROWS) - 1
ASSERT(Sum(spikeDetection, firstValid, lastValid) == 1, "Unexpected spike/non-spike duo")
Duplicate/FREE/R=[firstValid, lastValid] sweepsSCI, passingSweeps
WAVE/Z failingSweeps = GetSetDifference(sweepsSCI, passingSweeps)
else
Duplicate/FREE sweepsSCI, failingSweeps
WAVE/Z passingSweeps
endif

return [passingSweeps, failingSweeps]
End
2 changes: 1 addition & 1 deletion Packages/MIES/MIES_AnalysisFunctions.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ End
/// =============================== ============================================================
/// setvar_DataAcq_OnsetDelayUser Pre DAQ;20
/// Popup_Settings_FixedFreq Pre Sweep;100;Post Sweep;Maximum
/// sweepFormula_formula Pre Set;data(cursors(A,B), select(channels(AD), sweeps()))
/// sweepFormula_formula Pre Set;data(select(selchannels(AD)))
/// =============================== ============================================================
///
/// \endrst
Expand Down
17 changes: 2 additions & 15 deletions Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static Function AD_FillWaves(win, list, info)
WAVE/T list, info

variable i, j, headstage, passed, sweepNo, numEntries, ongoingDAQ, acqState
variable index, anaFuncType, stimsetCycleID, firstValid, lastValid, waMode
variable index, anaFuncType, stimsetCycleID, waMode
string key, anaFunc, stimset, msg, device, opMode

WAVE/Z totalSweepsPresent = GetPlainSweepList(win)
Expand Down Expand Up @@ -353,20 +353,7 @@ static Function AD_FillWaves(win, list, info)

break
case PSQ_RHEOBASE:
key = CreateAnaFuncLBNKey(anaFuncType, PSQ_FMT_LBN_SPIKE_DETECT, query = 1)
if(passed)
WAVE spikeDetection = GetLastSettingEachSCI(numericalValues, sweepNo, key, headstage, UNKNOWN_MODE)
ASSERT(DimSize(sweeps, ROWS) == DimSize(spikeDetection, ROWS), "Unexpected wave sizes")

firstValid = DimSize(spikeDetection, ROWS) - 2
lastValid = DimSize(spikeDetection, ROWS) - 1
ASSERT(Sum(spikeDetection, firstValid, lastValid) == 1, "Unexpected spike/non-spike duo")
Duplicate/FREE/R=[firstValid, lastValid] sweeps, passingSweeps
WAVE/Z failingSweeps = GetSetDifference(sweeps, passingSweeps)
else
Duplicate/FREE sweeps, failingSweeps
WAVE/Z passingSweeps
endif
[WAVE passingSweeps, WAVE failingSweeps] = AFH_GetRheobaseSweepsSCISweepQCSplitted(numericalValues, sweepNo, headstage, sweeps, passed)
break
#ifdef AUTOMATED_TESTING
case TEST_ANALYSIS_FUNCTION: // fallthrough-by-design
Expand Down
22 changes: 11 additions & 11 deletions Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2036,9 +2036,9 @@ static Function [WAVE apfreq, WAVE DAScale] PSQ_DS_GatherFrequencyCurrentData(st
str += code
sprintf code, "sweepr = [%s]\r", NumericWaveToList(sweeps, ",", trailSep = 0)
str += code
sprintf code, "sel = select(channels(AD%d), $sweepr, all)\r", ADC
sprintf code, "sel = select(selchannels(AD%d), selsweeps($sweepr), selvis(all))\r", ADC
str += code
sprintf code, "dat = data($trange, $sel)\r"
sprintf code, "dat = data(select(selrange($trange), $sel))\r"
str += code
sprintf code, "freq = merge(apfrequency($dat, 0))\r" // 0 == FULL
str += code
Expand Down Expand Up @@ -6892,7 +6892,7 @@ Function PSQ_PipetteInBath(string device, STRUCT AnalysisFunction_V3 &s)
ASSERT(WaveExists(baselineQCPassedLBN), "Missing baseline QC")
baselineQCPassed = baselineQCPassedLBN[s.headstage]

sprintf formula, "store(\"Steady state resistance\", tp(tpss(), select(channels(AD), [%d], all), [0]))", s.sweepNo
sprintf formula, "store(\"Steady state resistance\", tp(tpss(), select(selchannels(AD), selsweeps(%d), selvis(all)), [0]))", s.sweepNo
databrowser = PSQ_ExecuteSweepFormula(device, formula)

minPipetteResistance = AFH_GetAnalysisParamNumerical("MinPipetteResistance", s.params)
Expand Down Expand Up @@ -7358,17 +7358,17 @@ Function PSQ_SealEvaluation(string device, STRUCT AnalysisFunction_V3 &s)
switch(testpulseGroupSel)
case PSQ_SE_TGS_BOTH:
formula = ""
sprintf str, "store(\"Steady state resistance (group A)\", tp(tpss(), select(channels(AD), [%d], all), [0, 4, 5, 6]))\r", s.sweepNo
sprintf str, "store(\"Steady state resistance (group A)\", tp(tpss(), select(selchannels(AD), selsweeps(%d), selvis(all)), [0, 4, 5, 6]))\r", s.sweepNo
formula += str
formula += "and\r"
sprintf str, "store(\"Steady state resistance (group B)\", tp(tpss(), select(channels(AD), [%d], all), [0, 1, 2, 3]))", s.sweepNo
sprintf str, "store(\"Steady state resistance (group B)\", tp(tpss(), select(selchannels(AD), selsweeps(%d), selvis(all)), [0, 1, 2, 3]))", s.sweepNo
formula += str
break
case PSQ_SE_TGS_FIRST:
sprintf formula, "store(\"Steady state resistance (group A)\", tp(tpss(), select(channels(AD), [%d], all), [0]))", s.sweepNo
sprintf formula, "store(\"Steady state resistance (group A)\", tp(tpss(), select(selchannels(AD), selsweeps(%d), selvis(all)), [0]))", s.sweepNo
break
case PSQ_SE_TGS_SECOND:
sprintf formula, "store(\"Steady state resistance (group B)\", tp(tpss(), select(channels(AD), [%d], all), [0]))", s.sweepNo
sprintf formula, "store(\"Steady state resistance (group B)\", tp(tpss(), select(selchannels(AD), selsweeps(%d), selvis(all)), [0]))", s.sweepNo
break
default:
ASSERT(0, "Invalid testpulseGroupSel: " + num2str(testpulseGroupSel))
Expand Down Expand Up @@ -8119,10 +8119,10 @@ static Function PSQ_VM_EvaluateAverageVoltage(string device, variable sweepNo, v

if(baselineQCPassed)
formula = ""
sprintf str, "store(\"Average U_BLS0\", avg(data(U_BLS0, select(channels(AD), [%d], all))))\r", sweepNo
sprintf str, "store(\"Average U_BLS0\", avg(data(select(selrange(U_BLS0),selchannels(AD), selsweeps(%d), selvis(all)))))\r", sweepNo
formula += str
formula += "and\r"
sprintf str, "store(\"Average U_BLS1\", avg(data(U_BLS1, select(channels(AD), [%d], all))))\r", sweepNo
sprintf str, "store(\"Average U_BLS1\", avg(data(select(selrange(U_BLS1),selchannels(AD), selsweeps(%d), selvis(all)))))\r", sweepNo
formula += str

databrowser = PSQ_ExecuteSweepFormula(device, formula)
Expand Down Expand Up @@ -8510,10 +8510,10 @@ Function PSQ_AccessResistanceSmoke(string device, STRUCT AnalysisFunction_V3 &s)

if(baselinePassed)
cmd = ""
sprintf str, "store(\"Steady state resistance\", tp(tpss(), select(channels(AD), [%d], all), [0]))", s.sweepNo
sprintf str, "store(\"Steady state resistance\", tp(tpss(), select(selchannels(AD), selsweeps(%d), selvis(all)), [0]))", s.sweepNo
cmd += str
cmd += "\r and \r"
sprintf str, "store(\"Peak resistance\", tp(tpinst(), select(channels(AD), [%d], all), [0]))", s.sweepNo
sprintf str, "store(\"Peak resistance\", tp(tpinst(), select(selchannels(AD), selsweeps(%d), selvis(all)), [0]))", s.sweepNo
cmd += str

databrowser = PSQ_ExecuteSweepFormula(device, cmd)
Expand Down
37 changes: 4 additions & 33 deletions Packages/MIES/MIES_BrowserSettingsPanel.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ Function BSP_AddTracesForEpochs(string win)

variable i, j, start_x, start_y, end_x, end_y, yOffset
variable headstage, yLevelOffset, level, idx, numTraces, numEpochs
variable sweepNumber, traceIndex, channelType, channelNumber
variable sweepNumber, traceIndex, channelType, channelNumber, mapIndex
STRUCT RGBColor c
string xaxis, yaxis, axes, axis, levels_x_name, levels_y_name, name, idPart, level_x_trace

Expand Down Expand Up @@ -1646,13 +1646,13 @@ Function BSP_AddTracesForEpochs(string win)
sweepNumber = str2num(traceInfos[i][%sweepNumber])
channelType = WhichListItem(traceInfos[i][%channelType], XOP_CHANNEL_NAMES)
channelNumber = str2num(traceInfos[i][%GUIChannelNumber])
mapIndex = str2num(traceInfos[i][%SweepMapIndex])

WAVE/Z/T numericalValues = BSP_GetLogbookWave(win, LBT_LABNOTEBOOK, LBN_NUMERICAL_VALUES, sweepNumber = sweepNumber)
DFREF sweepDFR
[WAVE numericalValues, WAVE textualValues, sweepDFR] = SFH_GetLabNoteBooksAndDFForSweep(win, sweepNumber, mapIndex)
ASSERT(WaveExists(numericalValues), "Numerical LabNotebook not found.")
WAVE/Z/T textualValues = BSP_GetLogbookWave(win, LBT_LABNOTEBOOK, LBN_TEXTUAL_VALUES, sweepNumber = sweepNumber)
ASSERT(WaveExists(textualValues), "Textual LabNotebook not found.")

DFREF sweepDFR = BSP_GetSweepDF(win, sweepNumber)
// present since a2172f03 (Added generations of epoch information wave, 2019-05-22)
WAVE/T/Z epochsFromLBN = EP_FetchEpochs(numericalValues, textualValues, sweepNumber, sweepDFR, channelNumber, channelType)
if(!WaveExists(epochsFromLBN))
Expand Down Expand Up @@ -2003,32 +2003,3 @@ static Function BSP_MemoryFreeMappedDF(string win)

AB_FreeWorkingDFs(dfList, index)
End

/// @brief Gets sweep browser data folder from sweep- or data browser window name and sweep number
///
/// @param[in] win sweep- or data browser window
/// @param[in] sweepNo sweep number
///
/// @returns sweep data folder reference, null reference if requirements not met
Function/DF BSP_GetSweepDF(string win, variable sweepNo)

variable isSweepBrowser
string device

isSweepBrowser = BSP_IsSweepBrowser(win)
if(isSweepBrowser)
DFREF sweepBrowserDFR = SB_GetSweepBrowserFolder(win)
WAVE/T sweepMap = GetSweepBrowserMap(sweepBrowserDFR)
DFREF deviceDFR = SB_GetSweepDataFolder(sweepMap, sweepNo = sweepNo)
else
if(!BSP_HasBoundDevice(win))
return $""
endif
device = BSP_GetDevice(win)
DFREF deviceDFR = GetDeviceDataPath(device)
endif

DFREF sweepDFR = GetSingleSweepFolder(deviceDFR, sweepNo)

return sweepDFR
End
19 changes: 11 additions & 8 deletions Packages/MIES/MIES_Browser_Plotter.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#pragma ModuleName=MIES_BROWSER_PLOTTER
#endif

/// @file MIES_Browser_Plotter.ipf
/// @brief Functions for plotting DataBrowser/Sweepbrowser Graphs

static Constant NUM_CHANNEL_TYPES = 3
static Constant ADC_SLOT_MULTIPLIER = 4
static Constant EPOCH_SLOT_MULTIPLIER = 3
Expand Down Expand Up @@ -57,9 +60,6 @@ static Function [string oodDAQRegionsAll, variable totalXRange] GetOodDAQFullRan
return [oodDAQRegionsAll, totalXRange]
End

/// @file MIES_Browser_Plotter.ipf
/// @brief Functions for plotting DataBrowser/Sweepbrowser Graphs

/// @brief Create a vertically tiled graph for displaying AD and DA channels
///
/// For preservering the axis scaling callers should do the following:
Expand All @@ -84,8 +84,10 @@ End
/// @param traceIndex [internal use only] set to zero on the first call in a row of successive calls
/// @param experiment name of the experiment the sweep stems from
/// @param channelSelWave channel selection wave
/// @param device device name
/// @param bdi [optional, default = n/a] initialized BufferedDrawInfo structure, when given draw calls are buffered instead for later execution @sa OVS_EndIncrementalUpdate
Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WAVE numericalValues, WAVE/T textualValues, STRUCT TiledGraphSettings &tgs, DFREF sweepDFR, WAVE/T axisLabelCache, variable &traceIndex, string experiment, WAVE channelSelWave, [STRUCT BufferedDrawInfo &bdi])
/// @param mapIndex [optional, default = NaN] if the data originates from a sweepBrowser then the mapIndex is given here
Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WAVE numericalValues, WAVE/T textualValues, STRUCT TiledGraphSettings &tgs, DFREF sweepDFR, WAVE/T axisLabelCache, variable &traceIndex, string experiment, WAVE channelSelWave, string device, [STRUCT BufferedDrawInfo &bdi, variable mapIndex])

variable axisIndex, numChannels
variable numDACs, numADCs, numTTLs, i, j, k, hasPhysUnit, hardwareType
Expand All @@ -104,10 +106,11 @@ Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WA

ASSERT(!isEmpty(graph), "Empty graph")
ASSERT(IsFinite(sweepNo), "Non-finite sweepNo")
mapIndex = ParamIsDefault(mapIndex) ? NaN : mapIndex

Make/T/FREE userDataKeys = {"fullPath", "channelType", "channelNumber", "sweepNumber", "headstage", \
"textualValues", "numericalValues", "clampMode", "TTLBit", "experiment", "traceType", \
"occurence", "XAXIS", "YAXIS", "YRANGE", "TRACECOLOR", "AssociatedHeadstage", "GUIChannelNumber"}
Make/T/FREE userDataKeys = {"fullPath", "channelType", "channelNumber", "sweepNumber", "headstage", \
"textualValues", "numericalValues", "clampMode", "TTLBit", "experiment", "traceType", \
"occurence", "XAXIS", "YAXIS", "YRANGE", "TRACECOLOR", "AssociatedHeadstage", "GUIChannelNumber", "Device", "SweepMapIndex"}

WAVE ADCs = GetADCListFromConfig(config)
WAVE DACs = GetDACListFromConfig(config)
Expand Down Expand Up @@ -532,7 +535,7 @@ Function CreateTiledChannelGraph(string graph, WAVE config, variable sweepNo, WA
GetWavesDataFolder(textualValues, 2), GetWavesDataFolder(numericalValues, 2), \
num2str(IsFinite(headstage) ? clampModes[headstage] : NaN), num2str(ttlBit), experiment, "Sweep", \
num2str(k), horizAxis, vertAxis, traceRange, traceColor, num2istr(IsFinite(headstage)), \
num2istr(guiChannelNumber)})
num2istr(guiChannelNumber), device, num2str(mapIndex)})
endfor
endfor

Expand Down
Loading