UNPKG

isoxml

Version:

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

52 lines (51 loc) 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TimeLog = exports.TimeLogTimeLogTypeEnum = void 0; const constants_1 = require("./constants"); const classRegistry_1 = require("../classRegistry"); const utils_1 = require("../utils"); var TimeLogTimeLogTypeEnum; (function (TimeLogTimeLogTypeEnum) { TimeLogTimeLogTypeEnum["BinaryTimelogFileType1"] = "1"; })(TimeLogTimeLogTypeEnum || (exports.TimeLogTimeLogTypeEnum = TimeLogTimeLogTypeEnum = {})); const ATTRIBUTES = { A: { name: 'Filename', type: 'xs:ID', isPrimaryId: false, isOptional: false, isOnlyV4: false, }, B: { name: 'Filelength', type: 'xs:unsignedLong', isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 4294967294, }, C: { name: 'TimeLogType', type: 'xs:NMTOKEN', isPrimaryId: false, isOptional: false, isOnlyV4: false, }, }; const CHILD_TAGS = {}; class TimeLog { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = constants_1.TAGS.TimeLog; } static fromXML(xml, isoxmlManager, internalId, targetClass = TimeLog) { return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS); } } exports.TimeLog = TimeLog; (0, classRegistry_1.registerEntityClass)('main', constants_1.TAGS.TimeLog, TimeLog);