isoxml
Version:
JavaScript library to parse and generate ISOXML (ISO11783-10) files
64 lines (63 loc) • 1.75 kB
JavaScript
import { TAGS } from './constants';
import { registerEntityClass } from '../classRegistry';
import { fromXML, toXML } from '../utils';
const ATTRIBUTES = {
A: {
name: 'GuidanceGroupIdRef',
type: 'xs:IDREF',
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
},
B: {
name: 'GuidancePatternIdRef',
type: 'xs:IDREF',
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
},
C: {
name: 'GuidanceEastShift',
type: 'xs:long',
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
minValue: -2147483648,
maxValue: 2147483647,
},
D: {
name: 'GuidanceNorthShift',
type: 'xs:long',
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
minValue: -2147483648,
maxValue: 2147483647,
},
E: {
name: 'PropagationOffset',
type: 'xs:long',
isPrimaryId: false,
isOptional: true,
isOnlyV4: undefined,
minValue: -2147483648,
maxValue: 2147483647,
},
};
const CHILD_TAGS = {
ASP: { name: 'AllocationStamp', isOnlyV4: undefined },
};
export class GuidanceShift {
constructor(attributes, isoxmlManager) {
this.attributes = attributes;
this.isoxmlManager = isoxmlManager;
this.tag = TAGS.GuidanceShift;
}
static fromXML(xml, isoxmlManager, internalId, targetClass = GuidanceShift) {
return fromXML(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId);
}
toXML() {
return toXML(this, ATTRIBUTES, CHILD_TAGS);
}
}
registerEntityClass('main', TAGS.GuidanceShift, GuidanceShift);