Browse Source

add systype judement while poping the menu

gsp 1 year ago
parent
commit
66d6cb1947

+ 15 - 9
OTSCommon/Model/RptConfigFile.cs

@@ -17,9 +17,21 @@ namespace OTSCommon.Model
         private const string m_TriTempFile = "DefaultTriTemplateFile.tpf";
 
         public static string m_ReportMgrParamFile = "\\Config\\SysData\\OTSReportMgrParam.rpf"; //报告对应使用的参数文件名
-        public RptConfigFile(string pathe)
+        static RptConfigFile m_config=null;
+       public static RptConfigFile GetRptConfig()
         {
-            path = pathe;
+            if (m_config == null)
+            {
+                m_config = new RptConfigFile();
+            }
+            return m_config;
+        }
+        private RptConfigFile()
+        {
+
+            path = Application.StartupPath + RptConfigFile.m_ReportMgrParamFile;         //报表程序的配置文件
+
+            LoadDataFromFile();
         }
         public void LoadDataFromFile()
         {
@@ -41,13 +53,7 @@ namespace OTSCommon.Model
         }
 
 
-        public OTS_SysType_ID GetSysType()
-        {
-            DataSet ds = XMLoperate.GetXmlData(Application.StartupPath + m_ReportMgrParamFile, "XMLData");
-            DataTable dt = ds.Tables["Member"];
-
-            return OTS_SysType_ID.CleannessA;
-        }
+        
 
         public string GetDataFromDataSetXml(DataSet dataSrc, string propertyName,string memberName="XMLData")//the particular schema of OTS system.such as "<XMLData p1="aa" p2="bb"><Member RegName="cc" p1="dd"/>...</XMLData>
         {

+ 3 - 3
OTSIncAMeasureApp/ServiceCenter/EDSController.cs

@@ -174,14 +174,14 @@ namespace OTSModelSharp.ServiceCenter
             int nSize = a_listParticles.Count;
             if (nSize > 1024)
             {
-                NLog.LogManager.GetCurrentClassLogger().Warn("xraynum>1024");
+               
                 COTSParticleClr[] partsTemp = new COTSParticleClr[1024];
                 Point[] PsTemp = new Point[1024];
 
                 int nTimes = nSize / 1024;
                 for (int i = 0; i < nTimes; i++)
                 {
-                  
+                    NLog.LogManager.GetCurrentClassLogger().Warn("begin 1024 batch");
                     for (int m = 0; m < 1024; m++)
                     {
                         partsTemp[m]=a_listParticles[i * 1024 + m];
@@ -193,7 +193,7 @@ namespace OTSModelSharp.ServiceCenter
                         NLog.LogManager.GetCurrentClassLogger().Error("GetXRayByPoints: failed to get element.");
                         return false;
                     }
-                    NLog.LogManager.GetCurrentClassLogger().Warn("1024 batch succeed");
+                   
 
                 }
 

+ 9 - 1
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1212,7 +1212,15 @@ namespace OTSIncAReportGraph.Controls
                     CMenuStrip.Items[(int)RightButtonMenu.ParticleSegmentation].Visible = false;
                     CMenuStrip.Items[(int)RightButtonMenu.ImportSTDDb].Visible = false;
                 }
-                      
+                var m_RptConfigFile = RptConfigFile.GetRptConfig();         //报表程序的配置文件
+                if (m_RptConfigFile.Systype == OTS_SysType_ID.CleannessA)
+                {
+                    显示国标信息ToolStripMenuItem.Visible = false;
+                }
+
+
+
+
 
             }
 

+ 7 - 1
OTSIncAReportApp/1-UI/frmReportApp.cs

@@ -371,7 +371,13 @@ namespace OTSIncAReportApp
             {
                 rbHelp.Enabled = true;
             }
-            
+         RptConfigFile m_RptConfigFile =  RptConfigFile.GetRptConfig();         //报表程序的配置文件
+            if (m_RptConfigFile.Systype == OTS_SysType_ID.CleannessA)
+            {
+                ribbonOrbMenuItem_Extremum.Enabled = false;
+                ribbonOrbMenuItem_InclusionsTraceability.Enabled = false;
+            }
+       
 
         }
 

+ 1 - 1
OTSIncAReportApp/2-CommonFunction/OTSDataMgrFunction/ResultDataMgr.cs

@@ -31,7 +31,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
         private List<ResultFile> resultFilesList = new List<ResultFile>();   //测量结果列表
         private int workingResultId = -1;
         private int SelectedIndex = 0;
-        public RptConfigFile m_RptConfigFile = new RptConfigFile(Application.StartupPath + RptConfigFile.m_ReportMgrParamFile);         //报表程序的配置文件
+        public RptConfigFile m_RptConfigFile = RptConfigFile.GetRptConfig();         //报表程序的配置文件
         #endregion