UNPKG

isoxml

Version:

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

80 lines (79 loc) 2.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ControlAssignment = void 0; const constants_1 = require("./constants"); const classRegistry_1 = require("../classRegistry"); const utils_1 = require("../utils"); const ATTRIBUTES = { A: { name: 'SourceClientNAME', type: 'xs:hexBinary', isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, B: { name: 'UserClientNAME', type: 'xs:hexBinary', isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, C: { name: 'SourceDeviceStructureLabel', type: 'xs:hexBinary', isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, D: { name: 'UserDeviceStructureLabel', type: 'xs:hexBinary', isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, E: { name: 'SourceDeviceElementNumber', type: 'xs:unsignedShort', isPrimaryId: false, isOptional: false, isOnlyV4: undefined, minValue: 0, maxValue: 4095, }, F: { name: 'UserDeviceElementNumber', type: 'xs:unsignedShort', isPrimaryId: false, isOptional: false, isOnlyV4: undefined, minValue: 0, maxValue: 4095, }, G: { name: 'ProcessDataDDI', type: 'xs:hexBinary', isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, }; const CHILD_TAGS = { ASP: { name: 'AllocationStamp', isOnlyV4: undefined }, }; class ControlAssignment { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = constants_1.TAGS.ControlAssignment; } static fromXML(xml, isoxmlManager, internalId, targetClass = ControlAssignment) { return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS); } } exports.ControlAssignment = ControlAssignment; (0, classRegistry_1.registerEntityClass)('main', constants_1.TAGS.ControlAssignment, ControlAssignment);