소스 검색

提交部分二次采集代码

zty 3 년 전
부모
커밋
0b35dcd44e

+ 2 - 2
OTSCPP/OTSControl/COTSHardwareMgr.cpp

@@ -227,8 +227,8 @@ namespace OTSController {
 
 		xmls::Slo subClass;
 		xmls::Slo subClass1;
-		subClass.Register("drive", &szS);
-		 subClass1.Register ("drive",&szE);
+		subClass.Register("Value", &szS);
+		 subClass1.Register ("Value",&szE);
 		subClass.Register("SemControllerName", &subClass);
 		
 		subClass.Register("EDSName", &subClass1);

+ 54 - 10
OTSIncAMeasureApp/0-OTSModel/Measure/4-ReMeasure/SmplMeasureReMeasure.cs

@@ -2,6 +2,7 @@
 using OTSCommon;
 using OTSCommon.Model;
 using OTSModelSharp;
+using OTSModelSharp.DTLBase;
 using OTSModelSharp.ServiceInterface;
 using System;
 using System.Collections.Generic;
@@ -24,6 +25,7 @@ namespace OTSMeasureApp._0_OTSModel.Measure._4_ReMeasure
             try
             {
                 sem.Connect();
+                eds.Connect();
                 //参数定义
                 int nBrukerDwellTimeId = 3;
                 long nBrukerDwellTime = 0;
@@ -43,45 +45,55 @@ namespace OTSMeasureApp._0_OTSModel.Measure._4_ReMeasure
                         break;
                 }
                 nBrukerDwellTime = DWELLTIME_BRUKER_VALUES[nBrukerDwellTimeId];
+                SQLiteHelper sQLiteHelper = new SQLiteHelper(samplePath + "Inclusion.db");
+                sQLiteHelper.GetDBConnection();
+                sQLiteHelper.BeginTransaction();
+                log.Info("Begin to process field count : " + keyValues.Count);
                 //按帧图分析
                 for (int i = 0; i < keyValues.Count; i++)
                 {
                     List<COTSParticleClr> cOTSParticleClrs = new List<COTSParticleClr>();
                     //移动到当前帧
-                    sem.MoveSEMToPoint(keyValues[i][0].FieldPosX, keyValues[i][0].FieldPosY);
+                    log.Debug("Begin to move to the field : " + keyValues.ElementAt(i).Value[0].FieldId);
+                    sem.MoveSEMToPoint(keyValues.ElementAt(i).Value[0].FieldPosX, keyValues.ElementAt(i).Value[0].FieldPosY);
                     //采集图像
+                    log.Info("Begin to AcquireBSEImage ");
                     scan.SetDwellTime(nBrukerDwellTimeId);
                     scan.SetImageSize(width, height);
                     CBSEImgClr imgClr = scan.AcquireBSEImage(0, 0, (int)nBrukerDwellTime);
                     Bitmap bitmap = Imagepro.ToGrayBitmap(imgClr.GetImageDataPtr(), width, height);
-                    bitmap.Save(samplePath + keyValues[i][0].FieldId, System.Drawing.Imaging.ImageFormat.Bmp);
-
+                    bitmap.Save(samplePath + "Field" + keyValues.ElementAt(i).Value[0].FieldId + ".bmp", System.Drawing.Imaging.ImageFormat.Bmp);
                     //打能谱
+                    log.Info("Begin to GetXRayByPoints count : " + keyValues.ElementAt(i).Value.Count);
                     if (XRAYSCANMODE_INDEX == (int)OTS_X_RAY_SCAN_MODE.PointMode)
                     {
-                        for (int j = 0; j < keyValues[i].Count; j++)
+                        for (int j = 0; j < keyValues.ElementAt(i).Value.Count; j++)
                         {
                             COTSParticleClr cOTSParticle = new COTSParticleClr();
                             CPosXrayClr cPosXray = new CPosXrayClr();
+                            cOTSParticle.SetAnalysisId(keyValues.ElementAt(i).Value[j].XrayId);
+                            cOTSParticle.SetFieldId(keyValues.ElementAt(i).Value[j].FieldId);
                             cOTSParticle.SetXray(cPosXray);
-                            cOTSParticle.SetXRayPos(new Point(keyValues[i][j].PosX, keyValues[i][j].PosY));
+                            cOTSParticle.SetXRayPos(new Point(keyValues.ElementAt(i).Value[j].PosX, keyValues.ElementAt(i).Value[j].PosY));
                             cOTSParticleClrs.Add(cOTSParticle);
                         }
                         eds.GetXRayByPoints(cOTSParticleClrs, (uint)nBrukerDwellTime, true);
                     }
                     else
                     {
-                        for (int j = 0; j < keyValues[i].Count; j++)
+                        for (int j = 0; j < keyValues.ElementAt(i).Value.Count; j++)
                         {
                             COTSParticleClr cOTSParticle = new COTSParticleClr();
                             CPosXrayClr cPosXray = new CPosXrayClr();
+                            cOTSParticle.SetAnalysisId(keyValues.ElementAt(i).Value[j].XrayId);
+                            cOTSParticle.SetFieldId(keyValues.ElementAt(i).Value[j].FieldId);
                             cOTSParticle.SetXray(cPosXray);
-                            cOTSParticle.SetParticleRect(new Rectangle(keyValues[i][j].RectLeft, keyValues[i][j].RectTop, keyValues[i][j].RectWidth, keyValues[i][j].RectHeight));
+                            cOTSParticle.SetParticleRect(new Rectangle(keyValues.ElementAt(i).Value[j].RectLeft, keyValues.ElementAt(i).Value[j].RectTop, keyValues.ElementAt(i).Value[j].RectWidth, keyValues.ElementAt(i).Value[j].RectHeight));
                             COTSFeatureClr fea = new COTSFeatureClr();
                             List<COTSSegmentClr> segs = new List<COTSSegmentClr>();
-                            for (int k = 0; k < keyValues[i][j].SegmentNum; k++)
+                            for (int k = 0; k < keyValues.ElementAt(i).Value[j].SegmentNum; k++)
                             {
-                                segs.Add(new COTSSegmentClr(keyValues[i][j].SegmentList[k].Height, keyValues[i][j].SegmentList[k].Start, keyValues[i][j].SegmentList[k].Length));
+                                segs.Add(new COTSSegmentClr(keyValues.ElementAt(i).Value[j].SegmentList[k].Height, keyValues.ElementAt(i).Value[j].SegmentList[k].Start, keyValues.ElementAt(i).Value[j].SegmentList[k].Length));
                             }
                             fea.SetSegmentsList(segs, false);
                             cOTSParticle.SetFeature(fea);
@@ -89,13 +101,45 @@ namespace OTSMeasureApp._0_OTSModel.Measure._4_ReMeasure
                         }
                         eds.GetXRayByFeatures(cOTSParticleClrs, (uint)nBrukerDwellTime, true);
                     }
+                    //修改数据库能谱
+                    log.Info("Begin to save info to db ");
+                    for (int j = 0; j < cOTSParticleClrs.Count; j++)
+                    {
+                        UInt32[] xrayData = cOTSParticleClrs[j].GetXray().GetXrayData();
+                        byte[] bytedata = new byte[GENERALXRAYCHANNELS * 4];
+                        for (int k = 0; k < GENERALXRAYCHANNELS; k++)
+                        {
+                            uint m = xrayData[k];
+                            byte[] dwordData = BitConverter.GetBytes(m);
+                            bytedata[k * 4] = dwordData[0];
+                            bytedata[k * 4 + 1] = dwordData[1];
+                            bytedata[k * 4 + 2] = dwordData[2];
+                            bytedata[k * 4 + 3] = dwordData[3];
+                        }
+                        sQLiteHelper.ExecuteXrayForTransaction(cOTSParticleClrs[j].GetAnalysisId(), cOTSParticleClrs[j].GetFieldId(), bytedata);
+                        List<CElementChemistryClr> elementChemistryClrs = cOTSParticleClrs[j].GetXray().GetElementQuantifyData();
+                        List<string> nameList = new List<string>();
+                        List<double> perList = new List<double>();
+                        for (int k = 0; k < elementChemistryClrs.Count; k++)
+                        {
+                            nameList.Add(elementChemistryClrs[k].GetName());
+                            perList.Add(elementChemistryClrs[k].GetPercentage());
+                        }
+                        sQLiteHelper.ExecuteElementForTransaction(cOTSParticleClrs[j].GetAnalysisId(), cOTSParticleClrs[j].GetFieldId(), cOTSParticleClrs[j].GetXray().GetElementNum(), nameList, perList);
+                    }
+                    log.Info("End process the field : " + keyValues.ElementAt(i).Value[0].FieldId);
                 }
+                sQLiteHelper.CommitTransaction();
+                sem.DisConnect();
+                eds.DisConnect();
                 return true;
             }
