Browse Source

多语言20211125下午第二版

zhangjiaxin 3 years ago
parent
commit
594780b235

+ 27 - 24
Bin/x64/Debug/Resources/XMLData/ResourceForCpp/ResourceForReport-ZH.xml

@@ -2,32 +2,35 @@
 <XMLData FileMark="1037" Switch="false" Version="1.1.1">
     <collection RegName="keyvaluepair">
 	  <collection RegName="ResGrp" grpKey="0" text="常规参数" description="">
-			<member itemKey="20000" itemName="" itemText="测量结果数据"   description="Select Measurement Result。" boDownList=""/>
-			<member itemKey="20001" itemName="" itemText="测量图类型"     description="Survey Chart Type。" boDownList="BSE,颗粒分类图,Original,原图颗粒分布"/>
-			<member itemKey="20002" itemName="" itemText="测量图显示方式" description="chart display mode" boDownList="颗粒分布图,颗粒排列图"/>
-			<member itemKey="20003" itemName="" itemText="颗粒类型"       description="Particle Type。" boDownList="全部,分析颗粒"/>
-			<member itemKey="20004" itemName="" itemText="粒级表"         description="Particle Table。" boDownList="" />
-			<member itemKey="20005" itemName="" itemText="粒级"           description="Grain Size" boDownList="" />
-			<member itemKey="20006" itemName="" itemText="最小颗粒"       description="Smallest Particle" boDownList="" />
-			<member itemKey="20008" itemName="" itemText="最大颗粒"       description="Maximum Particle" boDownList="" />
-			<member itemKey="20353" itemName="" itemText="测量数据"       description="Measured Data" boDownList="全部颗粒类型,分析颗粒类型,颗粒尺寸类型" />
-			<member itemKey="20354" itemName="" itemText="尺寸计算法"     description="Dimension calculation method" boDownList="" />
+			<member itemKey="40000" itemName="" itemText="测量结果数据" description="Select Measurement Result。" boDownList=""/>
+			<member itemKey="40001" itemName="" itemText="测量图类型" description="Survey Chart Type。" boDownList="BSE,颗粒分类图,Original,原图颗粒分布"/>
+			<member itemKey="40002" itemName="" itemText="测量图显示方式" description="chart display mode" boDownList="颗粒分布图,颗粒排列图"/>
+			<member itemKey="40003" itemName="" itemText="颗粒类型" description="Particle Type。" boDownList="全部,分析颗粒"/>
+			<member itemKey="40004" itemName="" itemText="粒级表" description="Particle Table。" boDownList="" />
+			<member itemKey="40005" itemName="" itemText="粒级" description="Grain Size" boDownList="" />
+			<member itemKey="40006" itemName="" itemText="最小颗粒" description="Smallest Particle" boDownList="" />
+			<member itemKey="40007" itemName="" itemText="最大颗粒" description="Maximum Particle" boDownList="" />
+			<member itemKey="40008" itemName="" itemText="测量数据" description="Measured Data" boDownList="全部颗粒类型,分析颗粒类型,颗粒尺寸类型" />
+			<member itemKey="40009" itemName="" itemText="尺寸计算法" description="Dimension calculation method" boDownList="" />
+			<member itemKey="40010" itemName="" itemText="全部" description="" boDownList="" />
+			<member itemKey="40011" itemName="" itemText="自定义" description="" boDownList="" />
+			
 		</collection>
-		<collection RegName="ResGrp" grpKey="1" text="图像处理参数" description=""  >
-            <member itemKey="20026" itemName="" itemText="背景处理方式" description="" boDownList="" />		
-			<member itemKey="20027" itemName="" itemText="自动方式"     description="" boDownList="" />
-			<member itemKey="20028" itemName="" itemText="手动方式"     description="" boDownList="" />			
-			<member itemKey="20029" itemName="" itemText="取中"         description="" boDownList="" />
-			<member itemKey="20030" itemName="" itemText="向下"         description="" boDownList="" />
-			<member itemKey="20031" itemName="" itemText="向上"         description="" boDownList="" />
+		<collection RegName="ResGrp" grpKey="1" text="常规参数" description=""  >
+            <member itemKey="40000" itemName="" itemText="测量结果数据" description="Select Measurement Result" boDownList="" />		
+			<member itemKey="40001" itemName="" itemText="数据类型" description="Data Type" boDownList="" />
+			<member itemKey="40002" itemName="" itemText="数据表类型" description="Data table type" boDownList="测量结果概况,样品测量信息,颗粒成分,元素成分,颗粒尺寸分布,平均元素成分,国标一,国标二,美标,德标" />			
+			<member itemKey="40003" itemName="" itemText="粒级表" description="Particle Table" boDownList="" />
+			<member itemKey="40004" itemName="" itemText="尺寸计算法" description="Dimension Calculation Method" boDownList="" />
+			
         </collection>
