Example #1
0
        /// <summary>
        /// このクラスのMb3ファイルの読み込み
        /// </summary>
        /// <param name="readCE3">読み込み対象のReadCE3クラス</param>
        /// <returns>正常終了時に ReadCE3.RdStatus.NoErrorを返す</returns>
        public override ReadCE3.RdStatus RdMb3(ReadCE3 readCE3)
        {
            string str1;
            string str2;

            while (readCE3.GetRecord(out str1, out str2))
            {
                if (str1[0] == '-')
                {
                    if (str1 != "-MBE_PINSMD" && str1 != "-MBE_FLASHMARK")
                    {
                        return(ReadCE3.RdStatus.FormatError);
                    }
                    else
                    {
                        if (no_ResistMask)
                        {
                            no_MM = true;
                        }
                        return(ReadCE3.RdStatus.NoError);
                    }
                }
                else
                {
                    ReadCE3.RdStatus result = RdMb3Member(str1, str2, readCE3);
                    if (result != ReadCE3.RdStatus.NoError)
                    {
                        return(result);
                    }
                }
            }
            return(ReadCE3.RdStatus.FileError);
        }
Example #2
0
        public override ReadCE3.RdStatus RdMb3(ReadCE3 readCE3)
        {
            string str1;
            string str2;

            while (readCE3.GetRecord(out str1, out str2))
            {
                if (str1[0] == '-')
                {
                    if (str1 != "-LINE_INFO")
                    {
                        return(ReadCE3.RdStatus.FormatError);
                    }
                    else
                    {
                        return(ReadCE3.RdStatus.NoError);
                    }
                }
                else
                {
                    ReadCE3.RdStatus result = RdMb3Member(str1, str2, readCE3);
                    if (result != ReadCE3.RdStatus.NoError)
                    {
                        return(result);
                    }
                }
            }
            return(ReadCE3.RdStatus.FileError);
        }
Example #3
0
        /// <summary>
        /// このクラスのMb3ファイルの読み込み
        /// </summary>
        /// <param name="readCE3">読み込み対象のReadCE3クラス</param>
        /// <returns>正常終了時にReadCE3.RdStatus.NoError を返す</returns>
        public ReadCE3.RdStatus RdMb3(ReadCE3 readCE3)
        {
            //VisibleLayer = 0L;
            string str1;
            string str2;

            ReadCE3.RdStatus result = ReadCE3.RdStatus.NoError;
            while (readCE3.GetRecord(out str1, out str2))
            {
                if (str1[0] == '-')
                {
                    if (str1 != "-MBE_DOCINFO")
                    {
                        result = ReadCE3.RdStatus.FormatError;
                    }
                    break;
                }
                else
                {
                    result = RdMb3Member(str1, str2, readCE3);
                    if (result != ReadCE3.RdStatus.NoError)
                    {
                        break;
                    }
                }
            }
            return(result);
        }
        /// <summary>
        /// このクラスのMb3ファイルの読み込み
        /// </summary>
        /// <param name="readCE3">読み込み対象のReadCE3クラス</param>
        /// <returns>正常終了時にReadCE3.RdStatus.NoError を返す</returns>
        public override ReadCE3.RdStatus RdMb3(ReadCE3 readCE3)
        {
            string str1;
            string str2;

            AngleX10 = -1;
            while (readCE3.GetRecord(out str1, out str2))
            {
                if (str1[0] == '-')
                {
                    if (str1 != "-MBE_COMPONENT")
                    {
                        return(ReadCE3.RdStatus.FormatError);
                    }
                    else
                    {
                        //layer = refNum.Layer;


                        //foreach (MbeObj obj in contentsObj) {
                        //    if (obj.Id() == MbeObjID.MbeLine) {
                        //        if (obj.Layer == MbeLayer.LayerValue.PLC || obj.Layer == MbeLayer.LayerValue.PLS) {
                        //            ((MbeObjLine)obj).LineWidth = 2000;
                        //        }
                        //    }
                        //    if (obj.Id() == MbeObjID.MbeArc) {
                        //        if (obj.Layer == MbeLayer.LayerValue.PLC || obj.Layer == MbeLayer.LayerValue.PLS) {
                        //            ((MbeObjArc)obj).LineWidth = 2000;
                        //        }
                        //    }

                        //}



                        return(ReadCE3.RdStatus.NoError);
                    }
                }
                else
                {
                    ReadCE3.RdStatus result = RdMb3Member(str1, str2, readCE3);
                    if (result != ReadCE3.RdStatus.NoError)
                    {
                        return(result);
                    }
                }
            }

            return(ReadCE3.RdStatus.FileError);
        }
        /// <summary>
        /// Mb3ファイルの読み込み時のメンバーの解釈を行う
        /// </summary>
        /// <param name="str1">変数名または"+"で始まるブロックタグ</param>
        /// <param name="str2">変数値</param>
        /// <param name="readCE3">ブロック読み込み時に使うReadCE3クラス</param>
        /// <returns>正常終了時にReadCE3.RdStatus.NoErrorを返す</returns>
        public override ReadCE3.RdStatus RdMb3Member(string str1, string str2, ReadCE3 readCE3)
        {
            string _str1;
            string _str2;

            ReadCE3.RdStatus result = ReadCE3.RdStatus.NoError;
            switch (str1)
            {
            case "PACKAGE":
                packageName = ReadCE3.DecodeCE3String(str2);
                return(ReadCE3.RdStatus.NoError);

            case "REMARKS":
                remarksText = ReadCE3.DecodeCE3String(str2);
                return(ReadCE3.RdStatus.NoError);

            case "ANGLEX10":
                try { AngleX10 = Convert.ToInt32(str2); }
                catch (Exception) {
                    AngleX10 = -1;
                }
                return(ReadCE3.RdStatus.NoError);

            case "+REFNUM": {
                while (readCE3.GetRecord(out _str1, out _str2))
                {
                    if (_str1[0] == '-')
                    {
                        break;
                    }
                    else
                    {
                        if (_str1 == "")
                        {
                            continue;
                        }
                        MbeObj obj;
                        result = MbeObjIO.ReadMbeObj(readCE3, _str1, out obj);
                        if (obj != null && obj.Id() == MbeObjID.MbeText)
                        {
                            refNum = (MbeObjText)obj;
                        }
                    }
                }
                return(result);
            }

            case "+CONTENTS": {
                LinkedList <MbeObj> objLList = new LinkedList <MbeObj>();
                while (readCE3.GetRecord(out _str1, out _str2))
                {
                    if (_str1[0] == '-')
                    {
                        break;
                    }
                    else
                    {
                        if (_str1 == "")
                        {
                            continue;
                        }
                        MbeObj obj;
                        result = MbeObjIO.ReadMbeObj(readCE3, _str1, out obj);
                        if (obj != null)
                        {
                            objLList.AddLast(obj);
                        }
                    }
                }
                int nCount = objLList.Count;
                if (nCount == 0)
                {
                    contentsObj = null;
                    return(result);
                }
                SetContentsWithLinkedList(objLList);
                return(result);
            }

            default:
                return(base.RdMb3Member(str1, str2, readCE3));
            }
        }
