@@ -303,35 +303,37 @@ static Function/WAVE PA_CreateAndFillPulseWaveIfReq(wv, singleSweepFolder, chann
303303End
304304
305305/// @brief Populates pps.pulseAverSett with the user selection from the panel
306- Function PA_GatherSettings ( win, pps )
306+ static Function PA_GatherSettings ( win, s )
307307 string win
308- STRUCT PostPlotSettings & pps
308+ STRUCT PulseAverageSettings & s
309309
310310 string extPanel
311311
312312 win = GetMainWindow ( win)
313313 extPanel = BSP_GetPanel ( win)
314314
315315 if ( ! PA_IsActive ( win))
316- InitPulseAverageSettings ( pps . pulseAverSett )
316+ InitPulseAverageSettings ( s )
317317 return 0
318318 endif
319319
320- pps. pulseAverSett. showIndividualTraces = GetCheckboxState ( extPanel, "check_pulseAver_indTraces" )
321- pps. pulseAverSett. showAverageTrace = GetCheckboxState ( extPanel, "check_pulseAver_showAver" )
322- pps. pulseAverSett. multipleGraphs = GetCheckboxState ( extPanel, "check_pulseAver_multGraphs" )
323- pps. pulseAverSett. startingPulse = GetSetVariable ( extPanel, "setvar_pulseAver_startPulse" )
324- pps. pulseAverSett. endingPulse = GetSetVariable ( extPanel, "setvar_pulseAver_endPulse" )
325- pps. pulseAverSett. fallbackPulseLength = GetSetVariable ( extPanel, "setvar_pulseAver_fallbackLength" )
326- pps. pulseAverSett. regionSlider = BSP_GetDDAQ ( win)
327- pps. pulseAverSett. zeroTraces = GetCheckboxState ( extPanel, "check_pulseAver_zeroTrac" )
328- pps. pulseAverSett. autoTimeAlignment = GetCheckboxState ( extPanel, "check_pulseAver_timeAlign" )
329-
330- PA_DeconvGatherSettings ( win, pps. pulseAverSett. deconvolution)
320+ s. dfr = BSP_GetFolder ( win, MIES_BSP_PANEL_FOLDER)
321+ s. enabled = GetCheckboxState ( extPanel, "check_BrowserSettings_PA" )
322+ s. showIndividualTraces = GetCheckboxState ( extPanel, "check_pulseAver_indTraces" )
323+ s. showAverageTrace = GetCheckboxState ( extPanel, "check_pulseAver_showAver" )
324+ s. multipleGraphs = GetCheckboxState ( extPanel, "check_pulseAver_multGraphs" )
325+ s. startingPulse = GetSetVariable ( extPanel, "setvar_pulseAver_startPulse" )
326+ s. endingPulse = GetSetVariable ( extPanel, "setvar_pulseAver_endPulse" )
327+ s. fallbackPulseLength = GetSetVariable ( extPanel, "setvar_pulseAver_fallbackLength" )
328+ s. regionSlider = BSP_GetDDAQ ( win)
329+ s. zeroTraces = GetCheckboxState ( extPanel, "check_pulseAver_zeroTrac" )
330+ s. autoTimeAlignment = GetCheckboxState ( extPanel, "check_pulseAver_timeAlign" )
331+
332+ PA_DeconvGatherSettings ( win, s. deconvolution)
331333End
332334
333335/// @brief gather deconvolution settings from PA section in BSP
334- Function PA_DeconvGatherSettings ( win, deconvolution)
336+ static Function PA_DeconvGatherSettings ( win, deconvolution)
335337 string win
336338 STRUCT PulseAverageDeconvSettings & deconvolution
337339
@@ -343,9 +345,18 @@ Function PA_DeconvGatherSettings(win, deconvolution)
343345 deconvolution. range = GetSetVariable ( bsPanel, "setvar_pulseAver_deconv_range" )
344346End
345347
346- Function PA_ShowPulses ( win, dfr, pa)
348+ /// @brief Update the PA plot to accomodate changed settings
349+ Function PA_Update ( string win)
350+
351+ string graph = GetMainWindow ( win)
352+
353+ STRUCT PulseAverageSettings s
354+ PA_GatherSettings ( graph, s)
355+ PA_ShowPulses ( graph, s)
356+ End
357+
358+ static Function PA_ShowPulses ( win, pa)
347359 string win
348- DFREF dfr
349360 STRUCT PulseAverageSettings & pa
350361
351362 string graph, preExistingGraphs
@@ -364,7 +375,7 @@ Function PA_ShowPulses(win, dfr, pa)
364375
365376 preExistingGraphs = PA_GetAverageGraphs ()
366377
367- if ( ! PA_IsActive ( win ) )
378+ if ( ! pa . enabled )
368379 KillWindows ( preExistingGraphs)
369380 return NaN
370381 endif
@@ -390,7 +401,7 @@ Function PA_ShowPulses(win, dfr, pa)
390401 TUD_Clear ( graph)
391402 endfor
392403
393- DFREF pulseAverageDFR = GetDevicePulseAverageFolder ( dfr)
404+ DFREF pulseAverageDFR = GetDevicePulseAverageFolder ( pa . dfr)
394405 Make / FREE/ T userDataKeys = { "fullPath" , "sweepNumber" , "region" , "channelNumber" , "channelType" , \
395406 "pulseIndex" , "traceType" , "occurence" , "XAXIS" , "YAXIS" , "DiagonalElement" }
396407
719730/// Note: MIES_fWaveAverage() usually takes 5 times longer than CA_AveragingKey()
720731///
721732/// @returns wave reference to the average wave specified by @p outputDFR and @p outputWaveName
722- Function /WAVE PA_Average ( listOfWaves, outputDFR, outputWaveName)
733+ static Function/WAVE PA_Average ( listOfWaves, outputDFR, outputWaveName)
723734 string listOfWaves
724735 DFREF outputDFR
725736 string outputWaveName
@@ -752,7 +763,7 @@ Function/WAVE PA_SmoothDeconv(input, deconvolution)
752763 return wv
753764End
754765
755- Function /WAVE PA_Deconvolution ( average, outputDFR, outputWaveName, deconvolution)
766+ static Function/WAVE PA_Deconvolution ( average, outputDFR, outputWaveName, deconvolution)
756767 WAVE average
757768 DFREF outputDFR
758769 string outputWaveName
@@ -783,7 +794,7 @@ Function PA_CheckProc_Common(cba) : CheckBoxControl
783794
784795 switch ( cba. eventCode)
785796 case 2: // mouse up
786- UpdateSweepPlot ( cba. win)
797+ PA_Update ( cba. win)
787798 break
788799 endswitch
789800
@@ -796,7 +807,7 @@ Function PA_CheckProc_Individual(cba) : CheckBoxControl
796807 switch ( cba. eventCode)
797808 case 2: // mouse up
798809 BSP_SetIndividualControlStatus ( cba. win)
799- UpdateSweepPlot ( cba. win)
810+ PA_Update ( cba. win)
800811 break
801812 endswitch
802813
@@ -809,7 +820,7 @@ Function PA_CheckProc_Average(cba) : CheckBoxControl
809820 switch ( cba. eventCode)
810821 case 2: // mouse up
811822 BSP_SetDeconvControlStatus ( cba. win)
812- UpdateSweepPlot ( cba. win)
823+ PA_Update ( cba. win)
813824 break
814825 endswitch
815826
@@ -838,7 +849,7 @@ Function PA_SetVarProc_Common(sva) : SetVariableControl
838849 case 1: // mouse up
839850 case 2: // Enter key
840851 case 3: // Live update
841- UpdateSweepPlot ( sva. win)
852+ PA_Update ( sva. win)
842853 break
843854 endswitch
844855
@@ -895,7 +906,7 @@ Function PA_DeconvolutionIsActive(win)
895906End
896907
897908/// @brief Update deconvolution traces in Sweep Plots
898- Function PA_UpdateSweepPlotDeconvolution ( win, show)
909+ static Function PA_UpdateSweepPlotDeconvolution ( win, show)
899910 string win
900911 variable show
901912
972983/// traces are plotted on the diagonal graphs/axes of the PA graph(s).
973984///
974985/// @param refTraces list of graph#trace entries as reference for time alignment
975- Function PA_AutomaticTimeAlignment ( refTraces)
986+ static Function PA_AutomaticTimeAlignment ( refTraces)
976987 string refTraces
977988
978989 string graphtrace
0 commit comments