-            catch (Exception)
+            catch (Exception ex)
             {
+                log.Error("ReMeasure Erroe ! " + ex);
                 return false;
             }
         }
+
     }
 }

+ 56 - 2
OTSIncAMeasureApp/ServiceCenter/DTLBase/SQliteHelper.cs

@@ -19,8 +19,11 @@ namespace OTSModelSharp.DTLBase
         /// </summary>
         
         private string  connectionString;
+        SQLiteConnection connForTrans;
+        SQLiteCommand cmdForTrans;
+        SQLiteTransaction trans;
+
 
-       
         private NLog.Logger log;
         /// <summary>
         /// 构造函数
@@ -49,7 +52,7 @@ namespace OTSModelSharp.DTLBase
         public SQLiteConnection GetDBConnection()
         {
             SQLiteConnection connection = new SQLiteConnection(connectionString);
-
+            connForTrans = connection;
             return connection;
         }
         /// <summary>
@@ -157,6 +160,57 @@ namespace OTSModelSharp.DTLBase
             return affectedRows;
         }
 
+        /// <summary>
+        /// 单独修改指定位置的能谱数据
+        /// </summary>
+        /// <param name="XrayId"></param>
+        /// <param name="FieldId"></param>
+        /// <param name="pBlobData"></param>
+        /// <returns></returns>
+        public int ExecuteXrayForTransaction(int XrayId, int FieldId, byte[] pBlobData)
+        {
+            int affectedRows = 0;
+            cmdForTrans.CommandText = "UPDATE XRayData SET XRayData = @XRayData WHERE XrayIndex = " + XrayId + " and FieldId = " + FieldId + "";
+            cmdForTrans.Parameters.Clear();
+            cmdForTrans.Parameters.AddWithValue(@"XRayData", pBlobData);
+            affectedRows = cmdForTrans.ExecuteNonQuery();
+            return affectedRows;
+        }
+
+        public int ExecuteElementForTransaction(int XrayId, int FieldId, int ElementNum, List<string> nameList, List<double> perList)
+        {
+            int affectedRows = 0;
+            cmdForTrans.CommandText = "DELETE FROM ElementChemistry WHERE XrayId = " + XrayId + " and FieldId = " + FieldId + "";
+            affectedRows = cmdForTrans.ExecuteNonQuery();
+            for (int i = 0; i < ElementNum; i++)
+            {
+                cmdForTrans.CommandText = "INSERT INTO ElementChemistry(XrayID, FieldID, ElementId, ElementNum, Name, Percentage) VALUES ('" + XrayId + "','" + FieldId + "','" + i + "','" + ElementNum + "','" + nameList[i] + "','" + perList[i] + "')";
+                affectedRows = cmdForTrans.ExecuteNonQuery();
+            }
+
+            return affectedRows;
+        }
+
+        public bool BeginTransaction()
+        {
+            if (connForTrans.State != ConnectionState.Open)
+            {
+                connForTrans.Open();
+            }
+            trans = connForTrans.BeginTransaction();
+            cmdForTrans = new SQLiteCommand();
+            cmdForTrans.Connection = connForTrans;
+            cmdForTrans.Transaction = trans;
+            return true;
+        }
+
+        public bool CommitTransaction()
+        {
+            trans.Commit();
+            connForTrans.Close();
+            return true;
+        }
+
         /// <summary>
         /// 批量处理数据操作语句。
         /// </summary>

