Thomas Vachuska

Fixed GUI pulsing due to PORT_STATS_UPDATE event.

Change-Id: I18b7e8b300f0af6f6cbf453f346808bb1c6d0d3c
...@@ -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
...@@ -344,10 +343,10 @@ public class TopologyViewMessageHandler extends TopologyViewMessageHandlerBase { ...@@ -344,10 +343,10 @@ public class TopologyViewMessageHandler extends TopologyViewMessageHandlerBase {
344 HostId two = hostId(string(payload, "two")); 343 HostId two = hostId(string(payload, "two"));
345 344
346 HostToHostIntent intent = HostToHostIntent.builder() 345 HostToHostIntent intent = HostToHostIntent.builder()
347 - .appId(appId) 346 + .appId(appId)
348 - .one(one) 347 + .one(one)
349 - .two(two) 348 + .two(two)
350 - .build(); 349 + .build();
351 350
352 intentService.submit(intent); 351 intentService.submit(intent);
353 startMonitoringIntent(intent); 352 startMonitoringIntent(intent);
...@@ -774,8 +773,10 @@ public class TopologyViewMessageHandler extends TopologyViewMessageHandlerBase { ...@@ -774,8 +773,10 @@ 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) {
777 - sendMessage(deviceMessage(event)); 776 + if (event.type() != PORT_STATS_UPDATED) {
778 - eventAccummulator.add(event); 777 + sendMessage(deviceMessage(event));
778 + eventAccummulator.add(event);
779 + }
779 } 780 }
780 } 781 }
781 782
......
...@@ -263,17 +263,19 @@ ...@@ -263,17 +263,19 @@
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 - el.classed('link', true); 267 + if (el) {
268 - el.classed('inactive', !online); 268 + el.classed('link', true);
269 - el.classed(allLinkTypes, false); 269 + el.classed('inactive', !online);
270 - if (type) { 270 + el.classed(allLinkTypes, false);
271 - el.classed(type, true); 271 + if (type) {
272 + el.classed(type, true);
273 + }
274 + el.transition()
275 + .duration(delay)
276 + .attr('stroke-width', linkScale(lw))
277 + .attr('stroke', linkConfig[th].baseColor);
272 } 278 }
273 - el.transition()
274 - .duration(delay)
275 - .attr('stroke-width', linkScale(lw))
276 - .attr('stroke', linkConfig[th].baseColor);
277 } 279 }
278 280
279 function removeLinkElement(d) { 281 function removeLinkElement(d) {
......