|
@@ -147,6 +147,15 @@ namespace OTSIncAReportApp.Control_ECharts
|
|
List<Chartdate> list_json_str = GetListJsonStrByChartStruct();
|
|
List<Chartdate> list_json_str = GetListJsonStrByChartStruct();
|
|
url = "Resources/HTML/charts.html";
|
|
url = "Resources/HTML/charts.html";
|
|
m_ReportApp.data = JsonConvert.SerializeObject(list_json_str[0]);
|
|
m_ReportApp.data = JsonConvert.SerializeObject(list_json_str[0]);
|
|
|
|
+ if (ComSel == "PSize")
|
|
|
|
+ {
|
|
|
|
+ ComSel = "PSizeCombin";
|
|
|
|
+ m_ReportApp.dataCombin = JsonConvert.SerializeObject(GetListJsonStrByChartStruct()[0]);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ m_ReportApp.dataCombin = "";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
InitBrowser();
|
|
InitBrowser();
|
|
}
|
|
}
|
|
@@ -779,6 +788,123 @@ namespace OTSIncAReportApp.Control_ECharts
|
|
chart.ListData = listData;
|
|
chart.ListData = listData;
|
|
return chart;
|
|
return chart;
|
|
}
|
|
}
|
|
|
|
+ private Chartdate GetPSizeDataCombin(string path)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ DataOperation.DataAccess.ParticleData particledata = new DataOperation.DataAccess.ParticleData(path);
|
|
|
|
+ //创建新的图形数据源
|
|
|
|
+ Chartdate chart = new Chartdate();
|
|
|
|
+ chart.Title = m_ReportApp.m_reportname;
|
|
|
|
+ chart.YName = m_str_AxisY;
|
|
|
|
+
|
|
|
|
+ //设置标签名称
|
|
|
|
+ List<string> listName = new List<string>();
|
|
|
|
+
|
|
|
|
+ //获取粒级表
|
|
|
|
+ string pathe = m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFile;
|
|
|
|
+ DataSet ds = DataOperation.DataAccess.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 idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
|
|
|
|
+ //int sel = m_ReportApp.SourceGridData.ConditionItemList[idx].comboDownList.IndexOf(m_ReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString());
|
|
|
|
+ //int sel = m_conditionChoose.m_SourceGridData.GetPropIndexByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
|
|
|
|
+ int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
|
|
|
|
+ string filedAndParticl = "";
|
|
|
|
+ if (sel == 1)
|
|
|
|
+ {
|
|
|
|
+ List<Particle> selectParticles = m_ReportApp.GetSelectedParticles();
|
|
|
|
+ foreach (var item in selectParticles)
|
|
|
|
+ {
|
|
|
|
+ filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());
|
|
|
|
+ }
|
|
|
|
+ if (filedAndParticl != "")
|
|
|
|
+ {
|
|
|
|
+ filedAndParticl = filedAndParticl + ",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
|
|
|
|
+ //string con = m_ReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString();
|
|
|
|
+ string con = m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE).ToString();
|
|
|
|
+ string po = "";
|
|
|
|
+ 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.GetParticleAll(filedAndParticl);
|
|
|
|
+
|
|
|
|
+ //计算分类整个表的数据
|
|
|
|
+ DataTable dt = ClassificationIntegration(path);
|
|
|
|
+ List<string> listClassificationName = new List<string>();
|
|
|
|
+ //ListName
|
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ listClassificationName.Add(dt.Rows[i]["e1"].ToString());
|
|
|
|
+ }
|
|
|
|
+ chart.ListName = listClassificationName;
|
|
|
|
+ //设置数据
|
|
|
|
+ List<Item> listData = new List<Item>();
|
|
|
|
+ //ListData
|
|
|
|
+ string strNameGroup = "";
|
|
|
|
+ for (int j = 0; j < listClassificationName.Count; j++)
|
|
|
|
+ {
|
|
|
|
+ string strGroup = "";
|
|
|
|
+ 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) + " and GroupName = '" + listClassificationName[j] + "'");
|
|
|
|
+ strGroup += datas.Count();
|
|
|
|
+ if (k != listName.Count - 1)
|
|
|
|
+ {
|
|
|
|
+ strGroup += ",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Item item = new Item()
|
|
|
|
+ {
|
|
|
|
+ value = strGroup,
|
|
|
|
+ name = listClassificationName[j]
|
|
|
|
+ };
|
|
|
|
+ listData.Add(item);
|
|
|
|
+ strNameGroup += listClassificationName[j];
|
|
|
|
+ if (j != listClassificationName.Count - 1)
|
|
|
|
+ {
|
|
|
|
+ strNameGroup += ",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ chart.Title = "[" + strNameGroup + "]";
|
|
|
|
+ chart.ListData = listData;
|
|
|
|
+ return chart;
|
|
|
|
+ }
|
|
private string getWhere(string max, string min, string col)
|
|
private string getWhere(string max, string min, string col)
|
|
{
|
|
{
|
|
return col + ">=" + min + " and " + col + "<=" + max;
|
|
return col + ">=" + min + " and " + col + "<=" + max;
|
|
@@ -810,6 +936,9 @@ namespace OTSIncAReportApp.Control_ECharts
|
|
case "PSize":
|
|
case "PSize":
|
|
chartdate = GetPSizeData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
|
|
chartdate = GetPSizeData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
|
|
break;
|
|
break;
|
|
|
|
+ case "PSizeCombin":
|
|
|
|
+ chartdate = GetPSizeDataCombin(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
|
|
|
|
+ break;
|
|
case "InclusionareaRatio":
|
|
case "InclusionareaRatio":
|
|
chartdate = GetInclusionAreaRatioData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
|
|
chartdate = GetInclusionAreaRatioData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
|
|
break;
|
|
break;
|
|
@@ -1225,8 +1354,9 @@ namespace OTSIncAReportApp.Control_ECharts
|
|
{
|
|
{
|
|
//为页面图形提供数据参数
|
|
//为页面图形提供数据参数
|
|
string str = m_ReportApp.data;
|
|
string str = m_ReportApp.data;
|
|
|
|
+ string strCombin = m_ReportApp.dataCombin;
|
|
//执行网页脚本事件
|
|
//执行网页脚本事件
|
|
- m_ReportApp.browser.ExecuteScriptAsync("showchart('" + str + "','" + m_ReportApp.type + "')");
|
|
|
|
|
|
+ m_ReportApp.browser.ExecuteScriptAsync("showchart('" + str + "','" + strCombin + "','" + m_ReportApp.type + "')");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//public string GetPic()
|
|
//public string GetPic()
|