UNPKG

isoxml-angular

Version:

JavaScript library to parse and generate ISOXML (ISO11783-10) files

74 lines (73 loc) 1.98 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LineString = void 0; const classRegistry_1 = require("../classRegistry"); const utils_1 = require("../utils"); const ATTRIBUTES = { A: { name: "LineStringType", type: "xs:NMTOKEN", isPrimaryId: false, isOptional: false, isOnlyV4: false, }, B: { name: "LineStringDesignator", type: "xs:string", isPrimaryId: false, isOptional: true, isOnlyV4: false, }, C: { name: "LineStringWidth", type: "xs:unsignedLong", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 4294967294, }, D: { name: "LineStringLength", type: "xs:unsignedLong", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 4294967294, }, E: { name: "LineStringColour", type: "xs:unsignedByte", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 254, }, F: { name: "LineStringId", type: "xs:ID", isPrimaryId: true, isOptional: true, isOnlyV4: true, }, }; const CHILD_TAGS = { PNT: { name: "Point", isOnlyV4: false }, }; class LineString { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = "LSG" /* TAGS.LineString */; } static fromXML(xml, isoxmlManager, internalId, targetClass = LineString) { return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS); } } exports.LineString = LineString; (0, classRegistry_1.registerEntityClass)("main", "LSG" /* TAGS.LineString */, LineString);