|
@@ -169,8 +169,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
}
|
|
|
#endregion
|
|
|
#region 读取标准库所需要的数据
|
|
|
- private void GetSTL(string str ,out DataTable data)
|
|
|
+ private bool GetSTL(string str ,out DataTable data)
|
|
|
{
|
|
|
+ if (str.ToLower() == "nostddb")
|
|
|
+ {
|
|
|
+ data = null;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
DataTable dt = new DataTable();
|
|
|
dt.Columns.Add("TypeId");
|
|
|
dt.Columns.Add("Hardness", typeof(double));
|
|
@@ -178,7 +183,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
|
|
|
OTSCommon.SqLiteHelper sh = null;
|
|
|
- string fullPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.CurResultFile.FilePath + str + ".db";
|
|
|
+ string fullPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.CurResultFile.FilePath + "\\" + str + ".db";
|
|
|
string fullPath2 = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + str + ".db";
|
|
|
if (System.IO.File.Exists(fullPath))
|
|
|
{
|
|
@@ -192,7 +197,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
{
|
|
|
sh = null;
|
|
|
data = null;
|
|
|
- return;
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
DataTable dt_stl= sh.ExecuteQuery("select * from ClassifySTD");
|
|
@@ -220,6 +225,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
dt.Rows.Add(dr);
|
|
|
}
|
|
|
data = dt;
|
|
|
+ return true;
|
|
|
}
|
|
|
public bool GetDBData(c_TemplateClass m_mbszclass)
|
|
|
{
|
|
@@ -426,28 +432,6 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
#endregion
|
|
|
|
|
|
#region 插入颗粒列表并带有帧图
|
|
|
- private bool DoesDBexist()
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- ResultFile resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
|
|
|
- //string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
|
|
|
- string str_libraryName = resfile.GetSTDName();
|
|
|
- OTSCommon.SqLiteHelper sh = new OTSCommon.SqLiteHelper("data source='" + System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + str_libraryName + ".db" + "'");
|
|
|
-
|
|
|
- if (sh.ExecuteQuery("select * from ClassifySTD")==null)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
- catch
|
|
|
- {
|
|
|
- return false;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
private string datatable_data(DataTable dt,int it,string str)
|
|
|
{
|
|
|
if (str == "Hardness")
|
|
@@ -961,14 +945,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
ResultFile resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
|
|
|
//string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
|
|
|
string str_libraryName = resfile.GetSTDName();
|
|
|
- if (m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() == "Hardness")
|
|
|
+ if (m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.CleannessA)
|
|
|
{
|
|
|
dt.Columns.Add("Hardness", typeof(double));
|
|
|
dt.Columns.Add("Hardness_detailed");
|
|
|
- if (DoesDBexist())
|
|
|
+ DataTable dt_stl = new DataTable();
|
|
|
+ if (GetSTL(str_libraryName, out dt_stl))
|
|
|
{
|
|
|
- DataTable dt_stl = new DataTable();
|
|
|
- GetSTL(str_libraryName, out dt_stl);
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
for (int a = 0; a < dt_stl.Rows.Count; a++)
|
|
@@ -982,7 +965,6 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
//去除物质分类(非夹杂物分类)
|
|
@@ -1221,14 +1203,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
//string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
|
|
|
|
|
|
string str_libraryName = resfile.GetSTDName();
|
|
|
- if (m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() == "Hardness")
|
|
|
+ if (m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.CleannessA)
|
|
|
{
|
|
|
dt.Columns.Add("Hardness", typeof(double));
|
|
|
dt.Columns.Add("Hardness_detailed");
|
|
|
- if (DoesDBexist())
|
|
|
+ DataTable dt_stl = new DataTable();
|
|
|
+ if (GetSTL(str_libraryName, out dt_stl))
|
|
|
{
|
|
|
- DataTable dt_stl = new DataTable();
|
|
|
- GetSTL(str_libraryName, out dt_stl);
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
for (int a = 0; a < dt_stl.Rows.Count; a++)
|