Skip to content

Commit 5a5e9a6

Browse files
committed
BSP: BSP_AddTracesForEpochs correct loop vars j, k -> i, j
- according to coding conventions and nesting order
1 parent 22712b7 commit 5a5e9a6

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Packages/MIES/MIES_BrowserSettingsPanel.ipf

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ End
15991599
/// @brief Debug function to add traces with epoch information
16001600
Function BSP_AddTracesForEpochs(string win)
16011601

1602-
variable i, j, k, numEntries, start_x, start_y, end_x, end_y, yOffset
1602+
variable i, j, numEntries, start_x, start_y, end_x, end_y, yOffset
16031603
variable headstage, channelType, channelNumber, channelNumberDA, yLevelOffset, level, idx, numTraces, numEpochs
16041604
variable sweepNumber, traceIndex
16051605
STRUCT RGBColor c
@@ -1637,19 +1637,19 @@ Function BSP_AddTracesForEpochs(string win)
16371637
traceIndex = GetNextTraceIndex(win)
16381638

16391639
numTraces = DimSize(traceInfos, ROWS)
1640-
for(j = 0; j < numTraces; j += 1)
1641-
yaxis = traceInfos[j][%YAXIS]
1642-
xaxis = traceInfos[j][%XAXIS]
1640+
for(i = 0; i < numTraces; i += 1)
1641+
yaxis = traceInfos[i][%YAXIS]
1642+
xaxis = traceInfos[i][%XAXIS]
16431643

16441644
// use our own y axis
16451645
// need to replace for both AD and DA cases
16461646
yaxis = ReplaceString("_DA", yaxis, DB_AXIS_PART_EPOCHS + "_DA")
16471647
yaxis = ReplaceString("_AD", yaxis, DB_AXIS_PART_EPOCHS + "_DA")
16481648

1649-
headstage = str2num(traceInfos[j][%headstage])
1650-
sweepNumber = str2num(traceInfos[j][%sweepNumber])
1651-
channelType = WhichListItem(traceInfos[j][%channelType], XOP_CHANNEL_NAMES)
1652-
channelNumber = str2num(traceInfos[j][%channelNumber])
1649+
headstage = str2num(traceInfos[i][%headstage])
1650+
sweepNumber = str2num(traceInfos[i][%sweepNumber])
1651+
channelType = WhichListItem(traceInfos[i][%channelType], XOP_CHANNEL_NAMES)
1652+
channelNumber = str2num(traceInfos[i][%channelNumber])
16531653

16541654
switch(channelType)
16551655
case XOP_CHANNEL_TYPE_ADC:
@@ -1693,13 +1693,13 @@ Function BSP_AddTracesForEpochs(string win)
16931693
levels_y = NaN
16941694
SetStringInWaveNote(levels_y, "EpochInfo", GetWavesDataFolder(epochs, 2))
16951695

1696-
for(k = 0; k < numEpochs; k += 1)
1696+
for(j = 0; j < numEpochs; j += 1)
16971697

1698-
start_x = str2num(epochs[k][0]) * ONE_TO_MILLI
1699-
end_x = str2num(epochs[k][1]) * ONE_TO_MILLI
1698+
start_x = str2num(epochs[j][0]) * ONE_TO_MILLI
1699+
end_x = str2num(epochs[j][1]) * ONE_TO_MILLI
17001700

17011701
// handle EPOCH_USER_LEVEL being -1
1702-
level = str2num(epochs[k][3]) + 1
1702+
level = str2num(epochs[j][3]) + 1
17031703

17041704
start_y = yOffset - yLevelOffset * level - 0.1 * yLevelOffset * currentLevel[level]
17051705
end_y = start_y
@@ -1708,25 +1708,25 @@ Function BSP_AddTracesForEpochs(string win)
17081708
levels_x[idx][level][0] = start_x
17091709
levels_x[idx + 1][level][0] = end_x
17101710
levels_x[idx + 2][level][0] = NaN
1711-
levels_x[idx, idx + 2][level][1] = k
1711+
levels_x[idx, idx + 2][level][1] = j
17121712

17131713
levels_y[idx][level][0] = start_y
17141714
levels_y[idx + 1][level][0] = end_y
17151715
levels_y[idx + 2][level][0] = NaN
1716-
levels_y[idx, idx + 2][level][1] = k
1716+
levels_y[idx, idx + 2][level][1] = j
17171717

17181718
indexInLevel[level] = idx + 3
17191719

17201720
currentLevel[level] += 1
17211721
endfor
17221722

1723-
for(k = 0; k < BSP_EPOCH_LEVELS; k += 1)
1724-
sprintf level_x_trace, "%s_level%d_x_%s", GetTraceNamePrefix(traceIndex++), k, idPart
1723+
for(j = 0; j < BSP_EPOCH_LEVELS; j += 1)
1724+
sprintf level_x_trace, "%s_level%d_x_%s", GetTraceNamePrefix(traceIndex++), j, idPart
17251725

1726-
AppendToGraph/W=$win/L=$yAxis levels_y[][k]/TN=$level_x_trace vs levels_x[][k]
1726+
AppendToGraph/W=$win/L=$yAxis levels_y[][j]/TN=$level_x_trace vs levels_x[][j]
17271727
TUD_SetUserDataFromWaves(win, level_x_trace, {"traceType", "occurence", "XAXIS", "YAXIS"}, {"EpochVis", "", "bottom", yaxis})
17281728

1729-
[c] = GetTraceColor(k)
1729+
[c] = GetTraceColor(j)
17301730
ModifyGraph/W=$win marker($level_x_trace)=10, mode($level_x_trace)=4, rgb($level_x_trace)=(c.red, c.green, c.blue)
17311731
endfor
17321732

0 commit comments

Comments
 (0)