Skip to content

Commit

Permalink
Tests: Add Epochs tests with all fixed frequencies and multipliers
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHuth committed Feb 12, 2024
1 parent 30bc5d0 commit cbc250c
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Packages/tests/HardwareBasic/UTF_Epochs.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,50 @@ static Function EP_EpochTest17_REENTRY([str])
TestEpochsGeneric(str)
End

// IUTF_TD_GENERATOR s0:DeviceNameGeneratorMD1
// IUTF_TD_GENERATOR v0:DataGenerators#EpochTestSamplingFrequency_Gen
// IUTF_TD_GENERATOR s1:DataGenerators#EpochTest_Stimsets_Gen
static Function EP_EpochTestSamplingFrequency([STRUCT IUTF_mData &mData])

STRUCT DAQSettings s
string dynSetup, stimSetup

sprintf dynSetup, "_FFR:%d:", mData.v0
sprintf stimSetup, "_ST:%s:", mData.s1

InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1" + dynSetup + \
"__HS0_DA0_AD0_CM:VC:" + stimSetup)

AcquireData_NG(s, mData.s0)
End

static Function EP_EpochTestSamplingFrequency_REENTRY([STRUCT IUTF_mData &mData])

TestEpochsGeneric(mData.s0)
End

// IUTF_TD_GENERATOR s0:DeviceNameGeneratorMD1
// IUTF_TD_GENERATOR v0:DataGenerators#EpochTestSamplingMultiplier_Gen
// IUTF_TD_GENERATOR s1:DataGenerators#EpochTest_Stimsets_Gen
static Function EP_EpochTestSamplingMultiplier([STRUCT IUTF_mData &mData])

STRUCT DAQSettings s
string dynSetup, stimSetup

sprintf dynSetup, "_SIM:%d:", mData.v0
sprintf stimSetup, "_ST:%s:", mData.s1

InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1" + dynSetup + \
"__HS0_DA0_AD0_CM:VC:" + stimSetup)

AcquireData_NG(s, mData.s0)
End

static Function EP_EpochTestSamplingMultiplier_REENTRY([STRUCT IUTF_mData &mData])

TestEpochsGeneric(mData.s0)
End

// UTF_TD_GENERATOR DeviceNameGeneratorMD1
static Function EP_EpochTestUnassocDA([str])
string str
Expand Down
40 changes: 40 additions & 0 deletions Packages/tests/UTF_DataGenerators.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,46 @@ Function/WAVE GetMiesMacrosWithPanelType()
return matches
End

static Function/WAVE EpochTestSamplingFrequency_Gen()

variable freq, i

Make/FREE w = {100, 50, 25, 10}
for(freq : w)
SetDimLabel ROWS, i, $("f_" + num2istr(freq) + "_kHz"), w
i += 1
endfor

return w
End

static Function/WAVE EpochTestSamplingMultiplier_Gen()

variable mult, i

Make/FREE w = {2, 4, 8, 16, 32, 64}
for(mult : w)
SetDimLabel ROWS, i, $("Multiplier_" + num2istr(mult) + "x"), w
i += 1
endfor

return w
End

static Function/WAVE EpochTest_Stimsets_Gen()

string setName
variable i

Make/FREE/T wt = {"EpochTest0_DA_0", "EpochTest1_DA_0", "EpochTest2_DA_0", "EpochTest3_DA_0", "EpochTest4_DA_0", "EpochTest5_DA_0", "EpochTest6_DA_0", "EpochTest17_DA_0"}
for(setName : wt)
SetDimLabel ROWS, i, $setName, wt
i += 1
endfor

return wt
End

static Function/WAVE EpochTestTTL_TP_Gen()

Make/FREE w = {0, 1}
Expand Down

0 comments on commit cbc250c

Please sign in to comment.