"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.RisingBollardsNodeService = void 0;
const agv_constant_1 = require("../../entity/agv.constant");
const risingbollards_axis_util_1 = require("../../utils/risingbollards-axis.util");
const risingbollards_node_config_1 = require("./risingbollards-node-config");
const risingbollards_node_1 = require("./risingbollards-node");
class RisingBollardsNodeService {
  constructor() {
    this.programNodeConfig = new risingbollards_node_config_1.RisingBollardsNodeConfig();
    this.funcMap = new Map();
    this.funcMap.set('risingbollards/axis-config/get', this.getFixedAxisConfig.bind(this));
  }
  loadFromXml(dataModel) {
    const node = new risingbollards_node_1.RisingBollardsNode(this.programModel);
    node.setDataModel(dataModel);
    return node;
  }
  setProgramModel(programModel) {
    this.programModel = programModel;
  }
  getProgramNodeConfig() {
    return this.programNodeConfig;
  }
  getRpcMap() {
    return this.funcMap;
  }
  createNode() {
    return {
      nodeId: this.programNodeConfig.id,
      node: new risingbollards_node_1.RisingBollardsNode(this.programModel),
      children: []
    };
  }
  cloneNode(node) {
    return new risingbollards_node_1.RisingBollardsNode(this.programModel).cloneNode(node);
  }
  getFixedAxisConfig() {
    return {
      axisName: (0, risingbollards_axis_util_1.getRisingBollardsAxisName)(),
      axisGroupName: agv_constant_1.RISING_BOLLARDS_AXIS_GROUP_NAME
    };
  }
}
exports.RisingBollardsNodeService = RisingBollardsNodeService;
//# sourceMappingURL=risingbollards-node-service.js.map