Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Garados007 committed Nov 14, 2024
1 parent e9960db commit 592870c
Show file tree
Hide file tree
Showing 185 changed files with 2,903 additions and 4,275 deletions.
4 changes: 2 additions & 2 deletions Packages/Conversion/MIES_MassExperimentProcessing.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ End

static StrConstant kPackageName = "MIES PXP to NWBv2"
static StrConstant kPreferencesFileName = "ProcessPrefsMIESNWBv2.bin"
static Constant kPrefsRecordID = 0 // The recordID is a unique number identifying a record within the preference file.
static Constant kPrefsRecordID = 0 // The recordID is a unique number identifying a record within the preference file.

static Structure MultiExperimentProcessPrefs
uint32 version // Prefs version
Expand Down Expand Up @@ -314,7 +314,7 @@ Function StartMultiExperimentProcessWrapper()
// 64: Ignore + and - in the alphanumeric sort so that "Text-09" sorts before "Text-10". Set options to 80 or 81.
files = SortList(files, FILE_LIST_SEP, 80)

WAVE/T/Z inputPXPs = ListToTextWave(files, FILE_LIST_SEP)
WAVE/Z/T inputPXPs = ListToTextWave(files, FILE_LIST_SEP)

jsonID = JSON_New()
JSON_AddWave(jsonID, "/inputFiles", inputPXPs)
Expand Down
2 changes: 2 additions & 0 deletions Packages/MIES/MIES_AcquisitionStateHandling.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/// @brief Get the acquisition state as string
Function/S AS_StateToString(variable acqState)

switch(acqState)
case AS_INACTIVE:
return "AS_INACTIVE"
Expand Down Expand Up @@ -201,6 +202,7 @@ End
///
/// Requires that they were recorded with AS_RecordStateTransition().
Function/WAVE AS_GenerateEncounteredTransitions()

variable numEntries, i, j

WAVE acqStateTracking = GetAcqStateTracking()
Expand Down
114 changes: 29 additions & 85 deletions Packages/MIES/MIES_AmplifierInteraction.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static Constant ZERO_TOLERANCE = 100 // pA

static StrConstant AMPLIFIER_CONTROLS_VC = "setvar_DataAcq_Hold_VC;check_DataAcq_Amp_Chain;check_DatAcq_HoldEnableVC;setvar_DataAcq_WCC;setvar_DataAcq_WCR;check_DatAcq_WholeCellEnable;setvar_DataAcq_RsCorr;setvar_DataAcq_RsPred;check_DataAcq_Amp_Chain;check_DatAcq_RsCompEnable;setvar_DataAcq_PipetteOffset_VC;button_DataAcq_FastComp_VC;button_DataAcq_SlowComp_VC;button_DataAcq_AutoPipOffset_VC"
static StrConstant AMPLIFIER_CONTROLS_IC = "setvar_DataAcq_Hold_IC;check_DatAcq_HoldEnable;setvar_DataAcq_BB;check_DatAcq_BBEnable;setvar_DataAcq_CN;check_DatAcq_CNEnable;setvar_DataAcq_AutoBiasV;setvar_DataAcq_AutoBiasVrange;setvar_DataAcq_IbiasMax;check_DataAcq_AutoBias;setvar_DataAcq_PipetteOffset_IC;button_DataAcq_AutoBridgeBal_IC"
static Constant MAX_PIPETTEOFFSET = 150 // mV
static Constant MAX_PIPETTEOFFSET = 150 // mV
static Constant MIN_PIPETTEOFFSET = -150

static Constant NUM_TRIES_AXON_TELEGRAPH = 10
Expand Down Expand Up @@ -124,8 +124,7 @@ End
///
/// @param clampMode clamp mode (pass `NaN` for doesn't matter)
/// @param func MCC function, one of @ref AI_SendToAmpConstants
Function AI_GetMCCScale(clampMode, func)
variable clampMode, func
Function AI_GetMCCScale(variable clampMode, variable func)

if(IsFinite(clampMode))
AI_AssertOnInvalidClampMode(clampMode)
Expand Down Expand Up @@ -203,10 +202,7 @@ End
/// before use, some callers might save time in doing that once themselves.
///
/// @return 0 on success, 1 otherwise
Function AI_UpdateAmpModel(device, ctrl, headStage, [value, sendToAll, checkBeforeWrite, selectAmp])
string device
string ctrl
variable headStage, value, sendToAll, checkBeforeWrite, selectAmp
Function AI_UpdateAmpModel(string device, string ctrl, variable headStage, [variable value, variable sendToAll, variable checkBeforeWrite, variable selectAmp])

variable i, diff, selectedHeadstage, clampMode, oppositeMode, oldTab
variable runMode = TEST_PULSE_NOT_RUNNING
Expand Down Expand Up @@ -479,17 +475,13 @@ End
/// @brief Convenience wrapper for #AI_UpdateAmpView
///
/// Disallows setting single controls for outside callers as #AI_UpdateAmpModel should be used for that.
Function AI_SyncAmpStorageToGUI(device, headstage)
string device
variable headstage
Function AI_SyncAmpStorageToGUI(string device, variable headstage)

