示例#1
0
        /// <summary>
        /// 获取Process_Parameters  CopperLayer
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetCopperLayer()
        {
            int totalCoperLayer;

            totalCoperLayer = 0;

            //先对coperlayer取值
            //theJob.CopperLayers();
            foreach (ICopperLayer copper in theJob.CopperLayers())
            {
                totalCoperLayer = totalCoperLayer + 1;
            }

            jobNum_CU_LAYER = totalCoperLayer;

            Dictionary <string, string>[] dictCU_LAYER = new Dictionary <string, string> [totalCoperLayer];

            int i;

            i = 0;

            for (int dictLength = 0; dictLength < dictCU_LAYER.Length; dictLength++)
            {
                dictCU_LAYER[dictLength] = new Dictionary <string, string>();
            }

            int len_process = XmlGenerate.jobcomponslength(theJob.AllProcesses(false));

            string[] AllCuFinish_Thickness = new string[len_process];
            //获取:  //每一层的原始铜厚

            int j = 0;

            foreach (IProcess process in theJob.AllProcesses(false))
            {
                //Dictionary<string, string> dictAllProcess = new Dictionary<string, string>();
                //XmlGenerate.AllAttrGetKeyValues(process, dictAllProcess);
                Dictionary <string, double> dictAllProcessDoubleData = new Dictionary <string, double>();
                XmlGenerate.AllAttrGetKeyValues_double(process, dictAllProcessDoubleData);
                double d1 = dictAllProcessDoubleData["PLATING_THK_MAX_"];
                double d2 = dictAllProcessDoubleData["PLATING_THK_MIN_"];
                double a3 = (d1 + d2) / 2;
                AllCuFinish_Thickness[j] = a3.ToString();
                //线路完成面铜厚度取Procee(Final Assembly)下PLATING_THK_MIN_和PLATING_THK_MAX_的平均值
                job_CU_FINISH_THICKNESS = a3;
                j++;
            }


            try
            {
                foreach (ICopperLayer copper in theJob.CopperLayers())
                {
                    string CU_LAYER_INDEX = i.ToString();//  添加到最后生成的键值对中
                    Dictionary <string, string> dictAllCU_LAYER = new Dictionary <string, string>();
                    XmlGenerate.AllAttrGetKeyValues(copper, dictAllCU_LAYER);
                    //string str =dictAllCU_LAYER["d "];
                    dictCU_LAYER[i].Add("CU_LAYER_INDEX", (i + 1).ToString());
                    if (i == 0)
                    {
                        dictCU_LAYER[i].Add("CU_FINISH_THICKNESS", AllCuFinish_Thickness[0]);
                    }
                    else
                    {
                        //dictCU_LAYER[i].Add("CU_FINISH_THICKNESS", dictAllCU_LAYER["OVERALL_THICKNESS"]);
                        dictCU_LAYER[i].Add("CU_FINISH_THICKNESS", dictAllCU_LAYER["LAYER_FINISH_CU_THK_"]);
                        //dictCU_LAYER[i].Add("CU_FINISH_THICKNESS", copper.RequiredThickness(AvailableUnits.MIL).ToString());
                    }
                    //下划线可不输入
                    //dictCU_LAYER[i].Add("CU_RAW_THICKNESS_", dictAllCU_LAYER["COPPER_USAGE"]);
                    dictCU_LAYER[i].Add("COPPER_USAGE", dictAllCU_LAYER["COPPER_USAGE"]);
                    dictCU_LAYER[i].Add("CU_RAW_WEIGHT", dictAllCU_LAYER["REQUIRED_CU_WEIGHT"]);
                    //字段待确定
                    dictCU_LAYER[i].Add("CU_UNDERCUT", ""); //待确定
                    //dictCU_LAYER[i].Add("LAYER_SIGNAL_TYPE_", dictAllCU_LAYER["COPPER_USAGE"]);
                    i++;
                }
                listCU_LAYERT = new List <Dictionary <string, string> >();
                foreach (var item in dictCU_LAYER)
                {
                    listCU_LAYERT.Add(item);
                }
            }
            catch (Exception ex)
            {
                string exmess = ex.ToString();
                //throw;
            }
        }