UNPKG

@p2olab/pimad-core

Version:

PiMAd (Process-industry-Modular-Automation-description) High level access to automation of modular plants.

55 lines (54 loc) 1.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseParameterFactory = void 0; const Utils_1 = require("../Utils"); const Backbone_1 = require("../Backbone"); var PiMAdResponseVendor = Backbone_1.Backbone.PiMAdResponseVendor; class AParameter { constructor() { this.communication = []; this.interfaceClass = null; this.name = ''; this.initialized = false; this.responseVendor = new PiMAdResponseVendor(); } getAllCommunicationInterfaceData() { return this.communication; } getName() { return this.name; } getInterfaceClass() { return this.responseVendor.buyErrorResponse(); } getCommunicationInterfaceData(tag) { // TODO > Big refactor! Response type, callback, etc. // add Operations for InterfaceData by tag : CommunicationInterfaceData return {}; } initialize(name, communication, interfaceClass) { if (!this.initialized) { //TODO: much more checking this.name = name; this.communication = communication; this.interfaceClass = interfaceClass; this.initialized = (this.name == name && this.communication == communication && this.interfaceClass == interfaceClass); return this.initialized; } else { return false; } } } class BaseParameter extends AParameter { } class AParameterFactory { } class BaseParameterFactory extends AParameterFactory { create() { const parameter = new BaseParameter(); Utils_1.logger.debug(this.constructor.name + ' creates a ' + parameter.constructor.name); return parameter; } } exports.BaseParameterFactory = BaseParameterFactory;