Skip to content

Commit 134ff2b

Browse files
authored
Merge pull request #1256 from AllenInstitute/feature/1256-sweepformula_sweeps_from_all
SF: Change SF_GetSweepForFormula to return also data from non-displayed sweeps
2 parents 2688690 + 8803d9c commit 134ff2b

16 files changed

+2381
-1679
lines changed

Packages/MIES/MIES_AnalysisFunctions.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ End
12611261
///
12621262
/// setvar_DataAcq_OnsetDelayUser -> Pre DAQ|20|
12631263
/// Popup_Settings_FixedFreq -> Pre Sweep|100|Post Sweep|Maximum|
1264-
/// sweepFormula_formula -> Pre Set|data(cursors(A,B), channels(AD), sweeps())
1264+
/// sweepFormula_formula -> Pre Set|data(cursors(A,B), select(channels(AD), sweeps()))
12651265
///
12661266
/// \endrst
12671267
///

Packages/MIES/MIES_AnalysisFunctions_PatchSeq.ipf

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Packages/MIES/MIES_Constants.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ Constant HARDWARE_DAC_EXTERNAL_TRIGGER = 0x1
638638

639639
/// Used to upgrade the GuiStateWave as well as the DA Ephys panel
640640
Constant DA_EPHYS_PANEL_VERSION = 55
641-
Constant DATA_SWEEP_BROWSER_PANEL_VERSION = 39
641+
Constant DATA_SWEEP_BROWSER_PANEL_VERSION = 40
642642
Constant WAVEBUILDER_PANEL_VERSION = 12
643643
Constant ANALYSISBROWSER_PANEL_VERSION = 1
644644

Packages/MIES/MIES_DataBrowser.ipf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ End
3939
/// after GUI editor adapted controls in development process
4040
Function DB_ResetAndStoreCurrentDBPanel()
4141
string device, bsPanel, scPanel, shPanel, recreationCode
42-
string sfFormula, sfJSON, descNB
42+
string sfJSON, descNB
4343

4444
device = GetMainWindow(GetCurrentWindow())
4545
if(!windowExists(device))
@@ -222,8 +222,7 @@ Function DB_ResetAndStoreCurrentDBPanel()
222222
// settings history
223223
CheckBox check_limit_x_selected_sweeps WIN = $shPanel, value=0
224224

225-
sfFormula = BSP_GetSFFormula(device)
226-
ReplaceNotebookText(sfFormula, "data(\rcursors(A,B),\rchannels(AD),\rsweeps()\r)")
225+
SF_SetFormula(device, "data(\rcursors(A,B),\rselect(channels(AD),sweeps())\r)")
227226

228227
sfJSON = BSP_GetSFJSON(device)
229228
ReplaceNotebookText(sfJSON, "")

0 commit comments

Comments
 (0)