+ 63 - 62
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.Designer.cs

@@ -32,6 +32,7 @@
             this.panel2 = new System.Windows.Forms.Panel();
             this.label_Condition = new System.Windows.Forms.Label();
             this.tbx_Type = new System.Windows.Forms.TextBox();
+            this.btn_ReMeasure = new System.Windows.Forms.Button();
             this.btn_Sel = new System.Windows.Forms.Button();
             this.label_ParticleName = new System.Windows.Forms.Label();
             this.label_Dmax = new System.Windows.Forms.Label();
@@ -59,19 +60,18 @@
             this.label2 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
-            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
-            this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
-            this.dgV_ParticlesDevidePage = new System.Windows.Forms.DataGridView();
-            this.btn_ReMeasure = new System.Windows.Forms.Button();
             this.ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
             this.ToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem_selectparticle = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem_exportimagefile = new System.Windows.Forms.ToolStripMenuItem();
+            this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.EXCELToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.dgV_ParticlesDevidePage = new System.Windows.Forms.DataGridView();
             this.panel2.SuspendLayout();
             this.panel1.SuspendLayout();
             this.contextMenuStrip1.SuspendLayout();
@@ -119,6 +119,17 @@
             this.tbx_Type.TabIndex = 34;
             this.tbx_Type.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             // 
