You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

795 lines
24 KiB

3 months ago
3 months ago
  1. <script lang="ts" setup>
  2. import { socket } from 'libs/socket'
  3. import { sendControl } from 'libs/utils'
  4. import { useDebugStore } from 'stores/debugStore'
  5. import { useSystemStore } from 'stores/systemStore'
  6. import { onMounted, onUnmounted } from 'vue'
  7. const systemStore = useSystemStore()
  8. const debugStore = useDebugStore()
  9. onMounted(() => {
  10. socket.init(receiveMessage, 'notification')
  11. })
  12. onUnmounted(() => {
  13. socket.unregisterCallback(receiveMessage, 'notification')
  14. })
  15. const receiveMessage = (data: Socket.NotificationData) => {
  16. systemStore.pushSystemList(data)
  17. }
  18. const pallet_elevator_lift_up = async () => {
  19. const params = {
  20. command: 'debug_pallet_elevator_lift_up',
  21. params: {
  22. index: debugStore.formData.heatArea.index,
  23. ...debugStore.formData.heatArea.heatMotorData,
  24. },
  25. }
  26. await sendControl(params, 'debug')
  27. }
  28. const pallet_elevator_lift_down = async () => {
  29. const params = {
  30. command: 'debug_pallet_elevator_lift_down',
  31. params: {
  32. index: debugStore.formData.heatArea.index,
  33. ...debugStore.formData.heatArea.heatMotorData,
  34. },
  35. }
  36. await sendControl(params, 'debug')
  37. }
  38. const pallet_elevator_stop = async () => {
  39. const params = {
  40. command: 'debug_pallet_elevator_stop',
  41. params: {
  42. index: debugStore.formData.heatArea.index,
  43. },
  44. }
  45. await sendControl(params, 'debug')
  46. }
  47. const heater_start = async () => {
  48. const params = {
  49. command: 'debug_heater_start',
  50. params: {
  51. index: debugStore.formData.heatArea.index,
  52. ...debugStore.formData.heatArea.heatTemperature,
  53. },
  54. }
  55. await sendControl(params, 'debug')
  56. }
  57. const heater_stop = async () => {
  58. const params = {
  59. command: 'debug_heater_stop',
  60. params: {
  61. index: debugStore.formData.heatArea.index,
  62. },
  63. }
  64. await sendControl(params, 'debug')
  65. }
  66. const debug_heater_start_heat_maintaining = async () => {
  67. const params = {
  68. command: 'debug_heater_start_heat_maintaining',
  69. params: {
  70. index: debugStore.formData.heatArea.index,
  71. ...debugStore.formData.heatArea.heatTemperature,
  72. },
  73. }
  74. await sendControl(params, 'debug')
  75. }
  76. const debug_heater_stop_heat_maintaining = async () => {
  77. const params = {
  78. command: 'debug_heater_stop_heat_maintaining',
  79. params: {
  80. index: debugStore.formData.heatArea.index,
  81. },
  82. }
  83. await sendControl(params, 'debug')
  84. }
  85. const debug_fan_start = async () => {
  86. const params = {
  87. command: 'debug_fan_start',
  88. params: {
  89. index: debugStore.formData.heatArea.index,
  90. },
  91. }
  92. await sendControl(params, 'debug')
  93. }
  94. const debug_fan_stop = async () => {
  95. const params = {
  96. command: 'debug_fan_stop',
  97. params: {
  98. index: debugStore.formData.heatArea.index,
  99. },
  100. }
  101. await sendControl(params, 'debug')
  102. }
  103. const debug_cover_elvator_lift_up = async () => {
  104. const params = {
  105. command: 'debug_cover_elvator_lift_up',
  106. params: {
  107. ...debugStore.formData.lidData,
  108. },
  109. }
  110. await sendControl(params, 'debug')
  111. }
  112. const debug_cover_elvator_lift_down = async () => {
  113. const params = {
  114. command: 'debug_cover_elvator_lift_down',
  115. params: {
  116. ...debugStore.formData.lidData,
  117. },
  118. }
  119. await sendControl(params, 'debug')
  120. }
  121. const debug_cover_elvator_reset = async () => {
  122. const params = {
  123. command: 'debug_cover_elvator_reset',
  124. params: {},
  125. }
  126. await sendControl(params, 'debug')
  127. }
  128. const debug_cover_elvator_stop = async () => {
  129. const params = {
  130. command: 'debug_cover_elvator_stop',
  131. params: {},
  132. }
  133. await sendControl(params, 'debug')
  134. }
  135. const liquid_arm_reset = async () => {
  136. const params = {
  137. command: 'debug_liquid_arm_reset',
  138. params: {
  139. target: ['largeArm', 'smallArm'],
  140. },
  141. }
  142. await sendControl(params, 'debug')
  143. }
  144. const liquid_arm_rotation = async () => {
  145. const params = {
  146. command: 'debug_liquid_arm_rotation',
  147. params: {
  148. ...debugStore.formData.liquidArmData,
  149. },
  150. }
  151. await sendControl(params, 'debug')
  152. }
  153. const liquid_arm_stop = async () => {
  154. const params = {
  155. command: 'debug_liquid_arm_stop',
  156. params: {
  157. target: ['largeArm', 'smallArm'],
  158. },
  159. }
  160. await sendControl(params, 'debug')
  161. }
  162. const liquid_pump_pre_filling = async () => {
  163. const params = {
  164. command: 'debug_liquid_pump_pre_filling',
  165. params: {
  166. index: debugStore.formData.liquidPumpData.index,
  167. },
  168. }
  169. await sendControl(params, 'debug')
  170. }
  171. const liquid_pump_pre_evacuation = async () => {
  172. const params = {
  173. command: 'debug_liquid_pump_pre_evacuation',
  174. params: {
  175. index: debugStore.formData.liquidPumpData.index,
  176. },
  177. }
  178. await sendControl(params, 'debug')
  179. }
  180. const liquid_pump_start = async () => {
  181. const params = {
  182. command: 'debug_liquid_pump_start',
  183. params: {
  184. ...debugStore.formData.liquidPumpData,
  185. },
  186. }
  187. await sendControl(params, 'debug')
  188. }
  189. const liquid_pump_stop = async () => {
  190. const params = {
  191. command: 'debug_liquid_pump_stop',
  192. params: {
  193. index: debugStore.formData.liquidPumpData.index,
  194. },
  195. }
  196. await sendControl(params, 'debug')
  197. }
  198. const shaker_start = async () => {
  199. const params = {
  200. command: 'debug_shaker_start',
  201. params: {
  202. ...debugStore.formData.shakeSpeed,
  203. },
  204. }
  205. await sendControl(params, 'debug')
  206. }
  207. const shaker_stop = async () => {
  208. const params = {
  209. command: 'debug_shaker_stop',
  210. params: {},
  211. }
  212. await sendControl(params, 'debug')
  213. }
  214. const debug_transportation_arm_reset = async (motor: 'x' | 'y' | 'z') => {
  215. const params = {
  216. command: 'debug_transportation_arm_reset',
  217. params: {
  218. dim: [motor],
  219. },
  220. }
  221. await sendControl(params, 'debug')
  222. }
  223. const debug_transportation_arm_move = async (motor: 'x' | 'y' | 'z') => {
  224. const params = {
  225. command: 'debug_transportation_arm_move',
  226. params: {
  227. ...debugStore.formData.transferModule[`${motor}MotorData`],
  228. },
  229. }
  230. await sendControl(params, 'debug')
  231. }
  232. const debug_transportation_arm_stop = async (motor: 'x' | 'y' | 'z') => {
  233. const params = {
  234. command: 'debug_transportation_arm_stop',
  235. params: {
  236. dim: [motor],
  237. },
  238. }
  239. await sendControl(params, 'debug')
  240. }
  241. const debug_holding_jaw_open = async () => {
  242. const params = {
  243. command: 'debug_holding_jaw_open',
  244. params: {
  245. ...debugStore.formData.transferModule.JawData,
  246. },
  247. }
  248. await sendControl(params, 'debug')
  249. }
  250. const debug_holding_jaw_close = async () => {
  251. const params = {
  252. command: 'debug_holding_jaw_close',
  253. params: {
  254. ...debugStore.formData.transferModule.JawData,
  255. },
  256. }
  257. await sendControl(params, 'debug')
  258. }
  259. const debug_holding_jaw_pause = async () => {
  260. const params = {
  261. command: 'debug_holding_jaw_pause',
  262. params: {},
  263. }
  264. await sendControl(params, 'debug')
  265. }
  266. const door_open = async () => {
  267. const params = {
  268. command: 'debug_door_open',
  269. params: {},
  270. }
  271. await sendControl(params, 'debug')
  272. }
  273. const door_close = async () => {
  274. const params = {
  275. command: 'debug_door_close',
  276. params: {},
  277. }
  278. await sendControl(params, 'debug')
  279. }
  280. const door_stop = async () => {
  281. const params = {
  282. command: 'debug_door_stop',
  283. params: {},
  284. }
  285. await sendControl(params, 'debug')
  286. }
  287. </script>
  288. <template>
  289. <div class="debug-content">
  290. <el-row :gutter="10">
  291. <el-col :span="8">
  292. <el-card>
  293. <template #header>
  294. <div class="card-header">
  295. <span>转运模组</span>
  296. </div>
  297. </template>
  298. <el-divider>X轴电机</el-divider>
  299. <div class="card-box">
  300. <el-form>
  301. <el-form-item label="距离">
  302. <el-input v-model.number="debugStore.formData.transferModule.xMotorData.xDimDistance" type="number" placeholder="请输入距离">
  303. <template #append>
  304. mm
  305. </template>
  306. </el-input>
  307. </el-form-item>
  308. <el-form-item label="速度">
  309. <el-input v-model.number="debugStore.formData.transferModule.xMotorData.xDimRate" type="number" placeholder="请输入速度">
  310. <template #append>
  311. mm/s
  312. </template>
  313. </el-input>
  314. </el-form-item>
  315. <el-form-item>
  316. <ft-button type="primary" :click-handle="() => debug_transportation_arm_reset('x')">
  317. 回原点
  318. </ft-button>
  319. <ft-button type="primary" :click-handle="() => debug_transportation_arm_move('x')">
  320. 开始
  321. </ft-button>
  322. <ft-button :click-handle="() => debug_transportation_arm_stop('x')">
  323. 停止
  324. </ft-button>
  325. </el-form-item>
  326. </el-form>
  327. </div>
  328. <el-divider>Y轴电机</el-divider>
  329. <div class="card-box">
  330. <el-form>
  331. <el-form-item label="距离">
  332. <el-input v-model.number="debugStore.formData.transferModule.yMotorData.yDimDistance" type="number" placeholder="请输入距离">
  333. <template #append>
  334. mm
  335. </template>
  336. </el-input>
  337. </el-form-item>
  338. <el-form-item label="速度">
  339. <el-input v-model.number="debugStore.formData.transferModule.yMotorData.yDimRate" type="number" placeholder="请输入速度">
  340. <template #append>
  341. mm/s
  342. </template>
  343. </el-input>
  344. </el-form-item>
  345. <el-form-item>
  346. <ft-button type="primary" :click-handle="() => debug_transportation_arm_reset('y')">
  347. 回原点
  348. </ft-button>
  349. <ft-button type="primary" :click-handle="() => debug_transportation_arm_move('y')">
  350. 开始
  351. </ft-button>
  352. <ft-button :click-handle="() => debug_transportation_arm_stop('y')">
  353. 停止
  354. </ft-button>
  355. </el-form-item>
  356. </el-form>
  357. </div>
  358. <el-divider>Z轴电机</el-divider>
  359. <div class="card-box">
  360. <el-form>
  361. <el-form-item label="距离">
  362. <el-input v-model.number="debugStore.formData.transferModule.zMotorData.zDimDistance" type="number" placeholder="请输入距离">
  363. <template #append>
  364. mm
  365. </template>
  366. </el-input>
  367. </el-form-item>
  368. <el-form-item label="速度">
  369. <el-input v-model.number="debugStore.formData.transferModule.zMotorData.zDimRate" type="number" placeholder="请输入速度">
  370. <template #append>
  371. mm/s
  372. </template>
  373. </el-input>
  374. </el-form-item>
  375. <el-form-item>
  376. <ft-button type="primary" :click-handle="() => debug_transportation_arm_reset('z')">
  377. 回原点
  378. </ft-button>
  379. <ft-button type="primary" :click-handle="() => debug_transportation_arm_move('z')">
  380. 开始
  381. </ft-button>
  382. <ft-button :click-handle="() => debug_transportation_arm_stop('z')">
  383. 停止
  384. </ft-button>
  385. </el-form-item>
  386. </el-form>
  387. </div>
  388. <el-divider>夹爪舵机</el-divider>
  389. <div class="card-box">
  390. <el-form>
  391. <el-form-item label="速度">
  392. <el-input v-model.number="debugStore.formData.transferModule.JawData.rate" type="number" placeholder="请输入速度">
  393. <template #append>
  394. mm/s
  395. </template>
  396. </el-input>
  397. </el-form-item>
  398. <el-form-item>
  399. <ft-button type="primary" :click-handle="debug_holding_jaw_open">
  400. 打开
  401. </ft-button>
  402. <ft-button type="primary" :click-handle="debug_holding_jaw_close">
  403. 闭合
  404. </ft-button>
  405. <ft-button :click-handle="debug_holding_jaw_pause">
  406. 停止
  407. </ft-button>
  408. </el-form-item>
  409. </el-form>
  410. </div>
  411. </el-card>
  412. <el-card>
  413. <template #header>
  414. <div class="card-header">
  415. <span></span>
  416. </div>
  417. </template>
  418. <div class="card-box">
  419. <ft-button type="primary" :click-handle="door_open">
  420. 开门
  421. </ft-button>
  422. <ft-button type="primary" :click-handle="door_close">
  423. 关门
  424. </ft-button>
  425. <ft-button :click-handle="door_stop">
  426. 停止
  427. </ft-button>
  428. </div>
  429. </el-card>
  430. </el-col>
  431. <el-col :span="8">
  432. <el-card>
  433. <template #header>
  434. <div class="card-header">
  435. <span>加液模组</span>
  436. </div>
  437. </template>
  438. <el-divider>加液臂</el-divider>
  439. <div class="card-box">
  440. <el-form inline>
  441. <el-form-item label="大臂速度">
  442. <el-input v-model.number="debugStore.formData.liquidArmData.largeArmRotationRate" type="number" placeholder="请输入速度">
  443. <template #append>
  444. mm/s
  445. </template>
  446. </el-input>
  447. </el-form-item>
  448. <el-form-item label="大臂角度">
  449. <el-input v-model.number="debugStore.formData.liquidArmData.largeArmAngle" type="number" placeholder="请输入角度">
  450. <template #append>
  451. °
  452. </template>
  453. </el-input>
  454. </el-form-item>
  455. <el-form-item label="小臂速度">
  456. <el-input v-model.number="debugStore.formData.liquidArmData.smallArmRotationRate" type="number" placeholder="请输入速度">
  457. <template #append>
  458. mm/s
  459. </template>
  460. </el-input>
  461. </el-form-item>
  462. <el-form-item label="小臂角度">
  463. <el-input v-model.number="debugStore.formData.liquidArmData.smallArmAngle" type="number" placeholder="请输入角度">
  464. <template #append>
  465. °
  466. </template>
  467. </el-input>
  468. </el-form-item>
  469. </el-form>
  470. <ft-button type="primary" :click-handle="liquid_arm_reset">
  471. 复位
  472. </ft-button>
  473. <ft-button type="primary" :click-handle="liquid_arm_rotation">
  474. 开始
  475. </ft-button>
  476. <ft-button :click-handle="liquid_arm_stop">
  477. 停止
  478. </ft-button>
  479. </div>
  480. <el-divider>加液泵</el-divider>
  481. <div class="card-box">
  482. <el-form>
  483. <el-form-item label="加液速度">
  484. <el-input v-model.number="debugStore.formData.liquidPumpData.rate" type="number" placeholder="请输入速度">
  485. <template #append>
  486. mm/s
  487. </template>
  488. </el-input>
  489. </el-form-item>
  490. <el-form-item label="加液泵头">
  491. <el-select v-model="debugStore.formData.liquidPumpData.index" placeholder="请选择泵头">
  492. <el-option v-for="item in 8" :key="item" :label="item" :value="item" />
  493. </el-select>
  494. </el-form-item>
  495. <el-form-item>
  496. <ft-button type="primary" :click-handle="liquid_pump_pre_filling">
  497. 预充
  498. </ft-button>
  499. <ft-button :click-handle="liquid_pump_pre_evacuation">
  500. 排空
  501. </ft-button>
  502. </el-form-item>
  503. <el-form-item>
  504. <ft-button type="primary" :click-handle="liquid_pump_start">
  505. 启动
  506. </ft-button>
  507. <ft-button :click-handle="liquid_pump_stop">
  508. 停止
  509. </ft-button>
  510. </el-form-item>
  511. </el-form>
  512. </div>
  513. <el-divider>摇匀</el-divider>
  514. <div class="card-box">
  515. <el-form>
  516. <el-form-item label="摇匀速度">
  517. <el-input v-model.number="debugStore.formData.shakeSpeed.rate" type="number" placeholder="请输入速度">
  518. <template #append>
  519. mm/s
  520. </template>
  521. </el-input>
  522. </el-form-item>
  523. </el-form>
  524. <ft-button type="primary" :click-handle="shaker_start">
  525. 开始
  526. </ft-button>
  527. <ft-button :click-handle="shaker_stop">
  528. 停止
  529. </ft-button>
  530. </div>
  531. </el-card>
  532. <el-card>
  533. <template #header>
  534. <div class="card-header">
  535. <span>相机模组</span>
  536. </div>
  537. </template>
  538. <div class="card-box">
  539. <!-- <el-form> -->
  540. <!-- <el-form-item label="速度"> -->
  541. <!-- <el-input> -->
  542. <!-- <template #append> -->
  543. <!-- mm/s -->
  544. <!-- </template> -->
  545. <!-- </el-input> -->
  546. <!-- </el-form-item> -->
  547. <!-- <el-form-item label="距离"> -->
  548. <!-- <el-input> -->
  549. <!-- <template #append> -->
  550. <!-- ° -->
  551. <!-- </template> -->
  552. <!-- </el-input> -->
  553. <!-- </el-form-item> -->
  554. <!-- <el-form-item> -->
  555. <!-- <ft-button type="primary"> -->
  556. <!-- 抬升 -->
  557. <!-- </ft-button> -->
  558. <!-- <ft-button type="primary"> -->
  559. <!-- 下降 -->
  560. <!-- </ft-button> -->
  561. <!-- </el-form-item> -->
  562. <!-- <el-form-item> -->
  563. <!-- <ft-button type="primary"> -->
  564. <!-- 复位 -->
  565. <!-- </ft-button> -->
  566. <!-- <ft-button> -->
  567. <!-- 停止 -->
  568. <!-- </ft-button> -->
  569. <!-- </el-form-item> -->
  570. <!-- </el-form> -->
  571. </div>
  572. </el-card>
  573. </el-col>
  574. <el-col :span="8">
  575. <el-card>
  576. <template #header>
  577. <div class="card-header">
  578. <span>加热模组</span>
  579. <div>
  580. <el-select v-model="debugStore.formData.heatArea.index" style="width: 150px" placeholder="请选择区域">
  581. <el-option v-for="item in 6" :key="item" :label="`A${item}`" :value="item" />
  582. </el-select>
  583. </div>
  584. </div>
  585. </template>
  586. <el-divider>升降电机</el-divider>
  587. <div class="card-box">
  588. <el-form>
  589. <el-form-item label="距离">
  590. <el-input v-model.number="debugStore.formData.heatArea.heatMotorData.distance" type="number" placeholder="请输入距离">
  591. <template #append>
  592. mm
  593. </template>
  594. </el-input>
  595. </el-form-item>
  596. <el-form-item label="速度">
  597. <el-input v-model.number="debugStore.formData.heatArea.heatMotorData.rate" type="number" placeholder="请输入速度">
  598. <template #append>
  599. mm/s
  600. </template>
  601. </el-input>
  602. </el-form-item>
  603. </el-form>
  604. <ft-button type="primary" :click-handle="pallet_elevator_lift_up">
  605. 上升
  606. </ft-button>
  607. <ft-button type="primary" :click-handle="pallet_elevator_lift_down">
  608. 下降
  609. </ft-button>
  610. <ft-button :click-handle="pallet_elevator_stop">
  611. 停止
  612. </ft-button>
  613. </div>
  614. <el-divider>加热棒</el-divider>
  615. <div class="card-box">
  616. <el-form>
  617. <el-form-item label="温度">
  618. <el-input v-model.number="debugStore.formData.heatArea.heatTemperature.temperature" type="number" placeholder="请输入温度">
  619. <template #append>
  620. </template>
  621. </el-input>
  622. </el-form-item>
  623. <el-form-item>
  624. <ft-button type="primary" :click-handle="heater_start">
  625. 开始加热
  626. </ft-button>
  627. <ft-button :click-handle="heater_stop">
  628. 停止加热
  629. </ft-button>
  630. </el-form-item>
  631. <el-form-item>
  632. <ft-button type="primary" :click-handle="debug_heater_start_heat_maintaining">
  633. 开始恒温
  634. </ft-button>
  635. <ft-button :click-handle="debug_heater_stop_heat_maintaining">
  636. 停止恒温
  637. </ft-button>
  638. </el-form-item>
  639. </el-form>
  640. </div>
  641. <el-divider>拍子</el-divider>
  642. <div class="card-box">
  643. <ft-button type="primary">
  644. 启动吸附
  645. </ft-button>
  646. <ft-button>
  647. 停止吸附
  648. </ft-button>
  649. </div>
  650. <el-divider>风扇</el-divider>
  651. <div class="card-box">
  652. <ft-button type="primary" :click-handle="debug_fan_start">
  653. 打开风扇
  654. </ft-button>
  655. <ft-button :click-handle="debug_fan_stop">
  656. 关闭风扇
  657. </ft-button>
  658. </div>
  659. </el-card>
  660. <el-card>
  661. <template #header>
  662. <div class="card-header">
  663. <span>拍子存放模组</span>
  664. </div>
  665. </template>
  666. <div class="card-box">
  667. <el-form>
  668. <el-form-item label="速度">
  669. <el-input v-model.number="debugStore.formData.lidData.rate" type="number" placeholder="请输入速度">
  670. <template #append>
  671. mm/s
  672. </template>
  673. </el-input>
  674. </el-form-item>
  675. <el-form-item label="距离">
  676. <el-input v-model.number="debugStore.formData.lidData.distance" type="number" placeholder="请输入距离">
  677. <template #append>
  678. mm
  679. </template>
  680. </el-input>
  681. </el-form-item>
  682. <el-form-item>
  683. <ft-button type="primary" :click-handle="debug_cover_elvator_lift_up">
  684. 抬升
  685. </ft-button>
  686. <ft-button type="primary" :click-handle="debug_cover_elvator_lift_down">
  687. 下降
  688. </ft-button>
  689. </el-form-item>
  690. <el-form-item>
  691. <ft-button type="primary" :click-handle="debug_cover_elvator_reset">
  692. 复位
  693. </ft-button>
  694. <ft-button :click-handle="debug_cover_elvator_stop">
  695. 停止
  696. </ft-button>
  697. </el-form-item>
  698. </el-form>
  699. </div>
  700. </el-card>
  701. </el-col>
  702. </el-row>
  703. </div>
  704. </template>
  705. <style lang="scss" scoped>
  706. .debug-content {
  707. overflow: hidden;
  708. max-height: 100%;
  709. .el-row {
  710. height: 100%;
  711. overflow: auto;
  712. }
  713. }
  714. .el-card {
  715. margin-bottom: 10px;
  716. }
  717. :deep(.el-card__header) {
  718. padding: 5px 10px;
  719. }
  720. .el-input, .el-select {
  721. width: 100%;
  722. }
  723. .el-form-item {
  724. margin-bottom: 10px;
  725. margin-right: 10px;
  726. }
  727. .card-box {
  728. //display: flex;
  729. //align-items: center;
  730. }
  731. :deep(.el-input-group__append) {
  732. padding: 0 10px;
  733. }
  734. :deep(.el-card__header) {
  735. background:rgba(0,0,0,0.03);
  736. }
  737. .card-header {
  738. display: flex;
  739. align-items: center;
  740. justify-content: space-between;
  741. }
  742. .select-label {
  743. margin-right: 10px;
  744. }
  745. :deep(.el-card__body) {
  746. padding: 10px;
  747. }
  748. </style>