浏览代码

Merge branch 'master' of http://gitlab.pubdata.cn/liangyibo/CameraMachine

rambo 7 月之前
父节点
当前提交
fce4f204e6

+ 43 - 4
frontend/src/stores/modules/check.ts

@@ -9,6 +9,10 @@ const socketStore = socket();
 const clientStore = client();
 
 
+/**
+ * 定义检查信息的Store
+ * 包含设备连接状态检查、错误信息获取和重置检查等功能
+ */
 export const checkInfo = defineStore('checkInfo', () => {
 
     // 定义设备列表
@@ -35,12 +39,22 @@ export const checkInfo = defineStore('checkInfo', () => {
         },*/
     });
 
+    // 定义蓝牙扫描编号
     const blue_tooth_scan_NO = ref('')
+    // 定义检查时间
     const checkTime = ref(0)
+    // 定义检查设备状态的定时器
     let CKTimerInterval:any = null
+    // 定义检查相机控制的定时器
     let CKCamControlInterval:any = null
+    // 定义初始化mcu的类型
     let init_mcu_type = ref(true)
+    // 定义检查状态
     const isCheckStatus = ref(true)
+    /**
+     * 设置检查状态
+     * @param value 检查状态值
+     */
     const set_isCheckStatus = (value)=>{
         isCheckStatus.value = value
         //开始监听相机软件连接状态
@@ -88,6 +102,9 @@ export const checkInfo = defineStore('checkInfo', () => {
     });
 
     const configInfoStore = configInfo();
+    /**
+     * 检查相机控制
+     */
     const checkcamControl = async ()=>{
 
 
@@ -116,6 +133,9 @@ export const checkInfo = defineStore('checkInfo', () => {
     }
 
 
+    /**
+     * 检查相机
+     */
     const checkcamera = ()=>{
         clientStore.ipc.removeAllListeners(icpList.camera.hascamera);
         clientStore.ipc.send(icpList.camera.hascamera);
@@ -133,7 +153,11 @@ export const checkInfo = defineStore('checkInfo', () => {
 
     //第二次才算mcu正在失败
     const mcuErrorCount = ref(0);
-    // 通用设备检查函数
+    /**
+     * 通用设备检查函数
+     * @param deviceName 设备名称
+     * @param messageType 消息类型
+     */
     const checkDevice = async (deviceName: string, messageType: string) => {
         try {
             await socketStore.connectSocket();
@@ -197,7 +221,9 @@ export const checkInfo = defineStore('checkInfo', () => {
         }
     };
 
-    // 执行所有设备检查
+    /**
+     * 执行所有设备检查
+     */
     const checkAction = async () => {
         for (const deviceName of Object.keys(devices)) {
             switch (deviceName){
@@ -215,12 +241,16 @@ export const checkInfo = defineStore('checkInfo', () => {
 
     };
 
-    // 重新检查所有设备
+    /**
+     * 重新检查所有设备
+     */
     const reCheckAction = async () => {
         for (const device of Object.values(devices)) {
             device.status = 0;
             device.msg = "未连接";
         }
+        mcu.status = -0;
+        mcu.isInitSend = false;
         checkTime.value++;
         CKTimerInterval = setInterval(()=>{
             checkTime.value++;
@@ -234,7 +264,12 @@ export const checkInfo = defineStore('checkInfo', () => {
                 if( devices.mcu.status !== 2 || mcu.status !== 2 ){
                     devices.mcu.status = -1;
                     mcu.status = -1;
-                    devices.blue_tooth.msg = '拍照机连接失败';
+                    mcu.isInitSend = false;
+                    devices.mcu.msg = '拍照机连接失败';
+                }
+                if( devices.cam_control.status !== 2 ){
+                    devices.cam_control.status = -1;
+                    devices.cam_control.msg = '拍照机连接失败';
                 }
             }
         },1000)
@@ -242,6 +277,10 @@ export const checkInfo = defineStore('checkInfo', () => {
 
     };
 
+    /**
+     * 设置蓝牙扫描编号
+     * @param value 蓝牙扫描编号值
+     */
     function set_blue_tooth_scan_NO(value){
         blue_tooth_scan_NO.value = value
     }

+ 7 - 2
frontend/src/views/Photography/check.vue

@@ -215,6 +215,7 @@ function takePictures() {
 clientStore.ipc.on(icpList.socket.message+'_run_mcu_single', async (event, result) => {
   console.log('_run_mcu_single_check')
   console.log(result)
+
   if(result.code === 0 && result.data?.file_path){
     clientStore.ipc.removeAllListeners(icpList.takePhoto.createMainImage);
     clientStore.ipc.send(icpList.takePhoto.createMainImage,{
@@ -238,8 +239,12 @@ clientStore.ipc.on(icpList.socket.message+'_run_mcu_single', async (event, resul
 
 
   }else if(result.msg){
-
-    if(result.code !== 0) ElMessage.error(result.msg)
+    if( result.msg.indexOf('处理失败,请重试') >= 0){
+      ElMessage.error(result.msg)
+      step.value = 1
+      loading.value = false;
+      showVideo()
+    }
   }
 
 })

+ 0 - 12
hlm/aigc/CameraMachine/frontend/src/views/Home/index.vue

@@ -1,12 +0,0 @@
-<!-- ... existing code ... -->
-<div class="image-container left-image" @click="goCheck">
-    <img src="@/assets/images/home/left.jpg" alt="拍摄产品并处理图像" class="zoom-on-hover" />
-    <div class="overlay-text">拍摄产品<br>并处理图像</div>
-</div>
-
-<!-- 右侧图片区域 -->
-<div class="image-container right-image" @click="goShot">
-    <img src="@/assets/images/home/right.jpg" alt="仅处理图像" class="zoom-on-hover" />
-    <div class="overlay-text">仅处理图像</div>
-</div>
-<!-- ... existing code ... -->