songxuekui 2 tahun lalu
induk
melakukan
87fe2d8c8a

+ 1 - 0
AutoAnalysis/AutoAnalysisDialog.Designer.cs

@@ -1137,6 +1137,7 @@ namespace Metis.AutoAnalysis
             this.Controls.Add(this.panel2);
             this.Controls.Add(this.panel1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Location = new System.Drawing.Point(0, 0);
             this.Name = "AutoAnalysisDialog";
             this.Padding = new System.Windows.Forms.Padding(8);
             this.ShowInTaskbar = true;

+ 21 - 8
AutoAnalysis/AutoAnalysisDialog.cs

@@ -782,15 +782,19 @@ namespace Metis.AutoAnalysis
             }
             Console.WriteLine("Out of work runtime.");
 
-            if(chkAutoUpload.Checked)
+            if(_isWorking)
             {
-                UploadData();
-            }
+                //点停止按钮的时候不做这些处理
+                if (chkAutoUpload.Checked)
+                {
+                    UploadData();
+                }
 
-            this.Invoke(new Action(() =>
-            {
-                PrintReport(true);
-            }));
+                this.Invoke(new Action(() =>
+                {
+                    PrintReport(true);
+                }));
+            }
 
             //当全部扫码完成退出循环,_isWorking依然为true,则认为完成
             _workDone = _isWorking;
@@ -2361,8 +2365,11 @@ namespace Metis.AutoAnalysis
         {
             List<string> lstResult = new List<string>();
             string filename = dir + "\\report.ai";
-            if (Directory.Exists(filename) == false)
+            if (File.Exists(filename) == false)
+            {
+                LogHelper.log.Error("report.ai不存在 " + filename);
                 return lstResult;
+            }   
 
             var totalFiles = Directory.GetFiles(dir, "*.jpg");
             int count = 1;//只取1张
@@ -2394,6 +2401,11 @@ namespace Metis.AutoAnalysis
                     }
                 }
             }
+
+            if(lstResult.Count <= 0)
+            {
+                lstResult.Add(totalFiles[0]);
+            }
             return lstResult;
         }
 
@@ -2492,6 +2504,7 @@ namespace Metis.AutoAnalysis
 
                 foreach (var dir in m_lstWorkDir)
                 {
+                    LogHelper.log.Debug("搜索图片文件夹:" + dir);
                     List<Bitmap> lstBitamp = new List<Bitmap>();
                     var randomFiles = GetOnlyFile(dir + "\\AI");
                     inclusionList.Clear();

+ 3 - 1
AutoAnalysis/DataUpload.cs

@@ -53,6 +53,7 @@ namespace Metis.AutoAnalysis
                 //客户端套接字连接到网络节点上,用的是Connect  
                 socketclient.Connect(point);
                 m_connected = true;
+                LogHelper.log.Debug("服务器连接成功");
 
             }
             catch (Exception ex)
@@ -392,10 +393,11 @@ namespace Metis.AutoAnalysis
             {
                 //调用客户端套接字发送字节数组 .ToHexString()
                 int suc = socketclient.Send(sentBytes);
+                LogHelper.log.Debug("消息发送成功 " + strAll);
             }
             catch (Exception ex)
             {
-                //MessageBox.Show("发送数据失败 " + ex.Message);
+                LogHelper.log.Debug("消息发送失败 " + ex.Message);
             }
 
         }