Пример #1
0
        public void CheckNets(AltiumParser parser)
        {
            ConnectedNets = new List <Net>();

            foreach (var net in parser.Nets)
            {
                if (net.Connection.IsMatch(Connection))
                {
                    ConnectedNets.Add(net);
                }
            }

            if (ConnectedWires.Count != 0)
            {
                foreach (var wire in ConnectedWires)
                {
                    foreach (var net in parser.Nets)
                    {
                        if (wire.DotIsOnLine(net.Connection))
                        {
                            if (!ConnectedNets.Exists(x => x.UniqueId == net.UniqueId))
                            {
                                ConnectedNets.Add(net);
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
        public void CheckPowerPorts(AltiumParser parser)
        {
            ConnectedPowerPorts = new List <PowerPort>();

            foreach (var powerport in parser.PowerPorts)
            {
                if (powerport.Connection.IsMatch(Connection))
                {
                    ConnectedPowerPorts.Add(powerport);
                }
            }

            if (ConnectedWires.Count != 0)
            {
                foreach (var wire in ConnectedWires)
                {
                    foreach (var powerport in parser.PowerPorts)
                    {
                        if (wire.DotIsOnLine(powerport.Connection))
                        {
                            if (!ConnectedPowerPorts.Exists(x => x.UniqueId == powerport.UniqueId))
                            {
                                ConnectedPowerPorts.Add(powerport);
                            }
                        }
                    }
                }
            }
        }
Пример #3
0
        public void CheckPorts(AltiumParser parser)
        {
            ConnectedPorts = new List <Port>();

            foreach (var port in parser.Ports)
            {
                foreach (var connectiondot in port.ConnectionsDots)
                {
                    if (connectiondot.IsMatch(Connection))
                    {
                        ConnectedPorts.Add(port);
                    }
                }
            }

            if (ConnectedWires.Count != 0)
            {
                foreach (var wire in ConnectedWires)
                {
                    foreach (var port in parser.Ports)
                    {
                        foreach (var connectiondot in port.ConnectionsDots)
                        {
                            if (wire.ContainsDot(connectiondot))
                            {
                                if (!ConnectedPorts.Exists(x => x.UniqueId == port.UniqueId))
                                {
                                    ConnectedPorts.Add(port);
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #4
0
        public void Init(AltiumParser parser)
        {
            SheetEntriesList     = new List <SheetEntry>();
            AdditionalParameters = new List <Parameter>();

            foreach (var sheetEntry in parser.SheetEntries)
            {
                if (sheetEntry.OwnerIndex == Id)
                {
                    SheetEntriesList.Add(sheetEntry);
                }
            }

            foreach (var sheetName in parser.SheetsNames)
            {
                if (sheetName.OwnerIndex == Id)
                {
                    SheetName = sheetName;
                }
            }

            foreach (var parameter in parser.Parameters)
            {
                if (parameter.OwnerIndex == Id)
                {
                    AdditionalParameters.Add(parameter);
                }
            }

            foreach (var sheetFile in parser.SheetFiles)
            {
                if (sheetFile.OwnerIndex == Id)
                {
                    SheetFile = sheetFile;
                }
            }

            foreach (var sheetEntry in SheetEntriesList)
            {
                if (sheetEntry.Side == 0)
                {
                    sheetEntry.Connection = new Dot(TopLeftConer.X, TopLeftConer.Y - sheetEntry.CombinedDistanceFromTop);
                }
                else
                {
                    sheetEntry.Connection = new Dot(TopRightConer.X, TopRightConer.Y - sheetEntry.CombinedDistanceFromTop);
                }
            }

            foreach (var sheetEntry in SheetEntriesList)
            {
                sheetEntry.CheckWires(parser);
                sheetEntry.CheckNets(parser);
                sheetEntry.CheckPorts(parser);
                sheetEntry.CheckPowerPorts(parser);
                sheetEntry.GetConnections();
            }
        }
Пример #5
0
        public void Init(AltiumParser parser)
        {
            PinList = new List <Pin>();
            AdditionalParameters = new List <Parameter>();

            foreach (var pin in parser.Pins)
            {
                if (pin.OwnerIndex == Id && pin.OwnerpartId == CurrentPartId)
                {
                    PinList.Add(pin);
                }
            }


            foreach (var designator in parser.Designators)
            {
                if (designator.OwnerIndex == Id)
                {
                    Designator = designator;
                }
            }

            foreach (var parameter in parser.Parameters)
            {
                if (parameter.OwnerIndex == Id)
                {
                    AdditionalParameters.Add(parameter);
                }
            }

            foreach (var pin in PinList)
            {
                pin.CheckWires(parser);
                pin.CheckNets(parser);
                pin.CheckPorts(parser);
                pin.CheckPowerPorts(parser);
                pin.GetConnections();
            }
        }
Пример #6
0
        public void CheckWires(AltiumParser parser)
        {
            ConnectedWires = new List <Wire>();

            foreach (var wire in parser.Wires)
            {
                foreach (var wireDot in wire.WireDotList)
                {
                    if (wireDot.IsMatch(Connection))
                    {
                        ConnectedWires.Add(wire);
                        break;
                    }
                }
            }

            if (ConnectedWires.Count != 0)
            {
                var isupdated = true;

                while (isupdated)
                {
                    isupdated = false;

                    foreach (var wire in parser.Wires)
                    {
                        if (!ConnectedWires.Exists(w => w.UniqueId == wire.UniqueId))
                        {
                            for (int i = 0; i < ConnectedWires.Count; i++)
                            {
                                var connectedWire = ConnectedWires.ElementAt(i);
                                foreach (var connectedwireDot in connectedWire.WireDotList)
                                {
                                    foreach (var wireDot in wire.WireDotList)
                                    {
                                        if (connectedwireDot.IsMatch(wireDot))
                                        {
                                            foreach (var junction in parser.Junctions)
                                            {
                                                if (junction.Connection.IsMatch(wireDot))
                                                {
                                                    if (!ConnectedWires.Exists(w => w.UniqueId == wire.UniqueId))
                                                    {
                                                        ConnectedWires.Add(wire);
                                                        isupdated = true;
                                                    }
                                                }

                                                if (isupdated)
                                                {
                                                    break;
                                                }
                                            }

                                            if (isupdated)
                                            {
                                                break;
                                            }
                                        }

                                        if (isupdated)
                                        {
                                            break;
                                        }
                                    }

                                    if (isupdated)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }