ParticleList.cs 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991
  1. using DevExpress.DataAccess.Sql;
  2. using DevExpress.Office.Utils;
  3. using DevExpress.PivotGrid.OLAP.SchemaEntities;
  4. using DevExpress.XtraDiagram.Bars;
  5. using DevExpress.XtraTreeList.Data;
  6. using NPOI.Util;
  7. using Org.BouncyCastle.Crypto;
  8. using OTSCommon.DBOperate;
  9. using OTSCommon.DBOperate.Model;
  10. using OTSIncAReportApp._1_UI.Control_Graph.Controls;
  11. using OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess;
  12. using OTSIncAReportApp.DataOperation.DataAccess;
  13. using OTSIncAReportApp.OTSRstMgrFunction;
  14. using OTSIncAReportGraph.Controls;
  15. using OTSIncAReportGrids;
  16. using OTSPeriodicTable;
  17. using System;
  18. using System.Collections.Generic;
  19. using System.Data;
  20. using System.Drawing;
  21. using System.IO;
  22. using System.Linq;
  23. using System.Text;
  24. using System.Threading.Tasks;
  25. using System.Windows.Forms;
  26. using System.Windows.Media;
  27. using static NPOI.HSSF.Util.HSSFColor;
  28. using static OTSDataType.otsdataconst;
  29. using static OTSIncAReportApp.OTSReport_Export;
  30. namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
  31. {
  32. /// <summary>
  33. /// 颗粒列表
  34. /// </summary>
  35. class ParticleList
  36. {
  37. //string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath;
  38. ParticleData fielddata;
  39. FieldImage imgAcc;
  40. //ResultFile result;
  41. /// <summary>
  42. /// DEV颗粒列表颗粒前20个谱图排序
  43. /// </summary>
  44. /// <param name="m_mbszclass"></param>
  45. /// <returns></returns>
  46. public List<DataTable> Get_dev_kllb_data(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export,BasicData basicData,out List<DataTable> a_FilteredData)
  47. {
  48. //------------------加载模块,获取数据-------------------------------------------------
  49. string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath;
  50. fielddata = new ParticleData(str_resultPath);
  51. imgAcc = new FieldImage(str_resultPath);
  52. List<DataTable> OutDt = new List<DataTable>();
  53. a_FilteredData = new List<DataTable>();
  54. List<DataTable> datas = basicData.GetMeasurements();
  55. DataTable SpliceMeasurements= basicData.GetSpliceMeasurements();
  56. DataTable spliceAll = basicData.ObtainInformationOnSplicedParticles(m_otsreport_export);//拼接颗粒信息
  57. ResultFile result;
  58. string sou = m_otsreport_export.m_ReportApp.m_conditionChoose.m_CurrentConditions[OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
  59. if (sou.Contains("+"))
  60. {
  61. MessageBox.Show("This function does not support multiple samples!");
  62. result = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[0];
  63. }
  64. else
  65. {
  66. result = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)];
  67. }
  68. ParticlesGridDevidePage particlesGridDevide = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
  69. particlesGridDevide.fldImgAccess = new FieldImage(result.FilePath);
  70. particlesGridDevide.Particledata= new ParticleData(result.FilePath);
  71. for (int i = 0; i < datas.Count; i++)
  72. {
  73. int serialNumber = 1;
  74. if (m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.TCCleannessA/*|| m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.BatteryCleannessA*/)
  75. {
  76. datas[i].Columns.Add("Hardness", typeof(double));
  77. datas[i].Columns.Add("Hardness_detailed");
  78. DataTable dt_stl = new DataTable();
  79. if (GetSTL(basicData.GetResfile(), out dt_stl, m_otsreport_export))
  80. {
  81. for (int a = 0; a < datas[a].Rows.Count; a++)
  82. {
  83. for (int b = 0; b < dt_stl.Rows.Count; b++)
  84. {
  85. if (datas[a].Rows[a]["TypeName"].ToString() == dt_stl.Rows[b]["TypeId"].ToString())
  86. {
  87. datas[a].Rows[a]["Hardness"] = Convert.ToDouble(dt_stl.Rows[b]["Hardness"]);
  88. datas[a].Rows[a]["Hardness_detailed"] = dt_stl.Rows[b]["Hardness_detailed"];
  89. break;
  90. }
  91. }
  92. }
  93. }
  94. }
  95. #region 夹杂物筛选
  96. for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; a++)
  97. {
  98. for (int b = datas[i].Rows.Count - 1; b >= 0; b--)
  99. {
  100. if (m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial[a].ToString() == datas[i].Rows[b]["TypeId"].ToString())
  101. {
  102. datas[i].Rows.RemoveAt(b);
  103. }
  104. }
  105. }
  106. #endregion
  107. #region 安装选择的类型大小排序
  108. DataTable table = datas[i].Copy();
  109. DataView dvs = table.DefaultView;
  110. dvs.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() + " DESC";
  111. DataTable p1Data_b = dvs.ToTable();
  112. #endregion
  113. #region 创建要插入数据库表结构
  114. //插入模板需父子表,结构
  115. // 帧图表
  116. DataTable DT_field_dt = new DataTable();
  117. DataColumn colpictid2 = new DataColumn("FieldId");
  118. colpictid2.DataType = typeof(int);
  119. DT_field_dt.Columns.Add(colpictid2);
  120. //图像列
  121. DataColumn colpict2 = new DataColumn("FieldImg");
  122. colpict2.DataType = System.Type.GetType("System.Byte[]");
  123. DT_field_dt.Columns.Add(colpict2);
  124. //largest20表:(无关系表) 需要显示前20条带有显示能谱图像的颗粒表
  125. DataTable DT_Largest20 = new DataTable();
  126. DT_Largest20.TableName = "Largest20";
  127. DT_Largest20.Columns.Add("pid");
  128. DT_Largest20.Columns.Add("Size");
  129. DT_Largest20.Columns.Add("Width");
  130. DT_Largest20.Columns.Add("DMAX");
  131. DT_Largest20.Columns.Add("DMIN");
  132. DT_Largest20.Columns.Add("Class");
  133. DT_Largest20.Columns.Add("ColName1");
  134. DT_Largest20.Columns.Add("ColName2");
  135. DT_Largest20.Columns.Add("ColName3");
  136. DT_Largest20.Columns.Add("ColName4");
  137. DT_Largest20.Columns.Add("ColName5");
  138. DT_Largest20.Columns.Add("ColName6");
  139. DT_Largest20.Columns.Add("ColName7");
  140. DT_Largest20.Columns.Add("ColName8");
  141. DT_Largest20.Columns.Add("ColName9");
  142. DT_Largest20.Columns.Add("ColName10");
  143. DT_Largest20.Columns.Add("ColVal1");
  144. DT_Largest20.Columns.Add("ColVal2");
  145. DT_Largest20.Columns.Add("ColVal3");
  146. DT_Largest20.Columns.Add("ColVal4");
  147. DT_Largest20.Columns.Add("ColVal5");
  148. DT_Largest20.Columns.Add("ColVal6");
  149. DT_Largest20.Columns.Add("ColVal7");
  150. DT_Largest20.Columns.Add("ColVal8");
  151. DT_Largest20.Columns.Add("ColVal9");
  152. DT_Largest20.Columns.Add("ColVal10");
  153. // 图像列
  154. DT_Largest20.Columns.Add("p1", typeof(Bitmap));
  155. DT_Largest20.Columns.Add("p2", typeof(Bitmap));
  156. DT_Largest20.Columns.Add("p3", typeof(Bitmap));
  157. DT_Largest20.Columns.Add("GroupName");
  158. #endregion
  159. DataTable p1Data = fielddata.AddElementColumn(p1Data_b, m_mbszclass, spliceAll);
  160. #region 插入颗粒部份
  161. DataTable FilteredData = p1Data.Clone();
  162. ImageProcessor imageProcessor = new ImageProcessor();
  163. for (int i_row = 0; i_row < p1Data.Rows.Count; i_row++)
  164. {
  165. if (p1Data.Rows[i_row]["Element"].ToString() != "")
  166. {
  167. if (p1Data.Rows[i_row].ItemArray[24].ToString() != "Not Identified")
  168. {
  169. //获取颗粒的fieldid,和particleid
  170. string str_fieldid = p1Data.Rows[i_row]["fieldid"].ToString();
  171. string str_particleid = p1Data.Rows[i_row]["particleid"].ToString();
  172. string str_typeid = p1Data.Rows[i_row]["TypeId"].ToString();
  173. string str_typename = p1Data.Rows[i_row]["TypeName"].ToString();
  174. string str_element = p1Data.Rows[i_row]["Element"].ToString();
  175. //获取原始颗粒图像
  176. //Bitmap bp_particle = new Bitmap(1, 1);
  177. string str_path = str_resultPath + "\\FIELD_FILES\\";
  178. string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
  179. if (str_fieldid == "-1")
  180. continue;
  181. if (serialNumber > m_mbszclass.M_KLLBXX.list_int_kllb_number)
  182. continue;
  183. DataTable table1=p1Data.Clone();
  184. table1.ImportRow(p1Data.Rows[i_row]);
  185. bool isSplice = false;
  186. for (int b = 0; b < spliceAll.Rows.Count; b++)
  187. {
  188. if (spliceAll.Rows[b]["SubParticles"].ToString() == p1Data.Rows[i_row]["SubParticles"].ToString())
  189. {
  190. isSplice = true;
  191. }
  192. }
  193. //原图
  194. Bitmap bp_particle;
  195. //二次放大图
  196. Bitmap BP;
  197. //获取该颗粒的xray能谱图像
  198. Bitmap ls_xraybpnew;
  199. if (!isSplice)
  200. {
  201. //原图
  202. bp_particle = imgAcc.GetBitmapByParticleForUncombinedParticle(table1);
  203. bp_particle = imageProcessor.ResizeImageWithPadding(bp_particle, 120, 120, System.Drawing.Color.White);
  204. bp_particle.Tag = new List<string>() { p1Data.Rows[i_row]["FieldId"].ToString(), p1Data.Rows[i_row]["ParticleId"].ToString(), p1Data.Rows[i_row]["TypeId"].ToString() };
  205. MemoryStream newms_p1 = new MemoryStream();
  206. bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
  207. //获取该颗粒的xray能谱图像
  208. DataTable DT_XR = ExportXRay(str_fieldid, str_particleid, fielddata);
  209. //ElementIcons.Add(DT_XR);
  210. System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
  211. str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
  212. ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理 //能谱图
  213. MemoryStream newms_p3 = new MemoryStream();
  214. ls_xraybpnew.Save(newms_p3, System.Drawing.Imaging.ImageFormat.Bmp);
  215. DataTable SegmentData = fielddata.GetSegment();
  216. Bitmap BinaryParticles = ImageSplicer.ParticleBinaryDiagram(SegmentData, Convert.ToInt32(str_fieldid), Convert.ToInt32(str_particleid));
  217. BP = imageProcessor.ResizeImageWithPadding(BinaryParticles, 120, 120, System.Drawing.Color.White);
  218. //二次放大图
  219. MemoryStream newms_p2 = new MemoryStream();
  220. BP.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
  221. newms_p1.Dispose();
  222. newms_p2.Dispose();
  223. newms_p3.Dispose();
  224. }
  225. else
  226. {
  227. List<string> strFieldId = new List<string>();
  228. List<string> strXrayId = new List<string>();
  229. string detailedLocation = p1Data.Rows[i_row]["SubParticles"].ToString();
  230. string[] fruits = detailedLocation.Split(',');
  231. for (int p2 = 0; p2 < fruits.Length; p2++)
  232. {
  233. string[] fruit = fruits[p2].Split(':');
  234. strFieldId.Add(fruit[0]);
  235. strXrayId.Add(fruit[1]);
  236. }
  237. DataTable SpliceData = p1Data.Clone();
  238. for (int splice = 0; splice < SpliceMeasurements.Rows.Count; splice++)
  239. {
  240. for (int splice2 = 0; splice2 < strFieldId.Count; splice2++)
  241. {
  242. if (SpliceMeasurements.Rows[splice]["FieldId"].ToString() == strFieldId[splice2] && SpliceMeasurements.Rows[splice]["XrayId"].ToString() == strXrayId[splice2])
  243. {
  244. SpliceData.Rows.Add(SpliceMeasurements.Rows[splice].ItemArray);
  245. }
  246. }
  247. }
  248. double pix = particlesGridDevide.result.GetPixelSize();
  249. int bitHeight = particlesGridDevide.result.GetImageHeight();
  250. int bitWidth = particlesGridDevide.result.GetImageWidth();
  251. //原图
  252. Bitmap original = particlesGridDevide.fldImgAccess.GetBitmapForParticleAll
  253. (p1Data.Rows[i_row]["SubParticles"].ToString(), SpliceData, pix, bitHeight, bitWidth);
  254. bp_particle= OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(original, 120, 120);
  255. //黑白图
  256. Dictionary<string, List<Segment>> segsData = new Dictionary<string, List<Segment>>();
  257. foreach (DataRow dow in SpliceData.Rows)
  258. {
  259. int fldid = Convert.ToInt32(dow["fieldid"]);
  260. int partid = Convert.ToInt32(dow["particleId"]);
  261. var listseg = particlesGridDevide.Particledata.GetSegmentData(fldid, partid);
  262. string key = dow["fieldid"].ToString() + "_" + dow["particleid"].ToString();
  263. segsData.Add(key, listseg);
  264. }
  265. Bitmap black = particlesGridDevide.fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite
  266. (p1Data.Rows[i_row]["SubParticles"].ToString(), SpliceData, segsData, pix, bitHeight, bitWidth);
  267. BP = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(black, 120, 120);
  268. //谱图
  269. Bitmap xraybpnew = splice_ExportXRayBitmap
  270. (p1Data.Rows[i_row]["SubParticles"].ToString(), Convert.ToInt32(p1Data.Rows[i_row]["particleId"]),
  271. Convert.ToInt32(p1Data.Rows[i_row]["fieldid"]), particlesGridDevide.Particledata, p1Data.Rows[i_row]["TypeName"].ToString());
  272. ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(xraybpnew, 700, 115);//能谱图处理
  273. }
  274. //---------------------------------------------------------------------------------------
  275. DataRow dr = DT_Largest20.NewRow();
  276. dr["p1"] = bp_particle;
  277. dr["p2"] = BP;
  278. dr["p3"] = ls_xraybpnew;
  279. dr["pid"] = serialNumber++.ToString();
  280. //颗粒列表列中第一个可选参数
  281. dr["Size"] = datatable_data(p1Data, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1);
  282. //这个参数没有用
  283. dr["Width"] = p1Data.Rows[i_row]["rectwidth"].ToString();
  284. //颗粒列表列中第二个可选参数
  285. dr["DMAX"] = datatable_data(p1Data, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p2);
  286. //颗粒列表列中第三个可选参数
  287. dr["DMIN"] = datatable_data(p1Data, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p3);
  288. //颗粒列表列中显示分类不可以选择
  289. dr["Class"] = p1Data.Rows[i_row]["typename"].ToString();
  290. dr["GroupName"] = p1Data.Rows[i_row]["GroupName"].ToString();
  291. GetMaxElementFromDataTable(p1Data, i_row, out List<string> list_max_elementname, out List<double> list_max_elementvale);
  292. double colVal = 0;
  293. for (int a = 0; a < list_max_elementvale.Count; a++)
  294. {
  295. colVal = colVal + Convert.ToDouble(list_max_elementvale[a]);
  296. }
  297. //元素1
  298. dr["ColName1"] = list_max_elementname[0];
  299. dr["ColVal1"] = ParameterNormalization(colVal, list_max_elementvale[0]);
  300. //元素2
  301. dr["ColName2"] = list_max_elementname[1];
  302. dr["ColVal2"] = ParameterNormalization(colVal, list_max_elementvale[1]);
  303. //元素3
  304. dr["ColName3"] = list_max_elementname[2];
  305. dr["ColVal3"] = ParameterNormalization(colVal, list_max_elementvale[2]);
  306. //元素4
  307. dr["ColName4"] = list_max_elementname[3];
  308. dr["ColVal4"] = ParameterNormalization(colVal, list_max_elementvale[3]);
  309. //元素5
  310. dr["ColName5"] = list_max_elementname[4];
  311. dr["ColVal5"] = ParameterNormalization(colVal, list_max_elementvale[4]);
  312. //元素6
  313. dr["ColName6"] = list_max_elementname[5];
  314. dr["ColVal6"] = ParameterNormalization(colVal, list_max_elementvale[5]);
  315. //元素7
  316. dr["ColName7"] = list_max_elementname[6];
  317. dr["ColVal7"] = ParameterNormalization(colVal, list_max_elementvale[6]);
  318. //元素8
  319. dr["ColName8"] = list_max_elementname[7];
  320. dr["ColVal8"] = ParameterNormalization(colVal, list_max_elementvale[7]);
  321. //元素6
  322. dr["ColName9"] = list_max_elementname[8];
  323. dr["ColVal9"] = ParameterNormalization(colVal, list_max_elementvale[8]);
  324. //元素6
  325. dr["ColName9"] = list_max_elementname[9];
  326. dr["ColVal9"] = ParameterNormalization(colVal, list_max_elementvale[9]);
  327. DT_Largest20.Rows.Add(dr);
  328. FilteredData.Rows.Add(p1Data.Rows[i_row].ItemArray);
  329. }
  330. }
  331. }
  332. #endregion
  333. OutDt.Add(DT_Largest20);
  334. a_FilteredData.Add(FilteredData);
  335. }
  336. return OutDt;
  337. }
  338. /// <summary>
  339. /// 拼接颗粒
  340. /// </summary>
  341. public DataTable GetSplicingParticlesData(OTSReport_Export m_otsreport_export)
  342. {
  343. DataTable SplicingParticlesData = new DataTable();
  344. SplicingParticlesData.Columns.Add("image",typeof(Bitmap));
  345. SplicingParticlesData.Columns.Add("TypeName");
  346. SplicingParticlesData.Columns.Add("Area");
  347. SplicingParticlesData.Columns.Add("ECD");
  348. SplicingParticlesData.Columns.Add("DiameterRatio");
  349. SplicingParticlesData.Columns.Add("DPERP");
  350. //根据sql条件,查询获取颗粒信息数据
  351. ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
  352. DataTable particles = fielddata.GetSplicingParticlesData();
  353. if (particles.Rows.Count == 0)
  354. {
  355. return SplicingParticlesData;
  356. }
  357. ResultFile result;
  358. string sou = m_otsreport_export.m_ReportApp.m_conditionChoose.m_CurrentConditions[OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
  359. if (sou.Contains("+"))
  360. {
  361. MessageBox.Show("This function does not support multiple samples!");
  362. result = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[0];
  363. }
  364. else
  365. {
  366. result = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)];
  367. }
  368. ParticleData Particledata = new ParticleData(result.FilePath);
  369. string filePath = result.FilePath + "\\FIELD_FILES\\";
  370. for (int i = 0; i < particles.Rows.Count; i++)
  371. {
  372. DataTable table1 = particles.Clone();
  373. table1.ImportRow(particles.Rows[i]);
  374. Bitmap bmap = imgAcc.GetBitmapByParticleForUncombinedParticle(table1);
  375. 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() };
  376. DataRow row = SplicingParticlesData.NewRow();
  377. row["image"] = bmap;
  378. row["TypeName"] = particles.Rows[i]["TypeName"];
  379. row["Area"] = particles.Rows[i]["Area"];
  380. row["ECD"] = (Convert.ToDouble(particles.Rows[i]["Area"]) / Math.PI) * 2;
  381. row["DiameterRatio"] = Convert.ToDouble(particles.Rows[i]["DMAX"]) / Convert.ToDouble(particles.Rows[i]["DMIN"]);
  382. row["DPERP"] = particles.Rows[i]["DPERP"];
  383. SplicingParticlesData.Rows.Add(row);
  384. }
  385. return SplicingParticlesData;
  386. }
  387. /// <summary>
  388. /// 颗粒列表帧图
  389. /// </summary>
  390. /// <param name="m_mbszclass"></param>
  391. /// <param name="file_pic"></param>
  392. /// <param name="list_dt"></param>
  393. /// <param name="m_otsreport_export"></param>
  394. public void Get_dev_kllb_data_frame_pic(c_TemplateClass m_mbszclass, out DataTable file_pic, out List<DataTable> list_dt, OTSReport_Export m_otsreport_export, List<DataTable> a_FrameData)
  395. {
  396. //去除拼接后的颗粒
  397. List<DataTable> FrameData = new List<DataTable>();
  398. for (int i = 0; i < a_FrameData.Count; i++)
  399. {
  400. DataTable DT = a_FrameData[i].Clone();
  401. for (int a = 0; a < a_FrameData[i].Rows.Count; a++)
  402. {
  403. if (a_FrameData[i].Rows[a]["SubParticles"].ToString() == "")
  404. {
  405. DT.Rows.Add(a_FrameData[i].Rows[a].ItemArray);
  406. }
  407. }
  408. FrameData.Add(DT);
  409. }
  410. m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
  411. //根据sql条件,查询获取颗粒信息数据
  412. ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
  413. string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath;
  414. file_pic =new DataTable();
  415. file_pic.Clear();
  416. file_pic.Columns.Add("fieldid");
  417. file_pic.Columns.Add("id");
  418. file_pic.Columns.Add("fieldName");
  419. file_pic.Columns.Add("cunt", typeof(int));
  420. file_pic.Columns.Add("fieldFullName");
  421. file_pic.Columns.Add("Field_pic", typeof(Bitmap));
  422. list_dt = new List<DataTable>();
  423. for (int i = 0; i < FrameData.Count; i++)
  424. {
  425. DataTable pic = new DataTable();
  426. List<DataTable> picDt = new List<DataTable>();
  427. m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage.Out_MarkParticleRectangleOnFieldFile(str_resultPath, FrameData[i], out List<string> vs, out DataTable data);
  428. DataTable data_A = FrameGraphParticleTableDatat(FrameData[i], fielddata, data, m_mbszclass, m_otsreport_export);
  429. for (int a = 0; a < data.Rows.Count; a++)
  430. {
  431. DataTable dataTable = data_A.Clone();
  432. //在数据表中有颗粒在该帧图中的话,则对该帧图标记图像进行读取存入数据库
  433. DataRow[] datarowlist = data_A.Select(data.Rows[a]["fieldid"].ToString());
  434. if (datarowlist.Count() > 0)
  435. {
  436. for (int b = 0; b < data_A.Rows.Count; b++)
  437. {
  438. if (data.Rows[a]["id"].ToString() == data_A.Rows[b]["FieldId"].ToString())
  439. {
  440. dataTable.Rows.Add(data_A.Rows[b].ItemArray);
  441. dataTable.TableName = data_A.Rows[b]["FieldId"].ToString();
  442. }
  443. }
  444. //bool bl = false;
  445. // for (int j = 0; j < list_dt.Count; i++)
  446. // {
  447. // if (list_dt[j].TableName == dataTable.TableName)
  448. // {
  449. // bl = true;
  450. // }
  451. // }
  452. // if (!bl)
  453. // {
  454. list_dt.Add(dataTable);
  455. file_pic.Rows.Add(data.Rows[a].ItemArray);
  456. //}
  457. }
  458. }
  459. }
  460. }
  461. private bool GetSTL(string str, out DataTable data,OTSReport_Export m_otsreport_export)
  462. {
  463. if (str.ToLower() == "nostddb")
  464. {
  465. data = null;
  466. return false;
  467. }
  468. DataTable dt = new DataTable();
  469. dt.Columns.Add("TypeId");
  470. dt.Columns.Add("Hardness", typeof(double));
  471. dt.Columns.Add("Hardness_detailed");
  472. OTSCommon.DBOperate.SqLiteHelper sh = null;
  473. string fullPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.CurResultFile.FilePath + "\\" + str + ".db";
  474. string fullPath2 = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + str + ".db";
  475. if (System.IO.File.Exists(fullPath))
  476. {
  477. sh = new OTSCommon.DBOperate.SqLiteHelper("data source='" + fullPath + "'");
  478. }
  479. else if (System.IO.File.Exists(fullPath2))
  480. {
  481. sh = new OTSCommon.DBOperate.SqLiteHelper("data source='" + fullPath2 + "'");
  482. }
  483. else
  484. {
  485. sh = null;
  486. data = null;
  487. return false;
  488. }
  489. DataTable dt_stl = sh.ExecuteQuery("select * from ClassifySTD");
  490. for (int i = 0; i < dt_stl.Rows.Count; i++)
  491. {
  492. DataRow dr = dt.NewRow();
  493. dr["TypeId"] = dt_stl.Rows[i]["StrName"].ToString();
  494. dr["Hardness_detailed"] = dt_stl.Rows[i]["Hardness"].ToString();
  495. if (System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", "").ToString() != "")
  496. {
  497. try
  498. {
  499. if (System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", "") == "o. Def.")
  500. {
  501. dr["Hardness"] = 0;
  502. }
  503. else
  504. {
  505. dr["Hardness"] = Convert.ToDouble(System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", ""));
  506. }
  507. }
  508. catch
  509. {
  510. dr["Hardness"] = 0;
  511. }
  512. }
  513. else
  514. {
  515. dr["Hardness"] = 0;
  516. }
  517. dt.Rows.Add(dr);
  518. }
  519. data = dt;
  520. return true;
  521. }
  522. private DataTable ExportXRay(string in_fieldid, string in_particleid, ParticleData particleData)
  523. {
  524. DataTable data = new DataTable();
  525. data.Columns.Add("XName", typeof(string));
  526. data.Columns.Add("Serial", typeof(double));
  527. data.Columns.Add("data", typeof(double));
  528. uint[] Analysis_xray = new uint[2000];
  529. //获取Xray数据
  530. Particle list = particleData.GetParticleByFidAndPid(in_fieldid, in_particleid);
  531. if (list == null)
  532. {
  533. return null;
  534. }
  535. Particle particle = list;
  536. if (particle.XrayId > -1)
  537. {
  538. for (int i = 0; i < 999; i++)
  539. {
  540. DataRow dr = data.NewRow();
  541. dr["XName"] = i + 1;
  542. dr["Serial"] = i + 1;
  543. dr["data"] = BitConverter.ToUInt32(particle.XRayData, i * 4);
  544. Analysis_xray[i] = BitConverter.ToUInt32(particle.XRayData, i * 4);
  545. data.Rows.Add(dr);
  546. }
  547. }
  548. return data;
  549. }
  550. /// <summary>
  551. /// 输入颗粒的所在帧图id,颗粒id,颗粒类型id,获取对应的XRay能谱数据图
  552. /// </summary>
  553. /// <returns></returns>
  554. private Bitmap ExportXRayBitmap(string in_fieldid, string in_particleid, int in_stdtypeid, string TypeName, ParticleData particleData)
  555. {
  556. Bitmap ret_bp;
  557. //显示xray相关信息
  558. uint[] Analysis_xray = new uint[2000];
  559. int i_xray_id = 0;
  560. List<Element> list_celementchemistryclr = new List<Element>();
  561. //获取Xray数据
  562. Particle list = particleData.GetParticleByFidAndPid(in_fieldid, in_particleid);
  563. if (list == null)
  564. {
  565. return null;
  566. }
  567. Particle particle = list;
  568. if (particle.XrayId > -1)
  569. {
  570. for (int i = 0; i < 2000; i++)
  571. {
  572. if (particle.XRayData != null)
  573. {
  574. Analysis_xray[i] = BitConverter.ToUInt32(particle.XRayData, i * 4);
  575. }
  576. }
  577. i_xray_id = particle.XrayId;
  578. list_celementchemistryclr = particle.ElementList;
  579. }
  580. //get CElementChemistryClr list
  581. List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
  582. for (int i = 0; i < list_celementchemistryclr.Count; i++)
  583. {
  584. ShowElementInfo ls_sei = new ShowElementInfo();
  585. ls_sei.ElementName = list_celementchemistryclr[i].Name;
  586. ls_sei.Percentage = list_celementchemistryclr[i].Percentage;
  587. ls_sei.dKF = Convert.ToDouble(CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).K_Peak);
  588. list_showelementinfo.Add(ls_sei);
  589. }
  590. //获取使用标准库的名称
  591. string str_stdname = "";
  592. string str_IncALibName = "";
  593. if (in_stdtypeid < 1000)
  594. {
  595. //小于1000,使用系统默认分类
  596. str_IncALibName = TypeName;
  597. str_stdname = "Default standard library";
  598. }
  599. else if (in_stdtypeid >= 1000 && in_stdtypeid < 10000)
  600. {
  601. //大于等于1000,并且小于10000时,使用系统数据库中夹杂物来分析
  602. str_IncALibName = TypeName;
  603. str_stdname = "User defined standard library";
  604. }
  605. else if (in_stdtypeid > 10000)
  606. {
  607. //大于10000时,使用用户标准库来分析夹杂物名称
  608. str_IncALibName = TypeName;
  609. str_stdname = "System standard library";
  610. }
  611. //获取数据后,需要对xraytable设置
  612. OTSIncAReportGraph.Controls.Control_XRayTable control_XRayTable1 = new Control_XRayTable();
  613. control_XRayTable1.SetXRayShowLineValue(Analysis_xray, list_showelementinfo);
  614. //颗粒国标信息
  615. //control_XRayTable1.GBInfoStr = in_dparticle.GBContent;
  616. control_XRayTable1.MaterialName = str_IncALibName;//杂夹物
  617. control_XRayTable1.STDName = str_stdname;//标准库
  618. control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
  619. control_XRayTable1.Visible = true;
  620. control_XRayTable1.Invalidate();
  621. control_XRayTable1.Refresh();
  622. ret_bp = control_XRayTable1.ExportXRayImage();
  623. return ret_bp;
  624. }
  625. /// <summary>
  626. /// 输入颗粒的所在帧图id,颗粒id,颗粒类型id,获取对应的XRay能谱数据图
  627. /// </summary>
  628. /// <returns></returns>
  629. private Bitmap splice_ExportXRayBitmap(string subParticleString,int a_particleId,int a_fieldid, ParticleData particleData,string a_TyoeName)
  630. {
  631. Bitmap ret_bp;
  632. //显示xray相关信息
  633. uint[] Analysis_xray = new uint[2000];
  634. List<Element> list_celementchemistryclr = new List<Element>();
  635. //获取Xray数据
  636. Particle list = particleData.GetXrayByParticleIDAndFieldID(subParticleString, a_particleId, a_fieldid, out Analysis_xray);
  637. List<ShowElementInfo> list_showelementinfo = particleData.GetShowElementInfos(list.ElementList);
  638. //获取数据后,需要对xraytable设置
  639. OTSIncAReportGraph.Controls.Control_XRayTable control_XRayTable1 = new Control_XRayTable();
  640. control_XRayTable1.SetXRayShowLineValue(Analysis_xray, list_showelementinfo);
  641. control_XRayTable1.MaterialName = a_TyoeName;
  642. control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
  643. control_XRayTable1.Visible = true;
  644. control_XRayTable1.Invalidate();
  645. control_XRayTable1.Refresh();
  646. ret_bp = control_XRayTable1.ExportXRayImage();
  647. return ret_bp;
  648. }
  649. private string datatable_data(DataTable dt, int it, string str)
  650. {
  651. if (str == "Hardness")
  652. {
  653. return dt.Rows[it]["Hardness_detailed"].ToString();
  654. }
  655. else
  656. if (str == "Area")
  657. {
  658. return Convert.ToDouble(dt.Rows[it][str]).ToString("#0.00");
  659. }
  660. else
  661. if (str == "DMAX")
  662. {
  663. return Math.Round(Convert.ToDouble(dt.Rows[it][str]), 2).ToString();
  664. }
  665. else
  666. if (str == "ECD")
  667. {
  668. return Math.Round(Convert.ToDouble(dt.Rows[it][str]), 2).ToString();
  669. }
  670. else
  671. {
  672. return dt.Rows[it][str].ToString();
  673. }
  674. }
  675. /// <summary>
  676. /// 传入DataTable,和行号,返回该Row行中,返回6个靠前的元素,不足6个返回空
  677. /// </summary>
  678. /// <param name="in_dt"></param>
  679. /// <param name="row_index"></param>
  680. /// <returns></returns>
  681. private void GetMaxElementFromDataTable(DataTable in_dt, int row_index, out List<string> out_list_elementname, out List<double> out_list_elementvalue)
  682. {
  683. out_list_elementname = new List<string>();
  684. out_list_elementvalue = new List<double>();
  685. //分别排出元素名,元素值列表
  686. List<string> list_elementname = new List<string>();
  687. List<double> list_elementvalue = new List<double>();
  688. string str_element = in_dt.Rows[row_index]["Element"].ToString();
  689. //防止取出的元素信息为空
  690. if (str_element != "")
  691. {
  692. string[] strcbo = str_element.Split(';');
  693. for (int i = 0; i < strcbo.Length - 1; i++)
  694. {
  695. string[] str = strcbo[i].Split('-');
  696. list_elementname.Add(str[0]);
  697. list_elementvalue.Add(Math.Round(Convert.ToDouble(str[1]), 2));
  698. }
  699. }
  700. //循环6次,得到最大的6个元素信息
  701. for (int geti = 0; geti < 11; geti++)
  702. {
  703. double max_elementvalue = -1;
  704. string max_elementname = " ";
  705. int max_index = -1;
  706. if (list_elementvalue.Count > 0)
  707. {
  708. for (int i = 0; i < list_elementvalue.Count; i++)
  709. {
  710. if (list_elementvalue[i] > max_elementvalue)
  711. {
  712. max_elementvalue = list_elementvalue[i];
  713. max_elementname = list_elementname[i];
  714. max_index = i;
  715. }
  716. }
  717. //移除掉最大的元素
  718. list_elementname.RemoveAt(max_index);
  719. list_elementvalue.RemoveAt(max_index);
  720. //将最大的元素添加到list中
  721. if (max_elementvalue > 0)
  722. {
  723. out_list_elementname.Add(max_elementname);
  724. out_list_elementvalue.Add(max_elementvalue);
  725. }
  726. else
  727. {
  728. out_list_elementname.Add(" ");
  729. out_list_elementvalue.Add(0);
  730. }
  731. }
  732. else
  733. {
  734. //如果元素数量已经不够,则添加空
  735. out_list_elementname.Add(" ");
  736. out_list_elementvalue.Add(0);
  737. }
  738. }
  739. }
  740. /// <summary>
  741. /// 参数归一化
  742. /// </summary>
  743. /// <param name="a_mi">总数</param>
  744. /// <param name="m">传参</param>
  745. /// <returns></returns>
  746. private string ParameterNormalization(double a_mi, double m)
  747. {
  748. double ColVal = Convert.ToDouble(m / a_mi * 100);
  749. if (ColVal == 0)
  750. {
  751. return "";
  752. }
  753. else
  754. {
  755. if (m == 0)
  756. return "0";
  757. else
  758. return Math.Round(ColVal, 2).ToString();
  759. }
  760. }
  761. private DataTable FrameGraphParticleTableDatat(DataTable dt_ParticlesGridDevidePage, ParticleData fielddata, DataTable DT_field_dt, c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export)
  762. {
  763. DataTable dt;
  764. string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath;
  765. imgAcc = new FieldImage(str_resultPath);
  766. if (m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype != OTS_SysType_ID.IncA)
  767. {
  768. if (dt_ParticlesGridDevidePage.Columns.Contains("Hardness"))
  769. dt_ParticlesGridDevidePage.Columns.Remove("Hardness");
  770. if (dt_ParticlesGridDevidePage.Columns.Contains("Hardness_detailed"))
  771. dt_ParticlesGridDevidePage.Columns.Remove("Hardness_detailed");
  772. //将颗粒大小排序(从大到小)
  773. DataView dvs = dt_ParticlesGridDevidePage.DefaultView;
  774. dvs.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() + " DESC";
  775. dt = dvs.ToTable();
  776. dt.Columns.Add("Hardness");
  777. dt.Columns.Add("Hardness_detailed");
  778. }
  779. else
  780. {
  781. //将颗粒大小排序(从大到小)
  782. DataView dvs = dt_ParticlesGridDevidePage.DefaultView;
  783. dvs.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() + " DESC";
  784. dt = dvs.ToTable();
  785. }
  786. //表名Largest_frame表:(子表) 显示20条颗粒除外的部份颗粒信息
  787. DataTable FrameGraphSubTable = new DataTable();
  788. FrameGraphSubTable.TableName = "FrameGraphSubTable";
  789. FrameGraphSubTable.Columns.Add("pid");
  790. FrameGraphSubTable.Columns.Add("Size");
  791. FrameGraphSubTable.Columns.Add("Width");
  792. FrameGraphSubTable.Columns.Add("DMAX");
  793. FrameGraphSubTable.Columns.Add("DMIN");
  794. FrameGraphSubTable.Columns.Add("Class");
  795. FrameGraphSubTable.Columns.Add("ColName1");
  796. FrameGraphSubTable.Columns.Add("ColName2");
  797. FrameGraphSubTable.Columns.Add("ColName3");
  798. FrameGraphSubTable.Columns.Add("ColName4");
  799. FrameGraphSubTable.Columns.Add("ColName5");
  800. FrameGraphSubTable.Columns.Add("ColName6");
  801. FrameGraphSubTable.Columns.Add("ColName7");
  802. FrameGraphSubTable.Columns.Add("ColName8");
  803. FrameGraphSubTable.Columns.Add("ColName9");
  804. FrameGraphSubTable.Columns.Add("ColName10");
  805. FrameGraphSubTable.Columns.Add("ColVal1");
  806. FrameGraphSubTable.Columns.Add("ColVal2");
  807. FrameGraphSubTable.Columns.Add("ColVal3");
  808. FrameGraphSubTable.Columns.Add("ColVal4");
  809. FrameGraphSubTable.Columns.Add("ColVal5");
  810. FrameGraphSubTable.Columns.Add("ColVal6");
  811. FrameGraphSubTable.Columns.Add("ColVal7");
  812. FrameGraphSubTable.Columns.Add("ColVal8");
  813. FrameGraphSubTable.Columns.Add("ColVal9");
  814. FrameGraphSubTable.Columns.Add("ColVal10");
  815. FrameGraphSubTable.Columns.Add("pic", typeof(Bitmap));
  816. FrameGraphSubTable.Columns.Add("FieldId", typeof(int));
  817. FrameGraphSubTable.Columns.Add("GroupName");
  818. for (int i_row = 0; i_row < dt.Rows.Count; i_row++)
  819. {
  820. if (dt.Rows[i_row]["element"].ToString() == "")
  821. continue;
  822. if (dt.Rows[i_row]["TypeName"].ToString() == "Not Identified")
  823. continue;
  824. string str_fieldid = dt.Rows[i_row]["fieldid"].ToString();
  825. if (JudgeWhetherItExists(Convert.ToInt32(str_fieldid), DT_field_dt, "id"))
  826. {
  827. //获取原始颗粒图像
  828. Bitmap bp_particle = new Bitmap(1, 1);
  829. DataTable table1 = dt.Clone();
  830. table1.ImportRow(dt.Rows[i_row]);
  831. bp_particle = imgAcc.GetBitmapByParticleForUncombinedParticle(table1);
  832. bp_particle.Tag = new List<string>() { dt.Rows[i_row]["FieldId"].ToString(), dt.Rows[i_row]["ParticleId"].ToString(), dt.Rows[i_row]["TypeId"].ToString() };
  833. DataRow dr = FrameGraphSubTable.NewRow();
  834. dr["pic"] = bp_particle;
  835. //帧图列表列第一个字段的可选参数
  836. dr["pid"] = datatable_data(dt, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1);
  837. //帧图列表列第二个字段的可选参数
  838. dr["Size"] = datatable_data(dt, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p2);
  839. dr["Width"] = dt.Rows[i_row]["rectwidth"].ToString();
  840. dr["DMAX"] = Math.Round(Convert.ToDouble(dt.Rows[i_row]["dmax"]), 2).ToString();
  841. dr["DMIN"] = Math.Round(Convert.ToDouble(dt.Rows[i_row]["dmin"]), 2).ToString();
  842. dr["Class"] = dt.Rows[i_row]["typename"].ToString();
  843. dr["GroupName"] = dt.Rows[i_row]["GroupName"].ToString();
  844. dr["fieldid"] = str_fieldid;
  845. GetMaxElementFromDataTable(dt, i_row, out List<string> list_max_elementname, out List<double> list_max_elementvale);
  846. double colVal = 0;
  847. for (int i = 0; i < list_max_elementvale.Count; i++)
  848. {
  849. colVal = colVal + Convert.ToDouble(list_max_elementvale[i]);
  850. }
  851. //元素1
  852. dr["ColName1"] = list_max_elementname[0];
  853. dr["ColVal1"] = ParameterNormalization(colVal, list_max_elementvale[0]);
  854. //元素2
  855. dr["ColName2"] = list_max_elementname[1];
  856. dr["ColVal2"] = ParameterNormalization(colVal, list_max_elementvale[1]);
  857. //元素3
  858. dr["ColName3"] = list_max_elementname[2];
  859. dr["ColVal3"] = ParameterNormalization(colVal, list_max_elementvale[2]);
  860. //元素4
  861. dr["ColName4"] = list_max_elementname[3];
  862. dr["ColVal4"] = ParameterNormalization(colVal, list_max_elementvale[3]);
  863. //元素5
  864. dr["ColName5"] = list_max_elementname[4];
  865. dr["ColVal5"] = ParameterNormalization(colVal, list_max_elementvale[4]);
  866. //元素6
  867. dr["ColName6"] = list_max_elementname[5];
  868. dr["ColVal6"] = ParameterNormalization(colVal, list_max_elementvale[5]);
  869. //元素6
  870. dr["ColName7"] = list_max_elementname[6];
  871. dr["ColVal7"] = ParameterNormalization(colVal, list_max_elementvale[6]);
  872. //元素6
  873. dr["ColName8"] = list_max_elementname[7];
  874. dr["ColVal8"] = ParameterNormalization(colVal, list_max_elementvale[7]);
  875. //元素6
  876. dr["ColName9"] = list_max_elementname[8];
  877. dr["ColVal9"] = ParameterNormalization(colVal, list_max_elementvale[8]);
  878. //元素6
  879. dr["ColName10"] = list_max_elementname[9];
  880. dr["ColVal10"] = ParameterNormalization(colVal, list_max_elementvale[9]);
  881. FrameGraphSubTable.Rows.Add(dr);
  882. }
  883. }
  884. return FrameGraphSubTable;
  885. }
  886. private bool JudgeWhetherItExists(int id, DataTable dt, string column)
  887. {
  888. for (int i = 0; i < dt.Rows.Count; i++)
  889. {
  890. if (id == Convert.ToInt32(dt.Rows[i][column].ToString()))
  891. return true;
  892. }
  893. return false;
  894. }
  895. }
  896. }