Beispiel #1
0
        public void Parse(String line)
        {
            char[]   charSeparators = new char[] { ' ' };
            String[] items          = line.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries);

            if (items[0] != "DEF")
            {
                throw new Exception("KicadLibDef public class parse error. Another object.");
            }

            Name      = items[1];
            Reference = items[2];
            if (items[3] == "0")
            {
                TextOffset = System.Convert.ToDouble(items[4]);
                DrawPinNumber.Parse(items[5]);
                DrawPinName.Parse(items[6]);
                UnitsCount = System.Convert.ToInt32(items[7]);
                UnitLocked.Parse(items[8]);
                Options.Parse(items[9]);
            }
            else
            {
                throw new Exception("KicadLibDef public class parse error. Missing signature 0.");
            }
        }
Beispiel #2
0
        public void Parse(String[] items)
        {
            if (items[0] != "DEF")
            {
                throw new Exception("KicadLibDef public class parse error. Another object.");
            }

            Name      = items[1];
            Reference = items[2];
            if (items[3] == "0")
            {
                TextOffset = System.Convert.ToDouble(items[4]);
                DrawPinNumber.Parse(items[5]);
                DrawPinName.Parse(items[6]);
                UnitsCount = System.Convert.ToInt32(items[7]);
                UnitLocked.Parse(items[8]);
                Options.Parse(items[9]);
            }
            else
            {
                throw new Exception("KicadLibDef public class parse error. Missing signature 0.");
            }
        }