wangfei
2024-08-15 65062cbdae525bd0b7e5639a5a149d942e3d1b03
掰片/识别模块、钢化模块图片算法更改,可视化系统图片动态获取
4个文件已修改
426 ■■■■■ 已修改文件
UI-Project/src/views/Identify/identify.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/PurchaseReturn/purchaseReturn.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/PurchaseReturn/purchaseStorage.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/largescreen/largescreen.vue 340 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Identify/identify.vue
@@ -142,11 +142,12 @@
      const rawRects = response.data[0];
      rawData.value = response.data;
      totalPages.value = rawData.value.length;
      const scaleFactor =  1621.78/6000;
      adjustedRects.value = rawRects.map(rect => ({  
        ...rect,
        x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085,
        x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor,
        y_axis: rect.y_axis * 0.17,
        width: rect.width * 0.2 ,
        width: rect.width * scaleFactor ,
        widtha: rect.width ,
        heighta: rect.height ,
        height: rect.height * 0.165 ,
@@ -166,12 +167,13 @@
const handleCurrentChange = (val: number) => {  
  currentPage.value = val;
  const page = currentPage.value - 1
      const scaleFactor =  1621.78/6000;
      adjustedRects.value = rawData.value[page]?.map(rect => ({  
      // adjustedRects.value = rawRects.map(rect => ({  
        ...rect,
        x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085,
        x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor,
        y_axis: rect.y_axis * 0.17,
        width: rect.width * 0.2 ,
        width: rect.width * scaleFactor ,
        widtha: rect.width ,
        heighta: rect.height ,
        height: rect.height * 0.165 ,
@@ -210,11 +212,12 @@
    webSocket = new WebSocket(socketUrl);  
    webSocket.onmessage = (event) => {  
      const data = JSON.parse(event.data);   
      const scaleFactor =  1621.78/6000;
        adjustedRects.value = data.currentCutTerritory[0].map(rect => ({  
        ...rect,
        x_axis: (6000 -(rect.x_axis + rect.width)) * 0.2085,
        x_axis: (6000 -(rect.x_axis + rect.width)) * scaleFactor,
        y_axis: rect.y_axis * 0.17,
        width: rect.width * 0.2 ,
        width: rect.width * scaleFactor ,
        widtha: rect.width ,
        heighta: rect.height ,
        height: rect.height * 0.165 ,
UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -27,7 +27,7 @@
// 进炉中
  if(data.intoGlass!=null){
    adjustedRects1.value =  data.intoGlass[0].map(rect => {  
      console.log( adjustedRects1.value);
      const scaleFactor =  794.67/5087;
        let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
        let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
@@ -38,34 +38,21 @@
        heighta = rect.height;
      }
      if (rect.angle === 0) {  
    adjustedWidth = widtha * 0.12;
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.1;
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;   
    newX = 5087 - (rect.yCoordinate + widtha); 
    } else {  
    adjustedWidth = heighta * 0.12;
    adjustedWidth = heighta * scaleFactor;
    adjustedHeight = widtha * 0.1;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5087 - (rect.yCoordinate + heighta); 
  }
  // if (rect.angle === 0) {
  //         adjustedWidth = heighta * 0.12;
  //         adjustedHeight = widtha * 0.1;
  //         adjustedWidtha = heighta;
  //         adjustedHeighta = widtha;
  //         newX = 5087 - (rect.xCoordinate + heighta);
  //       } else {
  //         adjustedWidth = widtha * 0.12;
  //         adjustedHeight = heighta * 0.1;
  //         adjustedWidtha = widtha;
  //         adjustedHeighta = heighta;
  //         newX = 5087 - (rect.xCoordinate + widtha);
  //       }
  }
        return {  
        ...rect, 
        xcoordinate: newX * 0.12,
        xcoordinate: newX * scaleFactor,
        ycoordinate: rect.xCoordinate * 0.1,
        width: adjustedWidth,  
        height: adjustedHeight,  
@@ -78,7 +65,7 @@
      }
  if(data.intoGlass2!=null){
    adjustedRects2.value =  data.intoGlass2[0].map(rect => {  
      console.log( adjustedRects2.value);
      const scaleFactor =  794.67/5087;
      let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
      let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
@@ -89,34 +76,21 @@
        heighta = rect.height;
      }
      if (rect.angle === 0) {  
    adjustedWidth = widtha * 0.12;
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.1;
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5087 - (rect.yCoordinate + widtha); 
    } else {  
    adjustedWidth = heighta * 0.12;
    adjustedWidth = heighta * scaleFactor;
    adjustedHeight = widtha * 0.1;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5087 - (rect.yCoordinate + heighta);  
  }
  //     if (rect.angle === 0) {
  //         adjustedWidth = heighta * 0.12;
  //         adjustedHeight = widtha * 0.1;
  //         adjustedWidtha = heighta;
  //         adjustedHeighta = widtha;
  //         newX = 5087 - (rect.xCoordinate + heighta);
  // } else {
  //         adjustedWidth = widtha * 0.12;
  //         adjustedHeight = heighta * 0.1;
  //         adjustedWidtha = widtha;
  //         adjustedHeighta = heighta;
  //         newX = 5087 - (rect.xCoordinate + widtha);
  // }
  }
        return {  
        ...rect, 
        xcoordinate: newX * 0.12,
        xcoordinate: newX * scaleFactor,
        ycoordinate: rect.xCoordinate * 0.1,
        width: adjustedWidth,  
        height: adjustedHeight,  
@@ -130,6 +104,7 @@
  // 进炉前
  if(data.waitingGlass!=null){
    adjustedRectsa.value = data.waitingGlass[0].map(rect => {  
      const scaleFactor =  1621.78/5190;
  let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; 
  let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
@@ -140,13 +115,13 @@
        heighta = rect.height;
      }
  if (rect.angle === 0) {  
    adjustedWidth = widtha * 0.24;
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.16;
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    newX = 5190 - (rect.yCoordinate + widtha); 
    } else {  
    adjustedWidth = heighta * 0.24;
    adjustedWidth = heighta * scaleFactor;
    adjustedHeight = widtha * 0.16;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
@@ -154,7 +129,7 @@
  }  
  return {  
    ...rect, 
    x: newX * 0.24,
    x: newX * scaleFactor,
    y: rect.xCoordinate * 0.16,  
    width: adjustedWidth,  
    height: adjustedHeight,  
@@ -168,7 +143,8 @@
    // 已出炉
  if(data.outGlass!=null){
    adjustedRectsb.value = data.outGlass[0].map(rect => {  
  let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
      const scaleFactor =  1621.78/5190;
      let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;;
  let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
        widtha = rect.height;
@@ -178,13 +154,13 @@
        heighta = rect.height;
      }
  if (rect.angle === 0) {  
    adjustedWidth = widtha * 0.24;
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.16;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    // newX = 5190 - (rect.yCoordinate + widtha); 
  } else {  
    adjustedWidth = heighta * 0.24;
    adjustedWidth = heighta * scaleFactor;
    adjustedHeight = widtha * 0.16;  
    // adjustedWidtha = heighta;  
    // adjustedHeighta = widtha;  
@@ -192,7 +168,7 @@
  }  
  return {  
        ...rect, // 复制原始对象的其他属性  
        x: newX * 0.24,
        x: newX * scaleFactor,
        y: rect.xCoordinate * 0.16,
        width: adjustedWidth,  
        height: adjustedHeight,  
UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
@@ -36,7 +36,8 @@
  // 更新 tableData 的数据
  if(data.overGlass!=null){
    adjustedRects.value =  data.overGlass[0].map(rect => {  
  let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;
      const scaleFactor =  1621.78/5190;
      let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;
      let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
        widtha = rect.height;
@@ -46,13 +47,13 @@
        heighta = rect.height;
      }
    if (rect.angle === 0) {  
    adjustedWidth = widtha * 0.24;
    adjustedWidth = widtha * scaleFactor;
    adjustedHeight = heighta * 0.16;  
    // adjustedWidtha = widtha;  
    // adjustedHeighta = heighta;  
    // newX = 5190 - (rect.yCoordinate + rect.width); 
  } else {  
    adjustedWidth = heighta * 0.24;
    adjustedWidth = heighta * scaleFactor;
    adjustedHeight = widtha * 0.16;  
    // adjustedWidtha = heighta;  
    // adjustedHeighta = widtha;  
@@ -60,7 +61,7 @@
  }  
  return {  
    ...rect, 
    xcoordinate: newX * 0.24,
    xcoordinate: newX * scaleFactor,
    ycoordinate: rect.xCoordinate * 0.16,
    width: adjustedWidth,  
    height: adjustedHeight,  
UI-Project/src/views/largescreen/largescreen.vue
@@ -25,26 +25,42 @@
      </el-table-column>
      </el-table>
</div>  -->
<div id="parent" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;">
  <img src="../../assets/dpxsa.png" alt="" style="margin-left: -10px; width: 100%;height: 100%;position: relative;">
  <div id="lipiana" v-show="woshia"></div>
  <div id="lipianb" v-show="woshia"></div>
  <div id="lipianc" v-show="woshic"></div>
  <div id="lipiand" v-show="woshic"></div>
  <div id="overlay" v-show="flake"></div>
  <div id="overlayb" v-show="flakeb"></div>
  <div id="overlayc" v-show="flakec"></div>
  <div id="overlayd" v-show="flaked"></div>
  <div id="longa" v-show="dalipiana"></div>
  <div id="longb" v-show="dalipianb"></div>
  <div id="shangpianji" v-show="shangpian"></div>
  <div id="xiapianji1" v-show="xiapian1"></div>
  <div id="xiapianji2" v-show="xiapian2"></div>
  <div id="xiapianji3" v-show="xiapian3"></div>
  <div id="xiapianji4" v-show="xiapian4"></div>
  <div id="xiapianji5" v-show="xiapian5"></div>
  <div id="xiapianji6" v-show="xiapian6"></div>
<div class="parter" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;">
    <img src="../../assets/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image">
  <div  class="moving-rect lipiana" v-show="woshia"></div>
  <div  class="moving-rect lipianb" v-show="woshia"></div>
  <div  class="moving-rect lipianc" v-show="woshic"></div>
  <div  class="moving-rect lipiand" v-show="woshic"></div>
  <div  class="moving-rect overlaya" v-show="flake"></div>
  <div  class="moving-rect overlayb" v-show="flakeb"></div>
  <div  class="moving-rect overlayc" v-show="flakec"></div>
  <div  class="moving-rect overlayd" v-show="flaked"></div>
  <div  class="moving-rect longa" v-show="dalipiana"></div>
  <div  class="moving-rect longb" v-show="dalipianb"></div>
  <div  class="moving-rect shangpianji" v-show="shangpian"></div>
  <div  class="moving-rect xiapianji" v-show="xiapian"></div>
  <div  class="moving-rect xiapianji1" v-show="xiapian1"></div>
  <div  class="moving-rect xiapianji2" v-show="xiapian2"></div>
  <div  class="moving-rect xiapianji3" v-show="xiapian3"></div>
  <div  class="moving-rect xiapianji4" v-show="xiapian4"></div>
  <div  class="moving-rect xiapianji5" v-show="xiapian5"></div>
  <div  class="moving-rect xiapianji6" v-show="xiapian6"></div>
</div>
<!-- <div class="parter" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;">
    <img src="../../assets/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image">
    <div class="moving-rect vertical"></div>
    <div class="moving-rect all"></div>
    <div class="moving-rect horizontal"></div>
    <div class="moving-rect xiao"></div>
    <div class="moving-rect zhan"></div>
    <div class="moving-rect tu"></div>
    <div class="moving-rect zi"></div>
    <div class="moving-rect xia"></div>
    <div class="moving-rect zan"></div>
    <div class="moving-rect fa"></div>
    <div class="moving-rect hua"></div>
    <div class="moving-rect shui"></div>
</div> -->
<!-- <div id="centerright" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 240px;background-color: #911005;">
  <el-table height="240" ref="table" width="340px"
      @selection-change="handleSelectionChange"
@@ -130,6 +146,7 @@
const dalipiana = ref(false)
const dalipianb = ref(false)
const shangpian = ref(false)
const xiapian = ref(false)
const xiapian1 = ref(false)
const xiapian2 = ref(false)
const xiapian3 = ref(false)
@@ -251,6 +268,7 @@
const handleMessage6 = (data) => {
  const tasks = data.downWorkstation[0];  
  if (tasks && tasks.length >= 6) {  
    xiapian.value = tasks.some(task => task.racksNumber!== 0);
    xiapian1.value = tasks[0].racksNumber !== 0;
    xiapian2.value = tasks[1].racksNumber !== 0;
    xiapian3.value = tasks[2].racksNumber !== 0;
@@ -355,162 +373,236 @@
width: 100%;
height: 100%;
}
#parent{
  position: relative;
.parter {
    position: relative;
    display: inline-block; /* 使容器大小适应图片大小 */
  width: 1500px;
  margin-left: -300px
}
#overlay{
  position: absolute;
  z-index: 1;
  width: 36px;
  height: 10px;
  background-color: #529b2e;
  margin-top: -34px;
  margin-left: -2px;
img {
    display: block; /* 让图片以块级元素显示 */
    max-width: 100%; /* 确保图片不超出容器 */
}
#overlayb{
  position: absolute;
  z-index: 1;
  width: 17px;
  height: 115px;
  background-color: #529b2e;
  margin-top: -197px;
  margin-left:4px;
.moving-rect {
    width: 100px;
    height: 50px;
    position: absolute;
}
#overlayc{
  position: absolute;
  z-index: 1;
  width: 16px;
  height: 16px;
  background-color: #529b2e;
  margin-top: -243px;
  margin-left: 5px;
}
#overlayd{
  position: absolute;
  z-index: 1;
  width: 37px;
  height: 10px;
  background-color: #529b2e;
  margin-top: -238px;
  margin-left: 70px;
}
#lipiana{
  position: absolute;
  z-index: 1;
  width: 100px;
  height: 10px;
  background-color: #529b2e;
  margin-top: -57px;
  margin-left: 365px;
}
#lipianb{
  position: absolute;
  z-index: 1;
  width: 20px;
  height: 10px;
  background-color: #529b2e;
  margin-top: -72px;
  margin-left: 492px;
}
#lipianc{
  position: absolute;
  z-index: 1;
  width: 100px;
  height: 10px;
  background-color: #529b2e;
  margin-top: -32px;
  margin-left: 410px;
}
#lipiand{
  position: absolute;
  z-index: 1;
  width: 30px;
  height: 10px;
  background-color: #529b2e;
  margin-top: -47px;
  margin-left: 539px;
}
#longa{
  position: absolute;
.longa{
  z-index: 1;
  width: 33px;
  height: 5px;
  background-color: #529b2e;
  margin-top: -20px;
  margin-top: -15px;
  margin-left: 130px;
}
#longb{
  position: absolute;
.longb{
  z-index: 1;
  width: 33px;
  height: 5px;
  background-color: #529b2e;
  margin-top: -20px;
  margin-top: -15px;
  margin-left: 235px;
}
#shangpianji{
  position: absolute;
  z-index: 1;
  width: 29px;
  height: 10px;
  background-color: #529b2e;
  margin-top: -90px;
  margin-left: 868px;
}
#xiapianji1{
  position: absolute;
.xiapianji1{
  z-index: 1;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -213px;
  margin-top: -206px;
  margin-left: 173px;
}
#xiapianji2{
  position: absolute;
.xiapianji2{
  z-index: 1;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -213px;
  margin-top: -206px;
  margin-left: 217px;
}
#xiapianji3{
  position: absolute;
.xiapianji3{
  z-index: 1;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -202px;
  margin-top: -195px;
  margin-left: 196px;
}
#xiapianji4{
  position: absolute;
.xiapianji4{
  z-index: 1;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -213px;
  margin-top: -206px;
  margin-left: 270px;
}
#xiapianji5{
  position: absolute;
.xiapianji5{
  z-index: 1;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -213px;
  margin-top: -206px;
  margin-left: 314px;
}
#xiapianji6{
  position: absolute;
.xiapianji6{
  z-index: 1;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -202px;
  margin-top: -195px;
  margin-left: 293px;
}
.xiapianji {
    width: 20px;
    height: 10px;
    background-color: #529b2e;
    top: 9px;
    left: 200px;
    transform: translateX(-50%);
    animation: move-xiapianji 6s infinite;
}
@keyframes move-xiapianji {
    0% {
      left: 200px;
    }
    100% {
      left: calc(100% - 700px);
    }
}
.lipiana {
    width: 15px;
    height: 9px;
    background-color: #529b2e;
    top: 190px;
    right: 530px;
    transform: translateX(-50%);
    animation: move-lipiana 6s infinite;
}
@keyframes move-lipiana {
    0% {
      right: 530px;
    }
    100% {
      right: calc(100% - 350px);
    }
}
.lipianb {
    width: 18px;
    height: 10px;
    background-color: #529b2e;
    top: 160px;
    left: 502px;
    transform: translateX(-50%);
    animation: move-lipianb 6s infinite;
}
@keyframes move-lipianb {
    0% {
        top: 160px;
    }
    100% {
        top: calc(100% - 55px);
    }
}
.lipianc {
    width: 15px;
    height: 9px;
    background-color: #529b2e;
    top: 215px;
    right: 490px;
    transform: translateX(-50%);
    animation: move-lipianc 6s infinite;
}
@keyframes move-lipianc {
    0% {
      right: 490px;
    }
    100% {
      right: calc(100% - 350px);
    }
}
.lipiand {
    width: 25px;
    height: 10px;
    background-color: #529b2e;
    top: 160px;
    left: 555px;
    transform: translateX(-50%);
    animation: move-lipiand 6s infinite;
}
@keyframes move-lipiand {
    0% {
        top: 160px;
    }
    100% {
        top: calc(100% - 40px);
    }
}
.overlaya {
    width: 15px;
    height: 9px;
    background-color: #529b2e;
    top: 213px;
    right: 800px;
    transform: translateX(-50%);
    animation: move-overlaya 6s infinite;
}
@keyframes move-overlaya {
    0% {
      right: 880px;
    }
    100% {
      right: calc(100% - 15px);
    }
}
.overlayb {
    width: 20px;
    height: 10px;
    background-color: #529b2e;
    top: 110px;
    left: 13px;
    transform: translateX(-50%);
    animation: move-overlayb 6s infinite;
}
@keyframes move-overlayb {
    0% {
        top: 160px;
    }
    100% {
        top: calc(100% - 190px);
    }
}
.overlayc {
    width: 20px;
    height: 10px;
    background-color: #529b2e;
    top: 7px;
    left: 13px;
    transform: translateX(-50%);
    animation: move-overlayc 6s infinite;
}
@keyframes move-overlayc {
    0% {
      left: 20px;
    }
    100% {
      left: calc(100% - 900px);
    }
}
.shangpianji {
    width: 20px;
    height: 10px;
    background-color: #529b2e;
    top: 157px;
    right: 90px;
    transform: translateX(-50%);
    animation: move-shangpianji 6s infinite;
}
@keyframes move-shangpianji {
    0% {
      right: 90px;
    }
    100% {
      right: calc(100% - 770px);
    }
}
</style>