Skip to content
5 changes: 3 additions & 2 deletions Packages/MIES/MIES_Constants.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
/// @}

Expand Down Expand Up @@ -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"

Expand Down
3 changes: 3 additions & 0 deletions Packages/MIES/MIES_DAEphys.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -3620,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
Expand Down
16 changes: 13 additions & 3 deletions Packages/MIES/MIES_DAEphys_Macro.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -3694,7 +3694,7 @@ Window DA_Ephys() : Panel
Button button_DataAcq_OpenCommentNB,userdata(ResizeControlsInfo)=A"!!,I3!!#DR^]6\\4!!#<Pz!!#](Aon\"Qzzzzzzzzzzzzzz!!#](Aon\"Qzz"
Button button_DataAcq_OpenCommentNB,userdata(ResizeControlsInfo)+=A"zzzzzzzzzzzz!!#u:Du]k<zzzzzzzzzzz"
Button button_DataAcq_OpenCommentNB,userdata(ResizeControlsInfo)+=A"zzz!!#u:Du]k<zzzzzzzzzzzzzz!!!"
CheckBox check_Settings_TPAfterDAQ,pos={168.00,108.00},size={130.00,15.00},disable=1,proc=DAP_CheckProc_UpdateGuiState
CheckBox check_Settings_TPAfterDAQ,pos={160.00,108.00},size={130.00,15.00},disable=1,proc=DAP_CheckProc_UpdateGuiState
CheckBox check_Settings_TPAfterDAQ,title="Activate TP after DAQ"
CheckBox check_Settings_TPAfterDAQ,help={"Immediately start a test pulse after DAQ finishes"}
CheckBox check_Settings_TPAfterDAQ,userdata(tabnum)="5"
Expand Down Expand Up @@ -4331,6 +4331,16 @@ Window DA_Ephys() : Panel
CheckBox Radio_ClampMode_AllIClamp,userdata(Config_RestorePriority)="29"
CheckBox Radio_ClampMode_AllIClamp,userdata(Config_NiceName)="Headstage_All_IC"
CheckBox Radio_ClampMode_AllIClamp,value=0,mode=1
CheckBox Check_Settings_UnassocDADoTP,pos={192.00,84.00},size={95.00,15.00},disable=1,proc=DAP_CheckProc_UpdateGuiState
CheckBox Check_Settings_UnassocDADoTP,title="TP on unassoc."
CheckBox Check_Settings_UnassocDADoTP,help={"Insert test pulse on unassociated DA channels"}
CheckBox Check_Settings_UnassocDADoTP,userdata(tabnum)="5"
CheckBox Check_Settings_UnassocDADoTP,userdata(tabcontrol)="ADC"
CheckBox Check_Settings_UnassocDADoTP,userdata(ResizeControlsInfo)=A"!!,G<!!#?c!!#?-!!#<(z!!#](Aon\"Qzzzzzzzzzzzzzz!!#](Aon\"Qzz"
CheckBox Check_Settings_UnassocDADoTP,userdata(ResizeControlsInfo)+=A"zzzzzzzzzzzz!!#u:Duafnzzzzzzzzzzz"
CheckBox Check_Settings_UnassocDADoTP,userdata(ResizeControlsInfo)+=A"zzz!!#u:Duafnzzzzzzzzzzzzzz!!!"
CheckBox Check_Settings_UnassocDADoTP,userdata(Config_RestorePriority)="60"
CheckBox Check_Settings_UnassocDADoTP,value=1
DefineGuide UGV0={FR,-25},UGH0={FB,-27},UGV1={FL,481}
SetWindow kwTopWin,hook(cleanup)=DAP_WindowHook
SetWindow kwTopWin,hook(windowCoordinateSaving)=StoreWindowCoordinatesHook
Expand Down
9 changes: 6 additions & 3 deletions Packages/MIES/MIES_DataConfigurator.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -1190,7 +1191,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)

Expand Down Expand Up @@ -1236,6 +1237,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:
Expand All @@ -1245,7 +1247,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] = \
Expand All @@ -1269,7 +1271,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] = \
Expand Down Expand Up @@ -1304,6 +1306,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
Expand Down
16 changes: 12 additions & 4 deletions Packages/MIES/MIES_Epochs.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Packages/MIES/MIES_Structures.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ Structure DataConfigurationResult
variable distributedDAQOptPost
variable multiDevice
variable powerSpectrum
variable doTPonUnassocDA
WAVE statusHS
/// @}

Expand Down
11 changes: 8 additions & 3 deletions Packages/MIES/MIES_WaveDataFolderGetters.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand All @@ -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 = ""
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion Packages/MIES/labnotebook_numerical_description.itx
Original file line number Diff line number Diff line change
@@ -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" ""
Expand Down Expand Up @@ -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;"
Loading