Browse Source

数据采集更改

qinhb 3 months ago
parent
commit
874bdeb16d

+ 12 - 0
src/components/RealTimeMsg/index.vue

@@ -140,6 +140,18 @@ const addWebSocket = () => {
           JSON.parse(receivedMessage).content
         );
         break;
+      case "15":
+        emitter.emit(
+            EventsNames.GETDATA_WSD_DATA,
+            JSON.parse(receivedMessage).content
+        );
+        break;
+      case "16":
+        emitter.emit(
+            EventsNames.GETDATA_WKDLT_DATA,
+            JSON.parse(receivedMessage).content
+        );
+        break;
     }
   };
   ws.value.onclose = () => {

+ 31 - 2
src/layout/components/header.vue

@@ -9,6 +9,12 @@
       />
       <!-- <svg-icon v-else icon-class="LOGO" style="height: 48px; width: 155px" /> -->
     </div>
+    <div v-if="wsdData.temp" style="width: 288px;font-size: 20px;">
+      温度:{{wsdData.temp}},湿度:{{wsdData.humidity}}
+    </div>
+    <div v-if="dltData.ch1_temperature" style="width: 450px;font-size: 20px;">
+      电烙铁通道1:{{dltData.ch1_temperature}},电烙铁通道2:{{dltData.ch2_temperature}}
+    </div>
     <div v-if="routeMeta.back && routeMeta.title" class="middle-title">
       {{ routeMeta.title }}
     </div>
@@ -26,7 +32,7 @@
             @click="toExitApp"
           />
         </div>
-        <!-- <div>
+<!--         <div>
           <svg-icon
             class="activeNotice"
             icon-class="hongDa_black"
@@ -91,6 +97,7 @@ import dayjs from "dayjs";
 import type { DropdownInstance } from "element-plus";
 import { logoutApi } from "@/api/auth";
 import { useUserStore } from "@/store";
+import { emitter, EventsNames } from "@/utils/common";
 import { ElMessage, ElMessageBox } from "element-plus";
 const userStore = useUserStore();
 const router = useRouter();
@@ -106,8 +113,29 @@ const time = ref(dayjs().format("HH:mm:ss"));
 
 const processCount = ref(50);
 const messageStatus = ref(false);
-
+emitter.on(EventsNames.GETDATA_WSD_DATA, (name) => {
+  if(name){
+    wsdData.value = name
+  }else{
+    wsdData.value = {}
+  }
+});
+emitter.on(EventsNames.GETDATA_WKDLT_DATA, (name) => {
+  if(name){
+    dltData.value = name
+  }else{
+    dltData.value = {}
+  }
+});
 const headUrl = ref("");
+const wsdData = ref({
+  temp: '',
+  humidity: ''
+})
+const dltData = ref({
+  ch1_temperature: '',
+  ch2_temperature: ''
+})
 
 let timer: any = -1;
 
@@ -147,6 +175,7 @@ const commonBack = (itemValue) => {
       type: "warning",
     })
       .then(() => {
+        emitter.emit(EventsNames.PROCESS_REDER);
         router.back();
       })
       .catch(() => {});

+ 3 - 0
src/utils/common.ts

@@ -19,6 +19,9 @@ enum EventsNames {
   GETDATA_WKDLT = "GETDATA_WKDLT",
   //温湿度
   GETDATA_WSD = "GETDATA_WSD",
+  GETDATA_WSD_DATA = "GETDATA_WSD_DATA",
+
+  GETDATA_WKDLT_DATA = "GETDATA_WKDLT_DATA",
 }
 
 export { emitter, EventsNames };

+ 46 - 123
src/views/pro-steps/components/screwdriver.vue

@@ -24,42 +24,14 @@
             style="font-size: 18px; color: rgb(10, 89, 247); font-weight: 600"
             >新增数据</span
           >
-          <!-- DDLSD -->
-<!--          <el-select
-            v-model="taskValue"
-            v-if="item.deviceType == 'DDLSD'"
-            placeholder="请选择任务"
-            size="large"
-            @change="changeTask"
-            style="position: absolute; right: 460px; z-index: 2; width: 140px"
-          >
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            />
-          </el-select>-->
-<!--          <el-button
-            class="ces"
-            type="primary"
-            style="position: absolute; right: 340px; z-index: 2"
-            v-if="item.deviceType == 'DDLSD'"
-            @click.stop="
-              startTest1(item.deviceName, item.deviceNo, item.deviceType)
-            "
-            :disabled="
-              (item.deviceType == 'DDLSD' && !taskValue) ||
-              btnDisabled ||
-              setDiabledStatus
-            "
-            >设置参数</el-button
-          >
+
+
           <el-select
             v-model="taskId"
             v-if="item.deviceType == 'DDLSD'"
             placeholder="选择任务号"
             size="large"
+            @click.stop=""
             style="position: absolute; right: 180px; z-index: 2; width: 140px"
           >
             <el-option
@@ -68,25 +40,26 @@
               :label="item.label"
               :value="item.value"
             />
