@@ -5094,26 +5094,20 @@ End
50945094/// @brief Remove traces from a graph and optionally try to kill their waves
50955095///
50965096/// @param graph graph
5097- /// @param kill [optional, default: false] try to kill the wave after it has been removed
50985097/// @param trace [optional, default: all] remove the given trace only
50995098/// @param wv [optional, default: ignored] remove all traces which stem from the given wave
51005099/// @param dfr [optional, default: ignored] remove all traces which stem from one of the waves in dfr
51015100///
51025101/// Only one of trace/wv/dfr may be supplied.
5103- Function RemoveTracesFromGraph ( graph, [ kill, trace, wv, dfr] )
5102+ Function RemoveTracesFromGraph ( graph, [ trace, wv, dfr] )
51045103 string graph
5105- variable kill
51065104 string trace
51075105 WAVE /Z wv
51085106 DFREF dfr
51095107
5110- variable i , numEntries, tryKillingTheWave , numOptArgs, remove_all_traces, debugOnError
5108+ variable i , numEntries, numOptArgs, remove_all_traces, debugOnError
51115109 string traceList, refTrace
51125110
5113- if ( ParamIsDefault ( kill))
5114- kill = 0
5115- endif
5116-
51175111 numOptArgs = ParamIsDefault ( trace) + ParamIsDefault ( wv) + ParamIsDefault ( dfr)
51185112 ASSERT ( numOptArgs == 3 || numOptArgs == 2, "Can only accept one of the trace/wv/dfr parameters" )
51195113
@@ -5128,7 +5122,7 @@ Function RemoveTracesFromGraph(graph, [kill, trace, wv, dfr])
51285122 remove_all_traces = ParamIsDefault ( trace) && ParamIsDefault ( wv) && ParamIsDefault ( dfr)
51295123
51305124 // remove without calling TraceNameList or TraceNameToWaveRef
5131- if ( ! kill && remove_all_traces)
5125+ if ( remove_all_traces)
51325126#if IgorVersion () >= 9.0
51335127 RemoveFromGraph / ALL/ W=$ graph
51345128 return NaN
@@ -5158,29 +5152,20 @@ Function RemoveTracesFromGraph(graph, [kill, trace, wv, dfr])
51585152
51595153 if ( remove_all_traces)
51605154 RemoveFromGraph / W=$ graph $ refTrace
5161- tryKillingTheWave = 1
51625155 elseif ( ! ParamIsDefault ( trace))
51635156 if ( ! cmpstr ( refTrace, trace))
51645157 RemoveFromGraph / W=$ graph $ refTrace
5165- tryKillingTheWave = 1
51665158 endif
51675159 elseif ( ! ParamIsDefault ( wv))
51685160 if ( WaveRefsEqual ( refWave, wv))
51695161 RemoveFromGraph / W=$ graph $ refTrace
5170- tryKillingTheWave = 1
51715162 endif
51725163 elseif ( ! ParamIsDefault ( dfr))
51735164 if ( GetRowIndex ( candidates, refWave= refWave) >= 0 )
51745165 RemoveFromGraph / W=$ graph $ refTrace
5175- tryKillingTheWave = 1
51765166 endif
51775167 endif
51785168
5179- if ( kill && tryKillingTheWave)
5180- KillOrMoveToTrash ( wv= refWave)
5181- endif
5182-
5183- tryKillingTheWave = 0
51845169 endfor
51855170
51865171 return NaN
0 commit comments