GUI -- TopoView - Linking Oblique module in.
- updated oblique test scenario events. Change-Id: I590f22fbbc356c564cefe8d87e73fed701d88f98
Showing
17 changed files
with
33 additions
and
11 deletions
... | @@ -28,7 +28,7 @@ | ... | @@ -28,7 +28,7 @@ |
28 | ]; | 28 | ]; |
29 | 29 | ||
30 | // references to injected services etc. | 30 | // references to injected services etc. |
31 | - var $log, fs, ks, zs, gs, ms, sus, flash, tes, tfs, tps, tis, tss, tts; | 31 | + var $log, fs, ks, zs, gs, ms, sus, flash, tes, tfs, tps, tis, tss, tts, tos; |
32 | 32 | ||
33 | // DOM elements | 33 | // DOM elements |
34 | var ovtopo, svg, defs, zoomLayer, mapG, forceG, noDevsLayer; | 34 | var ovtopo, svg, defs, zoomLayer, mapG, forceG, noDevsLayer; |
... | @@ -52,7 +52,7 @@ | ... | @@ -52,7 +52,7 @@ |
52 | //P: togglePorts, | 52 | //P: togglePorts, |
53 | 53 | ||
54 | //X: [toggleNodeLock, 'Lock / unlock node positions'], | 54 | //X: [toggleNodeLock, 'Lock / unlock node positions'], |
55 | - //Z: [toggleOblique, 'Toggle oblique view (Experimental)'], | 55 | + Z: [tos.toggleOblique, 'Toggle oblique view (Experimental)'], |
56 | L: [tfs.cycleDeviceLabels, 'Cycle device labels'], | 56 | L: [tfs.cycleDeviceLabels, 'Cycle device labels'], |
57 | U: [tfs.unpin, 'Unpin node (hover mouse over)'], | 57 | U: [tfs.unpin, 'Unpin node (hover mouse over)'], |
58 | R: [resetZoom, 'Reset pan / zoom'], | 58 | R: [resetZoom, 'Reset pan / zoom'], |
... | @@ -214,10 +214,11 @@ | ... | @@ -214,10 +214,11 @@ |
214 | 'GlyphService', 'MapService', 'SvgUtilService', 'FlashService', | 214 | 'GlyphService', 'MapService', 'SvgUtilService', 'FlashService', |
215 | 'TopoEventService', 'TopoForceService', 'TopoPanelService', | 215 | 'TopoEventService', 'TopoForceService', 'TopoPanelService', |
216 | 'TopoInstService', 'TopoSelectService', 'TopoTrafficService', | 216 | 'TopoInstService', 'TopoSelectService', 'TopoTrafficService', |
217 | + 'TopoObliqueService', | ||
217 | 218 | ||
218 | function ($scope, _$log_, $loc, $timeout, _fs_, mast, | 219 | function ($scope, _$log_, $loc, $timeout, _fs_, mast, |
219 | _ks_, _zs_, _gs_, _ms_, _sus_, _flash_, | 220 | _ks_, _zs_, _gs_, _ms_, _sus_, _flash_, |
220 | - _tes_, _tfs_, _tps_, _tis_, _tss_, _tts_) { | 221 | + _tes_, _tfs_, _tps_, _tis_, _tss_, _tts_, _tos_) { |
221 | var self = this, | 222 | var self = this, |
222 | projection, | 223 | projection, |
223 | dim, | 224 | dim, |
... | @@ -238,10 +239,14 @@ | ... | @@ -238,10 +239,14 @@ |
238 | flash = _flash_; | 239 | flash = _flash_; |
239 | tes = _tes_; | 240 | tes = _tes_; |
240 | tfs = _tfs_; | 241 | tfs = _tfs_; |
242 | + // TODO: consider funnelling actions through TopoForceService... | ||
243 | + // rather than injecting references to these 'sub-modules', | ||
244 | + // just so we can invoke functions on them. | ||
241 | tps = _tps_; | 245 | tps = _tps_; |
242 | tis = _tis_; | 246 | tis = _tis_; |
243 | tss = _tss_; | 247 | tss = _tss_; |
244 | tts = _tts_; | 248 | tts = _tts_; |
249 | + tos = _tos_; | ||
245 | 250 | ||
246 | self.notifyResize = function () { | 251 | self.notifyResize = function () { |
247 | svgResized(fs.windowSize(mast.mastHeight())); | 252 | svgResized(fs.windowSize(mast.mastHeight())); | ... | ... |
... | @@ -23,7 +23,7 @@ | ... | @@ -23,7 +23,7 @@ |
23 | 'use strict'; | 23 | 'use strict'; |
24 | 24 | ||
25 | // injected refs | 25 | // injected refs |
26 | - var $log, fs, sus, is, ts, flash, tis, tms, tss, tts, fltr, | 26 | + var $log, fs, sus, is, ts, flash, tis, tms, tss, tts, tos, fltr, |
27 | icfg, uplink; | 27 | icfg, uplink; |
28 | 28 | ||
29 | // configuration | 29 | // configuration |
... | @@ -1084,6 +1084,13 @@ | ... | @@ -1084,6 +1084,13 @@ |
1084 | } | 1084 | } |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | + function mkObliqueApi(uplink) { | ||
1088 | + return { | ||
1089 | + node: function () { return node; }, | ||
1090 | + link: function () { return link; } | ||
1091 | + }; | ||
1092 | + } | ||
1093 | + | ||
1087 | function mkFilterApi(uplink) { | 1094 | function mkFilterApi(uplink) { |
1088 | return { | 1095 | return { |
1089 | node: function () { return node; }, | 1096 | node: function () { return node; }, |
... | @@ -1095,10 +1102,11 @@ | ... | @@ -1095,10 +1102,11 @@ |
1095 | .factory('TopoForceService', | 1102 | .factory('TopoForceService', |
1096 | ['$log', 'FnService', 'SvgUtilService', 'IconService', 'ThemeService', | 1103 | ['$log', 'FnService', 'SvgUtilService', 'IconService', 'ThemeService', |
1097 | 'FlashService', 'TopoInstService', 'TopoModelService', | 1104 | 'FlashService', 'TopoInstService', 'TopoModelService', |
1098 | - 'TopoSelectService', 'TopoTrafficService', 'TopoFilterService', | 1105 | + 'TopoSelectService', 'TopoTrafficService', |
1106 | + 'TopoObliqueService', 'TopoFilterService', | ||
1099 | 1107 | ||
1100 | function (_$log_, _fs_, _sus_, _is_, _ts_, _flash_, | 1108 | function (_$log_, _fs_, _sus_, _is_, _ts_, _flash_, |
1101 | - _tis_, _tms_, _tss_, _tts_, _fltr_) { | 1109 | + _tis_, _tms_, _tss_, _tts_, _tos_, _fltr_) { |
1102 | $log = _$log_; | 1110 | $log = _$log_; |
1103 | fs = _fs_; | 1111 | fs = _fs_; |
1104 | sus = _sus_; | 1112 | sus = _sus_; |
... | @@ -1109,6 +1117,7 @@ | ... | @@ -1109,6 +1117,7 @@ |
1109 | tms = _tms_; | 1117 | tms = _tms_; |
1110 | tss = _tss_; | 1118 | tss = _tss_; |
1111 | tts = _tts_; | 1119 | tts = _tts_; |
1120 | + tos = _tos_; | ||
1112 | fltr = _fltr_; | 1121 | fltr = _fltr_; |
1113 | 1122 | ||
1114 | icfg = is.iconConfig(); | 1123 | icfg = is.iconConfig(); |
... | @@ -1131,6 +1140,7 @@ | ... | @@ -1131,6 +1140,7 @@ |
1131 | tms.initModel(mkModelApi(uplink), dim); | 1140 | tms.initModel(mkModelApi(uplink), dim); |
1132 | tss.initSelect(mkSelectApi(uplink)); | 1141 | tss.initSelect(mkSelectApi(uplink)); |
1133 | tts.initTraffic(mkTrafficApi(uplink)); | 1142 | tts.initTraffic(mkTrafficApi(uplink)); |
1143 | + tos.initOblique(mkObliqueApi(uplink)); | ||
1134 | fltr.initFilter(mkFilterApi(uplink), d3.select('#mast-right')); | 1144 | fltr.initFilter(mkFilterApi(uplink), d3.select('#mast-right')); |
1135 | 1145 | ||
1136 | settings = angular.extend({}, defaultSettings, opts); | 1146 | settings = angular.extend({}, defaultSettings, opts); |
... | @@ -1167,6 +1177,7 @@ | ... | @@ -1167,6 +1177,7 @@ |
1167 | 1177 | ||
1168 | function destroyForce() { | 1178 | function destroyForce() { |
1169 | fltr.destroyFilter(); | 1179 | fltr.destroyFilter(); |
1180 | + tos.destroyOblique(); | ||
1170 | tts.destroyTraffic(); | 1181 | tts.destroyTraffic(); |
1171 | tss.destroySelect(); | 1182 | tss.destroySelect(); |
1172 | tms.destroyModel(); | 1183 | tms.destroyModel(); | ... | ... |
... | @@ -38,6 +38,11 @@ | ... | @@ -38,6 +38,11 @@ |
38 | 38 | ||
39 | // ========================== | 39 | // ========================== |
40 | 40 | ||
41 | + | ||
42 | + function toggleOblique() { | ||
43 | + $log.log("TOGGLING OBLIQUE VIEW"); | ||
44 | + } | ||
45 | + | ||
41 | // === ----------------------------------------------------- | 46 | // === ----------------------------------------------------- |
42 | // === MODULE DEFINITION === | 47 | // === MODULE DEFINITION === |
43 | 48 | ||
... | @@ -57,7 +62,9 @@ angular.module('ovTopo') | ... | @@ -57,7 +62,9 @@ angular.module('ovTopo') |
57 | 62 | ||
58 | return { | 63 | return { |
59 | initOblique: initOblique, | 64 | initOblique: initOblique, |
60 | - destroyOblique: destroyOblique | 65 | + destroyOblique: destroyOblique, |
66 | + | ||
67 | + toggleOblique: toggleOblique | ||
61 | }; | 68 | }; |
62 | }]); | 69 | }]); |
63 | }()); | 70 | }()); | ... | ... |
... | @@ -34,9 +34,10 @@ describe('factory: view/topo/topoOblique.js', function() { | ... | @@ -34,9 +34,10 @@ describe('factory: view/topo/topoOblique.js', function() { |
34 | 34 | ||
35 | it('should define api functions', function () { | 35 | it('should define api functions', function () { |
36 | expect(fs.areFunctions(tos, [ | 36 | expect(fs.areFunctions(tos, [ |
37 | - 'initOblique', 'destroyOblique' | 37 | + 'initOblique', 'destroyOblique', 'toggleOblique' |
38 | ])).toBeTruthy(); | 38 | ])).toBeTruthy(); |
39 | }); | 39 | }); |
40 | 40 | ||
41 | // TODO: more tests... | 41 | // TODO: more tests... |
42 | }); | 42 | }); |
43 | + | ... | ... |
-
Please register or login to post a comment