Fixed GUI pulsing due to PORT_STATS_UPDATE event.
Change-Id: I18b7e8b300f0af6f6cbf453f346808bb1c6d0d3c
Showing
3 changed files
with
7 additions
and
4 deletions
... | @@ -74,7 +74,7 @@ public class DeviceEvent extends AbstractEvent<DeviceEvent.Type, Device> { | ... | @@ -74,7 +74,7 @@ public class DeviceEvent extends AbstractEvent<DeviceEvent.Type, Device> { |
74 | */ | 74 | */ |
75 | PORT_REMOVED, | 75 | PORT_REMOVED, |
76 | 76 | ||
77 | - /* | 77 | + /** |
78 | * Signifies that port statistics has been updated. | 78 | * Signifies that port statistics has been updated. |
79 | */ | 79 | */ |
80 | PORT_STATS_UPDATED | 80 | PORT_STATS_UPDATED | ... | ... |
... | @@ -72,8 +72,7 @@ import static com.google.common.base.Strings.isNullOrEmpty; | ... | @@ -72,8 +72,7 @@ import static com.google.common.base.Strings.isNullOrEmpty; |
72 | import static org.onosproject.cluster.ClusterEvent.Type.INSTANCE_ADDED; | 72 | import static org.onosproject.cluster.ClusterEvent.Type.INSTANCE_ADDED; |
73 | import static org.onosproject.net.DeviceId.deviceId; | 73 | import static org.onosproject.net.DeviceId.deviceId; |
74 | import static org.onosproject.net.HostId.hostId; | 74 | import static org.onosproject.net.HostId.hostId; |
75 | -import static org.onosproject.net.device.DeviceEvent.Type.DEVICE_ADDED; | 75 | +import static org.onosproject.net.device.DeviceEvent.Type.*; |
76 | -import static org.onosproject.net.device.DeviceEvent.Type.DEVICE_UPDATED; | ||
77 | import static org.onosproject.net.host.HostEvent.Type.HOST_ADDED; | 76 | import static org.onosproject.net.host.HostEvent.Type.HOST_ADDED; |
78 | import static org.onosproject.net.link.LinkEvent.Type.LINK_ADDED; | 77 | import static org.onosproject.net.link.LinkEvent.Type.LINK_ADDED; |
79 | 78 | ||
... | @@ -774,10 +773,12 @@ public class TopologyViewMessageHandler extends TopologyViewMessageHandlerBase { | ... | @@ -774,10 +773,12 @@ public class TopologyViewMessageHandler extends TopologyViewMessageHandlerBase { |
774 | private class InternalDeviceListener implements DeviceListener { | 773 | private class InternalDeviceListener implements DeviceListener { |
775 | @Override | 774 | @Override |
776 | public void event(DeviceEvent event) { | 775 | public void event(DeviceEvent event) { |
776 | + if (event.type() != PORT_STATS_UPDATED) { | ||
777 | sendMessage(deviceMessage(event)); | 777 | sendMessage(deviceMessage(event)); |
778 | eventAccummulator.add(event); | 778 | eventAccummulator.add(event); |
779 | } | 779 | } |
780 | } | 780 | } |
781 | + } | ||
781 | 782 | ||
782 | // Link event listener. | 783 | // Link event listener. |
783 | private class InternalLinkListener implements LinkListener { | 784 | private class InternalLinkListener implements LinkListener { | ... | ... |
... | @@ -263,7 +263,8 @@ | ... | @@ -263,7 +263,8 @@ |
263 | online = ldata.online(), | 263 | online = ldata.online(), |
264 | delay = immediate ? 0 : 1000; | 264 | delay = immediate ? 0 : 1000; |
265 | 265 | ||
266 | - // TODO: understand why el is sometimes undefined on addLink events... | 266 | + // FIXME: understand why el is sometimes undefined on addLink events... |
267 | + if (el) { | ||
267 | el.classed('link', true); | 268 | el.classed('link', true); |
268 | el.classed('inactive', !online); | 269 | el.classed('inactive', !online); |
269 | el.classed(allLinkTypes, false); | 270 | el.classed(allLinkTypes, false); |
... | @@ -275,6 +276,7 @@ | ... | @@ -275,6 +276,7 @@ |
275 | .attr('stroke-width', linkScale(lw)) | 276 | .attr('stroke-width', linkScale(lw)) |
276 | .attr('stroke', linkConfig[th].baseColor); | 277 | .attr('stroke', linkConfig[th].baseColor); |
277 | } | 278 | } |
279 | + } | ||
278 | 280 | ||
279 | function removeLinkElement(d) { | 281 | function removeLinkElement(d) { |
280 | var idx = fs.find(d.key, network.links, 'key'), | 282 | var idx = fs.find(d.key, network.links, 'key'), | ... | ... |
-
Please register or login to post a comment