Пример #1
0
        public static sch_text CreateText(string type, string value, PointF pos, float textsize, int orientation, string shape)
        {
            sch_text result = new sch_text();

            result.Type        = type;
            result.Pos         = new Point((int)pos.X, (int)pos.Y);
            result.Orientation = orientation / 90;
            result.TextSize    = (int)textsize;
            result.Shape       = shape;
            result.Value       = value;
            return(result);
        }
Пример #2
0
        public static sch_text CreateNote(string value, PointF pos, float textsize, int orientation, bool italic, bool bold)
        {
            sch_text result = CreateText("Notes", value, pos, textsize, orientation, "~");

            if (italic)
            {
                result.Shape = "Italic";
            }
            else
            {
                result.Shape = "~";
            }

            if (bold)
            {
                result.Param = 12;
            }
            else
            {
                result.Param = 0;
            }
            return(result);
        }
Пример #3
0
        public bool LoadFromFile(string filename, string path)
        {
            string[] lines;
            int index;
            List<Token> tokens;

            try
            {
                lines = File.ReadAllLines(filename);
            }
            catch
            {
                return false;
            }

            this.Filename = Path.GetFileName(filename);

            Items = new List<sch_item_base>();

            index = 0;

            Version = lines[index++];

            LibNames = new List<string>();
            while ((index < lines.Length) && lines[index].StartsWith("LIBS:"))
            {
                LibNames.Add(StringUtils.After(lines[index], ":"));
                index++;
            }

            while ((index < lines.Length) && lines[index].StartsWith("EELAYER"))
            {
                // skip
                index++;
            }

            // $Descr
            index++;

            Encoding = StringUtils.After(lines[index++], " ");

            tokens = Utils.Tokenise(lines[index++]);
            SheetNumber = tokens[1].IntValue;
            SheetCount = tokens[2].IntValue;

            Title = StringUtils.After(lines[index++], " ");
            Date = StringUtils.After(lines[index++], " ");
            Rev = StringUtils.After(lines[index++], " ");
            Company = StringUtils.After(lines[index++], " ");

            Comment = new List<string>();
            while ((index < lines.Length) && lines[index].StartsWith("Comment"))
            {
                Comment.Add(StringUtils.After(lines[index], " "));
                index++;
            }

            // $EndDescr
            index++;

            while ((index < lines.Length) && !lines[index].StartsWith("$EndSCHEMATC"))
            {
                string type = StringUtils.Before(lines[index], " ");

                string[] fields = lines[index].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                switch (type)
                {
                    case "$Comp":
                        {
                            LegacyComponent comp = new LegacyComponent();
                            index++;

                            // L CONN_18 P4
                            comp.Symbol = new PartSpecifier(StringUtils.GetDsvField(lines[index], " ", 1));
                            comp.Reference = StringUtils.GetDsvField(lines[index], " ", 2);
                            index++;

                            while ((index < lines.Length) && !lines[index].StartsWith("$EndComp"))
                            {
                                string token = StringUtils.Before(lines[index], " ");

                                tokens = Utils.Tokenise(lines[index]);

                                switch (token)
                                {
                                    case "F":
                                        {
                                            LegacyField f = new LegacyField();
                                            //TODO: need to handle quoted strings

                                            f.Number = tokens[1].IntValue;
                                            f.Value = tokens[2].Value;
                                            f.Orientation = tokens[3].Value;
                                            f.Pos = new System.Drawing.PointF(tokens[4].IntValue, tokens[5].IntValue);
                                            f.Size = tokens[6].IntValue;

                                            if (tokens[7].Value == "0001")
                                                f.Hidden = true;
                                            else
                                                f.Hidden = false;

                                            f.HorizJustify = tokens[8].Value;

                                            f.VertJustify = tokens[9].Value[0].ToString();
                                            f.Italic = tokens[9].Value[1].ToString();
                                            f.Bold = tokens[9].Value[2].ToString();

                                            if (tokens.Count > 10)
                                                f.UserName = StringUtils.TrimQuotes(tokens[10].Value);

                                            switch (f.Number)
                                            {
                                                case 0:
                                                    comp.fReference = f;
                                                    //? comp.Reference = f.Value;
                                                    break;
                                                case 1:
                                                    comp.fValue = f;
                                                    comp.Value = f.Value;
                                                    break;
                                                case 2:
                                                    comp.fPcbFootprint = f;
                                                    comp.Footprint = f.Value;
                                                    break;
                                                case 3:
                                                    comp.fUserDocLink = f;
                                                    break;
                                                default:
                                                    if (comp.UserFields == null)
                                                        comp.UserFields = new List<LegacyField>();
                                                    comp.UserFields.Add(f);
                                                    break;
                                            }
                                        }
                                        break;

                                    case "U":
                                        comp.N = tokens[1].IntValue;
                                        comp.mm = tokens[2].IntValue;
                                        comp.Timestamp = tokens[3].Value;
                                        break;

                                    case "P":
                                        comp.Position = new PointF((float)tokens[1].AsFloat(), (float)tokens[2].AsFloat());
                                        break;

                                    case "AR":
                                        AlternateRef aref = new AlternateRef();
                                        string value = StringUtils.After(tokens[1].Value, "=");
                                        aref.Path = StringUtils.TrimQuotes(value);
                                        value = StringUtils.After(tokens[2].Value, "=");
                                        aref.Ref = StringUtils.TrimQuotes(value);
                                        value = StringUtils.After(tokens[3].Value, "=");
                                        aref.Part = StringUtils.TrimQuotes(value);

                                        if (aref.Ref != comp.Reference)
                                        {
                                            if (comp.AltRefs == null)
                                                comp.AltRefs = new List<AlternateRef>();
                                            comp.AltRefs.Add(aref);
                                        }
                                        break;

                                    default:
                                        // skip line
                                        index++;

                                        // look for orientation
                                        string t = lines[index];
                                        t = t.Remove(0, 1);

                                        tokens = Utils.Tokenise(t);
                                        comp.SetOrientation (tokens[0].IntValue, tokens[1].IntValue, tokens[2].IntValue, tokens[3].IntValue);
                                        break;
                                }
                                //skip
                                index++;
                            }
                            index++;

                            if (Components == null)
                                Components = new List<ComponentBase>();

                            if (comp.AltRefs == null)
                                Components.Add(comp);
                            else
                            {
                                AlternateRef aref = comp.AltRefs.Find(x => x.Path == path);
                                if (aref != null)
                                {
                                    //todo: ???
                                }

                                Components.Add(comp);
                            }

                            Items.Add(comp);
                        }
                        break;

                    case "$Sheet":
                        {
                            SheetSpecLegacy sheet = new SheetSpecLegacy();
                            while ((index < lines.Length) && !lines[index].StartsWith("$EndSheet"))
                            {
                                tokens = Utils.Tokenise(lines[index]);
                                string token = StringUtils.Before(lines[index], " ");
                                switch (token)
                                {
                                    case "F0":
                                        sheet.Name = new LegacyField (StringUtils.TrimQuotes(tokens[1].Value), tokens[2].GetValueAsInt());
                                        break;
                                    case "F1":
                                        sheet.Filename = new LegacyField(StringUtils.TrimQuotes(tokens[1].Value), tokens[2].GetValueAsInt());
                                        break;
                                    case "S":
                                        sheet.Position = new PointF((float)tokens[1].AsFloat(), (float)tokens[2].AsFloat());
                                        sheet.Size = new PointF((float)tokens[3].AsFloat(), (float)tokens[4].AsFloat());
                                        break;
                                    case "U":
                                        sheet.Timestamp = tokens[1].Value;
                                        break;
                                    default:
                                        break;
                                }
                                index++;
                            }
                            if (SubSheets == null)
                                SubSheets = new List<SheetSpecLegacy>();
                            SubSheets.Add(sheet);
                            index++;
                        }
                        break;

                    case "Wire":
                    case "Entry":
                        {
                            sch_wire wire = new sch_wire();
                            wire.name = type;
                            wire.type = fields[1];
                            wire.type2 = fields[2];
                            index++;

                            fields = lines[index].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                            wire.start = new Point(int.Parse(fields[0]), int.Parse(fields[1]));
                            wire.end = new Point(int.Parse(fields[2]), int.Parse(fields[3]));
                            index++;

                            Items.Add(wire);
                        }
                        break;

                    case "Text":
                        {
                            sch_text text = new sch_text();
                            text.name = type;
                            text.Type = fields[1];
                            text.Pos = new Point(int.Parse(fields[2]), int.Parse(fields[3]));
                            text.Orientation = int.Parse(fields[4]);
                            text.TextSize = int.Parse(fields[5]);
                            text.Shape = fields[6];
                            text.Param = int.Parse(fields[7]);
                            index++;

                            text.Value = lines[index];
                            index++;

                            Items.Add(text);
                        }
                        break;

                    case "NoConn":
                        sch_NoConnect noconn = new sch_NoConnect();
                        noconn.name = type;
                        noconn.dummy = fields[1];
                        noconn.pos = new Point(int.Parse(fields[2]), int.Parse(fields[3]));

                        Items.Add(noconn);
                        index++;
                        break;

                    case "Connection":
                        sch_Junction junction = new sch_Junction();
                        junction.name = type;
                        junction.dummy = fields[1];
                        junction.Pos = new Point(int.Parse(fields[2]), int.Parse(fields[3]));

                        Items.Add(junction);
                        index++;
                        break;

                    default://oops
                        Console.WriteLine("unrecognised: " + type);
                        index++;
                        break;
                }

                //index++;
            }

            return true;
        }
