From 49fbb2989fb9e54e8240d205608aabc54f55d4ce Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Tue, 12 Mar 2024 13:15:56 +0100 Subject: [PATCH] AB: bugfix LoadDataWrapper excluded loaded waves if the casing was different LoadDataWrapper does a check if it can find the loaded waves after the load. This check was case-sensitive. Thus, it failed if the input wave name was e.g. lower case and the actual loaded wave was upper case named. Fix: Make the check case-insensitive to be in line with general object name handling in Igor Pro since d13a6b7 --- Packages/MIES/MIES_AnalysisBrowser.ipf | 2 +- .../tests/Basic/UTF_AnalysisBrowserTest.ipf | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Packages/MIES/MIES_AnalysisBrowser.ipf b/Packages/MIES/MIES_AnalysisBrowser.ipf index 3da7600853..dfb8fe5dc4 100644 --- a/Packages/MIES/MIES_AnalysisBrowser.ipf +++ b/Packages/MIES/MIES_AnalysisBrowser.ipf @@ -627,7 +627,7 @@ static Function AB_LoadDataWrapper(tmpDFR, expFilePath, datafolderPath, listOfNa RemoveAllEmptyDataFolders(tmpDFR) - regexp = ConvertListToRegexpWithAlternations(listOfNames) + regexp = "(?i)" + ConvertListToRegexpWithAlternations(listOfNames) list = GetListOfObjects(tmpDFR, regexp, recursive=1, typeFlag=typeFlags) return ItemsInList(list) diff --git a/Packages/tests/Basic/UTF_AnalysisBrowserTest.ipf b/Packages/tests/Basic/UTF_AnalysisBrowserTest.ipf index aad6568105..4495a4555b 100644 --- a/Packages/tests/Basic/UTF_AnalysisBrowserTest.ipf +++ b/Packages/tests/Basic/UTF_AnalysisBrowserTest.ipf @@ -91,3 +91,25 @@ static Function TryLoadingDifferentFiles() KillWindow $abWin KillWindow $sBrowser1 End + +static Function TestAB_LoadDataWrapper() + + variable numLoaded + string expFilePath + string expName = "TestAB_LoadDataWrapper.pxp" + string wName = "wAvE1" + + WAVE/Z wv =root:WAVE1 + KillOrMoveToTrash(wv=wv) + wName = UpperStr(wName) + Make root:$wName + SaveExperiment/P=home as expName + + PathInfo home + expFilePath = S_path + expName + + DFREF tmpDFR = NewFreeDataFolder() + wName = LowerStr(wName) + ";" + numLoaded = MIES_AB#AB_LoadDataWrapper(tmpDFR, expFilePath, "root:", wName, typeFlags=COUNTOBJECTS_WAVES) + CHECK_GT_VAR(numLoaded, 0) +End