Skip to content

Commit

Permalink
TP: Rename TP_GetStoredTPs to TP_GetConsecutiveTPsUptoMarker
Browse files Browse the repository at this point in the history
This prevent misleading naming and it more fitting to the functionality
the function actually implements
  • Loading branch information
MichaelHuth committed Sep 3, 2024
1 parent 00941de commit 0057895
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Packages/MIES/MIES_TestPulse.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ End
/// identified by tpMarker.
///
/// The wave reference wave will have as many columns as active headstages were used.
Function/WAVE TP_GetStoredTPs(string device, variable tpMarker, variable number)
Function/WAVE TP_GetConsecutiveTPsUptoMarker(string device, variable tpMarker, variable number)

variable numEntries

Expand Down Expand Up @@ -318,7 +318,7 @@ End
/// - Active headstages
static Function/WAVE TP_GetTPWaveForAutoTP(string device, variable marker)

WAVE/WAVE/Z TPs = TP_GetStoredTPs(device, marker, 2)
WAVE/WAVE/Z TPs = TP_GetConsecutiveTPsUptoMarker(device, marker, 2)

if(!WaveExists(TPs))
return $""
Expand Down
14 changes: 7 additions & 7 deletions Packages/tests/Basic/UTF_Testpulse.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,29 @@ static Function FetchingTestpulsesWorks()
string device = "myDevice"

// emty stored TPs
WAVE/Z result = TP_GetStoredTPs(device, 0xA, 1)
WAVE/Z result = TP_GetConsecutiveTPsUptoMarker(device, 0xA, 1)
CHECK_WAVE(result, NULL_WAVE)

TP_StoreTP(device, {1}, 0xA, "I_DONT_CARE")

// not found
WAVE/Z result = TP_GetStoredTPs(device, 0xB, 1)
WAVE/Z result = TP_GetConsecutiveTPsUptoMarker(device, 0xB, 1)
CHECK_WAVE(result, NULL_WAVE)

// requested too many
WAVE/Z result = TP_GetStoredTPs(device, 0xA, 2)
WAVE/Z result = TP_GetConsecutiveTPsUptoMarker(device, 0xA, 2)
CHECK_WAVE(result, NULL_WAVE)

TP_StoreTP(device, {2}, 0xB, "I_DONT_CARE")

// works with fetching one TP
WAVE/WAVE/Z result = TP_GetStoredTPs(device, 0xA, 1)
WAVE/WAVE/Z result = TP_GetConsecutiveTPsUptoMarker(device, 0xA, 1)
CHECK_WAVE(result, WAVE_WAVE)
CHECK_EQUAL_VAR(DimSize(result, ROWS), 1)
CHECK_EQUAL_WAVES(WaveRef(result, row = 0), {{1}}, mode = WAVE_DATA)

// works with fetching two TPs
WAVE/WAVE/Z result = TP_GetStoredTPs(device, 0xB, 2)
WAVE/WAVE/Z result = TP_GetConsecutiveTPsUptoMarker(device, 0xB, 2)
CHECK_WAVE(result, WAVE_WAVE)
CHECK_EQUAL_VAR(DimSize(result, ROWS), 2)
CHECK_EQUAL_WAVES(WaveRef(result, row = 0), {{1}}, mode = WAVE_DATA)
Expand All @@ -74,12 +74,12 @@ static Function FetchingTestpulsesWorks()
SetNumberInWaveNote(storedTPs[2], "TPCycleID", 4711)

// fetching one works
WAVE/WAVE/Z result = TP_GetStoredTPs(device, 0xC, 1)
WAVE/WAVE/Z result = TP_GetConsecutiveTPsUptoMarker(device, 0xC, 1)
CHECK_WAVE(result, WAVE_WAVE)
CHECK_EQUAL_VAR(DimSize(result, ROWS), 1)
CHECK_EQUAL_WAVES(WaveRef(result, row = 0), {{3}}, mode = WAVE_DATA)

// but two not because 0xB has a different cycle id
WAVE/WAVE/Z result = TP_GetStoredTPs(device, 0xC, 2)
WAVE/WAVE/Z result = TP_GetConsecutiveTPsUptoMarker(device, 0xC, 2)
CHECK_WAVE(result, NULL_WAVE)
End

0 comments on commit 0057895

Please sign in to comment.