diff options
author | Siri Hansen <[email protected]> | 2016-04-28 14:13:33 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2016-05-19 15:21:51 +0200 |
commit | 7621e4aded2b5e8ad1a04102718c9bce21d4dc4c (patch) | |
tree | 464f1e8a0275a051841213200221d798ed36c8f9 /lib/observer/src/observer_port_wx.erl | |
parent | 90989e58d9e7f7c6fc3c4b52e4191d66d8ff2a96 (diff) | |
download | otp-7621e4aded2b5e8ad1a04102718c9bce21d4dc4c.tar.gz otp-7621e4aded2b5e8ad1a04102718c9bce21d4dc4c.tar.bz2 otp-7621e4aded2b5e8ad1a04102718c9bce21d4dc4c.zip |
[observer] Add tracing of ports
Diffstat (limited to 'lib/observer/src/observer_port_wx.erl')
-rw-r--r-- | lib/observer/src/observer_port_wx.erl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/observer/src/observer_port_wx.erl b/lib/observer/src/observer_port_wx.erl index 64502f0d16..a09637161f 100644 --- a/lib/observer/src/observer_port_wx.erl +++ b/lib/observer/src/observer_port_wx.erl @@ -183,6 +183,38 @@ handle_event(#wx{id=?ID_CLOSE_PORT}, State = #state{selected=Sel, ports=Ports}) {noreply, State#state{selected=undefined}} end; +handle_event(#wx{id=?ID_TRACE_PORTS}, #state{selected=Sel, ports=Ports}=State) -> + case Sel of + undefined -> + observer_wx:create_txt_dialog(State#state.panel, "No selected port", + "Tracer", ?wxICON_EXCLAMATION), + {noreply, State}; + R when is_integer(R) -> + Port = lists:nth(Sel+1, Ports), + observer_trace_wx:add_ports(observer_wx:get_tracer(), [Port#port.id]), + {noreply, State} + end; + +handle_event(#wx{id=?ID_TRACE_NAMES}, #state{selected=Sel, ports=Ports}=State) -> + case Sel of + undefined -> + observer_wx:create_txt_dialog(State#state.panel, "No selected port", + "Tracer", ?wxICON_EXCLAMATION), + {noreply, State}; + R when is_integer(R) -> + Port = lists:nth(Sel+1, Ports), + IdOrReg = case Port#port.name of + ignore -> Port#port.id; + Name -> Name + end, + observer_trace_wx:add_ports(observer_wx:get_tracer(), [IdOrReg]), + {noreply, State} + end; + +handle_event(#wx{id=?ID_TRACE_NEW, event=#wxCommand{type=command_menu_selected}}, State) -> + observer_trace_wx:add_ports(observer_wx:get_tracer(), [new_ports]), + {noreply, State}; + handle_event(#wx{id=?ID_REFRESH_INTERVAL}, State = #state{grid=Grid, timer=Timer0}) -> Timer = observer_lib:interval_dialog(Grid, Timer0, 10, 5*60), |