return AI_UpdateAmpView(device, headstage)
End

/// @brief Sync the settings from the GUI to the amp storage wave and the MCC application
Function AI_SyncGUIToAmpStorageAndMCCApp(device, headStage, clampMode)
string device
variable headStage, clampMode
Function AI_SyncGUIToAmpStorageAndMCCApp(string device, variable headStage, variable clampMode)

string ctrl, list
variable i, numEntries
Expand Down Expand Up @@ -656,9 +648,7 @@ static Function/S AI_AmpStorageControlToRowLabel(ctrl)
break
endswitch
End
Function AI_SetMIESHeadstage(device, [headstage, increment])
string device
variable headstage, increment
Function AI_SetMIESHeadstage(string device, [variable headstage, variable increment])

if(ParamIsDefault(headstage) && ParamIsDefault(increment))
return NaN
Expand All @@ -677,9 +667,7 @@ End
///
/// @param device device
/// @param headStage [optional: defaults to all active headstages]
Function AI_ZeroAmps(device, [headStage])
string device
variable headstage
Function AI_ZeroAmps(string device, [variable headStage])

variable i
// Ensure that data in BaselineSSAvg is up to date by verifying that TP is active
Expand Down Expand Up @@ -732,11 +720,7 @@ End
/// @brief Query the MCC application for the gains and units of the given clamp mode
///
/// Assumes that the correct amplifier is already selected!
Function AI_QueryGainsUnitsForClampMode(device, headstage, clampMode, DAGain, ADGain, DAUnit, ADUnit)
string device
variable headstage, clampMode
variable &DAGain, &ADGain
string &DAUnit, &ADUnit
Function AI_QueryGainsUnitsForClampMode(string device, variable headstage, variable clampMode, variable &DAGain, variable &ADGain, string &DAUnit, string &ADUnit)

DAGain = NaN
ADGain = NaN
Expand All @@ -758,10 +742,7 @@ End

/// @brief Update the `ChanAmpAssign` and `ChanAmpAssignUnit` waves according to the passed
/// clamp mode with the gains and units.
Function AI_UpdateChanAmpAssign(device, headStage, clampMode, DAGain, ADGain, DAUnit, ADUnit)
string device
variable headStage, clampMode, DAGain, ADGain
string DAUnit, ADUnit
Function AI_UpdateChanAmpAssign(string device, variable headStage, variable clampMode, variable DAGain, variable ADGain, string DAUnit, string ADUnit)

AI_AssertOnInvalidClampMode(clampMode)