+            // btn_ReMeasure
+            // 
+            this.btn_ReMeasure.Location = new System.Drawing.Point(595, 8);
+            this.btn_ReMeasure.Name = "btn_ReMeasure";
+            this.btn_ReMeasure.Size = new System.Drawing.Size(80, 23);
+            this.btn_ReMeasure.TabIndex = 33;
+            this.btn_ReMeasure.Text = "二次采集";
+            this.btn_ReMeasure.UseVisualStyleBackColor = true;
+            this.btn_ReMeasure.Visible = false;
+            this.btn_ReMeasure.Click += new System.EventHandler(this.btn_ReMeasure_Click);
+            // 
             // btn_Sel
             // 
             this.btn_Sel.Location = new System.Drawing.Point(535, 8);
@@ -390,63 +401,6 @@
             this.contextMenuStrip1.Name = "contextMenuStrip1";
             this.contextMenuStrip1.Size = new System.Drawing.Size(219, 280);
             // 
-            // toolStripSeparator1
-            // 
-            this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(215, 6);
-            // 
-            // testToolStripMenuItem
-            // 
-            this.testToolStripMenuItem.Name = "testToolStripMenuItem";
-            this.testToolStripMenuItem.Size = new System.Drawing.Size(218, 30);
-            this.testToolStripMenuItem.Text = "显示能谱数据";
-            this.testToolStripMenuItem.Visible = false;
-            this.testToolStripMenuItem.Click += new System.EventHandler(this.testToolStripMenuItem_Click);
-            // 
-            // tableLayoutPanel1
-            // 
-            this.tableLayoutPanel1.ColumnCount = 1;
-            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 0);
-            this.tableLayoutPanel1.Controls.Add(this.dgV_ParticlesDevidePage, 0, 1);
-            this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 2);
-            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
-            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
-            this.tableLayoutPanel1.RowCount = 3;
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 43F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 45F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(1508, 835);
-            this.tableLayoutPanel1.TabIndex = 7;
-            // 
-            // dgV_ParticlesDevidePage
-            // 
-            this.dgV_ParticlesDevidePage.AllowUserToAddRows = false;
-            this.dgV_ParticlesDevidePage.AllowUserToDeleteRows = false;
-            this.dgV_ParticlesDevidePage.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
-            this.dgV_ParticlesDevidePage.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dgV_ParticlesDevidePage.ContextMenuStrip = this.contextMenuStrip1;
-            this.dgV_ParticlesDevidePage.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.dgV_ParticlesDevidePage.Location = new System.Drawing.Point(3, 46);
-            this.dgV_ParticlesDevidePage.Name = "dgV_ParticlesDevidePage";
-            this.dgV_ParticlesDevidePage.ReadOnly = true;
-            this.dgV_ParticlesDevidePage.RowHeadersWidth = 4;
-            this.dgV_ParticlesDevidePage.RowTemplate.Height = 23;
-            this.dgV_ParticlesDevidePage.Size = new System.Drawing.Size(1502, 741);
-            this.dgV_ParticlesDevidePage.TabIndex = 5;
-            // 
-            // btn_ReMeasure
-            // 
-            this.btn_ReMeasure.Location = new System.Drawing.Point(595, 8);
-            this.btn_ReMeasure.Name = "btn_ReMeasure";
-            this.btn_ReMeasure.Size = new System.Drawing.Size(80, 23);
-            this.btn_ReMeasure.TabIndex = 33;
-            this.btn_ReMeasure.Text = "二次采集";
-            this.btn_ReMeasure.UseVisualStyleBackColor = true;
-            this.btn_ReMeasure.Click += new System.EventHandler(this.btn_ReMeasure_Click);
-            // 
             // ToolStripMenuItem1
             // 
             this.ToolStripMenuItem1.Image = global::OTSIncAReportApp.Properties.Resources.复制;
