ONOS-2328 GUI -- Started work on seeing multiple links between devices on the topology view. Device links are now grouped based on what device they are between. Also minor bug fixes and investigations into other bugs. WIP.

Change-Id: I444f016268efc5c489ba6ad0282d0f7827fff462
diff --git a/web/gui/src/main/webapp/app/view/topo/topoModel.js b/web/gui/src/main/webapp/app/view/topo/topoModel.js
index 2a4921b..9c8d46b 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoModel.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoModel.js
@@ -36,7 +36,7 @@
      */
 
     // shorthand
-    var lu, rlk, nodes, links;
+    var lu, rlk, nodes, links, linksByDevice;
 
     var dim;    // dimensions of layout [w,h]
 
@@ -185,6 +185,12 @@
             fromSource: link,
             srcPort: link.srcPort,
             tgtPort: link.dstPort,
+            position: {
+                x1: 0,
+                y1: 0,
+                x2: 0,
+                y2: 0
+            },
 
             // functions to aggregate dual link state
             type: function () {
@@ -292,6 +298,11 @@
 
                 } else {
                     result.removeRawLink = function () {
+                        // remove link out of aggregate linksByDevice list
+                        var linksForDevPair = linksByDevice[ldata.devicePair],
+                            rmvIdx = fs.find(ldata.key, linksForDevPair, 'key');
+                        linksForDevPair.splice(rmvIdx, 1);
+
                         if (link) {
                             // remove fromSource
                             ldata.fromSource = null;
@@ -393,6 +404,7 @@
                 rlk = api.network.revLinkToKey;
                 nodes = api.network.nodes;
                 links = api.network.links;
+                linksByDevice = api.network.linksByDevice;
             }
 
             function newDim(_dim_) {