"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MyWebscopeCap = void 0;
const installation_node_service_1 = require("./installation-node-service");
const agv_node_service_1 = require("./program/agv/agv-node-service");
const charge_node_service_1 = require("./program/charge/charge-node-service");
const force_to_board_node_service_1 = require("./program/force-to-board/force-to-board-node-service");
const force_leave_board_node_service_1 = require("./program/force-leave-board/force-leave-board-node-service");
const openloop_node_service_1 = require("./program/openloop/openloop-node-service");
const relocation_node_service_1 = require("./program/relocation/relocation-node-service");
const alignrailway_node_service_1 = require("./program/alignrailway/alignrailway-node-service");
const risingbollards_node_service_1 = require("./program/risingbollards/risingbollards-node-service");
const visioninspection_node_service_1 = require("./program/visioninspection/visioninspection-node-service");
const visionpick_node_service_1 = require("./program/visionpick/visionpick-node-service");
const basketunload_node_service_1 = require("./program/basketunload/basketunload-node-service");
const scope_setting_1 = require("./scope-setting");
const webscope_service_1 = require("./webscope-service");
const agv_service_1 = require("./service/agv.service");
const robot_init_service_1 = require("./service/robot-init.service");
class MyWebscopeCap {
  constructor(service) {
    this._rpcMap = new Map();
    this.programNodes = [new agv_node_service_1.AgvNodeService(), new charge_node_service_1.ChargeNodeService(), new force_to_board_node_service_1.ForceToBoardNodeService(), new force_leave_board_node_service_1.ForceLeaveBoardNodeService(), new openloop_node_service_1.OpenLoopNodeService(), new relocation_node_service_1.RelocationNodeService(), new alignrailway_node_service_1.AlignRailwayNodeService(), new risingbollards_node_service_1.RisingBollardsNodeService(), new visioninspection_node_service_1.VisionInspectionNodeService(), new visionpick_node_service_1.VisionPickNodeService(), new basketunload_node_service_1.BasketUnloadNodeService()];
    this.installNodes = [new installation_node_service_1.AgvInstallationNodeService(), new installation_node_service_1.RisingBollardsInstallationNodeService()];
    this.webscopeService = service;
    (0, scope_setting_1.setScopeSetting)(service.getScopeSetting());
    (0, webscope_service_1.setWebscopeService)(service);
    this.registerProgramNodeRpcMap();
    new agv_service_1.AgvService();
    new robot_init_service_1.RobotInitService();
  }
  getProgramNodeServie() {
    return this.programNodes;
  }
  getInstallationNodeServices() {
    return this.installNodes;
  }
  getRpcMap() {
    return this._rpcMap;
  }
  registerProgramNodeRpcMap() {
    for (const nodeService of this.programNodes) {
      if (!this.hasRpcMap(nodeService)) {
        continue;
      }
      for (const [rpcName, rpcHandler] of nodeService.getRpcMap()) {
        this._rpcMap.set(rpcName, rpcHandler);
      }
    }
  }
  hasRpcMap(nodeService) {
    return typeof nodeService.getRpcMap === 'function';
  }
}
exports.MyWebscopeCap = MyWebscopeCap;
//# sourceMappingURL=webscope_cap.impl.js.map