Skip to content

Commit

Permalink
Util: Add two conversion function for DA/AD unit string return
Browse files Browse the repository at this point in the history
Added GetADChannelUnit, GetDAChannelUnit that return the unit string
depending on clamp mode.

Adapted GetChanAmpAssignUnit to use the new functions.
  • Loading branch information
MichaelHuth committed Sep 3, 2024
1 parent 177bfaa commit 92ad402
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 12 additions & 0 deletions Packages/MIES/MIES_MiesUtilities_Conversion.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,15 @@ Function MapAnaFuncToConstant(anaFunc)
#endif
endswitch
End

/// @brief returns the unit string for the AD channel depending on clampmode
threadsafe Function/S GetADChannelUnit(variable clampMode)

return SelectString(clampMode == V_CLAMP_MODE, "mV", "pA")
End

/// @brief returns the unit string for the DA channel depending on clampmode
threadsafe Function/S GetDAChannelUnit(variable clampMode)

return SelectString(clampMode == V_CLAMP_MODE, "pA", "mV")
End
8 changes: 4 additions & 4 deletions Packages/MIES/MIES_WaveDataFolderGetters.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ Function/WAVE GetChanAmpAssignUnit(device)
Make/T/N=(4, NUM_HEADSTAGES) dfr:ChanAmpAssignUnit/WAVE=wv
wv = ""

wv[0][] = "mV"
wv[1][] = "pA"
wv[2][] = "pA"
wv[3][] = "mV"
wv[0][] = GetDAChannelUnit(V_CLAMP_MODE)
wv[1][] = GetADChannelUnit(V_CLAMP_MODE)
wv[2][] = GetDAChannelUnit(I_CLAMP_MODE)
wv[3][] = GetADChannelUnit(I_CLAMP_MODE)
endif

SetDimLabel ROWS, 0, VC_DAUnit, wv
Expand Down

0 comments on commit 92ad402

Please sign in to comment.