<script setup lang="ts">
import lodash from "lodash";
import { computed, reactive } from "vue";
import { ElButton, ElDivider, ElFormItem, ElIcon, ElInputNumber, useFormItem } from "element-plus";
import { CopyDocument, Delete } from "@element-plus/icons-vue";
import { Typeof } from "@ease-forge/shared";
import type Viewport from "@/core/engine/Viewport";
import {BayEditorProps} from "@/editor/propEditors/BayEditor.vue";
import PtrObject from "@/modules/amr/ptr/PtrObject";

defineOptions({
    name: 'PtrController',
});
// 读取组件 props 属性
const props = withDefaults(defineProps(), {});

function start() {
  const viewport: Viewport = window['viewport']
  // viewport.envManager.client.publish('/agv_robot/status', '')
  const item = viewport.state.selectedItem
  const ptrObject: PtrObject = viewport.state.selectedObject as PtrObject
  ptrObject.boot()
}

function stop() {
  const viewport: Viewport = window['viewport']
  // viewport.envManager.client.publish('/agv_robot/status', '')
  const item = viewport.state.selectedItem
  const ptrObject: PtrObject = viewport.state.selectedObject as PtrObject
  ptrObject.shutdown()
}


</script>

<template>
    <div class="ptr-controller">
      <el-button @click="start">启动</el-button>
      <el-button @click="stop">关闭</el-button>
    </div>
</template>

<style scoped>
.ptr-controller {
    width: 100%;
    user-select: none;
}
</style>
