GUI - added remapping of device type to glyph ID.
- this is so we can remap 'virtual' device type to 'cord' glyph (E-CORD demo) - added ecord mock-server scenario. Change-Id: I1a0ad48752f86ffb8abc75fbdc9bf8eabf10f692
Showing
10 changed files
with
141 additions
and
2 deletions
| ... | @@ -68,6 +68,17 @@ | ... | @@ -68,6 +68,17 @@ |
| 68 | e: 'badgeError' | 68 | e: 'badgeError' |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | + // NOTE: this type of hack should go away once we have implemented | ||
| 72 | + // the server-side UiModel code. | ||
| 73 | + // {virtual -> cord} is for the E-CORD demo at ONS 2016 | ||
| 74 | + var remappedDeviceTypes = { | ||
| 75 | + virtual: 'cord' | ||
| 76 | + }; | ||
| 77 | + | ||
| 78 | + function mapDeviceTypeToGlyph(type) { | ||
| 79 | + return remappedDeviceTypes[type] || type || 'unknown'; | ||
| 80 | + } | ||
| 81 | + | ||
| 71 | function badgeStatus(badge) { | 82 | function badgeStatus(badge) { |
| 72 | return status[badge.status] || status.i; | 83 | return status[badge.status] || status.i; |
| 73 | } | 84 | } |
| ... | @@ -311,9 +322,8 @@ | ... | @@ -311,9 +322,8 @@ |
| 311 | 322 | ||
| 312 | function deviceEnter(d) { | 323 | function deviceEnter(d) { |
| 313 | var node = d3.select(this), | 324 | var node = d3.select(this), |
| 314 | - glyphId = d.type || 'unknown', | 325 | + glyphId = mapDeviceTypeToGlyph(d.type), |
| 315 | label = trimLabel(deviceLabel(d)), | 326 | label = trimLabel(deviceLabel(d)), |
| 316 | - //devCfg = deviceIconConfig, | ||
| 317 | noLabel = !label, | 327 | noLabel = !label, |
| 318 | box, dx, dy, icon; | 328 | box, dx, dy, icon; |
| 319 | 329 | ... | ... |
-
Please register or login to post a comment