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> {
*/
PORT_REMOVED,
/*
/**
* Signifies that port statistics has been updated.
*/
PORT_STATS_UPDATED
......
......@@ -72,8 +72,7 @@ import static com.google.common.base.Strings.isNullOrEmpty;
import static org.onosproject.cluster.ClusterEvent.Type.INSTANCE_ADDED;
import static org.onosproject.net.DeviceId.deviceId;
import static org.onosproject.net.HostId.hostId;
import static org.onosproject.net.device.DeviceEvent.Type.DEVICE_ADDED;
import static org.onosproject.net.device.DeviceEvent.Type.DEVICE_UPDATED;
import static org.onosproject.net.device.DeviceEvent.Type.*;
import static org.onosproject.net.host.HostEvent.Type.HOST_ADDED;
import static org.onosproject.net.link.LinkEvent.Type.LINK_ADDED;
......@@ -344,10 +343,10 @@ public class TopologyViewMessageHandler extends TopologyViewMessageHandlerBase {
HostId two = hostId(string(payload, "two"));
HostToHostIntent intent = HostToHostIntent.builder()
.appId(appId)
.one(one)
.two(two)
.build();
.appId(appId)
.one(one)
.two(two)
.build();
intentService.submit(intent);
startMonitoringIntent(intent);
......@@ -774,8 +773,10 @@ public class TopologyViewMessageHandler extends TopologyViewMessageHandlerBase {
private class InternalDeviceListener implements DeviceListener {
@Override
public void event(DeviceEvent event) {
sendMessage(deviceMessage(event));
eventAccummulator.add(event);
if (event.type() != PORT_STATS_UPDATED) {
sendMessage(deviceMessage(event));
eventAccummulator.add(event);
}
}
}
......
......@@ -263,17 +263,19 @@
online = ldata.online(),
delay = immediate ? 0 : 1000;
// TODO: understand why el is sometimes undefined on addLink events...
el.classed('link', true);
el.classed('inactive', !online);
el.classed(allLinkTypes, false);
if (type) {
el.classed(type, true);
// FIXME: understand why el is sometimes undefined on addLink events...
if (el) {
el.classed('link', true);
el.classed('inactive', !online);
el.classed(allLinkTypes, false);
if (type) {
el.classed(type, true);
}
el.transition()
.duration(delay)
.attr('stroke-width', linkScale(lw))
.attr('stroke', linkConfig[th].baseColor);
}
el.transition()
.duration(delay)
.attr('stroke-width', linkScale(lw))
.attr('stroke', linkConfig[th].baseColor);
}
function removeLinkElement(d) {
......