blob: 55367841e8a92e10948ac11a36a1550c44659349 [file] [log] [blame]
Sean Condonf4f54a12018-10-10 23:25:46 +01001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the 'License');
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an 'AS IS' BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Sean Condon0d064ec2019-02-04 21:53:53 +000016import {Component, Input, OnInit} from '@angular/core';
17import {MapObject} from '../maputils';
Sean Condonf4f54a12018-10-10 23:25:46 +010018
19/**
Sean Condonaa4366d2018-11-02 14:29:01 +000020 * model of the topo2CurrentLayout attrs from BgZoom below
21 */
22export interface BgZoomAttrs {
23 offsetX: number;
24 offsetY: number;
25 scale: number;
26}
27
28/**
29 * model of the topo2CurrentLayout background zoom attrs from Layout below
30 */
31export interface BgZoom {
32 cfg: BgZoomAttrs;
33 usr?: BgZoomAttrs;
34}
35
36/**
37 * model of the topo2CurrentLayout breadcrumb from Layout below
38 */
39export interface LayoutCrumb {
40 id: string;
41 name: string;
42}
43
44/**
45 * Enum of the topo2CurrentRegion location type from Location below
46 */
47export enum LocationType {
Sean Condon0c577f62018-11-18 22:40:05 +000048 NONE = 'none',
Sean Condonaa4366d2018-11-02 14:29:01 +000049 GEO = 'geo',
50 GRID = 'grid'
51}
52
53/**
54 * model of the topo2CurrentLayout WebSocket response
55 */
56export interface Layout {
57 id: string;
58 bgDefaultScale: number;
59 bgDesc: string;
60 bgFilePath: string;
61 bgId: string;
62 bgType: LocationType;
63 bgWarn: string;
64 bgZoom: BgZoom;
65 crumbs: LayoutCrumb[];
66 parent: string;
67 region: string;
68 regionName: string;
69}
70
71/**
Sean Condonf4f54a12018-10-10 23:25:46 +010072 * ONOS GUI -- Topology Background Layer View.
73 */
74@Component({
75 selector: '[onos-backgroundsvg]',
76 templateUrl: './backgroundsvg.component.html',
77 styleUrls: ['./backgroundsvg.component.css']
78})
79export class BackgroundSvgComponent implements OnInit {
Sean Condon0d064ec2019-02-04 21:53:53 +000080 @Input() map: MapObject;
Sean Condonf4f54a12018-10-10 23:25:46 +010081
Sean Condonaa4366d2018-11-02 14:29:01 +000082 layoutData: Layout = <Layout>{};
83
Sean Condonf4f54a12018-10-10 23:25:46 +010084 constructor() { }
85
86 ngOnInit() {
87 }
88
Sean Condonaa4366d2018-11-02 14:29:01 +000089
90
Sean Condonf4f54a12018-10-10 23:25:46 +010091}