Ejemplo n.º 1
0
        private void SaveMyStandard()
        {
            int count = listBoxMyStandard.Items.Count;

            PolygonInfo[] myStdInfoArray = new PolygonInfo[count];
            for (int i = 0; i < count; i++)
            {
                myStdInfoArray[i] = (PolygonInfo)(listBoxMyStandard.Items[i]);
            }
            Properties.Settings.Default.MyStandardPolygonString = MbeMyStd.SaveMyStdInfoArray(myStdInfoArray);
        }
Ejemplo n.º 2
0
        private void buttonDown_Click(object sender, EventArgs e)
        {
            int index = listBoxMyStandard.SelectedIndex;

            if ((listBoxMyStandard.Items.Count - 1) <= index)
            {
                buttonDown.Enabled = false;
                return;
            }
            PolygonInfo myStdInfo = (PolygonInfo)(listBoxMyStandard.Items[index]);

            listBoxMyStandard.Items.RemoveAt(index);
            index++;
            listBoxMyStandard.Items.Insert(index, myStdInfo);
            listBoxMyStandard.SelectedIndex = index;
        }
Ejemplo n.º 3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            PolygonInfo info = obj as PolygonInfo;

            if ((System.Object)info == null)
            {
                return(false);
            }

            return(traceWidth == info.traceWidth &&
                   patternGap == info.patternGap);
        }
Ejemplo n.º 4
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            if (!CheckInputValue())
            {
                return;
            }

            PolygonInfo newInfo = new PolygonInfo();

            newInfo.TraceWidth = traceWidth;
            newInfo.PatternGap = patternGap;

            int  count     = listBoxMyStandard.Items.Count;
            bool existFlag = false;

            for (int i = 0; i < count; i++)
            {
                if (newInfo.Equals((PolygonInfo)(listBoxMyStandard.Items[i])))
                {
                    existFlag = true;
                    break;
                }
            }
            if (existFlag)
            {
                return;
            }


            int index = listBoxMyStandard.SelectedIndex;

            if (index < 0)
            {
                index = 0;
            }
            listBoxMyStandard.Items.Insert(index, newInfo);
            listBoxMyStandard.SelectedIndex = -1;
        }
Ejemplo n.º 5
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);
        }