isoxml-angular
Version:
JavaScript library to parse and generate ISOXML (ISO11783-10) files
114 lines (113 loc) • 2.98 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimelogPosition = 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,
allowEmptyString: true,
},
B: {
name: "PositionEast",
type: "xs:decimal",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: -180,
maxValue: 180,
fractionDigits: 9,
allowEmptyString: true,
},
C: {
name: "PositionUp",
type: "xs:long",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: -2147483648,
maxValue: 2147483647,
allowEmptyString: true,
},
D: {
name: "PositionStatus",
type: "xs:NMTOKEN",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
allowEmptyString: true,
},
E: {
name: "PDOP",
type: "xs:decimal",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: 0,
maxValue: 99.9,
allowEmptyString: true,
},
F: {
name: "HDOP",
type: "xs:decimal",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: 0,
maxValue: 99.9,
allowEmptyString: true,
},
G: {
name: "NumberOfSatellites",
type: "xs:unsignedByte",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: 0,
maxValue: 254,
allowEmptyString: true,
},
H: {
name: "GpsUtcTime",
type: "xs:unsignedLong",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: 0,
maxValue: 4294967294,
allowEmptyString: true,
},
I: {
name: "GpsUtcDate",
type: "xs:unsignedShort",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: 0,
maxValue: 65534,
allowEmptyString: true,
},
};
const CHILD_TAGS = {};
class TimelogPosition {
constructor(attributes, isoxmlManager) {
this.attributes = attributes;
this.isoxmlManager = isoxmlManager;
this.tag = "PTN" /* TAGS.Position */;
}
static fromXML(xml, isoxmlManager, internalId, targetClass = TimelogPosition) {
return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId);
}
toXML() {
return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS);
}
}
exports.TimelogPosition = TimelogPosition;
(0, classRegistry_1.registerEntityClass)("timelog", "PTN" /* TAGS.Position */, TimelogPosition);