Skip to content

Commit

Permalink
Merge pull request #1983 from AllenInstitute/feature/1983-more-flags-…
Browse files Browse the repository at this point in the history
…for-acquiredata-ng

AcquireData_NG: Add FFR configuration for fixed frequency acquisition
  • Loading branch information
t-b authored Jan 22, 2024
2 parents 4f5076a + 6c736a3 commit 025faf3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
8 changes: 1 addition & 7 deletions Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -812,18 +812,12 @@ static Function CheckSamplingInterval2_REENTRY([str])
CHECK_CLOSE_VAR(DimDelta(channelAD, ROWS), expectedSampInt, tol=1e-6)
End

static Function CheckSamplingInterval3_PreAcq(device)
string device

PGC_SetAndActivateControl(device, "Popup_Settings_FixedFreq", str="100")
End

// UTF_TD_GENERATOR DeviceNameGeneratorMD1
static Function CheckSamplingInterval3([str])
string str

STRUCT DAQSettings s
InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1" + \
InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1_FFR:100:" + \
"__HS0_DA0_AD0_CM:VC:_ST:StimulusSetA_DA_0:")

AcquireData_NG(s, str)
Expand Down
15 changes: 2 additions & 13 deletions Packages/tests/HardwareBasic/UTF_Epochs.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -905,17 +905,12 @@ static Function EP_EpochTest14_REENTRY([str])
TestEpochsGeneric(str)
End

static Function EP_EpochTest15_PreAcq(string device)

PGC_SetAndActivateControl(device, "SetVar_DataAcq_TPDuration", val =10)
End

// UTF_TD_GENERATOR DeviceNameGeneratorMD1
static Function EP_EpochTest15([str])
string str

STRUCT DAQSettings s
InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1_TBP43.59" + \
InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1_TBP43.59_TPD10" + \
"__HS0_DA0_AD0_CM:VC:_ST:EpochTest0_DA_0:")

AcquireData_NG(s, str)
Expand All @@ -927,12 +922,6 @@ static Function EP_EpochTest15_REENTRY([str])
TestEpochsGeneric(str)
End

static Function EP_EpochTest16_PreAcq(string device)

PGC_SetAndActivateControl(device, "Popup_Settings_FixedFreq", str = "10")
PGC_SetAndActivateControl(device, "SetVar_DataAcq_TPDuration", val = 10)
End

// This test runs an acquisition at a low 10 kHz rate.
// The check are verifying that the following previous isues are fixes:
// - The end of the epochs are capped at the end of the data that was prepared for acquisition
Expand All @@ -951,7 +940,7 @@ static Function EP_EpochTest16([str])
string str

STRUCT DAQSettings s
InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1_TBP43.59" + \
InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1_TBP43.59_TPD10_FFR:10:" + \
"__HS0_DA0_AD0_CM:VC:_ST:EpochTest0_DA_0:")

AcquireData_NG(s, str)
Expand Down
4 changes: 1 addition & 3 deletions Packages/tests/HardwareBasic/UTF_TestPulseAndTPDuringDAQ.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ End

static Function CheckTPEntriesFromLBN_PreAcq(string device)

PGC_SetAndActivateControl(device, "SetVar_DataAcq_TPDuration", val = 15)

PGC_SetAndActivateControl(device, "setvar_Settings_TP_RTolerance", val = 2)
PGC_SetAndActivateControl(device, "setvar_Settings_TPBuffer", val = 3)

Expand Down Expand Up @@ -162,7 +160,7 @@ End
static Function CheckTPEntriesFromLBN([string str])

STRUCT DAQSettings s
InitDAQSettingsFromString(s, "MD1_RA1_I0_L0_BKG1_GSI0_ITI5_TBP30" + \
InitDAQSettingsFromString(s, "MD1_RA1_I0_L0_BKG1_GSI0_ITI5_TBP30_TPD15" + \
"__HS0_DA0_AD0_CM:IC:_ST:StimulusSetA_DA_0:" + \
"__HS1_DA1_AD1_CM:VC:_ST:StimulusSetC_DA_0:")

Expand Down
17 changes: 16 additions & 1 deletion Packages/tests/UTF_HardwareHelperFunctions.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,8 @@ End

Structure DAQSettings
variable MD, RA, IDX, LIDX, BKG_DAQ, RES, DB, AMP, ITP, FAR
variable oodDAQ, dDAQ, OD, TD, TP, ITI, GSI, TPI, DAQ, DDL, SIM, STP, TBP
variable oodDAQ, dDAQ, OD, TD, TP, ITI, GSI, TPI, DAQ, DDL, SIM, STP, TBP, TPD
string FFR

WAVE hs, da, ad, cm, ttl, aso
WAVE/T st, ist, af, st_ttl, iaf
Expand Down Expand Up @@ -1258,6 +1259,10 @@ Function InitDAQSettingsFromString(s, str)

s.sim = ParseNumber(str, "_SIM", defValue = 1)

s.ffr = ParseString(str, "_FFR", defValue = NONE)

s.tpd = ParseNumber(str, "_TPD", defValue = NaN)

WAVE/T/Z hsConfig = ListToTextWave(str, "__")

if(WaveExists(hsConfig))
Expand Down Expand Up @@ -1374,6 +1379,8 @@ End
/// - Sampling interval multiplier (SIM: 1, 2, 4, ..., 64), defaults to 1
/// - Save TP: (STP: 1/0), defaults to 0
/// - TP Baseline Percentage: (TBP: [25, 49])
/// - Fixed frequency acquisition: (FFR: see @ref DAP_GetSamplingFrequencies() for available values)
/// - TP Duration: (TPD: [5, inf[)
///
/// HeadstageConfig:
/// - Full specification: __HSXX_ADXX_DAXX_CM:XX:_ST:XX:_IST:XX:_AF:XX:_IAF:XX:_ASOXX
Expand Down Expand Up @@ -1564,11 +1571,19 @@ Function AcquireData_NG(STRUCT DAQSettings &s, string device)

PGC_SetAndActivateControl(device, "Popup_Settings_SampIntMult", str = num2str(s.sim))

if(cmpstr(s.ffr, NONE))
PGC_SetAndActivateControl(device, "Popup_Settings_FixedFreq", str = s.ffr)
endif

// these don't have good defaults
if(IsFinite(s.iti))
PGC_SetAndActivateControl(device, "SetVar_DataAcq_ITI", val = s.iti)
endif

if(IsFinite(s.tpd))
PGC_SetAndActivateControl(device, "SetVar_DataAcq_TPDuration", val = s.tpd)
endif

PGC_SetAndActivateControl(device, "check_Settings_ITITP", val = s.tpi)

PGC_SetAndActivateControl(device, "Check_Settings_InsertTP", val = s.itp)
Expand Down

0 comments on commit 025faf3

Please sign in to comment.