Example #6
0
        public static MbeMyStd[] LoadMyStdInfoArray(string str)
        {
            LinkedList <MbeMyStd> infoLList = new LinkedList <MbeMyStd>();

            if (str != null)
            {
                StringReader     stringReader = new StringReader(str);
                ReadCE3.RdStatus result       = ReadCE3.RdStatus.NoError;
                try {
                    ReadCE3 readMb3 = new ReadCE3(stringReader);
                    string  str1;
                    string  str2;
                    while (readMb3.GetRecord(out str1, out str2))
                    {
                        if (str1[0] == '-')
                        {
                            break;
                        }
                        else
                        {
                            MbeMyStd info = null;
                            if (str1 == "")
                            {
                                continue;
                            }
                            else if (str1 == "+PAD_INFO")
                            {
                                info = new PadInfo();
                            }
                            else if (str1 == "+PTH_INFO")
                            {
                                info = new PthInfo();
                            }
                            else if (str1 == "+LINE_INFO")
                            {
                                info = new LineInfo();
                            }
                            else if (str1 == "+ARC_INFO")
                            {
                                info = new ArcInfo();
                            }
                            else if (str1 == "+HOLE_INFO")
                            {
                                info = new HoleInfo();
                            }
                            else if (str1 == "+GRID_INFO")
                            {
                                info = new GridInfo();
                            }
                            else if (str1 == "+TEXT_INFO")
                            {
                                info = new TextInfo();
                            }
                            else if (str1 == "+POLYGON_INFO")
                            {
                                info = new PolygonInfo();
                            }
                            else if (str1 == "+LIB_INFO")
                            {
                                info = new LibInfo();
                            }
                            else if (str1 == "+PPAGE_INFO")
                            {
                                info = new PrintPageLayerInfo();
                            }
                            if (info != null)
                            {
                                result = info.RdMb3(readMb3);
                                if (result == ReadCE3.RdStatus.NoError)
                                {
                                    infoLList.AddLast(info);
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }
                }
                catch {
                }
                finally {
                    stringReader.Dispose();
                }
            }
            MbeMyStd[] infoArray = new MbeMyStd[infoLList.Count];
            int        index     = 0;

            foreach (MbeMyStd info in infoLList)
            {
                infoArray[index] = info;
                index++;
            }

            return(infoArray);
        }