UNPKG

isoxml-angular

Version:

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

105 lines (104 loc) 2.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Position = void 0; const classRegistry_1 = require("../classRegistry"); const utils_1 = require("../utils"); const ATTRIBUTES = { A: { name: "PositionNorth", type: "xs:decimal", isPrimaryId: false, isOptional: false, isOnlyV4: false, minValue: -90, maxValue: 90, fractionDigits: 9, }, B: { name: "PositionEast", type: "xs:decimal", isPrimaryId: false, isOptional: false, isOnlyV4: false, minValue: -180, maxValue: 180, fractionDigits: 9, }, C: { name: "PositionUp", type: "xs:long", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: -2147483648, maxValue: 2147483647, }, D: { name: "PositionStatus", type: "xs:NMTOKEN", isPrimaryId: false, isOptional: false, isOnlyV4: false, }, E: { name: "PDOP", type: "xs:decimal", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 99.9, }, F: { name: "HDOP", type: "xs:decimal", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 99.9, }, G: { name: "NumberOfSatellites", type: "xs:unsignedByte", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 254, }, H: { name: "GpsUtcTime", type: "xs:unsignedLong", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 4294967294, }, I: { name: "GpsUtcDate", type: "xs:unsignedShort", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 65534, }, }; const CHILD_TAGS = {}; class Position { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = "PTN" /* TAGS.Position */; } static fromXML(xml, isoxmlManager, internalId, targetClass = Position) { return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS); } } exports.Position = Position; (0, classRegistry_1.registerEntityClass)("main", "PTN" /* TAGS.Position */, Position);