Skip to content

Commit c07003e

Browse files
committed
SB_GetSweepDataFolder: Drop sweepNo argument
In general we can't map a sweep number to a sweep data folder in the sweep browser as we can have the same sweep number from multiple experiments. Drop that argument as it is now not used anymore. See also #2151.
1 parent 109fded commit c07003e

File tree

3 files changed

+6
-36
lines changed

3 files changed

+6
-36
lines changed

Packages/MIES/MIES_AnalysisBrowser_SweepBrowser.ipf

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,43 +31,13 @@ Function SB_TranslateSBMapIndexToABMapIndex(string win, variable sbIndex)
3131
return V_row
3232
End
3333

34-
static Function SB_GetSweepIndexFromMap(WAVE/T sweepMap, variable sweepNo)
35-
36-
variable cIndex
37-
38-
cIndex = FindDimLabel(sweepMap, COLS, "Sweep")
39-
FindValue/RMD=[][cIndex]/TEXT=(num2istr(sweepNo))/TXOP=4 sweepMap
40-
41-
#ifdef AUTOMATED_TESTING
42-
variable dummy = V_row
43-
if(V_row >= 0)
44-
FindValue/RMD=[dummy + 1,][cIndex]/TEXT=(num2istr(sweepNo))/TXOP=4 sweepMap
45-
ASSERT(V_row == -1, "Found results for multiple experiments")
46-
endif
47-
V_row = dummy
48-
#endif // AUTOMATED_TESTING
49-
50-
return (V_row == -1) ? NaN : V_row
51-
End
52-
53-
/// @brief Return the sweep data folder for either a given index or sweepNo
54-
/// If a sweepNo is given then the result for the first sweep found with that number is returned
55-
Function/DF SB_GetSweepDataFolder(WAVE/T sweepMap, [variable sweepNo, variable index])
34+
/// @brief Return the sweep data folder for the given index
35+
Function/DF SB_GetSweepDataFolder(WAVE/T sweepMap, variable mapIndex)
5636

5737
string dataFolder, device
58-
variable cIndex
59-
60-
if(!ParamIsDefault(index) && ParamIsDefault(sweepNo))
61-
ASSERT(index >= 0 && index < DimSize(sweepMap, ROWS), "Invalid index")
62-
elseif(ParamIsDefault(index) && !ParamIsDefault(sweepNo))
63-
index = SB_GetSweepIndexFromMap(sweepMap, sweepNo)
64-
if(IsNaN(index))
65-
return $""
66-
endif
67-
endif
6838

69-
dataFolder = sweepMap[index][%DataFolder]
70-
device = sweepMap[index][%Device]
39+
dataFolder = sweepMap[mapIndex][%DataFolder]
40+
device = sweepMap[mapIndex][%Device]
7141

7242
return GetAnalysisSweepPath(dataFolder, device)
7343
End

Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static Function AD_FillWaves(string win, WAVE/T list, WAVE/T info)
320320
endif
321321

322322
if(!isDataBrowser)
323-
DFREF sweepDFR = SB_GetSweepDataFolder(sweepMap, index = mapIndex)
323+
DFREF sweepDFR = SB_GetSweepDataFolder(sweepMap, mapIndex)
324324
endif
325325

326326
msg = AD_GetResultMessage(anaFuncType, passed, numericalValues, textualValues, sweepNo, sweepDFR, headstage, ongoingDAQ, waMode)

Packages/MIES/MIES_BrowserSettingsPanel.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ Function BSP_ButtonProc_RestoreData(STRUCT WMButtonAction &ba) : ButtonControl
12571257

12581258
numEntries = GetNumberFromWaveNote(sweepMap, NOTE_INDEX)
12591259
for(i = 0; i < numEntries; i += 1)
1260-
DFREF sweepDFR = SB_GetSweepDataFolder(sweepMap, index = i)
1260+
DFREF sweepDFR = SB_GetSweepDataFolder(sweepMap, i)
12611261
DFREF singleSweepDFR = GetSingleSweepFolder(sweepDFR, sweepNo)
12621262
ReplaceWaveWithBackupForAll(singleSweepDFR)
12631263
endfor

0 commit comments

Comments
 (0)