-		<collection RegName="ResGrp" grpKey="2" text="图像处理参数" description=""  >
-            <member itemKey="20026" itemName="" itemText="背景处理方式" description="" boDownList="" />		
-			<member itemKey="20027" itemName="" itemText="自动方式" description="" boDownList="" />
-			<member itemKey="20028" itemName="" itemText="手动方式" description="" boDownList="" />			
-			<member itemKey="20029" itemName="" itemText="取中" description="" boDownList="" />
-			<member itemKey="20030" itemName="" itemText="向下" description="" boDownList="" />
-			<member itemKey="20031" itemName="" itemText="向上" description="" boDownList="" />
+		<collection RegName="ResGrp" grpKey="2" text="常规参数" description=""  >
+            <member itemKey="40000" itemName="" itemText="测量结果数据" description="Select Measurement Result" boDownList="" />		
+			<member itemKey="40001" itemName="" itemText="数据类型" description="Data Type" boDownList="" />
+			<member itemKey="40002" itemName="" itemText="数据表类型" description="Data graph type" boDownList="常用夹杂物分类,颗粒成分,元素成分,颗粒尺寸分布,三元相图" />			
+			<member itemKey="40003" itemName="" itemText="三元相图" description="Ternary phase diagram" boDownList="" />
+			<member itemKey="40004" itemName="" itemText="粒级表" description="Particle Table" boDownList="" />
+			<member itemKey="40005" itemName="" itemText="尺寸计算法" description="Dimension Calculation Method" boDownList="" />
         </collection>
     </collection>
 	

+ 49 - 110
OTSIncAReportApp/FunctionClass/OTSDataMgrFunction/DataMgrFun.cs

@@ -199,45 +199,44 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
         /// <summary>
         /// 界面显示Grid
         /// </summary>
-        private SampleData NewGridData(int tbindex, OTS_REPORT_PROP_GRID_ITEMS iItemId, string sSCaptionName, OTS_ITEM_TYPES iItemValType, bool bReadOnly, string sDescriptionInfo, object itemVal, List<string> comboDownList)
+        private SampleData NewGridData(int tbindex, OTS_REPORT_PROP_GRID_ITEMS iItemId, int number, OTS_ITEM_TYPES iItemValType, bool bReadOnly,  object itemVal, List<string> comboDownList)
         {
             string text = "";
             string des = "" ;
             string downlist = "";
-            //OTSDataType.XmlResourceData.GetInstance().GetStringByKey(tbindex, 20000,ref text, ref des, ref downlist);
+            OTSDataType.XmlResourceData.GetInstance().GetStringByKey(tbindex, number, ref text, ref des, ref downlist);
             SampleData sampleData = new SampleData();
             sampleData.iItemId = iItemId;
-            sampleData.sSCaptionName = sSCaptionName;
+            sampleData.sSCaptionName = text;
             sampleData.iItemValType = iItemValType;
             sampleData.bReadOnly = bReadOnly;
             sampleData.sDescriptionInfo = des;
 
-            //if (comboDownList.Count==0)
-            //{
-            //    List<string> liststr = new List<string>();
-            //    if (downlist!="")
-            //    {
-            //        string[] arrTemp = downlist.Split(',');
-            //        for (int i = 0; i < arrTemp.Count(); i++)
-            //        {
-            //            liststr.Add(arrTemp[i]);
-            //        }
-            //        sampleData.itemVal = liststr[0];
-            //        sampleData.comboDownList = liststr;
-            //    }
-            //    else
-            //    {
-            //        sampleData.itemVal = "0";
-            //        sampleData.comboDownList = liststr;
-            //    }
-               
-            //}
-            //else
-            //{
+            if (comboDownList.Count == 0)
+            {
+                List<string> liststr = new List<string>();
+                if (downlist != "")
+                {
+                    string[] arrTemp = downlist.Split(',');
+                    for (int i = 0; i < arrTemp.Count(); i++)
+                    {
+                        liststr.Add(arrTemp[i]);
+                    }
+                    sampleData.itemVal = liststr[0];
+                    sampleData.comboDownList = liststr;
+                }
+                else
+                {
+                    sampleData.itemVal = "0";
+                    sampleData.comboDownList = liststr;
+                }
+            }
+            else
+            {
                 sampleData.itemVal = itemVal;
                 sampleData.comboDownList = comboDownList;
-            //}
-           
+            }
+
             return sampleData;
         }
 