Expand All @@ -787,15 +768,13 @@ Function AI_UpdateChanAmpAssign(device, headStage, clampMode, DAGain, ADGain, DA
End

/// @brief Assert on invalid clamp modes, does nothing otherwise
Function AI_AssertOnInvalidClampMode(clampMode)
variable clampMode
Function AI_AssertOnInvalidClampMode(variable clampMode)

ASSERT(AI_IsValidClampMode(clampMode), "invalid clamp mode")
End

/// @brief Return true if the given clamp mode is valid
Function AI_IsValidClampMode(clampMode)
variable clampMode
Function AI_IsValidClampMode(variable clampMode)

return clampMode == V_CLAMP_MODE || clampMode == I_CLAMP_MODE || clampMode == I_EQUAL_ZERO_MODE
End
Expand All @@ -808,9 +787,7 @@ End
/// For each unique serial number one MCC is opened.
/// @param ampTitleList [optional, defaults to blank] MCC gui window title
/// @return 1 if all unique MCCs specified in ampSerialNumList were opened, 0 if one or more MCCs specified in ampSerialNumList were not able to be opened
Function AI_OpenMCCs(ampSerialNumList, [ampTitleList])
string ampSerialNumList
string ampTitleList
Function AI_OpenMCCs(string ampSerialNumList, [string ampTitleList])

string cmd, serialStr, title
variable i, j, numDups, serialNum, failedToOpenCount
Expand Down Expand Up @@ -919,9 +896,7 @@ End
#ifdef AMPLIFIER_XOPS_PRESENT

///@brief Returns the holding command of the amplifier
Function AI_GetHoldingCommand(device, headstage)
string device
variable headstage
Function AI_GetHoldingCommand(string device, variable headstage)

if(AI_SelectMultiClamp(device, headstage) != AMPLIFIER_CONNECTION_SUCCESS)
return NaN
Expand All @@ -937,9 +912,7 @@ End
/// DAP_ChangeHeadStageMode() if possible.
///
/// @brief One of @ref AmplifierClampModes or NaN if no amplifier is connected
Function AI_GetMode(device, headstage)
string device
variable headstage
Function AI_GetMode(string device, variable headstage)

if(AI_SelectMultiClamp(device, headstage) != AMPLIFIER_CONNECTION_SUCCESS)
return NaN
Expand Down Expand Up @@ -1017,9 +990,7 @@ End
/// @param headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES]
///
/// @returns one of @ref AISelectMultiClampReturnValues
Function AI_SelectMultiClamp(device, headStage)
string device
variable headStage
Function AI_SelectMultiClamp(string device, variable headStage)

variable channel, axonSerial, err
string mccSerial
Expand All @@ -1044,10 +1015,7 @@ Function AI_SelectMultiClamp(device, headStage)
End

/// @brief Set the clamp mode of user linked MCC based on the headstage number
Function AI_SetClampMode(device, headStage, mode, [zeroStep])
string device
variable headStage
variable mode, zeroStep
Function AI_SetClampMode(string device, variable headStage, variable mode, [variable zeroStep])

if(ParamIsDefault(zeroStep))
zeroStep = 0
Expand Down Expand Up @@ -1088,10 +1056,7 @@ End
/// before use, some callers might save time in doing that once themselves.
///
/// @returns return value (for getters, respects `usePrefixes`), success (`0`) or error (`NaN`).
Function AI_SendToAmp(device, headStage, mode, func, value, [checkBeforeWrite, usePrefixes, selectAmp])
string device
variable headStage, mode, func, value
variable checkBeforeWrite, usePrefixes, selectAmp
Function AI_SendToAmp(string device, variable headStage, variable mode, variable func, variable value, [variable checkBeforeWrite, variable usePrefixes, variable selectAmp])

variable ret, headstageMode, scale
string str
Expand Down Expand Up @@ -1450,9 +1415,7 @@ End
/// before using, some callers might be able to skip it.
///
/// @return 0 on success, 1 when the headstage does not have an amplifier connected or it could not be selected
Function AI_EnsureCorrectMode(device, headStage, [selectAmp])
string device
variable headStage, selectAmp
Function AI_EnsureCorrectMode(string device, variable headStage, [variable selectAmp])

variable serial, channel, storedMode, setMode, ampConnectionState

Expand Down Expand Up @@ -1493,9 +1456,7 @@ End
///
/// @param device device
/// @param sweepNo data wave sweep number
Function AI_FillAndSendAmpliferSettings(device, sweepNo)
string device
variable sweepNo
Function AI_FillAndSendAmpliferSettings(string device, variable sweepNo)

variable i, axonSerial, channel, ampConnState, clampMode
string mccSerial
Expand Down Expand Up @@ -1608,8 +1569,7 @@ End
/// The data is inserted into `ChanAmpAssign` and `ChanAmpAssignUnit`
///
/// @return number of connected amplifiers
Function AI_QueryGainsFromMCC(device)
string device
Function AI_QueryGainsFromMCC(string device)

variable clampMode, old_ClampMode, i, numConnAmplifiers, clampModeSwitchAllowed
variable DAGain, ADGain
Expand Down Expand Up @@ -1661,6 +1621,7 @@ End

/// @brief Create the amplifier connection waves
Function AI_FindConnectedAmps()

string list

IH_RemoveAmplifierConnWaves()
Expand Down Expand Up @@ -1718,16 +1679,12 @@ End

#else // AMPLIFIER_XOPS_PRESENT

Function AI_GetHoldingCommand(device, headstage)
string device
variable headstage
Function AI_GetHoldingCommand(string device, variable headstage)

DEBUGPRINT("Unimplemented")
End

Function AI_GetMode(device, headstage)
string device
variable headstage
Function AI_GetMode(string device, variable headstage)

DEBUGPRINT("Unimplemented")
End
Expand All @@ -1748,45 +1705,32 @@ static Function AI_SwitchAxonAmpMode()
DEBUGPRINT("Unimplemented")
End

Function AI_SelectMultiClamp(device, headStage)
string device
variable headStage
Function AI_SelectMultiClamp(string device, variable headStage)

DEBUGPRINT("Unimplemented")
End

Function AI_SetClampMode(device, headStage, mode, [zeroStep])
string device
variable headStage
variable mode, zeroStep
Function AI_SetClampMode(string device, variable headStage, variable mode, [variable zeroStep])

DEBUGPRINT("Unimplemented")
End

Function AI_SendToAmp(device, headStage, mode, func, value, [checkBeforeWrite, usePrefixes, selectAmp])
string device
variable headStage, mode, func, value
variable checkBeforeWrite, usePrefixes, selectAmp
Function AI_SendToAmp(string device, variable headStage, variable mode, variable func, variable value, [variable checkBeforeWrite, variable usePrefixes, variable selectAmp])

DEBUGPRINT("Unimplemented")
End

Function AI_EnsureCorrectMode(device, headStage, [selectAmp])
string device
variable headStage, selectAmp
Function AI_EnsureCorrectMode(string device, variable headStage, [variable selectAmp])

DEBUGPRINT("Unimplemented")
End

Function AI_FillAndSendAmpliferSettings(device, sweepNo)
string device
variable sweepNo
Function AI_FillAndSendAmpliferSettings(string device, variable sweepNo)

DEBUGPRINT("Unimplemented")
End

Function AI_QueryGainsFromMCC(device)
string device
Function AI_QueryGainsFromMCC(string device)

DEBUGPRINT("Unimplemented")
End
Expand Down
Loading

0 comments on commit 592870c

Please sign in to comment.