"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CameraConnector = void 0;
const integration_base_1 = require("@things-factory/integration-base");
const robotics_types_1 = require("../../controllers/robotics-types");
class CameraConnector {
    async ready(connectionConfigs) {
        await Promise.all(connectionConfigs.map(this.connect.bind(this)));
        integration_base_1.ConnectionManager.logger.info('camera-connector connections are ready');
    }
    async connect(connection) {
        // var { params } = connection
        integration_base_1.ConnectionManager.addConnectionInstance(connection, Object.assign({ discriminator: robotics_types_1.ROBOTICS_OBJECT_TYPES.CAMERA }, connection));
        integration_base_1.ConnectionManager.logger.info(`camera-connector connection(${connection.name}:${connection.endpoint}) is connected`);
    }
    async disconnect(connection) {
        integration_base_1.ConnectionManager.removeConnectionInstance(connection);
        integration_base_1.ConnectionManager.logger.info(`camera-connector connection(${connection.name}) is disconnected`);
    }
    get parameterSpec() {
        return [
            {
                type: 'string',
                label: 'device',
                name: 'device'
            },
            {
                type: 'string',
                label: 'width',
                name: 'width'
            },
            {
                type: 'string',
                label: 'height',
                name: 'height'
            },
            {
                type: 'entity-selector',
                label: 'base-robot-arm',
                name: 'baseRobotArm',
                property: {
                    queryName: 'robotArms',
                    valueKey: 'name'
                }
            },
            //   {
            //     type: 'camera-setting',
            //     label: 'setting',
            //     name: 'setting'
            //   },
            {
                type: 'camera-calibration',
                label: 'camera calibration',
                name: 'cameraCalibration'
            },
            //   {
            //     type: 'camera-roi',
            //     label: 'rois',
            //     name: 'rois'
            //   },
            {
                type: 'handeye-config',
                label: 'handeye configuration',
                name: 'handEyeConfig'
            },
            {
                type: 'handeye-calibration',
                label: 'handeye matrix',
                name: 'handEyeMatrix'
            },
            {
                type: 'offset-pose-simple',
                label: 'camera object offset',
                name: 'camObjOffset'
            }
        ];
    }
    get taskPrefixes() {
        return ['camera'];
    }
    get help() {
        return 'robotics/connector/camera-connector';
    }
}
exports.CameraConnector = CameraConnector;
integration_base_1.ConnectionManager.registerConnector('camera-connector', new CameraConnector());
//# sourceMappingURL=camera.js.map