@@ -471,6 +425,11 @@
             this.toolStripMenuItem4.Text = "复制图像";
             this.toolStripMenuItem4.Click += new System.EventHandler(this.toolStripMenuItem4_Click);
             // 
+            // toolStripSeparator1
+            // 
+            this.toolStripSeparator1.Name = "toolStripSeparator1";
+            this.toolStripSeparator1.Size = new System.Drawing.Size(215, 6);
+            // 
             // ToolStripMenuItem3
             // 
             this.ToolStripMenuItem3.Image = global::OTSIncAReportApp.Properties.Resources.恢复;
@@ -503,6 +462,14 @@
             this.ToolStripMenuItem_exportimagefile.Text = "导出图像文件";
             this.ToolStripMenuItem_exportimagefile.Click += new System.EventHandler(this.ToolStripMenuItem_exportimagefile_Click);
             // 
+            // testToolStripMenuItem
+            // 
+            this.testToolStripMenuItem.Name = "testToolStripMenuItem";
+            this.testToolStripMenuItem.Size = new System.Drawing.Size(218, 30);
+            this.testToolStripMenuItem.Text = "显示能谱数据";
+            this.testToolStripMenuItem.Visible = false;
+            this.testToolStripMenuItem.Click += new System.EventHandler(this.testToolStripMenuItem_Click);
+            // 
             // EXCELToolStripMenuItem
             // 
             this.EXCELToolStripMenuItem.Image = global::OTSIncAReportApp.Properties.Resources.导出所有数据到EXCEL321;
@@ -511,6 +478,40 @@
             this.EXCELToolStripMenuItem.Text = "导出EXCEL";
             this.EXCELToolStripMenuItem.Click += new System.EventHandler(this.EXCELToolStripMenuItem_Click);
             // 