@@ -254,123 +253,63 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
             {
                 //测量结果数据
                 List<string> list_source_str = GetSampleListName();
-             
-                list.Add(NewGridData(tbindex, 0, table["sscaptionname1"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Select Measurement Result", list_source_str[m_ReportApp.WorkingResult], list_source_str));
-
-
+                list.Add(NewGridData(tbindex, 0, 40000, OTS_ITEM_TYPES.COMBO, false,  list_source_str[m_ReportApp.WorkingResult], list_source_str));
                 //bse,颗粒分类图
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.IMAGE_TYPE, table["sscaptionname2"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Survey Chart Type", "BSE", new List<string>() { "BSE", table["sscaptionname13"].ToString(), "Original", "原图颗粒分布" }));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.IMAGE_TYPE, 40001, OTS_ITEM_TYPES.COMBO, false,  "", new List<string>() { }));
                 //测量图类型
-                
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE, table["sscaptionname3"].ToString(), OTS_ITEM_TYPES.COMBO, false, "chart display mode", table["sscaptionname14"].ToString(), new List<string>() { table["sscaptionname14"].ToString(), table["sscaptionname15"].ToString() }));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE, 40002, OTS_ITEM_TYPES.COMBO, false,  "", new List<string>() { }));
                 //测量图显示方式
-               
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.PARTICLE_TYPE, table["sscaptionname4"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Particle Type", table["sscaptionname16"].ToString(), new List<string>() { table["sscaptionname16"].ToString(), table["sscaptionname17"].ToString() }));
-
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.PARTICLE_TYPE, 40003, OTS_ITEM_TYPES.COMBO, false,  "", new List<string>() {  }));
                 //粒级表
-               
                 List<string> list_partsizelist = GetPartSizeFileList();//从系统默认的路径中查找出所有的粒级表文件
-                
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE, "粒级表", OTS_ITEM_TYPES.COMBO, false, "Particle Table", list_partsizelist[0], list_partsizelist));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE, 40004, OTS_ITEM_TYPES.COMBO, false,  list_partsizelist[0], list_partsizelist));
                 //粒级
-                
                 List<string> sizeList = GetPartSizeList();//获取粒级后额外增加全部,自定义,选项
-                sizeList.Insert(0, table["sscaptionname16"].ToString());//全部
-                sizeList.Insert(1, table["sscaptionname18"].ToString());//自定义
-
-                
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS, table["sscaptionname5"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Grain Size", table["sscaptionname16"].ToString(), sizeList));
-
+                sizeList.Insert(0, OTSDataType.XmlResourceData.GetInstance().GetStringByKey(tbindex, 40010));//全部
+                sizeList.Insert(1, OTSDataType.XmlResourceData.GetInstance().GetStringByKey(tbindex, 40011));//自定义
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS, 40005, OTS_ITEM_TYPES.COMBO, false, sizeList[0], sizeList));
                 //自定义最小
-               
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MIN, table["sscaptionname6"].ToString(), OTS_ITEM_TYPES.DOUBLE, false, "Smallest Particle", "0",new List<string> { }));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MIN, 40006, OTS_ITEM_TYPES.DOUBLE, false,  "0",new List<string> { }));
                 //自定义最大
-               
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MAX, table["sscaptionname7"].ToString(), OTS_ITEM_TYPES.DOUBLE, false, "Maximum Particle","0",new List<string> { }));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MAX, 40007, OTS_ITEM_TYPES.DOUBLE, false, "0",new List<string> { }));
                 //测量数据