-          </el-select>-->
+          </el-select>
           <!-- DDLSD -->
           <!-- WKDLT -->
 
-<!--          <el-input-number
+          <el-input-number
             @click.stop
             style="
               position: absolute;
-              right: 300px;
+              right: 180px;
               z-index: 2;
               margin-bottom: 1px;
             "
             v-model="tipTemperature"
-            :min="50"
-            :max="450"
-            v-if="item.deviceType == 'WKDLT'"
+            :min="5"
+            :max="30"
+            v-if="item.deviceType == 'WXDJC'"
           />
+
           <span
-            v-if="item.deviceType == 'WKDLT'"
+            v-if="item.deviceType == 'WXDJC'"
             style="
               position: absolute;
               right: 345px;
@@ -95,9 +68,9 @@
               font-size: 16px;
               color: black !important;
             "
-            ></span
+            >检测频率(分钟)</span
           >
-          <el-button
+<!--          <el-button
             class="ces"
             type="primary"
             style="position: absolute; right: 180px; z-index: 2"
@@ -207,7 +180,7 @@ defineOptions({
 });
 const dictS = useDictionaryStore();
 const store = useProcessStore();
-const tipTemperature = ref(50);
+const tipTemperature = ref(5);
 const tipTemperatureDisabled = ref(false);
 const setTipTemperature = async () => {
   try {
@@ -278,19 +251,28 @@ const getTask = async () => {
 };
 const options = ref([]);
 const options2 = ref([
-  { value: "1", label: "任务0" },
-  { value: "2", label: "任务1" },
-  { value: "3", label: "任务2" },
-  { value: "4", label: "任务3" },
-  { value: "5", label: "任务4" },
-  { value: "6", label: "任务5" },
-  { value: "7", label: "任务6" },
-  { value: "8", label: "任务7" },
+  { value: "1", label: "Pset1" },
+  { value: "2", label: "Pset2" },
+  { value: "3", label: "Pset3" },
+  { value: "4", label: "Psett4" },
+  { value: "5", label: "Pset5" },
+  { value: "6", label: "Pset6" },
+  { value: "7", label: "Pset7" },
+  { value: "8", label: "Psett8" },
+  { value: "9", label: "Psett9" },
+  { value: "10", label: "Psett10" },
+  { value: "11", label: "Psett11" },
+  { value: "12", label: "Psett12" },
+  { value: "13", label: "Psett13" },
+  { value: "14", label: "Psett14" },
+  { value: "15", label: "Psett15" },
+  { value: "16", label: "Psett16" },
 ]);
 const startTest = (a, b, c) => {
   let obj = {
     deviceName: a,
     deviceNo: b,
+    tipTemperature: tipTemperature.value,
     deviceType: c,
     operationId: store.scanInfo.operationId,
     operationName: store.processInfo.operationName,
@@ -321,24 +303,20 @@ const showLable = (key) => {
   switch (key) {
     case "tipTemperature":
       return "温度";
-    case "Finalangle":
-      return "最终角度";
-    case "Finaltime":
-      return "最终时间";
-    case "Tighteningresult":
-      return "最终结果";
-    case "Finaltorque":
+    case "Pset":
+      return "Pset号";
+    case "torque":
       return "最终扭矩";
+    case "angle":
+      return "最终角度";
+    case "duration":
+      return "持续时间";
     case "DataTimes":
       return "采集时间";
-    case "taskNo":
-      return "当前任务号";
-    case "warning":
+    case "tighteningresult":
+      return "拧紧结果";
+    case "error":
       return "警报";
-    case "tightenResult":
-      return "最终拧紧结果";
-    case "totalCycles":
-      return "总圈数";
     case "length":
       return "长度";
     case "height":
@@ -347,62 +325,6 @@ const showLable = (key) => {
       return "电烙铁通道1温度";
     case "ch2_temperature":
       return "电烙铁通道2温度";
-    case "DDLSD3":
-      return "目标扭力";
-    case "DDLSD4":
-      return "扭力保持时间";
-    case "DDLSD5":
-      return "浮高界定圈数";
-    case "DDLSD6":
-      return "滑牙界定圈数";
-    case "DDLSD7":
-      return "触发速度切换的扭力比值";
-    case "DDLSD8":
-      return "扭力补偿值";
-    case "DDLSD9":
-      return "开启浮高滑牙检测";
-    case "DDLSD10":
-      return "触发速度切换的扭力";
-    case "DDLSD11":
-      return "触发速度切换的速度比值";
-    case "DDLSD12":
-      return "扭力偏差上限";
-    case "DDLSD13":
-      return "扭力偏差下限";
-    case "DDLSD14":
-      return "扭力免检圈数";
-    case "DDLSD17":
-      return "自由旋转方向";
-    case "DDLSD18":
-      return "STEP-00拧紧圈数";
-    case "DDLSD19":
-      return "STEP-00拧紧速度";
-    case "DDLSD20":
-      return "STEP-01拧紧圈数";
-    case "DDLSD21":
-      return "STEP-01拧紧速度";
-    case "DDLSD22":
-      return "STEP-02拧紧圈数";
-    case "DDLSD23":
-      return "STEP-02拧紧速度";
-    case "DDLSD24":
-      return "STEP-03拧紧圈数";
-    case "DDLSD25":
-      return "STEP-03拧紧速度";
-    case "DDLSD26":
-      return "STEP-04拧紧圈数";
-    case "DDLSD27":
-      return "STEP-04拧紧速度";
-    case "DDLSD28":
-      return "STEP-00拧松圈数";
-    case "DDLSD29":
-      return "STEP-00拧松速度";
-    case "DDLSD30":
-      return "STEP-01拧松圈数";
-    case "DDLSD31":
-      return "STEP-01拧松速度";
-    case "DDLSD32":
-      return "STEP-02拧松圈数";
     case "humidity":
       return "湿度";
     case "temp":
@@ -480,10 +402,11 @@ const configeObj = (type) => {
     //电动螺丝刀
     case "DDLSD":
       return [
-        "Finaltorque",
-        "Finalangle",
-        "Finaltime",
-        "Tighteningresult"
+        "Pset",
+        "torque",
+        "angle",
+        "duration",
+        "tighteningresult",
       ];
     default:
       return ["数据1", "数据2", "数据3"];

+ 1 - 0
src/views/process/processes.vue

@@ -27,6 +27,7 @@ const opsArray = inject("opsArray");
 //   }
 // };
 const OptArrayLength = computed(() => opsArray.value.length);
+
 </script>
 
 <style lang="scss" scoped>

+ 16 - 74
src/views/traceability/components/collect.vue

@@ -92,10 +92,12 @@ const configeObj = (type) => {
       //电动螺丝刀
     case "DDLSD":
       return [
-        "Finaltorque",
-        "Finalangle",
-        "Finaltime",
-        "Tighteningresult"
+        "Pset",
+        "torque",
+        "angle",
+        "duration",
+        "tighteningresult",
+        "error"
       ];
     default:
       return ["数据1", "数据2", "数据3"];
@@ -105,24 +107,20 @@ const showLable = (key) => {
   switch (key) {
     case "tipTemperature":
       return "温度";
-    case "Finalangle":
-      return "最终角度";
-    case "Finaltime":
-      return "最终时间";
-    case "Tighteningresult":
-      return "最终结果";
-    case "Finaltorque":
+    case "Pset":
+      return "Pset号";
+    case "torque":
       return "最终扭矩";
+    case "angle":
+      return "最终角度";
+    case "duration":
+      return "持续时间";
     case "DataTimes":
       return "采集时间";
-    case "taskNo":
-      return "当前任务号";
-    case "warning":
+    case "tighteningresult":
+      return "拧紧结果";
+    case "error":
       return "警报";
-    case "tightenResult":
-      return "最终拧紧结果";
-    case "totalCycles":
-      return "总圈数";
     case "length":
       return "长度";
     case "height":
@@ -131,62 +129,6 @@ const showLable = (key) => {
       return "电烙铁通道1温度";
     case "ch2_temperature":
       return "电烙铁通道2温度";
-    case "DDLSD3":
-      return "目标扭力";
-    case "DDLSD4":
-      return "扭力保持时间";
-    case "DDLSD5":
-      return "浮高界定圈数";
-    case "DDLSD6":
-      return "滑牙界定圈数";
-    case "DDLSD7":
-      return "触发速度切换的扭力比值";
-    case "DDLSD8":
-      return "扭力补偿值";
-    case "DDLSD9":
-      return "开启浮高滑牙检测";
-    case "DDLSD10":
-      return "触发速度切换的扭力";
-    case "DDLSD11":
-      return "触发速度切换的速度比值";
-    case "DDLSD12":
-      return "扭力偏差上限";
-    case "DDLSD13":
-      return "扭力偏差下限";
-    case "DDLSD14":
-      return "扭力免检圈数";
-    case "DDLSD17":
-      return "自由旋转方向";
-    case "DDLSD18":
-      return "STEP-00拧紧圈数";
-    case "DDLSD19":
-      return "STEP-00拧紧速度";
-    case "DDLSD20":
-      return "STEP-01拧紧圈数";
-    case "DDLSD21":
-      return "STEP-01拧紧速度";
-    case "DDLSD22":
-      return "STEP-02拧紧圈数";
-    case "DDLSD23":
-      return "STEP-02拧紧速度";
-    case "DDLSD24":
-      return "STEP-03拧紧圈数";
-    case "DDLSD25":
-      return "STEP-03拧紧速度";
-    case "DDLSD26":
-      return "STEP-04拧紧圈数";
-    case "DDLSD27":
-      return "STEP-04拧紧速度";
-    case "DDLSD28":
-      return "STEP-00拧松圈数";
-    case "DDLSD29":
-      return "STEP-00拧松速度";
-    case "DDLSD30":
-      return "STEP-01拧松圈数";
-    case "DDLSD31":
-      return "STEP-01拧松速度";
-    case "DDLSD32":
-      return "STEP-02拧松圈数";
     case "humidity":
       return "湿度";
     case "temp":