isoxml-angular
Version:
JavaScript library to parse and generate ISOXML (ISO11783-10) files
144 lines (143 loc) • 3.8 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GuidancePattern = void 0;
const classRegistry_1 = require("../classRegistry");
const utils_1 = require("../utils");
const ATTRIBUTES = {
A: {
name: "GuidancePatternId",
type: "xs:ID",
isPrimaryId: true,
isOptional: false,
isOnlyV4: undefined,
},
B: {
name: "GuidancePatternDesignator",
type: "xs:string",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
},
C: {
name: "GuidancePatternType",
type: "xs:NMTOKEN",
isPrimaryId: false,
isOptional: false,
isOnlyV4: undefined,
},
D: {
name: "GuidancePatternOptions",
type: "xs:NMTOKEN",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
},
E: {
name: "GuidancePatternPropagationDirection",
type: "xs:NMTOKEN",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
},
F: {
name: "GuidancePatternExtension",
type: "xs:NMTOKEN",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
},
G: {
name: "GuidancePatternHeading",
type: "xs:decimal",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
minValue: 0,
maxValue: 360,
},
H: {
name: "GuidancePatternRadius",
type: "xs:unsignedLong",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
minValue: 0,
maxValue: 4294967294,
},
I: {
name: "GuidancePatternGNSSMethod",
type: "xs:NMTOKEN",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
},
J: {
name: "GuidancePatternHorizontalAccuracy",
type: "xs:decimal",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
minValue: 0,
maxValue: 65,
},
K: {
name: "GuidancePatternVerticalAccuracy",
type: "xs:decimal",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
minValue: 0,
maxValue: 65,
},
L: {
name: "BaseStationIdRef",
type: "xs:IDREF",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
},
M: {
name: "OriginalSRID",
type: "xs:string",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
},
N: {
name: "NumberOfSwathsLeft",
type: "xs:unsignedLong",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
minValue: 0,
maxValue: 4294967294,
},
O: {
name: "NumberOfSwathsRight",
type: "xs:unsignedLong",
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
minValue: 0,
maxValue: 4294967294,
},
};
const CHILD_TAGS = {
LSG: { name: "LineString", isOnlyV4: undefined },
PLN: { name: "BoundaryPolygon", isOnlyV4: undefined },
};
class GuidancePattern {
constructor(attributes, isoxmlManager) {
this.attributes = attributes;
this.isoxmlManager = isoxmlManager;
this.tag = "GPN" /* TAGS.GuidancePattern */;
}
static fromXML(xml, isoxmlManager, internalId, targetClass = GuidancePattern) {
return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId);
}
toXML() {
return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS);
}
}
exports.GuidancePattern = GuidancePattern;
(0, classRegistry_1.registerEntityClass)("main", "GPN" /* TAGS.GuidancePattern */, GuidancePattern);