Browse Source

fix: 区域判断取整

master
guoapeng 2 weeks ago
parent
commit
5997fe86dc
  1. 7
      src/components/spray/trayGraph/index.vue
  2. 6
      src/views/main/index.vue

7
src/components/spray/trayGraph/index.vue

@ -99,6 +99,7 @@ const addSelect = () => {
const height = newHeight const height = newHeight
const stageWidth = stage.value.width() const stageWidth = stage.value.width()
const stageHeight = stage.value.height() const stageHeight = stage.value.height()
console.log(width, height, stageWidth, stageHeight)
// //
// 1. / // 1. /
@ -121,6 +122,8 @@ const addSelect = () => {
boundBoxFunc(oldBoundBox, newBoundBox) { boundBoxFunc(oldBoundBox, newBoundBox) {
const stageWidth = stage.value.width() const stageWidth = stage.value.width()
const stageHeight = stage.value.height() const stageHeight = stage.value.height()
console.log('oldBoundBox', oldBoundBox)
console.log('newBoundBox', newBoundBox)
// //
// 1. / // 1. /
@ -129,8 +132,8 @@ const addSelect = () => {
if ( if (
newBoundBox.x < 0 newBoundBox.x < 0
|| newBoundBox.y < 0 || newBoundBox.y < 0
|| newBoundBox.x + newBoundBox.width > stageWidth
|| newBoundBox.y + newBoundBox.height > stageHeight
|| newBoundBox.x + Math.floor(newBoundBox.width) > stageWidth
|| newBoundBox.y + Math.floor(newBoundBox.height) > stageHeight
|| oldBoundBox.width - (newBoundBox.x - oldBoundBox.x) < 25 || oldBoundBox.width - (newBoundBox.x - oldBoundBox.x) < 25
|| newBoundBox.width < 25 || newBoundBox.width < 25
|| oldBoundBox.height - (newBoundBox.y - oldBoundBox.y) < 25 || oldBoundBox.height - (newBoundBox.y - oldBoundBox.y) < 25

6
src/views/main/index.vue

@ -56,12 +56,12 @@ const ok = () => {
} }
const statusMessage = (data: any) => { const statusMessage = (data: any) => {
// systemStore systemStatus // systemStore systemStatus
console.log(data)
const stopPressed = systemStore.systemStatus.stopPressed const stopPressed = systemStore.systemStatus.stopPressed
if (stopPressed !== data.stopPressed && data.stopPressed === false) { if (stopPressed !== data.stopPressed && data.stopPressed === false) {
getStatus() getStatus()
} }
console.log(data)
systemStore.updateSystemStatus(data) systemStore.updateSystemStatus(data)
} }
@ -93,13 +93,11 @@ const status = computed(() => {
return !['suspendable', 'selfTestCompleted', 'deviceHumidity', 'nozzleTemperature', 'slideTemperature'].includes(key) return !['suspendable', 'selfTestCompleted', 'deviceHumidity', 'nozzleTemperature', 'slideTemperature'].includes(key)
}) })
let str = '' let str = ''
console.log(keys)
keys.forEach((key) => { keys.forEach((key) => {
if (systemStore.systemStatus[key as keyof typeof systemStore.systemStatus]) { if (systemStore.systemStatus[key as keyof typeof systemStore.systemStatus]) {
str += `${ingObj[key as keyof typeof ingObj]} | ` str += `${ingObj[key as keyof typeof ingObj]} | `
} }
}) })
console.log(str)
if (str === '') { if (str === '') {
return '空闲' return '空闲'
} }

Loading…
Cancel
Save