Skip to content

Commit ce6f656

Browse files
committed
IVS_runInitAccessResisQC: Prefer analysis function PSQ_AccessResistance
1 parent 58be6e4 commit ce6f656

File tree

4 files changed

+2
-146
lines changed

4 files changed

+2
-146
lines changed

Packages/MIES/MIES_IVSCC.ipf

+2-76
Original file line numberDiff line numberDiff line change
@@ -196,92 +196,18 @@ Function IVS_runBaselineCheckQC()
196196
PGC_SetAndActivateControl(device, "DataAcquireButton")
197197
End
198198

199-
/// @brief Run the initial access resistance check from the WSE
200-
///
201-
/// This will check must be < 20MΩ or 15% of the R input.
202-
/// The EXTPBREAKN wave will also be run as a way of making sure the reading
203-
/// is recorded into the data set for post-experiment analysis
199+
/// @brief Run the initial access resistance smoke from the WSE
204200
Function IVS_runInitAccessResisQC()
205-
206-
string device
201+
string device, ctrl
207202
variable headstage
208-
variable baselineValue, instResistanceVal, ssResistanceVal
209-
variable qcResult, adChannel, tpBufferSetting
210-
string ctrl
211203

212204
device = IVS_DEFAULT_DEVICE
213205
headstage = IVS_DEFAULT_HEADSTAGE
214206

215207
ctrl = GetPanelControl(headstage, CHANNEL_TYPE_DAC, CHANNEL_CONTROL_WAVE)
216208
PGC_SetAndActivateControl(device, ctrl, str = "EXTPBREAKN*")
217209

218-
// save the current test pulse buffer setting
219-
tpBufferSetting = GetSetVariable(device, "setvar_Settings_TPBuffer")
220-
221-
// set the test pulse buffer up to a higher value to account for noise...using 5 for now
222-
PGC_SetAndActivateControl(device, "setvar_Settings_TPBuffer", val = 5)
223-
224-
// Check to see if Test Pulse is already running...if not running, turn it on...
225-
if(!TP_CheckIfTestpulseIsRunning(device))
226-
PGC_SetAndActivateControl(device, "StartTestPulseButton")
227-
endif
228-
229-
// Set up the QC Wave so the background task can get the information it needs
230-
Wave tempWave = GetIVSCCTemporaryWave(device)
231-
tempWave[%tpBuffer] = tpBufferSetting
232-
233-
CtrlNamedBackground IVS_finishInitAccessQCCheck, period=2, proc=IVS_finishInitAccessQCCheck
234-
CtrlNamedBackground IVS_finishInitAccessQCCheck, start
235-
End
236-
237-
/// @brief Complete the Baseline QC check in the background
238-
///
239-
/// @ingroup BackgroundFunctions
240-
Function IVS_finishInitAccessQCCheck(s)
241-
STRUCT WMBackgroundStruct &s
242-
243-
string device
244-
variable headstage, cycles
245-
variable instResistanceVal, ssResistanceVal, tpBufferSetting
246-
variable qcResult
247-
248-
device = IVS_DEFAULT_DEVICE
249-
headstage = IVS_DEFAULT_HEADSTAGE
250-
251-
Wave tempWave = GetIVSCCTemporaryWave(device)
252-
tpBufferSetting = tempWave[%tpBuffer]
253-
254-
cycles = 5 //define how many cycles the test pulse must run
255-
if(TP_TestPulseHasCycled(device, cycles))
256-
print "Enough Cycles passed..."
257-
else
258-
PUB_IVS_QCState(qcResult, "Too few TP cycles")
259-
return 0
260-
endif
261-
262-
WAVE TPResults = GetTPResults(device)
263-
264-
instResistanceVal = TPResults[%ResistanceInst][headstage]
265-
ssResistanceVal = TPResults[%ResistanceSteadyState][headstage]
266-
267-
printf "Initial Access Resistance: %g\r", instResistanceVal
268-
printf "SS Resistance: %g\r", ssResistanceVal
269-
270-
// See if we pass the baseline QC
271-
if ((instResistanceVal < 20.0) && (instResistanceVal < (0.15 * ssResistanceVal)))
272-
qcResult = instResistanceVal
273-
PUB_IVS_QCState(qcResult, "Resistance check")
274-
endif
275-
276-
// and now run the EXTPBREAKN wave so that things are saved into the data record
277210
PGC_SetAndActivateControl(device, "DataAcquireButton")
278-
279-
PUB_IVS_QCState(qcResult, "Result before finishing")
280-
281-
// set the test pulse buffer back to 1
282-
PGC_SetAndActivateControl(device, "setvar_Settings_TPBuffer", val = tpBufferSetting)
283-
284-
return 1
285211
End
286212

