tcx-builder
Version:
42 lines (41 loc) • 1.86 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var AbstractSource_1 = require("./AbstractSource");
var _common_1 = require("../_common");
var AbstractSourceAttributes_1 = require("./AbstractSourceAttributes");
var Device = /** @class */ (function (_super) {
__extends(Device, _super);
function Device(options) {
var _this = this;
var attributes = new AbstractSourceAttributes_1.AbstractSourceAttributes('Device_t');
_this = _super.call(this, attributes, options.name) || this;
_this.attributes = attributes;
_this.UnitId = options.unitId;
_this.ProductID = options.productID;
_this.Version = options.version;
return _this;
}
Device.prototype.toXml = function () {
var xmlElement = '';
xmlElement += _common_1.BaseObject.buildXmlNode('Name', this.Name);
xmlElement += _common_1.BaseObject.buildXmlNode('UnitId', this.UnitId.toString());
xmlElement += _common_1.BaseObject.buildXmlNode('ProductId', this.ProductID.toString());
xmlElement += _common_1.BaseObject.buildXmlNode('Version', this.Version.toXml());
return xmlElement;
};
return Device;
}(AbstractSource_1.AbstractSource));
exports.Device = Device;