@@ -4427,7 +4427,7 @@ Function PSQ_PipetteInBath(string device, struct AnalysisFunction_V3& s)
44274427 variable multiplier, chunk, baselineQCPassed, ret, DAC, pipetteResistanceQCPassed, samplingFrequencyQCPassed, ovsState
44284428 variable sweepsInSet, passesInSet, acquiredSweepsInSet, sweepPassed, setPassed, numSweepsFailedAllowed, failsInSet
44294429 variable maxPipetteResistance, minPipetteResistance, expectedNumTestpulses, numTestPulses, pipetteResistance
4430- string key, ctrl, stimset, msg, databrowser, bsPanel, formula_nb
4430+ string key, ctrl, stimset, msg, databrowser, bsPanel
44314431
44324432 switch ( s. eventType)
44334433 case PRE_DAQ_EVENT:
@@ -4461,11 +4461,10 @@ Function PSQ_PipetteInBath(string device, struct AnalysisFunction_V3& s)
44614461 databrowser = DB_GetBoundDataBrowser ( device)
44624462 bsPanel = BSP_GetPanel ( databrowser)
44634463
4464- formula_nb = BSP_GetSFFormula ( databrowser)
4465-
4466- /// @todo : Rework to use non-displayed sweeps, once https://github.com/AllenInstitute/MIES/pull/1256 is merged
4467- /// this also then allows us to remove the OVS fiddling
4468- ReplaceNotebookText ( formula_nb, "store(\" Steady state resistance\" , tp(ss, channels(AD), sweeps(), [0]))" )
4464+ /// @todo : The call should work on the last sweep acquired. Once this number is retrieved it can be set directly
4465+ /// in the formula string replacing sweeps(). The the OVS disabled/enable procedure can be skipped.
4466+ /// By using SF_ExecuteFormula instead it can also executed right here.
4467+ SF_SetFormula ( databrowser, "store(\" Steady state resistance\" , tp(ss, select(channels(AD), sweeps()), [0]))" )
44694468
44704469 PGC_SetAndActivateControl ( bsPanel, "check_BrowserSettings_SF" , val = 1 )
44714470
@@ -5019,7 +5018,7 @@ Function PSQ_SealEvaluation(string device, struct AnalysisFunction_V3& s)
50195018 variable multiplier, chunk, baselineQCPassed, ret, DAC, samplingFrequencyQCPassed, sealResistanceMax
50205019 variable sweepsInSet, passesInSet, acquiredSweepsInSet, sweepPassed, setPassed, numSweepsFailedAllowed, failsInSet, ovsState
50215020 variable expectedNumTestpulses, numTestPulses, sealResistanceA, sealResistanceB, sealResistanceQCPassed, testpulseGroupSel, sealThreshold
5022- string key, ctrl, stimset, msg, databrowser, bsPanel, formula, formula_nb , pipetteResistanceStr, sweepStr
5021+ string key, ctrl, stimset, msg, databrowser, bsPanel, formula, pipetteResistanceStr, sweepStr
50235022 string sealResistanceGroupAStr, sealResistanceGroupBStr
50245023
50255024 switch ( s. eventType)
@@ -5055,8 +5054,6 @@ Function PSQ_SealEvaluation(string device, struct AnalysisFunction_V3& s)
50555054
50565055 bsPanel = BSP_GetPanel ( databrowser)
50575056
5058- formula_nb = BSP_GetSFFormula ( databrowser)
5059-
50605057 testpulseGroupSel = PSQ_SE_GetTestpulseGroupSelection ( s. params)
50615058
50625059 /// @todo : Rework to use non-displayed sweeps, once https://github.com/AllenInstitute/MIES/pull/1256 is merged
@@ -5068,21 +5065,21 @@ Function PSQ_SealEvaluation(string device, struct AnalysisFunction_V3& s)
50685065 // and `tp` takes the *ignored* list
50695066 switch ( testpulseGroupSel)
50705067 case PSQ_SE_TGS_BOTH:
5071- formula = "store(\" Steady state resistance (group A)\" , tp(ss, channels(AD), sweeps(), [0, 4, 5, 6]))\r " + \
5068+ formula = "store(\" Steady state resistance (group A)\" , tp(ss, select( channels(AD), sweeps() ), [0, 4, 5, 6]))\r " + \
50725069 "and\r " + \
5073- "store(\" Steady state resistance (group B)\" , tp(ss, channels(AD), sweeps(), [0, 1, 2, 3]))"
5070+ "store(\" Steady state resistance (group B)\" , tp(ss, select( channels(AD), sweeps() ), [0, 1, 2, 3]))"
50745071 break
50755072 case PSQ_SE_TGS_FIRST:
5076- formula = "store(\" Steady state resistance (group A)\" , tp(ss, channels(AD), sweeps(), [0]))"
5073+ formula = "store(\" Steady state resistance (group A)\" , tp(ss, select( channels(AD), sweeps() ), [0]))"
50775074 break
50785075 case PSQ_SE_TGS_SECOND:
5079- formula = "store(\" Steady state resistance (group B)\" , tp(ss, channels(AD), sweeps(), [0]))"
5076+ formula = "store(\" Steady state resistance (group B)\" , tp(ss, select( channels(AD), sweeps() ), [0]))"
50805077 break
50815078 default :
50825079 ASSERT ( 0, "Invalid testpulseGroupSel: " + num2str ( testpulseGroupSel))
50835080 endswitch
50845081
5085- ReplaceNotebookText ( formula_nb , formula)
5082+ SF_SetFormula ( databrowser , formula)
50865083
50875084 PGC_SetAndActivateControl ( bsPanel, "check_BrowserSettings_SF" , val = 1 )
50885085
0 commit comments