panqiuyao преди 8 месеца
родител
ревизия
4984722649
променени са 1 файла, в които са добавени 38 реда и са изтрити 9 реда
  1. 38 9
      frontend/src/views/Setting/index.vue

+ 38 - 9
frontend/src/views/Setting/index.vue

@@ -315,7 +315,7 @@
         <template #footer>
           <div class="btn-row">
             <div class="normal-btn" @click="dialogVisible = false">关闭</div>
-             <div class="primary-btn" v-loading="captureLoading" @click="testShoesFlip">拍照测试</div>
+             <div class="primary-btn" v-loading="captureLoading" @click="testShoesFlip">运行并拍照</div>
             <div class="primary-btn" @click="saveRow">保存并关闭</div>
           </div>
         </template>
@@ -819,16 +819,45 @@ const imageUrl = ref(digiCamControlWEB+'preview.jpg')
 const imageUrlkey = ref(0)
 function testShoesFlip(){
   if (clientStore.isClient) {
-    clientStore.ipc.removeAllListeners(icpList.camera.takePictures);
-    clientStore.ipc.send(icpList.camera.takePictures,false);
-    clientStore.ipc.on(icpList.camera.takePictures, async (event, result) => {
+    socketStore.sendMessage({
+      type: 'run_mcu_single',
+      data: {
+        camera_height: editRowData.value.camera_height,
+        camera_angle: editRowData.value.camera_angle,
+        led_switch:editRowData.value.led_switch,
+        id:0,
+        mode_type:'执行'+ activeTab.value === 'left' ? '左脚' : '右脚'+'程序',
+        turntable_position:editRowData.value.turntable_position,
+        action_name:editRowData.value.action_name || '测试',
+        turntable_angle: editRowData.value.turntable_angle,
+        shoe_upturn: editRowData.value.shoe_upturn,
+        action_index:1,
+        number_focus:0,
+        take_picture:false,
+        pre_delay:0,
+        after_delay:0,
+      }
+    });
       captureLoading.value = true;
-      setTimeout(()=>{
-        imageUrlkey.value++;
-        preview(imageUrl.value+'?key='+imageUrlkey.value)
-        captureLoading.value = false;
-      },5000)
+
+    clientStore.ipc.on(icpList.socket.message+'_run_mcu_single_finish', (event, result) =>{
+      clientStore.ipc.removeAllListeners(icpList.camera.takePictures);
+      clientStore.ipc.send(icpList.camera.takePictures,false);
+      clientStore.ipc.on(icpList.camera.takePictures, async (event, result) => {
+        setTimeout(()=>{
+          imageUrlkey.value++;
+          preview(imageUrl.value+'?key='+imageUrlkey.value)
+          captureLoading.value = false;
+        },5000)
+        clientStore.ipc.removeAllListeners(icpList.camera.takePictures);
+      })
+
+      clientStore.ipc.removeAllListeners(icpList.socket.message+'_run_mcu_single_finish');
+
     })
+
+
+
   }
 }