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

PSX_GenerateComboKey: Fix it for the sweepbrowser #2300

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Changes from all commits
Commits
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
35 changes: 23 additions & 12 deletions Packages/MIES/MIES_SweepFormula_PSX.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2963,6 +2963,27 @@ static Function [WAVE acceptColors, WAVE rejectColors, WAVE undetColors] PSX_Get
Make/FREE undetColors = {PSX_COLOR_UNDET_R, PSX_COLOR_UNDET_G, PSX_COLOR_UNDET_B, 0.2 * 65535}
End

static Function/S PSX_GetDevice(string graph, variable sweepNo, variable mapIndex)

string device

WAVE textualValues = SFH_GetLabNoteBookForSweep(graph, sweepNo, mapIndex, LBN_TEXTUAL_VALUES)

// Introduced in 7e903ed8 (GetSweepSettingsTextWave: Add device as entry, 2023-01-03)
device = GetLastSettingTextIndep(textualValues, sweepNo, "Device", DATA_ACQUISITION_MODE)

if(!IsEmpty(device))
return device
endif

if(BSP_IsDataBrowser(graph))
return BSP_GetDevice(graph)
endif

WAVE/T sweepMap = SB_GetSweepMap(graph)
return sweepMap[mapIndex][%Device]
End

/// @brief Generate the unique combination key made up from `selectData` and `range`
///
/// This is used in the results wave, the listbox for selection and is attached
Expand All @@ -2982,19 +3003,8 @@ static Function/S PSX_GenerateComboKey(string graph, WAVE selectData, WAVE range
mapIndex = selectData[0][%SWEEPMAPINDEX]

WAVE numericalValues = SFH_GetLabNoteBookForSweep(graph, sweepNo, mapIndex, LBN_NUMERICAL_VALUES)
WAVE textualValues = SFH_GetLabNoteBookForSweep(graph, sweepNo, mapIndex, LBN_TEXTUAL_VALUES)

// Introduced in 7e903ed8 (GetSweepSettingsTextWave: Add device as entry, 2023-01-03)
device = GetLastSettingTextIndep(textualValues, sweepNo, "Device", DATA_ACQUISITION_MODE)

if(IsEmpty(device))
if(isDataBrowser)
device = BSP_GetDevice(graph)
else
WAVE/T sweepMap = SB_GetSweepMap(graph)
device = sweepMap[mapIndex][%Device]
endif
endif
device = PSX_GetDevice(graph, sweepNo, mapIndex)

ASSERT(!IsEmpty(device), "Could not find the device of the given selectData")

Expand All @@ -3011,6 +3021,7 @@ static Function/S PSX_GenerateComboKey(string graph, WAVE selectData, WAVE range
if(isDataBrowser)
experiment = GetExperimentName()
else
WAVE/T sweepMap = SB_GetSweepMap(graph)
experiment = sweepMap[mapIndex][%FileName]
endif

Expand Down