isoxml-angular
Version:
JavaScript library to parse and generate ISOXML (ISO11783-10) files
112 lines (111 loc) • 2.81 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Grid = void 0;
const classRegistry_1 = require("../classRegistry");
const utils_1 = require("../utils");
const ATTRIBUTES = {
A: {
name: "GridMinimumNorthPosition",
type: "xs:decimal",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: -90,
maxValue: 90,
fractionDigits: 9,
},
B: {
name: "GridMinimumEastPosition",
type: "xs:decimal",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: -180,
maxValue: 180,
fractionDigits: 9,
},
C: {
name: "GridCellNorthSize",
type: "xs:double",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: 0,
maxValue: 1,
},
D: {
name: "GridCellEastSize",
type: "xs:double",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: 0,
maxValue: 1,
},
E: {
name: "GridMaximumColumn",
type: "xs:unsignedLong",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: 0,
maxValue: 4294967295,
},
F: {
name: "GridMaximumRow",
type: "xs:unsignedLong",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: 0,
maxValue: 4294967295,
},
G: {
name: "Filename",
type: "xs:ID",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
},
H: {
name: "Filelength",
type: "xs:unsignedLong",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: 0,
maxValue: 4294967294,
},
I: {
name: "GridType",
type: "xs:NMTOKEN",
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
},
J: {
name: "TreatmentZoneCode",
type: "xs:unsignedByte",
isPrimaryId: false,
isOptional: true,
isOnlyV4: false,
minValue: 0,
maxValue: 254,
},
};
const CHILD_TAGS = {};
class Grid {
constructor(attributes, isoxmlManager) {
this.attributes = attributes;
this.isoxmlManager = isoxmlManager;
this.tag = "GRD" /* TAGS.Grid */;
}
static fromXML(xml, isoxmlManager, internalId, targetClass = Grid) {
return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId);
}
toXML() {
return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS);
}
}
exports.Grid = Grid;
(0, classRegistry_1.registerEntityClass)("main", "GRD" /* TAGS.Grid */, Grid);