UNPKG

isoxml

Version:

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

48 lines (47 loc) 1.37 kB
import { TAGS } from './constants'; import { registerEntityClass } from '../classRegistry'; import { fromXML, toXML } from '../utils'; export var TimeLogTimeLogTypeEnum; (function (TimeLogTimeLogTypeEnum) { TimeLogTimeLogTypeEnum["BinaryTimelogFileType1"] = "1"; })(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 = {}; export class TimeLog { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = TAGS.TimeLog; } static fromXML(xml, isoxmlManager, internalId, targetClass = TimeLog) { return fromXML(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return toXML(this, ATTRIBUTES, CHILD_TAGS); } } registerEntityClass('main', TAGS.TimeLog, TimeLog);