isoxml-angular
Version:
JavaScript library to parse and generate ISOXML (ISO11783-10) files
67 lines (66 loc) • 1.94 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeviceValuePresentation = void 0;
const classRegistry_1 = require("../classRegistry");
const utils_1 = require("../utils");
const ATTRIBUTES = {
A: {
name: 'DeviceValuePresentationObjectId',
type: 'xs:unsignedShort',
isPrimaryId: false,
isOptional: false,
isOnlyV4: false,
minValue: 1,
maxValue: 65534,
},
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,
},
};
const CHILD_TAGS = {};
class DeviceValuePresentation {
constructor(attributes, isoxmlManager) {
this.attributes = attributes;
this.isoxmlManager = isoxmlManager;
this.tag = "DVP" /* TAGS.DeviceValuePresentation */;
}
static fromXML(xml, isoxmlManager, internalId, targetClass = DeviceValuePresentation) {
return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId);
}
toXML() {
return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS);
}
}
exports.DeviceValuePresentation = DeviceValuePresentation;
(0, classRegistry_1.registerEntityClass)('main', "DVP" /* TAGS.DeviceValuePresentation */, DeviceValuePresentation);