Skip to content

Commit

Permalink
fixup! Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
t-b committed Nov 15, 2024
1 parent 1800135 commit c562289
Show file tree
Hide file tree
Showing 72 changed files with 614 additions and 1,220 deletions.
29 changes: 9 additions & 20 deletions Packages/Conversion/MIES_MassExperimentProcessing.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ EndStructure
static Constant kPrefsVersionNumber = 102

// Loads preferences into our structure.
static Function LoadPackagePrefs(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function LoadPackagePrefs(STRUCT MultiExperimentProcessPrefs &prefs)

variable currentPrefsVersion = kPrefsVersionNumber

Expand All @@ -79,14 +78,12 @@ static Function LoadPackagePrefs(prefs)
End

// Saves our structure to preferences.
static Function SavePackagePrefs(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function SavePackagePrefs(STRUCT MultiExperimentProcessPrefs &prefs)

SavePackagePreferences kPackageName, kPreferencesFileName, kPrefsRecordID, prefs
End

static Function ProcessCurrentExperiment(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function ProcessCurrentExperiment(STRUCT MultiExperimentProcessPrefs &prefs)

variable jsonID, index
string outputFilePath, inputFile, outputFolder
Expand Down Expand Up @@ -133,8 +130,7 @@ static Function ProcessCurrentExperiment(prefs)
StoreJSON(prefs, jsonID)
End

static Function PerformMiesTasks(outputFilePath)
string outputFilePath
static Function PerformMiesTasks(string outputFilePath)

string folder, message
variable nwbVersion, error
Expand Down Expand Up @@ -164,8 +160,7 @@ static Function IsAppropriateExperiment()
End

// Returns full path to the next experiment file to be loaded or "" if we are finished.
static Function/S FindNextExperiment(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function/S FindNextExperiment(STRUCT MultiExperimentProcessPrefs &prefs)

variable jsonID, index

Expand All @@ -183,8 +178,7 @@ static Function/S FindNextExperiment(prefs)
End

// Caller needs to release json
static Function GetJSON(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function GetJSON(STRUCT MultiExperimentProcessPrefs &prefs)

string data, fname

Expand All @@ -194,9 +188,7 @@ static Function GetJSON(prefs)
End

// json will be released
static Function StoreJSON(prefs, jsonID)
STRUCT MultiExperimentProcessPrefs &prefs
variable jsonID
static Function StoreJSON(STRUCT MultiExperimentProcessPrefs &prefs, variable jsonID)

string data = JSON_Dump(jsonID, indent = 2)

Expand All @@ -208,8 +200,7 @@ End
// Posts commands to Igor's operation queue to close the current experiment and open the next one.
// Igor executes operation queue commands when it is idling - that is, when it is not running a
// function or operation.
static Function PostLoadNextExperiment(nextExperimentFullPath)
string nextExperimentFullPath
static Function PostLoadNextExperiment(string nextExperimentFullPath)

ASSERT(FileExists(nextExperimentFullPath), "Experiment must exist")

Expand All @@ -225,9 +216,7 @@ End

// This is the hook function that Igor calls whenever a file is opened. We use it to
// detect the opening of an experiment and to call our ProcessCurrentExperiment function.
static Function AfterFileOpenHook(refNum, file, pathName, type, creator, kind)
variable refNum, kind
string file, pathName, type, creator
static Function AfterFileOpenHook(variable refNum, string file, string pathName, string type, string creator, variable kind)

STRUCT MultiExperimentProcessPrefs prefs

Expand Down
43 changes: 11 additions & 32 deletions Packages/MIES/MIES_AmplifierInteraction.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ static Constant NUM_TRIES_AXON_TELEGRAPH = 10
#define AMPLIFIER_XOPS_PRESENT
#endif

static Function AI_InitAxonTelegraphStruct(tds)
STRUCT AxonTelegraph_DataStruct &tds
static Function AI_InitAxonTelegraphStruct(STRUCT AxonTelegraph_DataStruct &tds)

tds.version = 13
End
Expand Down Expand Up @@ -58,19 +57,15 @@ static Structure AxonTelegraph_DataStruct
EndStructure

/// @brief Returns the serial number of the headstage compatible with Axon* functions, @see GetChanAmpAssign
static Function AI_GetAmpAxonSerial(device, headStage)
string device
variable headStage
static Function AI_GetAmpAxonSerial(string device, variable headStage)

WAVE ChanAmpAssign = GetChanAmpAssign(device)

return ChanAmpAssign[%AmpSerialNo][headStage]
End

/// @brief Returns the serial number of the headstage compatible with MCC* functions, @see GetChanAmpAssign
static Function/S AI_GetAmpMCCSerial(device, headStage)
string device
variable headStage
static Function/S AI_GetAmpMCCSerial(string device, variable headStage)

variable axonSerial
string mccSerial
Expand All @@ -86,19 +81,14 @@ static Function/S AI_GetAmpMCCSerial(device, headStage)
End

///@brief Return the channel of the currently selected head stage
static Function AI_GetAmpChannel(device, headStage)
string device
variable headStage
static Function AI_GetAmpChannel(string device, variable headStage)

WAVE ChanAmpAssign = GetChanAmpAssign(device)

return ChanAmpAssign[%AmpChannelID][headStage]
End

static Function AI_IsValidSerialAndChannel([mccSerial, axonSerial, channel])
string mccSerial
variable axonSerial
variable channel
static Function AI_IsValidSerialAndChannel([string mccSerial, variable axonSerial, variable channel])

if(!ParamIsDefault(mccSerial))
if(isEmpty(mccSerial))
Expand Down Expand Up @@ -520,10 +510,7 @@ End
/// @param device device
/// @param headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES]
/// @param ctrl [optional, defaults to all controls] name of the control being updated
static Function AI_UpdateAmpView(device, headStage, [ctrl])
string device
variable headStage
string ctrl
static Function AI_UpdateAmpView(string device, variable headStage, [string ctrl])

string lbl, list
variable i, numEntries, value
Expand Down Expand Up @@ -567,8 +554,7 @@ static Function AI_UpdateAmpView(device, headStage, [ctrl])
End

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

strswitch(ctrl)
// V-Clamp controls
Expand Down Expand Up @@ -693,9 +679,7 @@ End
///
/// @param device device
/// @param headStage MIES headstage number, must be in the range [0, NUM_HEADSTAGES]
static Function AI_MIESAutoPipetteOffset(device, headStage)
string device
variable headStage
static Function AI_MIESAutoPipetteOffset(string device, variable headStage)

variable clampMode, vDelta, offset, value

Expand Down Expand Up @@ -860,6 +844,7 @@ End
///
/// @return a 1D FREE wave containing amplifier serial numbers without leading zeroes
static Function/WAVE AI_GetMCCSerialNumbers()

AI_FindConnectedAmps()
WAVE W_TelegraphServers = GetAmplifierTelegraphServers()
Duplicate/FREE/R=[][FindDimLabel(W_TelegraphServers, COLS, "SerialNum")] W_TelegraphServers, OpenMCCList
Expand Down Expand Up @@ -944,10 +929,7 @@ End
/// @param clampMode clamp mode
/// @param[out] ADGain ADC gain
/// @param[out] DAGain DAC gain
static Function AI_RetrieveGains(device, headstage, clampMode, ADGain, DAGain)
string device
variable headstage, clampMode
variable &ADGain, &DAGain
static Function AI_RetrieveGains(string device, variable headstage, variable clampMode, variable &ADGain, variable &DAGain)

variable axonSerial = AI_GetAmpAxonSerial(device, headstage)
variable channel = AI_GetAmpChannel(device, headStage)
Expand Down Expand Up @@ -1689,10 +1671,7 @@ Function AI_GetMode(string device, variable headstage)
DEBUGPRINT("Unimplemented")
End

static Function AI_RetrieveGains(device, headstage, clampMode, ADGain, DAGain)
string device
variable headstage, clampMode
variable &ADGain, &DAGain
static Function AI_RetrieveGains(string device, variable headstage, variable clampMode, variable &ADGain, variable &DAGain)

ADGain = NaN
DAGain = NaN
Expand Down
Loading

0 comments on commit c562289

Please sign in to comment.