ソースを参照

多样品 颗粒列表添加提示

cxs 1 年間 前
コミット
0c747f6430
1 ファイル変更13 行追加10 行削除
  1. 13 10
      OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

+ 13 - 10
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -167,20 +167,14 @@ namespace OTSIncAReportGrids
             ReportFun = new OTSImageDisHelp(resultFile);
 
             string sou = m_condition.m_CurrentConditions[OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
-            if (!sou.Contains("+"))
+            if (sou.Contains("+"))
             {
+                MessageBox.Show("This function does not support multiple samples!");
                 result = m_ReportApp.m_rstDataMgr.ResultFilesList[0];
             }
             else
             {
-                for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
-                {
-                    if (sou == m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName_real.ToString())
-                    {
-                        result = m_ReportApp.m_rstDataMgr.ResultFilesList[i];
-                    }
-
-                }
+                result = m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)];
             }
 
 
@@ -197,6 +191,10 @@ namespace OTSIncAReportGrids
         }
         bool Init()
         {
+            if(result==null)
+            {
+                return false;
+            }
             try
             {
                 lan = new Language(this);
@@ -1702,7 +1700,12 @@ namespace OTSIncAReportGrids
         /// </summary>
         public void SaveMarkParticleRectangleOnFieldFile(string str_resultPath, DataTable dataTable, out List<string> vs, out DataTable dt_FIeld)
         {
-            Init();
+            if(!Init())
+            {
+                vs = null;
+                dt_FIeld = null;
+                return;
+            }
 
             List<string> maxlength = new List<string>();
             for (int i = 0; i < dataTable.Rows.Count; i++)