Symbols converter

This commit is contained in:
ziajka 2018-11-09 09:31:15 +01:00
parent 600bb91ad1
commit 17e59fde68
15 changed files with 78 additions and 36 deletions

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { Drawing } from "../models/drawing";
import { MapDrawing } from "../models/map/map-drawing";
import { Converter } from "../converter";
import { Drawing } from "../../models/drawing";
import { MapDrawing } from "../../models/map/map-drawing";
@Injectable()

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { Label } from "../models/label";
import { MapLabel } from "../models/map/map-label";
import { Converter } from "../converter";
import { Label } from "../../models/label";
import { MapLabel } from "../../models/map/map-label";
@Injectable()

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { LinkNode } from "../../models/link-node";
import { MapLinkNode } from "../models/map/map-link-node";
import { Converter } from "../converter";
import { LinkNode } from "../../../models/link-node";
import { MapLinkNode } from "../../models/map/map-link-node";
import { LabelToMapLabelConverter } from "./label-to-map-label-converter";

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { MapLink } from "../models/map/map-link";
import { Link } from "../../models/link";
import { Converter } from "../converter";
import { MapLink } from "../../models/map/map-link";
import { Link } from "../../../models/link";
import { LinkNodeToMapLinkNodeConverter } from "./link-node-to-map-link-node-converter";

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { Drawing } from "../models/drawing";
import { MapDrawing } from "../models/map/map-drawing";
import { Converter } from "../converter";
import { Drawing } from "../../models/drawing";
import { MapDrawing } from "../../models/map/map-drawing";
@Injectable()

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { Label } from "../models/label";
import { MapLabel } from "../models/map/map-label";
import { Converter } from "../converter";
import { Label } from "../../models/label";
import { MapLabel } from "../../models/map/map-label";
@Injectable()

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { LinkNode } from "../../models/link-node";
import { MapLinkNode } from "../models/map/map-link-node";
import { Converter } from "../converter";
import { LinkNode } from "../../../models/link-node";
import { MapLinkNode } from "../../models/map/map-link-node";
import { MapLabelToLabelConverter } from "./map-label-to-label-converter";

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { MapLink } from "../models/map/map-link";
import { Link } from "../../models/link";
import { Converter } from "../converter";
import { MapLink } from "../../models/map/map-link";
import { Link } from "../../../models/link";
import { MapLinkNodeToLinkNodeConverter } from "./map-link-node-to-link-node-converter";

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { MapNode } from "../models/map/map-node";
import { Node } from "../models/node";
import { Converter } from "../converter";
import { MapNode } from "../../models/map/map-node";
import { Node } from "../../models/node";
import { MapLabelToLabelConverter } from "./map-label-to-label-converter";
import { MapPortToPortConverter } from "./map-port-to-port-converter";

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { MapPort } from "../models/map/map-port";
import { Port } from "../../models/port";
import { Converter } from "../converter";
import { MapPort } from "../../models/map/map-port";
import { Port } from "../../../models/port";
@Injectable()

View File

@ -0,0 +1,18 @@
import { Injectable } from "@angular/core";
import { Converter } from "../converter";
import { MapSymbol } from "../../models/map/map-symbol";
import { Symbol } from "../../../models/symbol";
@Injectable()
export class MapSymbolToSymbolConverter implements Converter<MapSymbol, Symbol> {
convert(mapSymbol: MapSymbol) {
const symbol = new Symbol();
symbol.symbol_id = mapSymbol.id;
symbol.builtin = mapSymbol.builtin;
symbol.filename = mapSymbol.filename;
symbol.raw = mapSymbol.raw;
return symbol;
}
}

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { MapNode } from "../models/map/map-node";
import { Node } from "../models/node";
import { Converter } from "../converter";
import { MapNode } from "../../models/map/map-node";
import { Node } from "../../models/node";
import { LabelToMapLabelConverter } from "./label-to-map-label-converter";
import { PortToMapPortConverter } from "./port-to-map-port-converter";

View File

@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { Converter } from "./converter";
import { MapPort } from "../models/map/map-port";
import { Port } from "../../models/port";
import { Converter } from "../converter";
import { MapPort } from "../../models/map/map-port";
import { Port } from "../../../models/port";
@Injectable()

View File

@ -0,0 +1,18 @@
import { Injectable } from "@angular/core";
import { Converter } from "../converter";
import { MapSymbol } from "../../models/map/map-symbol";
import { Symbol } from "../../../models/symbol";
@Injectable()
export class SymbolToMapSymbolConverter implements Converter<Symbol, MapSymbol> {
convert(symbol: Symbol) {
const mapSymbol = new MapSymbol();
mapSymbol.id = symbol.symbol_id;
mapSymbol.builtin = symbol.builtin;
mapSymbol.filename = symbol.filename;
mapSymbol.raw = symbol.raw;
return mapSymbol;
}
}

View File

@ -0,0 +1,6 @@
export class MapSymbol {
id: string;
builtin: boolean;
filename: string;
raw: string;
}