Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Packages/MIES/MIES_AmplifierInteraction.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ static Function AI_UpdateAmpModel(string device, variable headStage, [string ctr
AI_UpdateAmpModel(device, i, ctrl = "setvar_DataAcq_RsCorr", value = AmpStorageWave[%$rowLabel][0][i], selectAmp = 0)
break
case MCC_NO_AUTOBIAS_V_FUNC: // fallthrough
ASSERT(value > -100 && value < 100, "Out of range: value = " + num2str(value) + " mV, expected (-100, 100) mV")
case MCC_NO_AUTOBIAS_VRANGE_FUNC: // fallthrough
case MCC_NO_AUTOBIAS_IBIASMAX_FUNC: // fallthrough
case MCC_NO_AUTOBIAS_ENABLE_FUNC:
Expand Down Expand Up @@ -1213,7 +1214,7 @@ Function AI_IsControlFromClampMode(string ctrl, variable clampMode)
End

/// @brief Convert amplifier controls to row labels for `AmpStorageWave`
static Function/S AI_AmpStorageControlToRowLabel(string ctrl)
Function/S AI_AmpStorageControlToRowLabel(string ctrl)

strswitch(ctrl)
// V-Clamp controls
Expand Down
27 changes: 18 additions & 9 deletions Packages/MIES/MIES_DAEphys.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -3321,15 +3321,7 @@ Function DAP_CheckProc_ClampMode(STRUCT WMCheckboxAction &cba) : CheckBoxControl
device = cba.win
control = cba.ctrlName
DAP_GetInfoFromControl(device, control, mode, headStage)

NVAR dataAcqRunMode = $GetDataAcqRunMode(device)
if(dataAcqRunMode == DAQ_NOT_RUNNING)
DAP_ChangeHeadStageMode(device, mode, headstage, DO_MCC_MIES_SYNCING)
else
WAVE GuiState = GetDA_EphysGuiStateNum(device)
GuiState[headstage][%HSmode_delayed] = mode
DAP_SetAmpModeControls(device, headstage, mode, delayed = 1)
endif
DAP_SetClampMode(device, headstage, mode)
catch
ClearRTError()
SetCheckBoxState(device, control, !cba.checked)
Expand Down Expand Up @@ -5901,3 +5893,20 @@ Function/S DAP_GetEmptyDeviceList()

return AddListItem(NONE, "", ";", Inf)
End

/// @brief Sets a new clamp mode
///
/// @param[in] device Device title, e.g. "Dev1"
/// @param[in] headstage headstage number
/// @param[in] mode clamp mode @ref AmplifierClampModes
Function DAP_SetClampMode(string device, variable headstage, variable mode)

NVAR dataAcqRunMode = $GetDataAcqRunMode(device)
if(dataAcqRunMode == DAQ_NOT_RUNNING)
DAP_ChangeHeadStageMode(device, mode, headstage, DO_MCC_MIES_SYNCING)
Comment on lines +5902 to +5906
else
WAVE GuiState = GetDA_EphysGuiStateNum(device)
GuiState[headstage][%HSmode_delayed] = mode
DAP_SetAmpModeControls(device, headstage, mode, delayed = 1)
endif
Comment thread
MichaelHuth marked this conversation as resolved.
End
Loading