|
@@ -30,6 +30,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
DataTable userLibraryData;
|
|
|
DataTable m_bt_DBData = new DataTable();
|
|
|
List<string> TemplateList;
|
|
|
+ frmReportConditionChoose m_condition;
|
|
|
+
|
|
|
+ public int condition = -1;
|
|
|
#endregion
|
|
|
|
|
|
#region 构造函数
|
|
@@ -37,7 +40,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
{
|
|
|
m_otsreport_export = in_export;
|
|
|
TemplateList = new List<string>();
|
|
|
-
|
|
|
+ m_condition = in_export.m_ReportApp.m_conditionChoose;
|
|
|
//加载三元相图各项
|
|
|
string pathtpf = in_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.TrigTemplateFileFolder + "\\" + in_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.TriTempFile;// Application.StartupPath + "\\Config\\ProData\\DefaultTriTemplateFile.tpf";
|
|
|
TemplateList = new List<string>();
|
|
@@ -200,7 +203,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
}
|
|
|
data = dt;
|
|
|
}
|
|
|
- public bool GetDBData(MBSZClass m_mbszclass)
|
|
|
+ public bool GetDBData(c_TemplateClass m_mbszclass)
|
|
|
{
|
|
|
//GetSTL();
|
|
|
|
|
@@ -925,7 +928,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
/// </summary>
|
|
|
/// <param name="m_mbszclass"></param>
|
|
|
/// <returns></returns>
|
|
|
- public DataTable Get_dev_kllb_data(MBSZClass m_mbszclass)
|
|
|
+ public DataTable Get_dev_kllb_data(c_TemplateClass m_mbszclass)
|
|
|
{
|
|
|
int serialNumber = 1;
|
|
|
//------------------加载模块,获取数据-------------------------------------------------
|
|
@@ -1140,7 +1143,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
return DT_Largest20;
|
|
|
}
|
|
|
|
|
|
- public void Get_dev_kllb_data_frame(MBSZClass m_mbszclass, out DataTable file_pic, out List<DataTable> list_dt)
|
|
|
+ public void Get_dev_kllb_data_frame(c_TemplateClass m_mbszclass, out DataTable file_pic, out List<DataTable> list_dt)
|
|
|
{
|
|
|
|
|
|
//------------------加载模块,获取数据-------------------------------------------------
|
|
@@ -1231,7 +1234,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
list_dt = listData;
|
|
|
}
|
|
|
|
|
|
- private void FrameGraphParticleTableDatat(DataTable dt_ParticlesGridDevidePage, ParticleData fielddata, DataTable DT_field_dt, MBSZClass m_mbszclass, out DataTable data_A)
|
|
|
+ private void FrameGraphParticleTableDatat(DataTable dt_ParticlesGridDevidePage, ParticleData fielddata, DataTable DT_field_dt, c_TemplateClass m_mbszclass, out DataTable data_A)
|
|
|
{
|
|
|
//将颗粒大小排序(从大到小)
|
|
|
DataView dv = dt_ParticlesGridDevidePage.DefaultView;
|
|
@@ -1355,7 +1358,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void ParticleSizeTable(MBSZClass m_mbszclass, out DataTable surface_dt, out DataTable partsize_dt, out DataTable class_dt, out DataTable subdivide_dt)
|
|
|
+ public void ParticleSizeTable(c_TemplateClass m_mbszclass, out DataTable surface_dt, out DataTable partsize_dt, out DataTable class_dt, out DataTable subdivide_dt)
|
|
|
{
|
|
|
//全部大类
|
|
|
DataTable dt_addCalss = new DataTable();
|
|
@@ -1535,7 +1538,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
}
|
|
|
|
|
|
- public bool InsertReportTemplateTable_ElementAvgGrid(MBSZClass m_mbszclass, out DataTable dt1, out DataTable dt2)
|
|
|
+ public bool InsertReportTemplateTable_ElementAvgGrid(c_TemplateClass m_mbszclass, out DataTable dt1, out DataTable dt2)
|
|
|
{
|
|
|
if (m_bt_DBData.Columns.Count == 0)
|
|
|
{
|
|
@@ -1676,7 +1679,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- public Bitmap GetByte_InsertReportChart_Trianglediagram(int selectindex, MBSZClass m_mbszclass)
|
|
|
+ #region 三元图
|
|
|
+ //截取Echar的三元图
|
|
|
+ public Bitmap GetByte_InsertReportChart_Trianglediagram(int selectindex, c_TemplateClass m_mbszclass)
|
|
|
{
|
|
|
//加载模块
|
|
|
EChart_Trianglediagram eChart_Trianglediagram = new EChart_Trianglediagram(m_otsreport_export.m_ReportApp, TemplateList[selectindex]);
|
|
@@ -1705,12 +1710,431 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
return btmap_pic;
|
|
|
}
|
|
|
+ //手动绘制的三元图
|
|
|
+ public Bitmap DrawATernaryPicture(int selectindex, c_TemplateClass m_mbszclass, List<Color> Color_list)
|
|
|
+ {
|
|
|
+ int sel = 0;
|
|
|
+ if (m_mbszclass.M_SY.int_xzkl == 0)
|
|
|
+ {
|
|
|
+ sel = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sel = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ ResultFile resultFile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
|
|
|
+
|
|
|
+ string template = TemplateList[selectindex];
|
|
|
+ if (template == "")
|
|
|
+ { //三元相图模板
|
|
|
+ template = m_condition.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.TRIO_CHART_TYPE).ToString();
|
|
|
+ }
|
|
|
+ //获取粒级表
|
|
|
+ string pathtpf = Application.StartupPath + "\\Config\\ProData\\DefaultTriTemplateFile.tpf";
|
|
|
+ List<string> nameList = new List<string>();
|
|
|
+ DataSet ds = XMLoperate.GetXmlData(pathtpf, "XMLData");
|
|
|
+ DataTable dt = ds.Tables["Member"];
|
|
|
+ string TemplateName = "";
|
|
|
+ //遍历第一层节点
|
|
|
+ foreach (DataRow element in dt.Rows)
|
|
|
+ {
|
|
|
+ TemplateName = element["TemplateName"].ToString();
|
|
|
+
|
|
|
+ if (TemplateName == template)
|
|
|
+ {
|
|
|
+ string Element = element["Element"].ToString();
|
|
|
+ nameList.Add(Element.Split('.')[0]);
|
|
|
+ nameList.Add(Element.Split('.')[1]);
|
|
|
+ nameList.Add(Element.Split('.')[2]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ DataTable dt_point_sort = new DataTable();
|
|
|
+ dt_point_sort.Columns.Add("X", typeof(double));
|
|
|
+ dt_point_sort.Columns.Add("Y", typeof(double));
|
|
|
+ dt_point_sort.Columns.Add("Color_position");
|
|
|
+ DataTable particles = GetParticles(resultFile.FilePath, nameList, sel);
|
|
|
+ foreach (DataRow item in particles.Rows)
|
|
|
+ {
|
|
|
+ if (item["particleLocation"].ToString() == "0,0,0")
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ double top = Convert.ToDouble(item["top"]);
|
|
|
+ double left = Convert.ToDouble(item["left"]);
|
|
|
+ double right = Convert.ToDouble(item["right"]);
|
|
|
+ //x=right+top/2,y=(√3/2)*top
|
|
|
+ double Y = 0.866 * top * 500;
|
|
|
+ double X = (right + top / 2) * 500;
|
|
|
+ double[] point_ = { Math.Round(X, 2), Math.Round(Y) };
|
|
|
+ DataRow dr = dt_point_sort.NewRow();
|
|
|
+ dr["X"] = Math.Round(X, 2);
|
|
|
+ dr["Y"] = Math.Round(Y);
|
|
|
+ dr["Color_position"] = item["Color_position"];
|
|
|
+ dt_point_sort.Rows.Add(dr);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 图形
|
|
|
+ int Line = 500;
|
|
|
+ Bitmap map = new Bitmap(530, 530);
|
|
|
+ Graphics g = Graphics.FromImage(map);
|
|
|
+
|
|
|
+ SolidBrush sbrush_White = new SolidBrush(Color.White);
|
|
|
+ g.FillRectangle(sbrush_White, 0, 0, 530, 530);
|
|
|
+
|
|
|
+ Pen mypen = new Pen(Color.Black, 2);
|
|
|
+ g.DrawImage(map, 0, 0, map.Width, map.Height);
|
|
|
+ g.DrawLine(mypen, new Point(Line + 10, Line), new Point(Line / 2 + 10, Convert.ToInt32(Line - (Line / 2 * 1.732))));//"\"
|
|
|
+ g.DrawLine(mypen, new Point(Line / 2 + 10, Convert.ToInt32(Line - (Line / 2 * 1.732))), new Point(0 + 10, Line));//"/"
|
|
|
+ g.DrawLine(mypen, new Point(0 + 10, Line), new Point(Line + 10, Line));//"_"
|
|
|
+
|
|
|
+
|
|
|
+ mypen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
|
|
|
+ mypen.DashPattern = new float[] { 2, 2 };
|
|
|
+ mypen = new Pen(Color.FromArgb(212, 212, 212), 1);
|
|
|
+
|
|
|
+
|
|
|
+ int point = Line / 10;
|
|
|
+ for (int i = 1; i < 10; i++)
|
|
|
+ {
|
|
|
+ //"\"
|
|
|
+ int x1_a = point / 2 + ((point / 2) * (i - 1));
|
|
|
+ int x2_a = Line - (43 * i);
|
|
|
+ int y1_a = point * i;
|
|
|
+ g.DrawLine(mypen, new Point(x1_a + 10, x2_a), new Point(y1_a + 10, Line));
|
|
|
+
|
|
|
+ //"/"
|
|
|
+ int x1_b = Line - (point / 2 + ((point / 2) * (i - 1)));
|
|
|
+ int x2_b = Line - (43 * i);
|
|
|
+ int y1_b = Line - (point * i);
|
|
|
+ g.DrawLine(mypen, new Point(x1_b + 10, x2_b), new Point(y1_b + 10, Line));
|
|
|
+
|
|
|
+ //"_"
|
|
|
+ int x1_c = point / 2 + ((point / 2) * (i - 1));
|
|
|
+ int x2_c = Line - (43 * i);
|
|
|
+
|
|
|
+ int y1_c = Line - (point / 2 + ((point / 2) * (i - 1)));
|
|
|
+ int y2_c = Line - (43 * i);
|
|
|
+
|
|
|
+ g.DrawLine(mypen, new Point(x1_c + 10, x2_c), new Point(y1_c + 10, y2_c));
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < dt_point_sort.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ mypen = new Pen(Color.Black, 1);
|
|
|
+ SolidBrush mysbrush = new SolidBrush(Color_list[Convert.ToInt32(dt_point_sort.Rows[i]["Color_position"])]);
|
|
|
+
|
|
|
+ g.FillRectangle(mysbrush, Convert.ToInt32(dt_point_sort.Rows[i]["X"]) + 8, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]) - 2, 4, 5);
|
|
|
+ g.DrawRectangle(mypen, Convert.ToInt32(dt_point_sort.Rows[i]["X"]) + 7, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]) - 2, 5, 5);
|
|
|
+ }
|
|
|
+ Font myFont = new Font("宋体", 13, FontStyle.Bold);
|
|
|
+
|
|
|
+ Font Font_features = new Font("宋体", 10, FontStyle.Bold);
|
|
|
+ SolidBrush sbrush = new SolidBrush(Color.Black);
|
|
|
+ g.DrawString("features:" + dt_point_sort.Rows.Count.ToString(), Font_features, sbrush, 350, 200);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ g.DrawString(TemplateName, myFont, sbrush, 265 - (TemplateName.Length * 10 / 2), 10);
|
|
|
+
|
|
|
+ g.DrawString(TemplateName.Split('.')[0].ToString(), myFont, sbrush, 265 - (TemplateName.Split('.')[0].ToString().Length * 10 / 2), 45);//顶点名字
|
|
|
+ g.DrawString(TemplateName.Split('.')[1].ToString(), myFont, sbrush, 0, 510);//左侧名字
|
|
|
+ g.DrawString(TemplateName.Split('.')[2].ToString(), myFont, sbrush, 500 - (TemplateName.Split('.')[0].ToString().Length * 10), 510);//左侧名字
|
|
|
+ // map.Save("D:\\1.bmp");
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ //绘制图例
|
|
|
+ public Bitmap DrawATernaryDiagramLegend(List<Color> Color_list)
|
|
|
+ {
|
|
|
+ Bitmap map = new Bitmap(450, 115);
|
|
|
+ Graphics g = Graphics.FromImage(map);
|
|
|
+ SolidBrush sbrush_White = new SolidBrush(Color.White);
|
|
|
+ SolidBrush sbrush = new SolidBrush(Color.Black);
|
|
|
+ g.FillRectangle(sbrush_White, 0, 0, 450, 115);
|
|
|
+ Font myFont = new Font("宋体", 10, FontStyle.Bold);
|
|
|
+ g.DrawString("legend(length,microns)", myFont, sbrush, 140, 3);
|
|
|
+ //legend(length,microns)
|
|
|
+ Pen mypen = new Pen(Color.Black, 1);
|
|
|
+ g.DrawLine(mypen, 100, 19, 350, 19);
|
|
|
+
|
|
|
+
|
|
|
+ //设置标签名称
|
|
|
+ List<string> listName = new List<string>();
|
|
|
+ //获取粒级表
|
|
|
+ string pathe = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFile;
|
|
|
+ DataSet ds = XMLoperate.GetXml(pathe);
|
|
|
+ string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
|
|
|
+
|
|
|
+ for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
|
|
|
+ {
|
|
|
+ if (sizestr.Split(',')[i].Length > 0)
|
|
|
+ {
|
|
|
+ double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
|
|
|
+ double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
|
|
|
+ listName.Add(d1.ToString() + "~" + d2.ToString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
|
|
|
+ listName.Add(d.ToString() + "~MAX");
|
|
|
+ int PositionJeight = 27;
|
|
|
+ string str_unit = " microns";
|
|
|
+ for (int i=0;i< listName.Count;i=i+3)
|
|
|
+ {
|
|
|
+ if (i< listName.Count)
|
|
|
+ {
|
|
|
+ SolidBrush sbrush_Color = new SolidBrush(Color_list[i]);
|
|
|
+ g.DrawRectangle(mypen, 26, PositionJeight, 8, 8);
|
|
|
+ g.FillRectangle(sbrush_Color, 27, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i].ToString()+ str_unit, myFont, sbrush, 38, PositionJeight-2);
|
|
|
+ }
|
|
|
+ if (i+1 < listName.Count)
|
|
|
+ {
|
|
|
+ SolidBrush sbrush_Color = new SolidBrush(Color_list[i+1]);
|
|
|
+ g.DrawRectangle(mypen, 170, PositionJeight, 8, 8);
|
|
|
+ g.FillRectangle(sbrush_Color, 171, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i+1].ToString()+ str_unit, myFont, sbrush, 182, PositionJeight - 2);
|
|
|
+ }
|
|
|
+ if (i + 2 < listName.Count)
|
|
|
+ {
|
|
|
+ SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 2]);
|
|
|
+ g.DrawRectangle(mypen, 314, PositionJeight, 8, 8);
|
|
|
+ g.FillRectangle(sbrush_Color, 315, PositionJeight + 1, 7, 7);
|
|
|
+ g.DrawString(listName[i + 2].ToString()+ str_unit, myFont, sbrush, 326, PositionJeight - 2);
|
|
|
+ }
|
|
|
+
|
|
|
+ PositionJeight = PositionJeight + 15;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //g.DrawRectangle(mypen, 26, 27, 8, 8);
|
|
|
+ //g.DrawString("50-100 microns", myFont, sbrush, 38, 25);
|
|
|
+
|
|
|
+ //g.DrawRectangle(mypen, 170, 27, 8, 8);
|
|
|
+ //g.DrawString("50-100 microns", myFont, sbrush, 182, 25);
|
|
|
+
|
|
|
+ //g.DrawRectangle(mypen, 314, 27, 8, 8);
|
|
|
+ //g.DrawString("50-100 microns", myFont, sbrush, 326, 25);
|
|
|
+ //map.Save("D://2.bmp");
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ private DataTable GetParticles(string filepath, List<string> nameList, int sel)
|
|
|
+ {
|
|
|
+ ParticleData particledata = new ParticleData(filepath);
|
|
|
+ //设置标签名称
|
|
|
+ List<string> listName = new List<string>();
|
|
|
+ //获取粒级表
|
|
|
+ string pathe = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFile;
|
|
|
+ DataSet ds = XMLoperate.GetXml(pathe);
|
|
|
+ string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
|
|
|
+
|
|
|
+ for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
|
|
|
+ {
|
|
|
+ if (sizestr.Split(',')[i].Length > 0)
|
|
|
+ {
|
|
|
+ double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
|
|
|
+ double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
|
|
|
+ listName.Add(d1.ToString() + "~" + d2.ToString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
|
|
|
+ listName.Add(d.ToString() + "~MAX");
|
|
|
+
|
|
|
+ string filedAndParticl = "";
|
|
|
+ if (sel == 1)
|
|
|
+ {
|
|
|
+ List<Particle> selectParticles = m_otsreport_export.m_ReportApp.GetSelectedParticles();
|
|
|
+ foreach (var item in selectParticles)
|
|
|
+ {
|
|
|
+ filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());
|
|
|
+ }
|
|
|
+ if (filedAndParticl != "")
|
|
|
+ {
|
|
|
+ filedAndParticl = filedAndParticl + ",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ string po = "";
|
|
|
+ string con = "";
|
|
|
+ int row = m_condition.m_SourceGridData.ConditionItemList.Count;
|
|
|
+ if (condition != -1)
|
|
|
+ {
|
|
|
+ List<string> li = new List<string>() { "DMAX", "DMIN", "Area", "FERET" };
|
|
|
+ con = li[condition];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (row < 4)
|
|
|
+ {
|
|
|
+ con = "DMAX";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ con = m_condition.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE).ToString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ switch (con)
|
|
|
+ {
|
|
|
+ case "DMAX":
|
|
|
+ po = "DMAX";
|
|
|
+ break;
|
|
|
+ case "DMIN":
|
|
|
+ po = "DMIN";
|
|
|
+ break;
|
|
|
+ case "CIRCLE":
|
|
|
+ po = "Area";
|
|
|
+ break;
|
|
|
+ case "FERET":
|
|
|
+ po = "DFERET";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ DataTable dtp = particledata.GetParticleHaveXray(filedAndParticl);
|
|
|
+ //创建一个临时表
|
|
|
+ DataTable ret_dt = new DataTable();
|
|
|
+ //然后额外存放三列,用于存放拆分后三个顶点的值
|
|
|
+ ret_dt.Columns.Add("sizeLevel");
|
|
|
+ ret_dt.Columns.Add("particleLocation");
|
|
|
+ ret_dt.Columns.Add("top");
|
|
|
+ ret_dt.Columns.Add("left");
|
|
|
+ ret_dt.Columns.Add("right");
|
|
|
+ ret_dt.Columns.Add("Color_position");
|
|
|
+
|
|
|
+ for (int k = 0; k < listName.Count; k++)
|
|
|
+ {
|
|
|
+ string str = listName[k];
|
|
|
+ string d1 = str.Split('~')[0];
|
|
|
+ string d2 = str.Split('~')[1];
|
|
|
+ if (d2 == "MAX")
|
|
|
+ {
|
|
|
+ d2 = "999";
|
|
|
+ }
|
|
|
+
|
|
|
+ DataRow[] datas = dtp.Select(getWhere(d2, d1, po));
|
|
|
+ foreach (var item in datas)
|
|
|
+ {
|
|
|
+ DataRow dr = ret_dt.NewRow();
|
|
|
+ dr["sizeLevel"] = str;
|
|
|
+ string element = item["Element"].ToString();
|
|
|
+ string strRet = getStrRet(nameList, element);
|
|
|
+ dr["particleLocation"] = strRet;
|
|
|
+ dr["top"] = strRet.Split(',')[0];
|
|
|
+ dr["left"] = strRet.Split(',')[1];
|
|
|
+ dr["right"] = strRet.Split(',')[2];
|
|
|
+ dr["Color_position"] = k.ToString();
|
|
|
+ ret_dt.Rows.Add(dr);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret_dt;
|
|
|
+ }
|
|
|
+ private string getWhere(string max, string min, string col)
|
|
|
+ {
|
|
|
+ return col + ">=" + min + " and " + col + "<=" + max;
|
|
|
+ }
|
|
|
+
|
|
|
+ private string getStrRet(List<string> template, string element)
|
|
|
+ {
|
|
|
+ List<string> name = new List<string>()
|
|
|
+ { "h","he",
|
|
|
+ "li","be","b","c","n","o","f","ne",
|
|
|
+ "na","mg","al","si","p","s","cl","ar",
|
|
|
+ "k","ca","sc","ti","v","cr","mn","fe","co","ni","cu","zn","ga","ge","as","se","br","kr",
|
|
|
+ "rb","sr","y","zr","nb","mo","tc","ru","rh","pd","ag","cd","in","sn","sb","te","i","xe",
|
|
|
+ "cs","ba","la",
|
|
|
+ "ce","pr","nd","pm","sm","eu","gd","tb","dy","ho","er","tm","yb","lu",
|
|
|
+ "hf","ta","w","re","os","ir","pt","au","hg","tl","pb","bi","po","at","rn",
|
|
|
+ "fr","ra","ac",
|
|
|
+ "th","pa","u","np","pu","am","cm","bk","cf","es","fm","md","no","lr"
|
|
|
+ };
|
|
|
+ List<double> value = new List<double>()
|
|
|
+ { 1.008,4.003,
|
|
|
+ 6.941,9.012,10.811,12.011,14.007,15.999,18.998,20.180,
|
|
|
+ 22.990,24.305,26.982,28.086,30.974,32.066,35.453,39.948,
|
|
|
+ 39.098,40.08,44.956,47.88,50.942,51.996,54.938,55.847,58.933,58.70,63.546,65.39,69.72,72.61,74.922,78.96,79.904,83.80,
|
|
|
+ 85.468,87.62,88.906,91.22,92.906,95.94,98.00,101.07,102.906,106.42,107.868,112.41,114.82,118.71,121.76,127.60,126.905,131.29,
|
|
|
+ 132.905,137.33,138.906,
|
|
|
+ 140.12,140.908,144.24,145.0,150.36,151.97,157.25,158.925,162.50,64.93,167.26,168.934,173.04,174.967,
|
|
|
+ 178.49,180.948,183.85,186.207,190.20,192.22,195.08,196.967,200.59,204.38,207.2,208.980,209.00,210.00,222.00,
|
|
|
+ 223.00,226.025,227.028,
|
|
|
+ 232.038,231.036,238.029,237.048,244.00,243.00,247.00,247.00,251.00,252.00,257.00,258.00,259.00,260.00
|
|
|
+ };
|
|
|
+ double d_ASum = 0;
|
|
|
+ double d_BSum = 0;
|
|
|
+ double d_CSum = 0;
|
|
|
+ string aElements = template[0];
|
|
|
+ string bElements = template[1];
|
|
|
+ string cElements = template[2];
|
|
|
+ foreach (var item in element.Split(';'))
|
|
|
+ {
|
|
|
+ if (item.Contains(aElements + "-"))
|
|
|
+ {
|
|
|
+ if (aElements != "")
|
|
|
+ {
|
|
|
+ d_ASum = Convert.ToDouble(item.Split('-')[1]) / value[name.IndexOf(aElements.ToLower())];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ for (int i = 0; i < bElements.Split(',').Length; i++)
|
|
|
+ {
|
|
|
+ string e = bElements.Split(',')[i];
|
|
|
+ if (item.Contains(e + "-"))
|
|
|
+ {
|
|
|
+ d_BSum = d_BSum + Convert.ToDouble(item.Split('-')[1]) / value[name.IndexOf(e.ToLower())];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.Contains(cElements + "-"))
|
|
|
+ {
|
|
|
+ if (cElements != "")
|
|
|
+ d_CSum = Convert.ToDouble(item.Split('-')[1]) / value[name.IndexOf(cElements.ToLower())];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ double allNums = d_ASum + d_BSum + d_CSum;
|
|
|
+ string strRet = "";
|
|
|
+ if ((allNums) == 0)
|
|
|
+ {
|
|
|
+ strRet = "0,0,0";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ double aPercent = 0, bPercent = 0, cPercent = 0;
|
|
|
+ if (d_ASum != 0)
|
|
|
+ {
|
|
|
+ aPercent = d_ASum / allNums;
|
|
|
+ }
|
|
|
+ if (d_BSum != 0)
|
|
|
+ {
|
|
|
+ bPercent = d_BSum / allNums;
|
|
|
+ }
|
|
|
+ if (d_CSum != 0)
|
|
|
+ {
|
|
|
+ cPercent = d_CSum / allNums;
|
|
|
+ }
|
|
|
+ strRet = aPercent.ToString() + "," + bPercent.ToString() + "," + cPercent.ToString();
|
|
|
+ }
|
|
|
+ return strRet;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 大分类数据
|
|
|
/// </summary>
|
|
|
/// <param name="m_mbszclass"></param>
|
|
|
/// <returns></returns>
|
|
|
- public DataTable ClassificationIntegration(MBSZClass m_mbszclass,string str)
|
|
|
+ public DataTable ClassificationIntegration(c_TemplateClass m_mbszclass,string str)
|
|
|
{
|
|
|
ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
|
|
|
DataTable data = new DataTable();
|
|
@@ -1896,7 +2320,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
/// </summary>
|
|
|
/// <param name="m_mbszclass"></param>
|
|
|
/// <returns></returns>
|
|
|
- public DataTable subdivisionIntegration(MBSZClass m_mbszclass)
|
|
|
+ public DataTable subdivisionIntegration(c_TemplateClass m_mbszclass)
|
|
|
{
|
|
|
ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
|
|
|
|