isoxml-angular
Version:
JavaScript library to parse and generate ISOXML (ISO11783-10) files
124 lines (123 loc) • 3.1 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Point = void 0;
const classRegistry_1 = require("../classRegistry");
const utils_1 = require("../utils");
const ATTRIBUTES = {
A: {
name: "PointType",
type: "xs:NMTOKEN",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
allowEmptyString: true,
},
B: {
name: "PointDesignator",
type: "xs:string",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
},
C: {
name: "PointNorth",
type: "xs:decimal",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: -90,
maxValue: 90,
fractionDigits: 9,
allowEmptyString: true,
},
D: {
name: "PointEast",
type: "xs:decimal",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: -180,
maxValue: 180,
fractionDigits: 9,
allowEmptyString: true,
},
E: {
name: "PointUp",
type: "xs:long",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: -2147483647,
maxValue: 2147483647,
allowEmptyString: true,
},
F: {
name: "PointColour",
type: "xs:unsignedByte",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: 0,
maxValue: 254,
allowEmptyString: true,
},
G: {
name: "PointId",
type: "xs:ID",
isPrimaryId: true,
isOptional: true,
isOnlyV4: true,
},
H: {
name: "PointHorizontalAccuracy",
type: "xs:decimal",
isPrimaryId: false,
isOptional: true,
isOnlyV4: true,
minValue: 0,
maxValue: 65,
allowEmptyString: true,
},
I: {
name: "PointVerticalAccuracy",
type: "xs:decimal",
isPrimaryId: false,
isOptional: true,
isOnlyV4: true,
minValue: 0,
maxValue: 65,
allowEmptyString: true,
},
J: {
name: "Filename",
type: "xs:string",
isPrimaryId: false,
isOptional: true,
isOnlyV4: true,
},
K: {
name: "Filelength",
type: "xs:unsignedLong",
isPrimaryId: false,
isOptional: true,
isOnlyV4: true,
minValue: 0,
maxValue: 4294967294,
},
};
const CHILD_TAGS = {};
class Point {
constructor(attributes, isoxmlManager) {
this.attributes = attributes;
this.isoxmlManager = isoxmlManager;
this.tag = "PNT" /* TAGS.Point */;
}
static fromXML(xml, isoxmlManager, internalId, targetClass = Point) {
return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId);
}
toXML() {
return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS);
}
}
exports.Point = Point;
(0, classRegistry_1.registerEntityClass)("main", "PNT" /* TAGS.Point */, Point);