"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MarkedObject = void 0;
const integration_base_1 = require("@things-factory/integration-base");
const robotics_types_1 = require("../../controllers/robotics-types");
class MarkedObject {
    async ready(connectionConfigs) {
        await Promise.all(connectionConfigs.map(this.connect.bind(this)));
        integration_base_1.ConnectionManager.logger.info('marked-object connections are ready');
    }
    async connect(connection) {
        // var { params } = connection
        integration_base_1.ConnectionManager.addConnectionInstance(connection, Object.assign({ discriminator: robotics_types_1.ROBOTICS_OBJECT_TYPES.OBJECT }, connection));
        integration_base_1.ConnectionManager.logger.info(`marked-object connection(${connection.name}:${connection.endpoint}) is connected`);
    }
    async disconnect(connection) {
        integration_base_1.ConnectionManager.removeConnectionInstance(connection);
        integration_base_1.ConnectionManager.logger.info(`marked-object connection(${connection.name}) is disconnected`);
    }
    get parameterSpec() {
        return [
            {
                type: 'string',
                label: 'type',
                name: 'type'
            },
            {
                type: 'offset-pose-simple',
                label: 'poi-offset',
                name: 'poiOffset'
            }
        ];
    }
    get taskPrefixes() {
        return ['trackable-object'];
    }
    get help() {
        return 'robotics/connector/marked-object';
    }
}
exports.MarkedObject = MarkedObject;
integration_base_1.ConnectionManager.registerConnector('marked-object', new MarkedObject());
//# sourceMappingURL=marked-object.js.map