287213
/// @brief Run PSQ_SealEvaluation()

Packages/MIES/MIES_Publish.ipf

-30
Original file line numberDiff line numberDiff line change
@@ -329,36 +329,6 @@ Function PUB_ClampModeChange(string device, variable headstage, variable oldClam
329329
PUB_Publish(jsonID, AMPLIFIER_CLAMP_MODE_FILTER)
330330
End
331331

332-
/// @brief Push QC results onto ZeroMQ Publisher socket
333-
///
334-
/// Filter: #IVS_PUB_FILTER
335-
///
336-
/// Payload: JSON-encoded string with three elements in the top-level object
337-
///
338-
/// Example:
339-
///
340-
/// \rst
341-
/// .. code-block:: json
342-
///
343-
/// {
344-
/// "Description": "some text",
345-
/// "Issuer": "My QC Function",
346-
/// "Value": 123
347-
/// }
348-
///
349-
/// \endrst
350-
Function PUB_IVS_QCState(variable result, string description)
351-
variable jsonID
352-
353-
jsonID = JSON_New()
354-
JSON_AddTreeObject(jsonID, "")
355-
JSON_AddString(jsonID, "Issuer", GetRTStackInfo(2))
356-
JSON_AddVariable(jsonID, "Value", result)
357-
JSON_AddString(jsonID, "Description", description)
358-
359-
PUB_Publish(jsonID, IVS_PUB_FILTER)
360-
End
361-
362332
/// Filter: #PRESSURE_STATE_FILTER
363333
///
364334
/// Example:

Packages/MIES/MIES_WaveDataFolderGetters.ipf

-22
Original file line numberDiff line numberDiff line change
@@ -4630,28 +4630,6 @@ Function/WAVE P_PressureDataTxtWaveRef(device)
46304630
End
46314631
/// @}
46324632

4633-
/// @brief Returns a wave reference to the temporary wave for IVSCC
4634-
///
4635-
/// Rows:
4636-
/// - 0: tpBuffer, used to hold previous tp settings.
4637-
/// Setting will be restored upon completion of qc function.
4638-
Function/Wave GetIVSCCTemporaryWave(device)
4639-
string device
4640-
4641-
DFREF dfr = GetDevSpecLabNBTempFolder(device)
4642-
4643-
WAVE/D/Z/SDFR=dfr wv = IVSCCTemporary
4644-
4645-
if(WaveExists(wv))
4646-
return wv
4647-
endif
4648-
4649-
Make/D/N=(1) dfr:IVSCCTemporary/Wave=wv
4650-
SetDimLabel 0, 0, tpBuffer, wv
4651-
4652-
return wv
4653-
End
4654-
46554633
/// @brief Return the data folder reference to the device specific lab notebook folder for temporary waves
46564634
Function/DF GetDevSpecLabNBTempFolder(device)
46574635
string device

Packages/Testing-MIES/UTF_ZeroMQPublishing.ipf

-18
Original file line numberDiff line numberDiff line change
@@ -357,24 +357,6 @@ static Function CheckTrueRestMembPot()
357357
JSON_Release(jsonID)
358358
End
359359

360-
static Function CheckIVSCC()
361-
string expected, actual
362-
variable jsonID
363-
364-
MIES_PUB#PUB_IVS_QCState(123, "some text")
365-
366-
jsonID = FetchAndParseMessage(IVS_PUB_FILTER)
367-
expected = JSON_GetString(jsonID, "/Issuer")
368-
actual = "CheckIVSCC"
369-
CHECK_EQUAL_STR(actual, expected)
370-
371-
expected = JSON_GetString(jsonID, "/Description")
372-
actual = "some text"
373-
CHECK_EQUAL_STR(actual, expected)
374-
375-
CHECK_EQUAL_VAR(JSON_GetVariable(jsonID, "/Value"), 123)
376-
End
377-
378360
static Function CheckDAQStateChange_DAQ()
379361
string device, actual, expected
380362
variable headstage, i, jsonID, type

0 commit comments

Comments
 (0)