UNPKG

isoxml-angular

Version:

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

72 lines (71 loc) 1.98 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ValuePresentation = void 0; const classRegistry_1 = require("../classRegistry"); const utils_1 = require("../utils"); const ATTRIBUTES = { A: { name: 'ValuePresentationId', type: 'xs:ID', isPrimaryId: true, isOptional: false, isOnlyV4: false, }, B: { name: 'Offset', type: 'xs:long', isPrimaryId: false, isOptional: false, isOnlyV4: false, minValue: -2147483648, maxValue: 2147483647, }, C: { name: 'Scale', type: 'xs:decimal', isPrimaryId: false, isOptional: false, isOnlyV4: false, minValue: 1e-9, maxValue: 100000000, }, D: { name: 'NumberOfDecimals', type: 'xs:unsignedByte', isPrimaryId: false, isOptional: false, isOnlyV4: false, minValue: 0, maxValue: 7, }, E: { name: 'UnitDesignator', type: 'xs:string', isPrimaryId: false, isOptional: true, isOnlyV4: false, }, F: { name: 'ColourLegendIdRef', type: 'xs:IDREF', isPrimaryId: false, isOptional: true, isOnlyV4: false, }, }; const CHILD_TAGS = {}; class ValuePresentation { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = "VPN" /* TAGS.ValuePresentation */; } static fromXML(xml, isoxmlManager, internalId, targetClass = ValuePresentation) { return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS); } } exports.ValuePresentation = ValuePresentation; (0, classRegistry_1.registerEntityClass)('main', "VPN" /* TAGS.ValuePresentation */, ValuePresentation);