+            // tableLayoutPanel1
+            // 
+            this.tableLayoutPanel1.ColumnCount = 1;
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+            this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 0);
+            this.tableLayoutPanel1.Controls.Add(this.dgV_ParticlesDevidePage, 0, 1);
+            this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 2);
+            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+            this.tableLayoutPanel1.RowCount = 3;
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 43F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 45F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(1508, 835);
+            this.tableLayoutPanel1.TabIndex = 7;
+            // 
+            // dgV_ParticlesDevidePage
+            // 
+            this.dgV_ParticlesDevidePage.AllowUserToAddRows = false;
+            this.dgV_ParticlesDevidePage.AllowUserToDeleteRows = false;
+            this.dgV_ParticlesDevidePage.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
+            this.dgV_ParticlesDevidePage.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgV_ParticlesDevidePage.ContextMenuStrip = this.contextMenuStrip1;
+            this.dgV_ParticlesDevidePage.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.dgV_ParticlesDevidePage.Location = new System.Drawing.Point(3, 46);
+            this.dgV_ParticlesDevidePage.Name = "dgV_ParticlesDevidePage";
+            this.dgV_ParticlesDevidePage.ReadOnly = true;
+            this.dgV_ParticlesDevidePage.RowHeadersWidth = 4;
+            this.dgV_ParticlesDevidePage.RowTemplate.Height = 23;
+            this.dgV_ParticlesDevidePage.Size = new System.Drawing.Size(1502, 741);
+            this.dgV_ParticlesDevidePage.TabIndex = 5;
+            // 
             // ParticlesGridDevidePage
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 4 - 3
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -1099,13 +1099,14 @@ namespace OTSIncAReportGrids
                 string ImageResolution = imageScanParam["ImageResolution"].ToString();
                 double width = Convert.ToDouble(ImageResolution.Split('_')[1]);
                 double height = Convert.ToDouble(ImageResolution.Split('_')[2]);
-                
+
+
                 ParticleList.OrderBy(a => a.FieldId).ToList();
                 for (int i = 0; i < ParticleList.Count; i++)
                 {
                     if (keyValues.ContainsKey(ParticleList[i].FieldId))
                     {
-                        List<Particle> Particles = keyValues.ElementAt(ParticleList[i].FieldId).Value;
+                        List<Particle> Particles = keyValues[ParticleList[i].FieldId];
                         Particles.Add(ParticleList[i]);
                         keyValues[ParticleList[i].FieldId] = Particles;
                     }
@@ -1125,7 +1126,7 @@ namespace OTSIncAReportGrids
                 //第二步,移动到指定位置,先读取再设置
                 if (m_OTSIncAReportGridsFun.m_SEMConnectionState == true)
                 {
-                    m_OTSIncAReportGridsFun.ReMeasure(result.FilePath, (int)width, (int)height, keyValues, frmReMeasure.IMGSCANSPEED_INDEX, frmReMeasure.XRAYSCANMODE_INDEX, frmReMeasure.NUD_SCANTIME_COUNT);
+                    m_OTSIncAReportGridsFun.ReMeasure(result.FilePath + "\\FIELD_FILES\\", (int)width, (int)height, keyValues, frmReMeasure.IMGSCANSPEED_INDEX, frmReMeasure.XRAYSCANMODE_INDEX, frmReMeasure.NUD_SCANTIME_COUNT);
                 }
 
                 Thread.Sleep(1500);

+ 3 - 0
OTSIncAReportApp/1-UI/frmReMeasure.cs

@@ -81,6 +81,9 @@ namespace OTSIncAReportApp._1_UI
 
         private void BTN_YES_Click(object sender, EventArgs e)
         {
+            IMGSCANSPEED_INDEX = IDC_COMBO_IMGSCANSPEED.SelectedIndex;
+            XRAYSCANMODE_INDEX = IDC_COMBO_XRAYSCANMODE.SelectedIndex;
+            NUD_SCANTIME_COUNT = (int)NUD_SCANTIME.Value;
             this.DialogResult = DialogResult.OK;
             this.Close();
         }