-                
-                List<string> list3 = new List<string>() { table["sscaptionname19"].ToString(), table["sscaptionname20"].ToString(), table["sscaptionname21"].ToString() };
-               
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.MEASURE_DATA_TYPE, table["sscaptionname22"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Measured Data", list3[0], list3));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.MEASURE_DATA_TYPE, 40008, OTS_ITEM_TYPES.COMBO, false, "", new List<string> { }));
                 //计算方式
-               
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, table["sscaptionname8"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Dimension calculation method", "DMAX", GetSizeCalMethodTypeList()));
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, 40009, OTS_ITEM_TYPES.COMBO, false, GetSizeCalMethodTypeList()[0], GetSizeCalMethodTypeList()));
             }
             else if (tbindex == 1)//Grid表格页
             {
                 //测量结果数据
                 List<string> list_source_str = GetSampleListName();
-                
-                list.Add(NewGridData(tbindex,0, table["sscaptionname1"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Select Measurement Result", list_source_str[m_ReportApp.WorkingResult], list_source_str));
-
+                list.Add(NewGridData(tbindex,0, 40000, OTS_ITEM_TYPES.COMBO, false,  list_source_str[m_ReportApp.WorkingResult], list_source_str));
                 //数据类型
                 List<string> list_datasourcetypelist = GetDataSourceTypeList();
-                
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE, table["sscaptionname9"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Data Type", list_datasourcetypelist[0], list_datasourcetypelist));
-
-                //数据表类型
-                //string sSCaptionName10 = table["sscaptionname10"].ToString();
-                List<string> list2 = new List<string>() { table["sscaptionname25"].ToString(), table["sscaptionname26"].ToString(), table["sscaptionname27"].ToString(), table["sscaptionname28"].ToString(), table["sscaptionname29"].ToString(), table["sscaptionname30"].ToString()};
-                string[] aa = m_ReportApp.Text.Split('-');
-                List<string> listStd = new List<string>() { "国标一", "国标二", "美标", "德标" };
-                list2.AddRange(listStd);
-
-
-               
-                
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE, table["sscaptionname10"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Data table type", list2[0], list2));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE, 40001, OTS_ITEM_TYPES.COMBO, false, list_datasourcetypelist[0], list_datasourcetypelist));
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE, 40002, OTS_ITEM_TYPES.COMBO, false,  "", new List<string> { }));
                 //粒级表
-                
                 List<string> list_partsizelist = GetPartSizeFileList();//从系统默认的路径中查找出所有的粒级表文件
-              
-                
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE, "粒级表", OTS_ITEM_TYPES.COMBO, false, "Particle Table", list_partsizelist[0], list_partsizelist));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE, 40003, OTS_ITEM_TYPES.COMBO, false,  list_partsizelist[0], list_partsizelist));
                 //尺寸计算方法
-              
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, table["sscaptionname8"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Dimension Calculation Method", "DMAX", GetSizeCalMethodTypeList()));
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, 40004, OTS_ITEM_TYPES.COMBO, false, GetSizeCalMethodTypeList()[0], GetSizeCalMethodTypeList()));
             }
             else if (tbindex == 2)//Chart图页
             {
                 //测量结果数据
                 List<string> list_source_str = GetSampleListName();
-               
-                list.Add(NewGridData(tbindex,0, table["sscaptionname1"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Select Measurement Result", list_source_str[m_ReportApp.WorkingResult], list_source_str));
-
+                list.Add(NewGridData(tbindex,0, 40000, OTS_ITEM_TYPES.COMBO, false,  list_source_str[m_ReportApp.WorkingResult], list_source_str));
                 //数据类型
                 List<string> list_datasourcetypelist = GetDataSourceTypeList();
-                
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE, table["sscaptionname9"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Data Type", list_datasourcetypelist[0], list_datasourcetypelist));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE, 40001, OTS_ITEM_TYPES.COMBO, false,  list_datasourcetypelist[0], list_datasourcetypelist));
                 //数据图类型
-               
-                List<string> list2 = new List<string>() { "常用夹杂物分类", table["sscaptionname27"].ToString(), table["sscaptionname28"].ToString(), table["sscaptionname29"].ToString(), table["sscaptionname12"].ToString() };
-              
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE, table["sscaptionname10"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Data graph type", list2[0], list2));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE, 40002, OTS_ITEM_TYPES.COMBO, false,  "", new List<string> { }));
                 //三元相图模板
-              
                 List<string> trio_listname = GetTriTemplateNameList();
-               
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.TRIO_CHART_TYPE, table["sscaptionname12"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Ternary phase diagram", trio_listname.First(), trio_listname));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.TRIO_CHART_TYPE, 40003, OTS_ITEM_TYPES.COMBO, false,  trio_listname.First(), trio_listname));
                 //粒级表
-               
                 List<string> list_partsizelist = GetPartSizeFileList();
-                
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE, "粒级表", OTS_ITEM_TYPES.COMBO, false, "Particle Table", list_partsizelist[0], list_partsizelist));
-
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE,40004, OTS_ITEM_TYPES.COMBO, false,  list_partsizelist[0], list_partsizelist));
                 //尺寸计算法
-              
-                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, table["sscaptionname8"].ToString(), OTS_ITEM_TYPES.COMBO, false, "Dimension Calculation Method", "DMAX", GetSizeCalMethodTypeList()));
+                list.Add(NewGridData(tbindex,OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, 40005, OTS_ITEM_TYPES.COMBO, false, GetSizeCalMethodTypeList().First(), GetSizeCalMethodTypeList()));
             }
 
             return list;