|  | @@ -169,22 +169,10 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              m_ReportApp = ReportApp;
 | 
	
		
			
				|  |  |              m_condition = ReportApp.m_conditionChoose;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              string sou = m_condition.m_CurrentConditions[OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
 | 
	
		
			
				|  |  |              if (sou.Contains("+"))
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  MessageBox.Show("This function does not support multiple samples!");
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                //m_ReportApp.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE].itemVal = (int)IMAGE_DISPLAY_TYPE.DISTRIBUTION;
 | 
	
		
			
				|  |  | -                //var rstlist = m_conditionData.GetComboDownListByItemName(OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
 | 
	
		
			
				|  |  | -                //prop.SetPropByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE, rstlist[(int)IMAGE_DISPLAY_TYPE.DISTRIBUTION]);
 | 
	
		
			
				|  |  | -                //m_ReportApp.MoreSource = "";
 | 
	
		
			
				|  |  | -                //m_condition.SetDefaultConditionValue();
 | 
	
		
			
				|  |  | -                //m_condition.DisCurrentPicProperty();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                  result = m_ReportApp.m_rstDataMgr.ResultFilesList[0];
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              else
 | 
	
	
		
			
				|  | @@ -193,7 +181,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              ReportFun = new OTSImageDisHelp(result);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              //设置窗体的双缓冲,以保证大数据时拖动不卡
 | 
	
		
			
				|  |  |              this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
 | 
	
		
			
				|  |  |              this.UpdateStyles();
 | 
	
	
		
			
				|  | @@ -230,17 +217,19 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              try
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | +                //m_condition[OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE].itemVal = (int)IMAGE_DISPLAY_TYPE.DISTRIBUTION;
 | 
	
		
			
				|  |  | +                //var rstlist = m_conditionData.GetComboDownListByItemName(OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE);
 | 
	
		
			
				|  |  | +                //prop.SetPropByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE, rstlist[(int)IMAGE_DISPLAY_TYPE.DISTRIBUTION]);
 | 
	
		
			
				|  |  | +                //m_ReportApp.MoreSource = "";
 | 
	
		
			
				|  |  | +                //m_condition.SetDefaultConditionValue();
 | 
	
		
			
				|  |  | +                //m_condition.DisCurrentPicProperty();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                  lan = new Language(this);
 | 
	
		
			
				|  |  |                  table = lan.GetNameTable(this.Name);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                  m_mythread_state = false;
 | 
	
		
			
				|  |  |                  m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
 | 
	
		
			
				|  |  | -                //m_frm_userprogress = new Frm_UserProgress();
 | 
	
		
			
				|  |  |                  fieldData = new FieldData(result.FilePath);
 | 
	
		
			
				|  |  |                  Particledata = new ParticleData(result.FilePath);
 | 
	
		
			
				|  |  | -                //List<Field> fieldlist = fieldData.GetFieldList();
 | 
	
		
			
				|  |  | -                //m_ReportApp.m_rstDataMgr.CurResultFile.List_OTSField = fieldlist;
 | 
	
		
			
				|  |  |                  var systype = m_ReportApp.m_RptConfigFile.Systype;
 | 
	
		
			
				|  |  |                  if (systype == OTSCommon.Model.OTS_SysType_ID.CleannessA)
 | 
	
		
			
				|  |  |                  {
 | 
	
	
		
			
				|  | @@ -253,7 +242,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                      else
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  |                          userLibraryData = null;
 | 
	
		
			
				|  |  | -                        //MessageBox.Show("未读取到用户标准库!");
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  //初始化底层操作类
 | 
	
	
		
			
				|  | @@ -265,7 +253,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                  log.Error(ex.ToString());
 | 
	
		
			
				|  |  |                  return false;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          private void ParticlesGridDevidePage_Load(object sender, EventArgs e)
 | 
	
		
			
				|  |  |          {
 | 
	
	
		
			
				|  | @@ -287,21 +274,17 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              cbB_PageSize.Items.Add("5000");
 | 
	
		
			
				|  |  |              cbB_PageSize.Items.Add("All");
 | 
	
		
			
				|  |  |              cbB_PageSize.SelectedIndex = 0;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              dgV_ParticlesDevidePage.Focus();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          #region 自定义方法
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          bool UpdateTable()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            //多次测试发现 读取数据库时间耗时长,但读取条数目对读取数据库时长影响不大,故此处直接读取所有数据库信息,以取代多次连接数据库方式,优化分页速度
 | 
	
		
			
				|  |  |              particlesAll = new DataTable();
 | 
	
		
			
				|  |  |              if (sel == (int)SelItem.analyticalParticle)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                //particlesAll = Particledata.GetInfoForPartucleDevidePage2(condition);
 | 
	
		
			
				|  |  | +                
 | 
	
		
			
				|  |  |                  particlesAll = Particledata.GetInfoForPartucleDevidePage_analyticalParticle(condition);
 | 
	
		
			
				|  |  |                  DataTable mergeParticles = Particledata.GetInfoForPartucleDevidePage_mergeParticles(condition);
 | 
	
		
			
				|  |  |                  if (mergeParticles != null && mergeParticles.Rows.Count > 0)
 | 
	
	
		
			
				|  | @@ -385,16 +368,13 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (sel!=(int)SelItem.MergeParticles)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                  DataTable XRayData = Particledata.GetXRayData();
 | 
	
		
			
				|  |  |                  particlesAll.Columns.Add("XRayDataCount");
 | 
	
		
			
				|  |  |                  for (int i = 0; i < particlesAll.Rows.Count; i++)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  |                      if (int.Parse(particlesAll.Rows[i]["particleId"].ToString()) > -1)
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                          particlesAll.Rows[i]["XRayDataCount"] = 0;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                          string str = " XrayIndex= " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
 | 
	
		
			
				|  |  |                          DataRow[] drs = XRayData.Select(str);
 | 
	
		
			
				|  |  |                          uint xraycount = 0;
 | 
	
	
		
			
				|  | @@ -414,7 +394,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                                  particlesAll.Rows[i]["XRayDataCount"] = xraycount;
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -429,15 +408,15 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |          public Bitmap GetBitmapByParticle(string fieldImage, Rectangle offset_rect)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            //然后将取出的数据,转换成Bitmap对象
 | 
	
		
			
				|  |  |              Bitmap ls_bt = DrawFunction.ReadImageFile(fieldImage);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            //为了能把整个颗粒显示完整
 | 
	
		
			
				|  |  |              offset_rect.X = offset_rect.X - 5;
 | 
	
		
			
				|  |  |              offset_rect.Y = offset_rect.Y - 5;
 | 
	
		
			
				|  |  |              offset_rect.Width = offset_rect.Width + 10;
 | 
	
		
			
				|  |  |              offset_rect.Height = offset_rect.Height + 10;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              //防止计算偏差后,有坐标溢出现象
 | 
	
		
			
				|  |  |              if (offset_rect.X < 0)
 | 
	
		
			
				|  |  |                  offset_rect.X = 0;
 | 
	
	
		
			
				|  | @@ -462,7 +441,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              else
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                  new_ret_bp = new Bitmap(offset_rect.Width, offset_rect.Height);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -470,22 +448,18 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          public Bitmap GetBitmapForBig(string sub, ParticleData fielddata, double xs)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              string vs = "," + sub.Replace(':', '-') + ",";
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              DataTable dataTable = fielddata.GetParticleAllforparticlelist(vs);
 | 
	
		
			
				|  |  |              if (dataTable.Rows.Count == 0)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  return null;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              string path = result.FilePath;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              //内接矩形
 | 
	
		
			
				|  |  |              double max_Y = Convert.ToInt64(dataTable.Rows[0]["FieldPosY"]) * xs - Convert.ToInt64(dataTable.Rows[0]["RectTop"]);
 | 
	
		
			
				|  |  |              double max_X = Convert.ToInt64(dataTable.Rows[0]["FieldPosX"]) * xs + Convert.ToInt64(dataTable.Rows[0]["RectLeft"]);
 | 
	
		
			
				|  |  |              double min_Y = max_Y;
 | 
	
		
			
				|  |  |              double min_X = max_X;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              //拼接field矩形
 | 
	
		
			
				|  |  |              double MAX_Y = Convert.ToInt64(dataTable.Rows[0]["FieldPosY"]) * xs;
 | 
	
		
			
				|  |  |              double MAX_X = Convert.ToInt64(dataTable.Rows[0]["FieldPosX"]) * xs;
 | 
	
	
		
			
				|  | @@ -508,6 +482,7 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  |                      max_Y = lrfttopY;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                  if (min_Y > lrfttopY - Convert.ToInt64(item["RectHeight"]))
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  |                      min_Y = lrfttopY - Convert.ToInt64(item["RectHeight"]);
 | 
	
	
		
			
				|  | @@ -539,20 +514,15 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              Graphics graph = Graphics.FromImage(tableChartImage);
 | 
	
		
			
				|  |  |              //初始化这个大图
 | 
	
		
			
				|  |  |              graph.DrawImage(tableChartImage, 0, 0);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              int width = Convert.ToInt32(max_X - min_X);
 | 
	
		
			
				|  |  |              int height = Convert.ToInt32(max_Y - min_Y);
 | 
	
		
			
				|  |  |              int X = Convert.ToInt32(min_X - MIN_X);
 | 
	
		
			
				|  |  |              int Y = Convert.ToInt32(MAX_Y - max_Y);
 | 
	
		
			
				|  |  |              Rectangle rectangle = new Rectangle() { X = X, Y = Y, Width = width, Height = height };
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              foreach (DataRow item in dataTable.Rows)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  string filePath = path + "\\FIELD_FILES\\";
 | 
	
		
			
				|  |  |                  string imagePath = filePath + "Field" + item["fieldid"].ToString() + ".bmp";
 | 
	
		
			
				|  |  | -                //然后将取出的数据,转换成Bitmap对象
 | 
	
		
			
				|  |  |                  Bitmap ls_bt = DrawFunction.ReadImageFile(imagePath);
 | 
	
		
			
				|  |  |                  int x = Convert.ToInt32(Convert.ToDouble(item["FieldPosX"]) * xs - MIN_X);
 | 
	
		
			
				|  |  |                  int y = System.Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosY"]) * xs - MAX_Y));
 | 
	
	
		
			
				|  | @@ -562,12 +532,9 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  catch /*(Exception e)*/
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                      throw;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              Bitmap bmap = tableChartImage.Clone(rectangle, PixelFormat.Format8bppIndexed);
 | 
	
		
			
				|  |  |              return bmap;
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -576,17 +543,15 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |          private void BindDataGridView()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              dgV_ParticlesDevidePage.Visible = false;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              if (m_frm_userprogress.IsDisposed)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  ProgressStart();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              dgV_ParticlesDevidePage.Rows.Clear();
 | 
	
		
			
				|  |  |              dgV_ParticlesDevidePage.Columns.Clear();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              var startFun = m_ReportApp.m_RptConfigFile.Systype;
 | 
	
		
			
				|  |  | -            //从报告xml文件中加载,显示计算列,显示元素信息
 | 
	
		
			
				|  |  | +            
 | 
	
		
			
				|  |  |              string str_DefaultComputedColName = "", str_ElementsColName = "";
 | 
	
		
			
				|  |  |              DataSet ds = XMLoperate.GetXmlData(Application.StartupPath + RptConfigFile.m_ReportMgrParamFile, "XMLData");
 | 
	
		
			
				|  |  |              DataTable dt = ds.Tables["Member"];
 | 
	
	
		
			
				|  | @@ -604,13 +569,8 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                      str_ElementsColName = element["strValue"].ToString();
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            //获取需要显示的计算列
 | 
	
		
			
				|  |  |              string[] strs = str_DefaultComputedColName.Split(',');
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            //列名
 | 
	
		
			
				|  |  |              Dictionary<string, string> keyValues = new Dictionary<string, string>() { };
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              keyValues.Add("rowid", table["str4"].ToString());
 | 
	
		
			
				|  |  |              keyValues.Add("TypeName", table["str6"].ToString());
 | 
	
		
			
				|  |  |              keyValues.Add("ParticleImage", table["str5"].ToString());
 | 
	
	
		
			
				|  | @@ -696,10 +656,8 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                          keyValues.Add("Electrical_conductivity", table["str36"].ToString());
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              keyValues.Add("Element", "Element");
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              Dictionary<string, string>.Enumerator en = keyValues.GetEnumerator();
 | 
	
		
			
				|  |  |              for (int irow = 0; irow < keyValues.Count; irow++)
 | 
	
		
			
				|  |  |              {
 | 
	
	
		
			
				|  | @@ -711,10 +669,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                          iconColumn.Name = en.Current.Key;
 | 
	
		
			
				|  |  |                          iconColumn.HeaderText = en.Current.Value;
 | 
	
		
			
				|  |  |                          dgV_ParticlesDevidePage.Columns.Add(iconColumn);
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    else if (en.Current.Key == "Element")
 | 
	
		
			
				|  |  | -                    {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      else
 | 
	
		
			
				|  |  |                      {
 | 
	
	
		
			
				|  | @@ -725,7 +679,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                              dgV_ParticlesDevidePage.Columns[id - 1].Tag = "NumericType";
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (PageSize == -1)
 | 
	
	
		
			
				|  | @@ -748,7 +701,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                  particles.ImportRow(particlesAll.Rows[fi]);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              string particleM = "";
 | 
	
		
			
				|  |  | -            //获取需要显示的元素名
 | 
	
		
			
				|  |  |              List<string> ElementTypeSort = new List<string>(str_ElementsColName.Split(',').ToList());//去重
 | 
	
		
			
				|  |  |              for (int i = 0; i < ElementTypeSort.Count; i++)
 | 
	
		
			
				|  |  |              {
 | 
	
	
		
			
				|  | @@ -761,13 +713,11 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                  int id = dgV_ParticlesDevidePage.Columns.Count;
 | 
	
		
			
				|  |  |                  dgV_ParticlesDevidePage.Columns[id - 1].Tag = "NumericType";
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            double jd = 95f / (double)particles.Rows.Count;//计算进度刻度
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +            double jd = 95f / (double)particles.Rows.Count;
 | 
	
		
			
				|  |  |              string filePath = result.FilePath + "\\FIELD_FILES\\";
 | 
	
		
			
				|  |  |              KeyValuePair<string, Bitmap> FieldImage = new KeyValuePair<string, Bitmap>();
 | 
	
		
			
				|  |  |              for (int i = 0; i < particles.Rows.Count; i++)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                //更新进度,每100条记录加载完,更新一次进度
 | 
	
		
			
				|  |  |                  if (i % 10 == 0)
 | 
	
		
			
				|  |  |                      m_frm_userprogress.SetProgressValueAndText((int)(jd * i), "loading..");
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -780,10 +730,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  |                      if (enl.MoveNext())
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  | -                        if (enl.Current.Key == "rowid")
 | 
	
		
			
				|  |  | -                        {
 | 
	
		
			
				|  |  | -                            //dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = i + 1;
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  |                          if (enl.Current.Key == "ParticleImage")
 | 
	
		
			
				|  |  |                          {
 | 
	
		
			
				|  |  |                              if (particles.Columns.Contains("SubParticles"))
 | 
	
	
		
			
				|  | @@ -826,7 +772,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                                      string imagePath = filePath + "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
 | 
	
		
			
				|  |  |                                      FieldImage = new KeyValuePair<string, Bitmap>(particles.Rows[i]["fieldid"].ToString(), Particledata.ReadImageFile(imagePath));
 | 
	
		
			
				|  |  |                                  }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                                  Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particles.Rows[i]["RectLeft"]), Y = Convert.ToInt32(particles.Rows[i]["RectTop"]), Width = Convert.ToInt32(particles.Rows[i]["RectWidth"]), Height = Convert.ToInt32(particles.Rows[i]["RectHeight"]) };
 | 
	
		
			
				|  |  |                                  Bitmap bmap = Particledata.GetBitmapByParticle(FieldImage.Value, rectangle);
 | 
	
		
			
				|  |  |                                  bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString(), particles.Rows[i]["TypeId"].ToString(), particles.Rows[i]["XrayId"].ToString() };
 | 
	
	
		
			
				|  | @@ -887,6 +832,8 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          if (enl.Current.Key == "TypeName")
 | 
	
		
			
				|  |  |                          {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                              if (particles.Rows[i]["TypeId"].ToString() == "9")
 | 
	
		
			
				|  |  |                              {
 | 
	
		
			
				|  |  |                                  dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = "Not Identified";
 | 
	
	
		
			
				|  | @@ -926,7 +873,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              //加载完成,关闭进度条
 | 
	
		
			
				|  |  |              m_frm_userprogress.Close();
 | 
	
		
			
				|  |  |              #endregion
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              dgV_ParticlesDevidePage.Visible = true;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -983,16 +929,9 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |          public static Point CalculateParticleCenterPosition(ResultFile resultFile, Point SEMPos, Point ParticlePos)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              Point point = new Point();
 | 
	
		
			
				|  |  | -            //Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)resultFile.ResultInfo["Sample"])["Members"]);
 | 
	
		
			
				|  |  | -            //Dictionary<string, object> imageScanParam = (Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)sampleMembers["MsrParams"])["Members"])["ImageScanParam"];
 | 
	
		
			
				|  |  | -            //Dictionary<string, object> SEMDataMsr = (Dictionary<string, object>)sampleMembers["SEMDataMsr"];
 | 
	
		
			
				|  |  | -            //Dictionary<string, object> SEMStageData = (Dictionary<string, object>)resultFile.ResultInfo["SEMStageData"];
 | 
	
		
			
				|  |  |              float ScanFieldSizeX = resultFile.GetScanFieldSizeX();
 | 
	
		
			
				|  |  |              string leftOrRight = resultFile.GetXAxisDir();
 | 
	
		
			
				|  |  |              string downOrUp = resultFile.GetYAxisDir();
 | 
	
		
			
				|  |  | -            //string ImageResolution = imageScanParam["ImageResolution"].ToString();
 | 
	
		
			
				|  |  | -            //int width = resultFile.GetImageWidth();
 | 
	
		
			
				|  |  | -            //int height = resultFile.GetImageHeight();
 | 
	
		
			
				|  |  |              float ScanFieldSizeY = resultFile.GetScanFieldSizeY();
 | 
	
		
			
				|  |  |              float m_pixelSize = resultFile.GetPixelSize();
 | 
	
		
			
				|  |  |              if (leftOrRight == "RIGHT_TOWARD")
 | 
	
	
		
			
				|  | @@ -1696,7 +1635,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              string str_path_FIELD_FILES = str_resultPath + "\\FIELD_FILES\\";
 | 
	
		
			
				|  |  |              string str_path_FIELD_FILES_MARK = str_resultPath + "\\FIELD_FILES_MARK\\";
 | 
	
		
			
				|  |  |              int intQuantity = 0;
 | 
	
		
			
				|  |  | -            //List<string> vs = new List<string>();
 | 
	
		
			
				|  |  |              dt_FIeld = new DataTable();
 | 
	
		
			
				|  |  |              vs = new List<string>();
 | 
	
		
			
				|  |  |              ////判断是否已经有导出过的标记帧图文件夹,如果已经存在,则直接返回不输出,先不加
 | 
	
	
		
			
				|  | @@ -1824,7 +1762,7 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            //
 | 
	
		
			
				|  |  | +            
 | 
	
		
			
				|  |  |              GC.Collect();
 | 
	
		
			
				|  |  |              GC.WaitForPendingFinalizers();
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -2121,7 +2059,7 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                  List<Particle> list_Part = new List<Particle>();
 | 
	
		
			
				|  |  |                  for (int ii = 0; ii < dgV_ParticlesDevidePage.SelectedRows.Count; ii++)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -                    //从事先加载的Bitmap对象的Tag中取出List<string>
 | 
	
		
			
				|  |  | +                    
 | 
	
		
			
				|  |  |                      DataGridViewRow dgvr = dgV_ParticlesDevidePage.SelectedRows[ii];
 | 
	
		
			
				|  |  |                      Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
 | 
	
		
			
				|  |  |                      List<string> list_str = (List<string>)ls_bp.Tag;
 | 
	
	
		
			
				|  | @@ -2247,7 +2185,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  file.CopyTo(targetPath, true);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              return true;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          private void DisplayData()
 | 
	
	
		
			
				|  | @@ -2320,10 +2257,9 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              int gauge = RulerSelection(ScanFieldSizeX);
 | 
	
		
			
				|  |  |              float RulerPixels = gauge / PixelSize;
 | 
	
		
			
				|  |  | -            //查找该field下对应所有的颗粒
 | 
	
		
			
				|  |  |              DataTable dt_AllParticle = fieldData.GetAllParticle_DataTable();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              DirectoryInfo theFolder = new DirectoryInfo(str_path_FIELD_FILES);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              if (theFolder.Exists)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  DataTable dt = new DataTable();
 | 
	
	
		
			
				|  | @@ -2338,11 +2274,9 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  |                          if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
 | 
	
		
			
				|  |  |                          {
 | 
	
		
			
				|  |  | -                            //确认对应的帧图名
 | 
	
		
			
				|  |  |                              string str_fieldid = Path.GetFileNameWithoutExtension(nextifile.Name);
 | 
	
		
			
				|  |  |                              str_fieldid = str_fieldid.Substring(5, str_fieldid.Length - 5);//减去field字符长度
 | 
	
		
			
				|  |  |                              bool bl = false;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                              if (str_fieldid == max_list[i].ToString())
 | 
	
		
			
				|  |  |                              {
 | 
	
		
			
				|  |  |                                  bl = true;
 | 
	
	
		
			
				|  | @@ -2361,7 +2295,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                                      }
 | 
	
		
			
				|  |  |                                  }
 | 
	
		
			
				|  |  |                                  dr["cunt"] = drcunt;
 | 
	
		
			
				|  |  | -                                //dr["cunt"] = dataTable.Select(" fieldid = " + str_fieldid).Count();
 | 
	
		
			
				|  |  |                                  dr["fieldName"] = nextifile.Name;
 | 
	
		
			
				|  |  |                                  dr["fieldFullName"] = nextifile.FullName;
 | 
	
		
			
				|  |  |                                  dr["id"] = str_fieldid;
 | 
	
	
		
			
				|  | @@ -2380,7 +2313,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                      for (int ia = 0; ia < dataTable.Rows.Count; ia++)
 | 
	
		
			
				|  |  |                          if (Convert.ToInt32(dt_FIeld.Rows[i]["id"]) == Convert.ToInt32(dataTable.Rows[ia]["fieldid"]))
 | 
	
		
			
				|  |  |                              drCount++;
 | 
	
		
			
				|  |  | -                    //if (dataTable.Select(dt_FIeld.Rows[i]["fieldid"].ToString()).Count() > 0)
 | 
	
		
			
				|  |  |                          if (drCount > 0)
 | 
	
		
			
				|  |  |                          {
 | 
	
		
			
				|  |  |                          vs.Add(dt_FIeld.Rows[i]["id"].ToString());
 | 
	
	
		
			
				|  | @@ -2429,21 +2361,17 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                              {
 | 
	
		
			
				|  |  |                                  ls_offsetx = offset_rect.X - 10;
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                            g.DrawString(dt_FIeld.Rows[i]["id"].ToString() + "" + str_particleid.ToString(),
 | 
	
		
			
				|  |  | -                                new Font("黑体", 8), new SolidBrush(Color.Aqua), new PointF(ls_offsetx, offset_rect.Y));
 | 
	
		
			
				|  |  | +                            g.DrawString(dt_FIeld.Rows[i]["id"].ToString() + "" + str_particleid.ToString(),new Font("黑体", 8), new SolidBrush(Color.Aqua), new PointF(ls_offsetx, offset_rect.Y));
 | 
	
		
			
				|  |  | +                            
 | 
	
		
			
				|  |  | +                            
 | 
	
		
			
				|  |  |                              var bitmap = DrawRuler(ls_fieldbp, (int)(RulerPixels/2), 2, (gauge/2).ToString()+ "μm");
 | 
	
		
			
				|  |  |                              dt_FIeld.Rows[i]["Field_pic"] = bitmap;
 | 
	
		
			
				|  |  | -                            //bitmap.Save("D:\\图片\\asd.bmp");
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            //
 | 
	
		
			
				|  |  |              GC.Collect();
 | 
	
		
			
				|  |  |              GC.WaitForPendingFinalizers();
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -2600,7 +2528,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                              if (str[1] != ""&&double.Parse(str[1]) != 0)  //咨询demo后,元素含量返回值为零时一般去除此元素
 | 
	
		
			
				|  |  |                              {ele.Add(str[0]);}
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                    
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              foreach(var el in ele)
 | 
	
	
		
			
				|  | @@ -2613,11 +2540,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              m_particlesGridDevidePageShowConfig = new ParticlesGridDevidePageShowConfig(m_ReportApp.m_RptConfigFile.Systype, elementsstr);
 | 
	
		
			
				|  |  |                  m_particlesGridDevidePageShowConfig.ShowDialog();
 | 
	
		
			
				|  |  | -            //}
 | 
	
		
			
				|  |  | -            //else
 | 
	
		
			
				|  |  | -            //{
 | 
	
		
			
				|  |  | -            //    m_particlesGridDevidePageShowConfig.Activate();
 | 
	
		
			
				|  |  | -            //}
 | 
	
		
			
				|  |  |              if (m_particlesGridDevidePageShowConfig.DialogResult == DialogResult.OK)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  dgV_ParticlesDevidePage.Rows.Clear();
 | 
	
	
		
			
				|  | @@ -2681,17 +2603,12 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                      DataGridViewRow dgvr = SelectRows[0];
 | 
	
		
			
				|  |  |                      Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
 | 
	
		
			
				|  |  |                      List<string> list_str = (List<string>)ls_bp.Tag;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                    //显示xray相关信息
 | 
	
		
			
				|  |  |                      uint[] Search_xray = new uint[2000];
 | 
	
		
			
				|  |  |                      uint[] Analysis_xray = new uint[2000];
 | 
	
		
			
				|  |  |                      int i_xray_id = 0;
 | 
	
		
			
				|  |  |                      List<Element> list_celementchemistryclr = new List<Element>();
 | 
	
		
			
				|  |  | -                    //获取Xray数据
 | 
	
		
			
				|  |  |                      ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    //get CElementChemistryClr list
 | 
	
		
			
				|  |  |                      List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
 | 
	
		
			
				|  |  |                      for (int i = 0; i < list_celementchemistryclr.Count; i++)
 | 
	
		
			
				|  |  |                      {
 | 
	
	
		
			
				|  | @@ -2723,7 +2640,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      control_XRayTable1.SetParticleInfo("Area:" + Math.Round(particle.Area, 2) + "  " + "DMAX:" + Math.Round(particle.DMAX, 2) +"  " + "DELONG:" + Math.Round(particle.DELONG, 2) + "  " + "DFERET:" + Math.Round(particle.DFERET, 2) + "  " + "DINSCR:" + Math.Round(particle.DINSCR, 2) + "\n" + "DMEAN:" + Math.Round(particle.DMEAN, 2) + "  " + "DMIN:" + Math.Round(particle.DMIN, 2) + "  " + "DPERP:" + Math.Round(particle.DPERP, 2) + "  " + "ORIENTATION:" + Math.Round(particle.ORIENTATION, 2) + "  " + "PERIMETER:" + Math.Round(particle.PERIMETER, 2));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    //获取数据后,需要对xraytable设置
 | 
	
		
			
				|  |  |                      control_XRayTable1.Visible = true;
 | 
	
		
			
				|  |  |                      control_XRayTable1.SetXRayShowLineValue(null, Analysis_xray, list_showelementinfo);
 | 
	
		
			
				|  |  |                      //颗粒国标信息
 | 
	
	
		
			
				|  | @@ -2762,7 +2678,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  SaveParticleslist_select();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -2815,7 +2730,6 @@ namespace OTSIncAReportGrids
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  UpdateTable();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                  lnkFirst_Click(null, null);
 | 
	
		
			
				|  |  |                  SetDataGridViewStyle();
 | 
	
		
			
				|  |  |              }
 |