From ff76cac01e5309f99dbb71bc47cabfab361a0418 Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Mon, 5 Jun 2023 15:44:49 +0200 Subject: [PATCH 1/8] DAEphys: Add new checkbox to panel for o TP on unassociated DA channels - checkbox got a Configuration Restore priority of 60 to be restored before the inserted TP checkbox - increase panel version to 61 --- Packages/MIES/MIES_Constants.ipf | 2 +- Packages/MIES/MIES_DAEphys.ipf | 1 + Packages/MIES/MIES_DAEphys_Macro.ipf | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Packages/MIES/MIES_Constants.ipf b/Packages/MIES/MIES_Constants.ipf index 0b4c5c0862..ffba1ee951 100644 --- a/Packages/MIES/MIES_Constants.ipf +++ b/Packages/MIES/MIES_Constants.ipf @@ -18,7 +18,7 @@ Constant DAQ_CONFIG_WAVE_VERSION = 2 /// Used to upgrade the GuiStateWave as well as the DA Ephys panel -Constant DA_EPHYS_PANEL_VERSION = 60 +Constant DA_EPHYS_PANEL_VERSION = 61 Constant DATA_SWEEP_BROWSER_PANEL_VERSION = 46 Constant WAVEBUILDER_PANEL_VERSION = 14 Constant ANALYSISBROWSER_PANEL_VERSION = 3 diff --git a/Packages/MIES/MIES_DAEphys.ipf b/Packages/MIES/MIES_DAEphys.ipf index ee3c97ed07..bf6146661f 100644 --- a/Packages/MIES/MIES_DAEphys.ipf +++ b/Packages/MIES/MIES_DAEphys.ipf @@ -633,6 +633,7 @@ Function DAP_EphysPanelStartUpSettings() CheckBox Check_Settings_BackgrndDataAcq WIN = $device, value= 1 CheckBox Check_Settings_InsertTP WIN = $device,value= 1 + CheckBox Check_Settings_UnassocDADoTP WIN = $device,value= 1 CheckBox Check_DataAcq_Get_Set_ITI WIN = $device, value = 1 CheckBox check_Settings_TP_SaveTP WIN = $device, value = 0 CheckBox check_settings_TP_show_steady WIN = $device, value = 1 diff --git a/Packages/MIES/MIES_DAEphys_Macro.ipf b/Packages/MIES/MIES_DAEphys_Macro.ipf index 48956fb72d..4d13b67253 100644 --- a/Packages/MIES/MIES_DAEphys_Macro.ipf +++ b/Packages/MIES/MIES_DAEphys_Macro.ipf @@ -3155,7 +3155,7 @@ Window DA_Ephys() : Panel CheckBox check_Settings_MD,userdata(ResizeControlsInfo)+=A"zzzzzzzzzzzz!!#u:Duafnzzzzzzzzzzz" CheckBox check_Settings_MD,userdata(ResizeControlsInfo)+=A"zzz!!#u:Duafnzzzzzzzzzzzzzz!!!" CheckBox check_Settings_MD,userdata(oldDisabledState)="2",value=1 - CheckBox Check_Settings_InsertTP,pos={168.00,84.00},size={61.00,15.00},disable=1,proc=DAP_CheckProc_InsertTP + CheckBox Check_Settings_InsertTP,pos={127.00,84.00},size={61.00,15.00},disable=1,proc=DAP_CheckProc_InsertTP CheckBox Check_Settings_InsertTP,title="Insert TP" CheckBox Check_Settings_InsertTP,help={"Inserts a test pulse at the front of each sweep in a set."} CheckBox Check_Settings_InsertTP,userdata(tabnum)="5",userdata(tabcontrol)="ADC" @@ -3604,7 +3604,7 @@ Window DA_Ephys() : Panel CheckBox check_settings_TP_show_peak,userdata(ResizeControlsInfo)+=A"zzzzzzzzzzzz!!#u:Duafnzzzzzzzzzzz" CheckBox check_settings_TP_show_peak,userdata(ResizeControlsInfo)+=A"zzz!!#u:Duafnzzzzzzzzzzzzzz!!!" CheckBox check_settings_TP_show_peak,value=1 - CheckBox check_settings_TP_show_steady,pos={168.00,132.00},size={165.00,15.00},disable=1,proc=DAP_CheckProc_UpdateGuiState + CheckBox check_settings_TP_show_steady,pos={160.00,132.00},size={165.00,15.00},disable=1,proc=DAP_CheckProc_UpdateGuiState CheckBox check_settings_TP_show_steady,title="Show steady state resistance" CheckBox check_settings_TP_show_steady,help={"Show the steady state resistance curve during the testpulse"} CheckBox check_settings_TP_show_steady,userdata(tabnum)="5" @@ -3694,7 +3694,7 @@ Window DA_Ephys() : Panel Button button_DataAcq_OpenCommentNB,userdata(ResizeControlsInfo)=A"!!,I3!!#DR^]6\\4!!# Date: Tue, 6 Jun 2023 00:23:00 +0200 Subject: [PATCH 2/8] DAP: Make CB "TP on unassoc" dependent from Insert TP checkbox - If Insert TP is unselected then TP on unassoc is unselected and disabled If Insert TP is selected then TP on unassoc is restored --- Packages/MIES/MIES_DAEphys.ipf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Packages/MIES/MIES_DAEphys.ipf b/Packages/MIES/MIES_DAEphys.ipf index bf6146661f..fba93412af 100644 --- a/Packages/MIES/MIES_DAEphys.ipf +++ b/Packages/MIES/MIES_DAEphys.ipf @@ -3621,6 +3621,8 @@ Function DAP_CheckProc_InsertTP(cba) : CheckBoxControl switch(cba.eventCode) case 2: DAG_Update(cba.win, cba.ctrlName, val = cba.checked) + device = cba.win + AdaptDependentControls(device, "Check_Settings_UnassocDADoTP", cba.checked, CHECKBOX_SELECTED, DEP_CTRLS_INVERT) DAP_UpdateOnsetDelay(cba.win) break endswitch From 343546b97eea1021c8b177f669506fc04d0562e6 Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Mon, 5 Jun 2023 15:53:18 +0200 Subject: [PATCH 3/8] DC: Add no TP for unassoc DA in DataConfigurationResult structure - and retrieve it in DC_GetConfiguration --- Packages/MIES/MIES_DataConfigurator.ipf | 1 + Packages/MIES/MIES_Structures.ipf | 1 + 2 files changed, 2 insertions(+) diff --git a/Packages/MIES/MIES_DataConfigurator.ipf b/Packages/MIES/MIES_DataConfigurator.ipf index 3b19d2c99d..0b0c818c4d 100644 --- a/Packages/MIES/MIES_DataConfigurator.ipf +++ b/Packages/MIES/MIES_DataConfigurator.ipf @@ -1304,6 +1304,7 @@ static Function [STRUCT DataConfigurationResult s] DC_GetConfiguration(string de s.distributedDAQOptPost = DAG_GetNumericalValue(device, "Setvar_DataAcq_dDAQOptOvPost") s.powerSpectrum = DAG_GetNumericalValue(device, "check_settings_show_power") s.skipAhead = DAG_GetNumericalValue(device, "SetVar_DataAcq_skipAhead") + s.doTPonUnassocDA = DAG_GetNumericalValue(device, "Check_Settings_UnassocDADoTP") // MH: note with NI the decimationFactor can now be < 1, like 0.4 if a single NI ADC channel runs with 500 kHz // whereas the source data generated waves for ITC min sample rate are at 200 kHz diff --git a/Packages/MIES/MIES_Structures.ipf b/Packages/MIES/MIES_Structures.ipf index a9d5fb6bb0..fce4c6af1b 100644 --- a/Packages/MIES/MIES_Structures.ipf +++ b/Packages/MIES/MIES_Structures.ipf @@ -462,6 +462,7 @@ Structure DataConfigurationResult variable distributedDAQOptPost variable multiDevice variable powerSpectrum + variable doTPonUnassocDA WAVE statusHS /// @} From d59ad105ca24c4b78d41eca3dfb552b9565d1844 Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Mon, 5 Jun 2023 19:52:48 +0200 Subject: [PATCH 4/8] DC: Dont add TP on Acquisition if TP on unassoc checkbox is unchecked --- Packages/MIES/MIES_DataConfigurator.ipf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Packages/MIES/MIES_DataConfigurator.ipf b/Packages/MIES/MIES_DataConfigurator.ipf index 0b0c818c4d..413c0ebe5a 100644 --- a/Packages/MIES/MIES_DataConfigurator.ipf +++ b/Packages/MIES/MIES_DataConfigurator.ipf @@ -1190,7 +1190,7 @@ End static Function DC_FillDAQDataWaveForDAQ(string device, STRUCT DataConfigurationResult &s) variable i, tpAmp, cutOff, channel, headstage, DAScale, singleSetLength, stimsetCol, startOffset - variable lastValidRow + variable lastValidRow, isUnAssociated WAVE config = GetDAQConfigWave(device) @@ -1236,6 +1236,7 @@ static Function DC_FillDAQDataWaveForDAQ(string device, STRUCT DataConfiguration singleSetLength = s.setLength[i] stimsetCol = s.setColumn[i] startOffset = s.insertStart[i] + isUnAssociated = IsNaN(headstage) switch(s.hardwareType) case HARDWARE_ITC_DAC: @@ -1245,7 +1246,7 @@ static Function DC_FillDAQDataWaveForDAQ(string device, STRUCT DataConfiguration SIGNED_INT_16BIT_MIN, \ SIGNED_INT_16BIT_MAX); AbortOnRTE - if(s.globalTPInsert) + if(s.globalTPInsert && !(isUnAssociated && !s.doTPonUnassocDA)) // space in ITCDataWave for the testpulse is allocated via an automatic increase // of the onset delay MultiThread ITCDataWave[0, s.testPulseLength - 1][i] = \ @@ -1269,7 +1270,7 @@ static Function DC_FillDAQDataWaveForDAQ(string device, STRUCT DataConfiguration NI_DAC_MIN, \ NI_DAC_MAX); AbortOnRTE - if(s.globalTPInsert) + if(s.globalTPInsert && !(isUnAssociated && !s.doTPonUnassocDA)) // space in ITCDataWave for the testpulse is allocated via an automatic increase // of the onset delay MultiThread NIChannel[0, s.testPulseLength - 1] = \ From c06605cddfc2bdd49970c1932d90fd006c7200b4 Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Tue, 6 Jun 2023 00:41:44 +0200 Subject: [PATCH 5/8] LBN: Add new entry for TP on unassoc DA channels in LBN - Stores the checkbox state of Check_Settings_UnassocDADoTP from DAEphys panel - key is: TPONUNASSOCDA_ENTRY_KEY - It is stored in DC_PrepareLBNEntries - Increased wave version to 37 - Increased LBN version to 70 --- Packages/MIES/MIES_Constants.ipf | 3 ++- Packages/MIES/MIES_DataConfigurator.ipf | 1 + Packages/MIES/MIES_WaveDataFolderGetters.ipf | 11 ++++++++--- Packages/MIES/labnotebook_numerical_description.itx | 3 ++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Packages/MIES/MIES_Constants.ipf b/Packages/MIES/MIES_Constants.ipf index ffba1ee951..594ea9900d 100644 --- a/Packages/MIES/MIES_Constants.ipf +++ b/Packages/MIES/MIES_Constants.ipf @@ -38,7 +38,7 @@ Constant SWEEP_EPOCH_VERSION = 7 /// - New/Changed layers of entries /// /// @{ -Constant LABNOTEBOOK_VERSION = 69 +Constant LABNOTEBOOK_VERSION = 70 Constant RESULTS_VERSION = 2 /// @} @@ -934,6 +934,7 @@ StrConstant STIMSET_SCALE_FACTOR_KEY = "Stim Scale Factor" StrConstant STIMSET_WAVE_NOTE_KEY = "Stim Wave Note" StrConstant EPOCHS_ENTRY_KEY = "Epochs" StrConstant CLAMPMODE_ENTRY_KEY = "Clamp Mode" +StrConstant TPONUNASSOCDA_ENTRY_KEY = "Global TP insert on unassociated DA channels" StrConstant TP_AMPLITUDE_VC_ENTRY_KEY = "TP Amplitude VC" StrConstant TP_AMPLITUDE_IC_ENTRY_KEY = "TP Amplitude IC" diff --git a/Packages/MIES/MIES_DataConfigurator.ipf b/Packages/MIES/MIES_DataConfigurator.ipf index 413c0ebe5a..fb913b8b99 100644 --- a/Packages/MIES/MIES_DataConfigurator.ipf +++ b/Packages/MIES/MIES_DataConfigurator.ipf @@ -1029,6 +1029,7 @@ static Function DC_PrepareLBNEntries(string device, STRUCT DataConfigurationResu DC_DocumentChannelProperty(device, "Save amplifier settings", INDEP_HEADSTAGE, NaN, NaN, var=DAG_GetNumericalValue(device, "check_Settings_SaveAmpSettings")) DC_DocumentChannelProperty(device, "Require amplifier", INDEP_HEADSTAGE, NaN, NaN, var=DAG_GetNumericalValue(device, "check_Settings_RequireAmpConn")) DC_DocumentChannelProperty(device, "Skip Ahead", INDEP_HEADSTAGE, NaN, NaN, var=s.skipAhead) + DC_DocumentChannelProperty(device, TPONUNASSOCDA_ENTRY_KEY, INDEP_HEADSTAGE, NaN, NaN, var=s.doTPonUnassocDA) for(i = 0; i < NUM_HEADSTAGES; i += 1) diff --git a/Packages/MIES/MIES_WaveDataFolderGetters.ipf b/Packages/MIES/MIES_WaveDataFolderGetters.ipf index 173113cfef..cfc6a6e178 100644 --- a/Packages/MIES/MIES_WaveDataFolderGetters.ipf +++ b/Packages/MIES/MIES_WaveDataFolderGetters.ipf @@ -2101,7 +2101,7 @@ threadsafe Function/WAVE GetLBNidCache(numericalValues) return wv End -static Constant SWEEP_SETTINGS_WAVE_VERSION = 36 +static Constant SWEEP_SETTINGS_WAVE_VERSION = 37 /// @brief Uses the parameter names from the `sourceKey` columns and /// write them as dimension into the columns of dest. @@ -2248,6 +2248,7 @@ End /// - 57: Save amplifier settings /// - 58: Require amplifier /// - 59: Skip Ahead +/// - 60: Global TP insert on unassociated DA channels Function/Wave GetSweepSettingsKeyWave(device) string device @@ -2266,9 +2267,9 @@ Function/Wave GetSweepSettingsKeyWave(device) if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave)) return wv elseif(WaveExists(wv)) - Redimension/N=(-1, 60) wv + Redimension/N=(-1, 61) wv else - Make/T/N=(3, 60) newDFR:$newName/Wave=wv + Make/T/N=(3, 61) newDFR:$newName/Wave=wv endif wv = "" @@ -2517,6 +2518,10 @@ Function/Wave GetSweepSettingsKeyWave(device) wv[%Units][59] = "" wv[%Tolerance][59] = "1" + wv[%Parameter][60] = TPONUNASSOCDA_ENTRY_KEY + wv[%Units][60] = "" + wv[%Tolerance][60] = LABNOTEBOOK_NO_TOLERANCE + SetSweepSettingsDimLabels(wv, wv) SetWaveVersion(wv, versionOfNewWave) diff --git a/Packages/MIES/labnotebook_numerical_description.itx b/Packages/MIES/labnotebook_numerical_description.itx index 8f688935eb..819afd874c 100644 --- a/Packages/MIES/labnotebook_numerical_description.itx +++ b/Packages/MIES/labnotebook_numerical_description.itx @@ -1,5 +1,5 @@ IGOR -WAVES/T/N=(193,6) labnotebook_numerical_description +WAVES/T/N=(194,6) labnotebook_numerical_description BEGIN "Name" "Unit" "Tolerance" "Description" "Headstage Contingency" "ClampMode" "SweepNum" "" "-" "Sweep number: Non-repeating non-negative numeric identifier for sweep time series. Increments in the order of acquisition. Starts at zero." "ALL" "" @@ -194,6 +194,7 @@ BEGIN "Require amplifier" "On/Off" "-" "ON if data acquisition was done with an amplifier, OFF if not." "INDEP" "IC;VC;I=0" "Skip Ahead" "" "1" "Determines how many sweeps are skipped from the stimset whan starting data acquisition." "INDEP" "IC;VC;I=0" "Skip Sweeps source" "" "0.1" "Stores who is responsible for sweep skipping. Current values are 0x1 for the user and 0x2 for automatic/internal reasons." "INDEP" "IC;VC;I=0" + "Global TP insert on unassociated DA channels" "" "-" "When set, the global test pulse is inserted in stimset of unassociated DA channels. When not set, no test pulse is inserted in the stimsets of unassociated DA channels." "INDEP" "IC;VC;I=0" END X SetScale/P x 0,1,"", labnotebook_numerical_description; SetScale/P y 0,1,"", labnotebook_numerical_description; SetScale d 0,0,"", labnotebook_numerical_description X Note labnotebook_numerical_description, "WAVE_LAYOUT_VERSION:2;" From 3c4dcb18e4a415c2c8d7717c4bfa7a6b4b4b4286 Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Tue, 20 Jun 2023 15:54:09 +0200 Subject: [PATCH 6/8] EP: Add epoch for No TP on unassociated DA channels -> B0_TP - If the user switches off the TP for unassoc DA channels in range a Baseline is present that fills the time where the associated channels run TP. For that time interval we need an B0 epoch. - also add docu for that new epoch --- Packages/MIES/MIES_Epochs.ipf | 16 ++++-- Packages/doc/epoch_information.rst | 92 +++++++++++++++--------------- 2 files changed, 59 insertions(+), 49 deletions(-) diff --git a/Packages/MIES/MIES_Epochs.ipf b/Packages/MIES/MIES_Epochs.ipf index 68c91a6534..9fde73b696 100644 --- a/Packages/MIES/MIES_Epochs.ipf +++ b/Packages/MIES/MIES_Epochs.ipf @@ -25,6 +25,7 @@ static StrConstant SHORTNAMEKEY_SEP = "=" static StrConstant EPOCH_SN_BL_ONSETDELAYUSER = "B0_OD" static StrConstant EPOCH_SN_BL_DDAQ = "B0_DD" static StrConstant EPOCH_SN_BL_TERMINATIONDELAY = "B0_TD" +static StrConstant EPOCH_SN_BL_UNASSOC_NOTP_BASELINE = "B0_TP" static StrConstant EPOCH_SN_BL_DDAQOPT = "B0_DO" static StrConstant EPOCH_SN_BL_DDAQTRAIL = "B0_TR" static StrConstant EPOCH_SN_TP = "TP" @@ -63,7 +64,7 @@ End Function EP_CollectEpochInfo(string device, STRUCT DataConfigurationResult &s) variable i, channel, singleSetLength, epochOffset, epochBegin, epochEnd - variable stimsetCol, startOffset, stopCollectionPoint + variable stimsetCol, startOffset, stopCollectionPoint, isUnAssociated, testPulseLength string tags if(s.dataAcqOrTP != DATA_ACQUISITION_MODE) @@ -85,6 +86,7 @@ Function EP_CollectEpochInfo(string device, STRUCT DataConfigurationResult &s) singleSetLength = s.setLength[i] WAVE singleStimSet = s.stimSet[i] stimsetCol = s.setColumn[i] + isUnAssociated = IsNaN(s.headstageDAC[i]) // epoch for onsetDelayAuto is assumed to be a globalTPInsert which is added as epoch below if(s.onsetDelayUser) @@ -136,10 +138,16 @@ Function EP_CollectEpochInfo(string device, STRUCT DataConfigurationResult &s) EP_AddEpoch(device, channel, epochBegin * s.samplingInterval, stopCollectionPoint * s.samplingInterval, tags, EPOCH_SN_BL_DDAQTRAIL, 0) endif + testPulseLength = s.testPulseLength * s.samplingInterval if(s.globalTPInsert) - // space in ITCDataWave for the testpulse is allocated via an automatic increase - // of the onset delay - EP_AddEpochsFromTP(device, channel, s.baselinefrac, s.testPulseLength * s.samplingInterval, 0, s.DACAmp[i][%TPAMP]) + if(!(isUnAssociated && !s.doTPonUnassocDA)) + // space in ITCDataWave for the testpulse is allocated via an automatic increase + // of the onset delay + EP_AddEpochsFromTP(device, channel, s.baselinefrac, testPulseLength, 0, s.DACAmp[i][%TPAMP]) + else + tags = ReplaceStringByKey(EPOCH_TYPE_KEY, "", EPOCH_BASELINE_REGION_KEY, STIMSETKEYNAME_SEP, EPOCHNAME_SEP) + EP_AddEpoch(device, channel, 0, testPulseLength, tags, EPOCH_SN_BL_UNASSOC_NOTP_BASELINE, 0) + endif endif endfor End diff --git a/Packages/doc/epoch_information.rst b/Packages/doc/epoch_information.rst index 842c8197c1..0ba49edbdb 100644 --- a/Packages/doc/epoch_information.rst +++ b/Packages/doc/epoch_information.rst @@ -133,51 +133,53 @@ Naming The following table describes the 1:1 relationship between epoch names and MIES feature names: -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| Level | Level | Level | Level | Tags | Short Name | Origin | -+=======+=======+=======+=======+=====================================================+===============+==============================================================================+ -| 0 | | | | Type=Baseline | B0_OD | Onset Delay | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| 0 | | | | Type=Baseline | B0_DD | Onset delay of channel due to distributed DAQ [dDAQ] | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| 0 | | | | Type=Baseline | B0_DO | Onset delay of channel due to distributed DAQ optimized overlay [dDAQ OptOv] | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| 0 | | | | Type=Inserted Testpulse | TP | Inserted TP | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | 1 | | | Type=Inserted Testpulse;SubType=Baseline | TP_B0 | preceding baseline of inserted TP | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | 1 | | | Type=Inserted Testpulse;SubType=Pulse;Amplitude=x | TP_P | pulse time of inserted TP | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | 1 | | | Type=Inserted Testpulse;SubType=Baseline | TP_B1 | subsequent baseline of inserted TP | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| 0 | | | | Type=Stimset | ST | Stimset | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | 1 | | | Type=Epoch;Epoch=x;EpochType=x;Amplitude=x;Details=x| Ex | Stimset-Epoch (Details is optional) | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | | 2 | | +SubType=Baseline | Ex_PT_Px_BT | Stimset-Epoch baseline before first pulse (example pulse train) | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | | 2 | | +Pulse=x | Ex_PT_Px | Stimset-Epoch component (example pulse train) | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | | | 3 | +SubType=Pulse;Pulse=x | Ex_PT_Px_P | High region of pulse (example pulse train) | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | | | 3 | +SubType=Baseline;Pulse=x | Ex_PT_Px_B | Zero region of pulse (example pulse train) | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | | 2 | | +Cycle=x | Ex_TG_Cx | Trigonometric epoch, one epoch for each full sin/cos cycle | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | | | 3 | +Cycle=x;Half Cycle=x | Ex_TG_Cx_Hx | Two for each cycle, one negative and one positive | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | | 2 | | +Incomplete Cycle=x | Ex_TG_Ix | Everything else except full cycles | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | | 2 | | Type=oodDAQ;oodDAQRegion=x | ODx | oodDAQ region | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| | 1 | | | Type=Baseline | ST_B | trailing baseline due to different length stimsets | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| 0 | | | | Type=Baseline | B0_TR | trailing baseline from Distributed DAQ [OptOv] | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| 0 | | | | Type=Baseline | B0_TD | Termination Delay | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ -| 0 | | | | Type=Unacquired | UA | Planned to be acquired but skipped due to early sweep stop | -+-------+-------+-------+-------+-----------------------------------------------------+---------------+------------------------------------------------------------------------------+ ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| Level | Level | Level | Level | Tags | Short Name | Origin | ++=======+=======+=======+=======+=====================================================+===============+========================================================================================+ +| 0 | | | | Type=Baseline | B0_OD | Onset Delay | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| 0 | | | | Type=Baseline | B0_TP | Baseline on unassoc. DA if "TP on unassoc." is off and "Insert TP" for assoc. DA is on | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| 0 | | | | Type=Baseline | B0_DD | Onset delay of channel due to distributed DAQ [dDAQ] | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| 0 | | | | Type=Baseline | B0_DO | Onset delay of channel due to distributed DAQ optimized overlay [dDAQ OptOv] | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| 0 | | | | Type=Inserted Testpulse | TP | Inserted TP | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | 1 | | | Type=Inserted Testpulse;SubType=Baseline | TP_B0 | preceding baseline of inserted TP | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | 1 | | | Type=Inserted Testpulse;SubType=Pulse;Amplitude=x | TP_P | pulse time of inserted TP | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | 1 | | | Type=Inserted Testpulse;SubType=Baseline | TP_B1 | subsequent baseline of inserted TP | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| 0 | | | | Type=Stimset | ST | Stimset | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | 1 | | | Type=Epoch;Epoch=x;EpochType=x;Amplitude=x;Details=x| Ex | Stimset-Epoch (Details is optional) | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | | 2 | | +SubType=Baseline | Ex_PT_Px_BT | Stimset-Epoch baseline before first pulse (example pulse train) | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | | 2 | | +Pulse=x | Ex_PT_Px | Stimset-Epoch component (example pulse train) | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | | | 3 | +SubType=Pulse;Pulse=x | Ex_PT_Px_P | High region of pulse (example pulse train) | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | | | 3 | +SubType=Baseline;Pulse=x | Ex_PT_Px_B | Zero region of pulse (example pulse train) | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | | 2 | | +Cycle=x | Ex_TG_Cx | Trigonometric epoch, one epoch for each full sin/cos cycle | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | | | 3 | +Cycle=x;Half Cycle=x | Ex_TG_Cx_Hx | Two for each cycle, one negative and one positive | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | | 2 | | +Incomplete Cycle=x | Ex_TG_Ix | Everything else except full cycles | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | | 2 | | Type=oodDAQ;oodDAQRegion=x | ODx | oodDAQ region | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| | 1 | | | Type=Baseline | ST_B | trailing baseline due to different length stimsets | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| 0 | | | | Type=Baseline | B0_TR | trailing baseline from Distributed DAQ [OptOv] | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| 0 | | | | Type=Baseline | B0_TD | Termination Delay | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ +| 0 | | | | Type=Unacquired | UA | Planned to be acquired but skipped due to early sweep stop | ++-------+-------+-------+-------+-----------------------------------------------------+---------------+----------------------------------------------------------------------------------------+ If the name entry begins with ``+`` then it is appended to the higher-level name. The ``x`` is a place holder where additional information is included in the names, such as Stimset-Epoch numbering, or amplitudes. Currently only From 9ba175bbe225d8b744de7f40dc1ab6e998115ab9 Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Tue, 20 Jun 2023 16:39:52 +0200 Subject: [PATCH 7/8] Tests: Adapt TestEpochsGeneric to test all DA channels - before it tested only assoc. DA channels --- Packages/tests/HardwareBasic/UTF_Epochs.ipf | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Packages/tests/HardwareBasic/UTF_Epochs.ipf b/Packages/tests/HardwareBasic/UTF_Epochs.ipf index 16047c8384..928a5413ff 100644 --- a/Packages/tests/HardwareBasic/UTF_Epochs.ipf +++ b/Packages/tests/HardwareBasic/UTF_Epochs.ipf @@ -297,8 +297,8 @@ static Function TestEpochsGeneric(device) string device variable numEntries, endTimeDAC, endTimeEpochs, samplingInterval - variable i, lastPoint - string list, epochStr + variable i, lastPoint, index + string list, setNameLBEntry string sweeps, configs variable sweepNo @@ -356,17 +356,20 @@ static Function TestEpochsGeneric(device) lastPoint = DimSize(sweep, ROWS) endTimeDAC = samplingInterval * lastPoint - WAVE/T epochLBEntries = GetLastSetting(textualValues, sweepNo, EPOCHS_ENTRY_KEY, DATA_ACQUISITION_MODE) - WAVE/T setNameLBEntries = GetLastSetting(textualValues, sweepNo, STIM_WAVE_NAME_KEY, DATA_ACQUISITION_MODE) - for(i = 0; i < numEntries; i += 1) - epochStr = epochLBEntries[i] - if(WB_StimsetIsFromThirdParty(setNameLBEntries[i]) || !cmpstr(setNameLBEntries[i], STIMSET_TP_WHILE_DAQ)) - CHECK_EMPTY_STR(epochStr) + + WAVE/Z/T epochChannel = EP_FetchEpochs(numericalValues, textualValues, sweepNo, DACs[i], XOP_CHANNEL_TYPE_DAC) + + [WAVE setting, index] = GetLastSettingChannel(numericalValues, textualValues, sweepNo, STIM_WAVE_NAME_KEY, DACs[i], XOP_CHANNEL_TYPE_DAC, DATA_ACQUISITION_MODE) + CHECK_WAVE(setting, TEXT_WAVE) + WAVE/T settingText = setting + setNameLBEntry = settingText[index] + if(WB_StimsetIsFromThirdParty(setNameLBEntry) || !cmpstr(setNameLBEntry, STIMSET_TP_WHILE_DAQ)) + CHECK_WAVE(epochChannel, NULL_WAVE) continue endif + CHECK_WAVE(epochChannel, TEXT_WAVE) - WAVE/T epochChannel = EP_EpochStrToWave(epochStr) Make/FREE/D/N=(DimSize(epochChannel, ROWS)) endT // preserve epochs wave in CDF From ec5fad458e7d1bf1a8e3566291f419e673f49ea6 Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Thu, 22 Jun 2023 04:51:38 +0200 Subject: [PATCH 8/8] Tests: Add epoch test for unassoc DA channel without insert TP - checks if TP interval of assoc DA equals the B0_TP interval of unassoc DA with disabled TP --- Packages/tests/HardwareBasic/UTF_Epochs.ipf | 85 +++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/Packages/tests/HardwareBasic/UTF_Epochs.ipf b/Packages/tests/HardwareBasic/UTF_Epochs.ipf index 928a5413ff..11e4c3023a 100644 --- a/Packages/tests/HardwareBasic/UTF_Epochs.ipf +++ b/Packages/tests/HardwareBasic/UTF_Epochs.ipf @@ -866,3 +866,88 @@ static Function EP_EpochTest15_REENTRY([str]) TestEpochsGeneric(str) End + +static Function EP_EpochTestUnassocDA_PreAcq(string device) + + PGC_SetAndActivateControl(device, "Check_Settings_UnassocDADoTP", val = 0) +End + +// UTF_TD_GENERATOR DeviceNameGeneratorMD1 +static Function EP_EpochTestUnassocDA([str]) + string str + + STRUCT DAQSettings s + InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1" + \ + "__HS0_DA0_AD0_CM:VC:_ST:StimulusSetA_DA_0:" + \ + "__HS1_DA1_AD1_CM:VC:_ST:StimulusSetC_DA_0:" + \ + "__HS2_DA2_AD2_CM:VC:_ST:StimulusSetA_DA_0:_ASO0" + \ + "__TTL1_ST:StimulusSetA_TTL_0:" + \ + "__TTL3_ST:StimulusSetB_TTL_0:" + \ + "__TTL5_ST:StimulusSetA_TTL_0:" + \ + "__TTL7_ST:StimulusSetB_TTL_0:") + + AcquireData_NG(s, str) +End + +static Function EP_EpochTestUnassocDA_REENTRY([str]) + string str + + variable cbState + + WAVE/T textualValues = GetLBTextualValues(str) + WAVE numericalValues = GetLBNumericalValues(str) + WAVE/T epochChannel0 = EP_FetchEpochs(numericalValues, textualValues, 0, 0, XOP_CHANNEL_TYPE_DAC) + WAVE/T epochChannel2 = EP_FetchEpochs(numericalValues, textualValues, 0, 2, XOP_CHANNEL_TYPE_DAC) + Make/FREE/T/N=(DimSize(epochChannel0, ROWS)) epochNames0 = EP_GetShortName(epochChannel0[p][%Tags]) + Make/FREE/T/N=(DimSize(epochChannel2, ROWS)) epochNames2 = EP_GetShortName(epochChannel2[p][%Tags]) + WAVE tpIndex = FindIndizes(epochNames0, str="TP") + CHECK_EQUAL_VAR(DimSize(tpIndex, ROWS), 1) + WAVE tpBaseIndex = FindIndizes(epochNames2, str="B0_TP") + CHECK_EQUAL_VAR(DimSize(tpBaseIndex, ROWS), 1) + WAVE/Z tpMissing = FindIndizes(epochNames2, str="TP*", prop = PROP_WILDCARD) + CHECK_WAVE(tpMissing, NULL_WAVE) + + CHECK_EQUAL_STR(epochChannel0[tpIndex[0]][%StartTime], epochChannel2[tpBaseIndex[0]][%StartTime]) + CHECK_EQUAL_STR(epochChannel0[tpIndex[0]][%EndTime], epochChannel2[tpBaseIndex[0]][%EndTime]) + + cbState = GetLastSettingIndep(numericalValues, 0, TPONUNASSOCDA_ENTRY_KEY, DATA_ACQUISITION_MODE, defValue = NaN) + CHECK_EQUAL_VAR(cbState, 0) + + TestEpochsGeneric(str) +End + +// UTF_TD_GENERATOR DeviceNameGeneratorMD1 +static Function EP_EpochTestUnassocDADefault([str]) + string str + + STRUCT DAQSettings s + InitDAQSettingsFromString(s, "MD1_RA0_I0_L0_BKG1" + \ + "__HS0_DA0_AD0_CM:VC:_ST:StimulusSetA_DA_0:" + \ + "__HS1_DA1_AD1_CM:VC:_ST:StimulusSetC_DA_0:" + \ + "__HS2_DA2_AD2_CM:VC:_ST:StimulusSetA_DA_0:_ASO0" + \ + "__TTL1_ST:StimulusSetA_TTL_0:" + \ + "__TTL3_ST:StimulusSetB_TTL_0:" + \ + "__TTL5_ST:StimulusSetA_TTL_0:" + \ + "__TTL7_ST:StimulusSetB_TTL_0:") + + AcquireData_NG(s, str) +End + +static Function EP_EpochTestUnassocDADefault_REENTRY([str]) + string str + + variable cbState + + WAVE/T textualValues = GetLBTextualValues(str) + WAVE numericalValues = GetLBNumericalValues(str) + WAVE/T epochChannel2 = EP_FetchEpochs(numericalValues, textualValues, 0, 2, XOP_CHANNEL_TYPE_DAC) + Make/FREE/T/N=(DimSize(epochChannel2, ROWS)) epochNames2 = EP_GetShortName(epochChannel2[p][%Tags]) + WAVE tpExisting = FindIndizes(epochNames2, str="TP") + CHECK_EQUAL_VAR(DimSize(tpExisting, ROWS), 1) + + WAVE numericalValues = GetLBNumericalValues(str) + cbState = GetLastSettingIndep(numericalValues, 0, TPONUNASSOCDA_ENTRY_KEY, DATA_ACQUISITION_MODE, defValue = NaN) + CHECK_EQUAL_VAR(cbState, 1) + + TestEpochsGeneric(str) +End