Пример #4
0
        private void ConvertSheet(k.Schema.SchematicLegacy k_schematic, int EagleSheetNumber, string DestName, bool IsMain, int SheetNumber, int NumSheets)
        {
            List <PinConnection> connections = new List <PinConnection>();
            List <LineSegment>   BusLines    = new List <LineSegment>();

            Trace(string.Format("Processing schematic sheet: {0}", EagleSheetNumber + 1));

            Sheet       source_sheet = schematic.Drawing.Schematic.Sheets.Sheet[EagleSheetNumber];
            SheetLegacy k_sheet      = new SheetLegacy();

            k_sheet.Filename    = DestName;
            k_sheet.LibNames    = libraryConverter.LibNames;
            k_sheet.SheetNumber = SheetNumber;
            k_sheet.SheetCount  = NumSheets;

            k_schematic.Sheets.Add(k_sheet);

            if (IsMain)
            {
                k_schematic.MainSheet = k_sheet;
            }

            // first get the page size
            foreach (Instance instance in source_sheet.Instances.Instance)
            {
                // find part ->
                Part part = FindPart(instance.Part);
                if (part == null)
                {
                    continue;
                }

                //
                if (part.Library == "frames")
                {
                    PageStr  = "A4";
                    PageSize = new SizeF(297, 210);

                    ConvertFrame(part.Deviceset);

                    k_sheet.PaperName = PageStr;
                    k_sheet.PageSize  = new SizeF(PageSize.Width * Common.mm_to_mil, PageSize.Height * Common.mm_to_mil);
                    break;
                }
            }

            // text items
            foreach (Text text in source_sheet.Plain.Text)
            {
                bool mirror;

                k.Schema.sch_text k_text = sch_text.CreateNote(
                    text.mText,
                    StrToPointInchFlip(text.X, text.Y),
                    Common.StrToInch(text.Size),
                    Common.xGetAngleFlip(text.Rot, out mirror),
                    false, false);

                switch (Common.GetAngle(text.Rot))
                {
                case 0: break;

                case 90:
                    if (mirror)
                    {
                        k_text.Pos.X += (int)(k_text.TextSize * 1.5f);
                        k_text.Pos.Y -= (int)(k_text.name.Length * k_text.TextSize * 1.5f);
                    }
                    break;

                case 180:
                    k_text.Pos.Y += (int)(k_text.TextSize * 1.5f);
                    break;

                case 270:
                    if (mirror)
                    {
                        //k_text.Pos.X += (int)(k_text.TextSize * 1.5f);
                        k_text.Pos.Y += (int)(k_text.name.Length * k_text.TextSize * 1.7f);
                    }
                    else
                    {
                        k_text.Pos.X += (int)(k_text.TextSize * 1.5f);
                    }
                    break;
                }

                k_sheet.Items.Add(k_text);
            }

            // lines
            foreach (Wire wire in source_sheet.Plain.Wire)
            {
                k.Schema.sch_wire k_line = sch_wire.CreateLine(StrToPointInchFlip(wire.X1, wire.Y1),
                                                               StrToPointInchFlip(wire.X2, wire.Y2));

                k_sheet.Items.Add(k_line);
            }

            #region === (Instance) components ====
            foreach (Instance instance in source_sheet.Instances.Instance)
            {
                // find part ->
                Part part = FindPart(instance.Part);

                if (part == null)
                {
                    Trace("error: Part not found: " + instance.Part);
                    continue;
                }

                if (part.Library == "frames")
                {
                    continue;
                }

                k.Symbol.Symbol k_symbol = FindSymbol(part.Deviceset);

                LegacyComponent k_comp = new LegacyComponent();

                k_comp.Timestamp = GetUniqueTimeStamp();

                // need to flip Y coord
                k_comp.Position = StrToPointInchFlip(instance.X, instance.Y);
                k_comp.Symbol   = new PartSpecifier(part.Deviceset + part.Device);

                // set Reference field
                if (!k_symbol.PowerSymbol)
                {
                    k_comp.Reference = PartMap.GetNewName(instance.Part);
                    if (instance.Part != k_comp.Reference)
                    {
                        Trace(String.Format("note: {0} is renamed {1}", instance.Part, k_comp.Reference));
                    }
                }
                else
                {
                    k_comp.Reference         = k_symbol.Reference;
                    k_comp.fReference.Hidden = !k_symbol.fReference.Text.Visible;
                    k_comp.fReference.Size   = (int)k_symbol.fReference.Text.FontSize;
                }

                // set a default pos/
                k_comp.fReference.Pos          = new PointF(k_comp.Position.X + k_symbol.fReference.Text.Pos.At.X, k_comp.Position.Y + k_symbol.fReference.Text.Pos.At.Y);
                k_comp.fReference.HorizJustify = "L";
                k_comp.fReference.VertJustify  = "B";

                // Set Value field
                if (!string.IsNullOrEmpty(part.Value))
                {
                    k_comp.Value = part.Value;
                }
                else
                {
                    k_comp.Value = k_symbol.fValue.Text.Value;
                }

                k_comp.fValue.Pos          = new PointF(k_comp.Position.X + k_symbol.fValue.Text.Pos.At.X, k_comp.Position.Y + k_symbol.fValue.Text.Pos.At.Y);
                k_comp.fValue.HorizJustify = "L";
                k_comp.fValue.VertJustify  = "B";

                // Set Footprint field
                Device device = libraryConverter.AllDevices.Find(x => x.Name == part.Deviceset + part.Device);
                if (device != null)
                {
                    k_comp.Footprint = part.Library + ":" + device.Package;
                }
                k_comp.fPcbFootprint.Pos    = new PointF(k_comp.Position.X, k_comp.Position.Y);
                k_comp.fPcbFootprint.Hidden = true;

                // User doc field (not used)
                k_comp.fUserDocLink.Pos = new PointF(k_comp.Position.X, k_comp.Position.Y);

                //
                if (k_symbol.NumUnits > 1)
                {
                    int unit = GetUnitNumber(part, instance.Gate);
                    k_comp.N = unit;
                }

                // ---------------------------------
                // Set position, orientation
                ExtRotation instanceRot     = ExtRotation.Parse(instance.Rot);
                bool        instance_mirror = instanceRot.Mirror;
                int         instance_angle  = (int)instanceRot.Rotation;

                if (!string.IsNullOrEmpty(instance.Rot))
                {
                    if (instance_mirror)
                    {
                        k_comp.Rotation = (instance_angle + 180) % 360;
                    }
                    else
                    {
                        k_comp.Rotation = instance_angle;
                    }
                    k_comp.Mirror = instance_mirror;
                }

                foreach (EagleImport.Attribute attrib in instance.Attribute)
                {
                    ExtRotation attrRot     = ExtRotation.Parse(attrib.Rot);
                    bool        attr_mirror = attrRot.Mirror;
                    int         attr_angle  = (int)attrRot.Rotation;

                    //int angle = GetAngle(attrib.Rot);
                    //angle %= 360;
                    //string orientation = (angle == 0) || (angle == 180) ? "H" : "V";

                    k.Symbol.SymbolField sym_field = null;
                    LegacyField          field     = null;
                    switch (attrib.Name)
                    {
                    case "NAME":
                        sym_field = k_symbol.fReference;
                        field     = k_comp.fReference;
                        //field.Pos = new PointF(k_comp.Position.X + k_symbol.fReference.Text.Pos.X, k_comp.Position.Y + k_symbol.fReference.Text.Pos.Y);
                        break;

                    case "VALUE":
                        sym_field = k_symbol.fValue;
                        field     = k_comp.fValue;
                        //field.Pos = new PointF(k_comp.Position.X + k_symbol.fValue.Text.Pos.X, k_comp.Position.Y + k_symbol.fValue.Text.Pos.Y);
                        break;

                        //Part?
                        // voltage, current
                    }

                    if (field != null)
                    {
                        field.Size = (int)Common.StrToInch(attrib.Size);

                        SetFieldAttributes(field, StrToPointInchFlip(attrib.X, attrib.Y),
                                           //sym_field.Text.xAngle, sym_field.Text.xMirror, k_comp.Position, attr_angle, attr_mirror);
                                           instance_angle, k_comp.Mirror, k_comp.Position, attr_angle, attr_mirror);

                        //PointF p = Common.StrToPointInchFlip (attrib.X, attrib.Y);

                        //field.Pos = Common.StrToPointInchFlip(attrib.X, attrib.Y);

                        //debug
                        // field pos rotated about comp pos
                        PointF            p = PointFExt.Rotate(field.Pos, k_comp.Position, k_comp.Rotation);
                        k.Schema.sch_wire k_line;

                        //// field pos  +
                        ////PointF p = field.Pos;
                        //k_line = sch_wire.CreateLine(new PointF(p.X - 25, p.Y), new PointF(p.X + 25, p.Y));
                        //k_sheet.Items.Add(k_line);
                        //k_line = sch_wire.CreateLine(new PointF(p.X, p.Y - 25), new PointF(p.X, p.Y + 25));
                        //k_sheet.Items.Add(k_line);

                        // actual coord of attribute  |__
                        //p = Common.StrToPointInchFlip(attrib.X, attrib.Y);
                        //k_line = sch_wire.CreateLine(new PointF(p.X-50, p.Y), new PointF(p.X + 50, p.Y));
                        //k_sheet.Items.Add(k_line);
                        //k_line = sch_wire.CreateLine(new PointF(p.X, p.Y-50), new PointF(p.X, p.Y + 50));
                        //k_sheet.Items.Add(k_line);
                    }
                }

                //
                AllComponents.Add(k_comp);

                k_sheet.Components.Add(k_comp);
            }
            #endregion

            #region ==== Busses ====
            foreach (Bus bus in source_sheet.Busses.Bus)
            {
                foreach (Segment segment in bus.Segment)
                {
                    foreach (Wire wire in segment.Wire)
                    {
                        k.Schema.sch_wire k_bus = sch_wire.CreateBus(StrToPointInchFlip(wire.X1, wire.Y1),
                                                                     StrToPointInchFlip(wire.X2, wire.Y2));

                        k_sheet.Items.Add(k_bus);

                        BusLines.Add(new LineSegment(Vector2Ext.ToVector2(k_bus.start), Vector2Ext.ToVector2(k_bus.end)));
                    }
                }
            }
            #endregion


            #region ==== (Net) look for wires, junctions, labels ====
            foreach (Net net in source_sheet.Nets.Net)
            {
                foreach (Segment segment in net.Segment)
                {
                    List <Vector2>     snap_points = new List <Vector2>();
                    List <LineSegment> snap_lines  = new List <LineSegment>();

                    foreach (Wire wire in segment.Wire)
                    {
                        PointF start = StrToPointInchFlip(wire.X1, wire.Y1);
                        PointF end   = StrToPointInchFlip(wire.X2, wire.Y2);

                        Vector2 p1 = Vector2Ext.ToVector2(start);
                        Vector2 p2 = Vector2Ext.ToVector2(end);

                        bool is_bus_entry = false;

                        foreach (LineSegment line in BusLines)
                        {
                            if (line.Contains(p1) || line.Contains(p2))
                            {
                                is_bus_entry = true;
                            }
                        }

                        if (is_bus_entry)
                        {
                            sch_wire k_wire = sch_wire.CreateWireToBusEntry(start, end);
                            k_sheet.Items.Add(k_wire);
                        }
                        else
                        {
                            sch_wire k_wire = sch_wire.CreateWire(start, end);
                            k_sheet.Items.Add(k_wire);
                            //snap_points.Add(Vector2Ext.ToVector2(k_wire.start));
                            //snap_points.Add(Vector2Ext.ToVector2(k_wire.end));
                            snap_lines.Add(new LineSegment(Vector2Ext.ToVector2(k_wire.start), Vector2Ext.ToVector2(k_wire.end)));
                        }
                    }

                    foreach (Junction junction in segment.Junction)
                    {
                        sch_Junction k_junction = new sch_Junction(StrToPointInchFlip(junction.X, junction.Y));
                        k_sheet.Items.Add(k_junction);

                        snap_points.Add(Vector2Ext.ToVector2(k_junction.Pos));
                    }

                    //todo: add gate positions to snap_points

                    foreach (Pinref pinref in segment.Pinref)
                    {
                        Part            part     = FindPart(pinref.Part);
                        k.Symbol.Symbol k_symbol = FindSymbol(part.Deviceset);

                        // get comp ...

                        PinConnection connect = connections.Find(x => x.Part == part && x.GateId == pinref.Gate && x.PinName == pinref.Pin);
                        if (connect == null)
                        {
                            connect = new PinConnection(net.Name, part, pinref.Gate, pinref.Pin);
                            connections.Add(connect);
                        }
                    }

                    foreach (Label label in segment.Label)
                    {
                        ExtRotation rot = ExtRotation.Parse(label.Rot);

                        int angle = (int)rot.Rotation;
                        if (rot.Mirror)
                        {
                            if ((angle % 180) == 0)
                            {
                                angle = 180 - angle;
                            }
                        }
                        //angle %= 360;
                        sch_text k_text = sch_text.CreateLocalLabel(net.Name,
                                                                    StrToPointInchFlip(label.X, label.Y),
                                                                    Common.StrToInch(label.Size),
                                                                    angle);

                        // find nearest point
                        //k_text.Pos = FindSnapPoint(snap_points, k_text.Pos);
                        k_text.Pos = FindNearestPoint(snap_points, snap_lines, Vector2Ext.ToVector2(StrToPointInchFlip(label.X, label.Y)));

                        k_sheet.Items.Add(k_text);

                        AllLabels.Add(new PinConnection(k_text, k_sheet));
                    }
                }
            }
            #endregion

            #region add no-connects
            if (option_add_no_connects)
            {
                foreach (Instance instance in source_sheet.Instances.Instance)
                {
                    // find part ->
                    Part part = FindPart(instance.Part);
                    if (part == null)
                    {
                        //Trace("Part not found: " + instance.Part);
                        continue;
                    }

                    if (part.Library == "frames")
                    {
                        continue;
                    }

                    k.Symbol.Symbol k_symbol = FindSymbol(part.Deviceset);

                    //
                    List <PinConnection> pins = connections.FindAll(x => x.Part.Name == instance.Part && x.GateId == instance.Gate);
                    foreach (PinConnection p in pins)
                    {
                        //    Trace(string.Format("Part {0,-10} Gate {1,-10} Pin {2,-10} Net {3,-10}", p.Part.Name, p.GateId, p.PinName, p.NetLabel));
                    }

                    //
                    List <PinConnection> NoConnects = new List <PinConnection>();

                    Symbol symbol = FindSymbol(part, instance.Gate);

                    foreach (Pin pin in symbol.Pin)
                    {
                        PinConnection conn = connections.Find(x => x.Part == part && x.GateId == instance.Gate && x.PinName == pin.Name);
                        if (conn == null)
                        {
                            //Trace(string.Format("Part {0,-10} Gate {1,-10} Pin {2,-10}", part.Name, instance.Gate, pin.Name));
                            NoConnects.Add(new PinConnection(null, part, instance.Gate, pin.Name));

                            // todo: add no-connects
                            PointF instance_pos = StrToPointInchFlip(instance.X, instance.Y);
                            PointF pin_pos      = Common.StrToPointInch(pin.X, pin.Y);

                            ExtRotation rot = ExtRotation.Parse(instance.Rot);

                            pin_pos = PointFExt.Rotate(pin_pos, (int)rot.Rotation);
                            if (rot.Mirror)
                            {
                                pin_pos = new PointF(-pin_pos.X, pin_pos.Y);
                            }

                            PointF pos = new PointF(instance_pos.X + pin_pos.X, instance_pos.Y - pin_pos.Y);

                            sch_NoConnect k_noconn = new sch_NoConnect(pos);
                            k_sheet.Items.Add(k_noconn);
                        }
                    }
                }
            }

            #endregion
        }