| | |
| | | <script> |
| | | import { |
| | | showToast, |
| | | showModal |
| | | showModal, |
| | | showError, |
| | | showInfo |
| | | } from "@/comm/utils.js" |
| | | import { |
| | | Button |
| | |
| | | |
| | | } catch (ex) { |
| | | |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | async loadAgvState() { |
| | |
| | | const info = await getAgvState(this.ip) |
| | | return info |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | return {} |
| | | } |
| | | }, |
| | |
| | | const info = await stations(this.ip) |
| | | return info.station_list || [] |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | return [] |
| | | } |
| | | }, |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | |
| | | }, |
| | |
| | | this.calibratioStationType = "end" |
| | | this.$refs.refPopupCalibration.open() |
| | | } else { |
| | | this.teachingModeCur.teaching_flag = 0 |
| | | await teachingModeFlag(this.ip, this.teachingModeCur) |
| | | this.teachingMode = await getTeachingMode(this.ip) |
| | | |
| | | this.teachingStatus = "end" |
| | | this.askTeachingBiDirection(this.teachingModeCur) |
| | | |
| | | } |
| | | } else { |
| | | this.teachingModeCur.teaching_flag = 0 |
| | | await teachingModeFlag(this.ip, this.teachingModeCur) |
| | | this.teachingMode = await getTeachingMode(this.ip) |
| | | this.teachingStatus = "end" |
| | | this.askTeachingBiDirection(this.teachingModeCur) |
| | | } |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | |
| | | }, |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | async clickTeachingStart() { |
| | |
| | | stationTeaching.splice(curIndex, 1) |
| | | _this.teachingStart("Stations") |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | |
| | | } else { |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | clickTeachingEnd() { |
| | |
| | | _this.teachingMode = await getTeachingMode(_this.ip) |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | } else { |
| | | _this.teachingStatus = "save" |
| | |
| | | |
| | | this.teachingStatus = "save" |
| | | try {} catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | |
| | | }, |
| | |
| | | list[curIndex].y = infoAgv.y |
| | | |
| | | } |
| | | this.teachingStatus = "end" |
| | | this.teachingModeCur.teaching_flag = 0 |
| | | await teachingModeFlag(this.ip, this.teachingModeCur) |
| | | this.teachingMode = await getTeachingMode(this.ip) |
| | | this.askTeachingBiDirection(this.teachingModeCur) |
| | | |
| | | |
| | | } |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | async clickNoCalibration() { |
| | |
| | | |
| | | } else if (this.calibratioStationType == "end") { |
| | | |
| | | this.teachingModeCur.teaching_flag = 0 |
| | | await teachingModeFlag(this.ip, this.teachingModeCur) |
| | | this.teachingMode = await getTeachingMode(this.ip) |
| | | this.askTeachingBiDirection(this.teachingModeCur) |
| | | |
| | | } |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | askTeachingBiDirection(teachingMode) { |
| | | showModal("是否将当前示教路线设置为双向?", "示教结束").then((res) => { |
| | | if (res) { |
| | | teachingMode.bidirection = "1" |
| | | } else { |
| | | teachingMode.bidirection = "0" |
| | | } |
| | | teachingMode.teaching_flag = 0 |
| | | this.finishTeaching(teachingMode) |
| | | }) |
| | | |
| | | }, |
| | | async finishTeaching(teachingMode) { |
| | | try { |
| | | await teachingModeFlag(this.ip, teachingMode) |
| | | this.teachingMode = await getTeachingMode(this.ip) |
| | | this.teachingStatus = "end" |
| | | } catch (ex) { |
| | | showError(ex) |
| | | } |
| | | }, |
| | | clickBackTeaching() { |
| | | this.$refs.refPopupCalibration.close() |
| | | this.teachingStatus = "" |
| | | }, |
| | | showError(ex) { |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.msg == "string" ? ex.msg : exStr |
| | | showModal(tip, "错误", false) |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |