Exemplo n.º 1
0
        private void SpreadUsed(Node nd)
        {
            NodeTraces curTrace = new NodeTraces();

            List<int> fixedConnection = new List<int>();
            List<int> currentConnection = new List<int>();
            for (int i = 0; i < nd.arcCollection.Count; i++)
            {
                if (currentConnection.FindIndex(el => el == i) < 0)
                {
                    List<int> curList = nodeDistanceDict[nd.name].GetConnectedPoints(i);
                    int curStart = curList.Min();
                    currentConnection.Add(curStart);

                    foreach (int curEnd in curList)
                    {
                        if (currentConnection.FindIndex(el => el == curEnd) < 0) //(curStart != curEnd)
                        {
                            int numbFixedWith = nodeDistanceDict[nd.name].GetFixedPointTo(curEnd);
                            if ((numbFixedWith >= 0))
                                fixedConnection.Add(curEnd);
                                //curTrace.AddTrace(RecoveryFixedPath(nd.arcCollection[curEnd], nd.name));

                            if (numbFixedWith != curStart)
                            {
                                NodeTraces recPath = RecoveryUnicPath(curTrace.lines, nd.arcCollection[curEnd],
                                                           nd.arcCollection[curStart], nd.name);

                                if ((numbFixedWith >= 0) && (recPath.lines.Count > 0) &&
                                    (recPath.lines.FindIndex(el => (el.type != Material.na_ && el.type != Material.pa_)) >= 0) )
                                {
                                    currentConnection.Add(numbFixedWith);
                                }
                                curTrace.AddTrace(recPath);
                            }
                            currentConnection.Add(curEnd);//!!!!!!!
                        }
                    }
                }
            }
            foreach(int curEnd in fixedConnection)
                curTrace.AddTrace(RecoveryFixedPath(nd.arcCollection[curEnd], nd.name));

            SetUsed(curTrace);
        }
Exemplo n.º 2
0
        /*
        private NodeTraces GetNodeTrace_old(Node nd, System.IO.StreamWriter file)//better
        {
            NodeTraces allNodeTrace = new NodeTraces();

            List<int> currentConnection = new List<int>();
            for (int i = 0; i < nd.arcCollection.Count; i++)
            {
                if (currentConnection.FindIndex(el => el == i) < 0)
                {
                    List<int> curList = nodeDistanceDict[nd.name].GetConnectedPoints(i);
                    int curStart = curList.Min();

                    if (nd.name == "VCC")
                    {
                        //PrintUsed(0, file);
                        PrintNumb(0, file);
                    }

                    foreach (int curEnd in curList)
                    {
                        if (curStart != curEnd)
                        {
                            NodeTraces curTrace = new NodeTraces();

                            int numbFixedWith = nodeDistanceDict[nd.name].GetFixedPointTo(curEnd);
                            if ((numbFixedWith >= 0) && (currentConnection.FindIndex(el => el == numbFixedWith) >= 0))
                                curTrace.AddTrace(RecoveryFixedPath(nd.arcCollection[curEnd], nd.name));
                            else
                                curTrace.AddTrace(RecoveryPath(nd.arcCollection[curEnd],
                                                           nd.arcCollection[curStart], nd.name));
                            currentConnection.Add(curEnd);

                            //SetUsed(curTrace);

                            //ReplaceUnused procRemove = new ReplaceUnused(0, GetPoint(startPoint).priority, false);
                            //SpreadWaveProcess(startPoint, procRemove);

                            allNodeTrace.AddTrace(curTrace);
                        }
                    }

                    if (nd.name == "VCC")
                    {
                        PrintUsed(0, file);
                        //PrintNumb(0, file);
                    }
                }
            }
            return allNodeTrace;
        }*/
        private NodeTraces GetNodeTrace(Node nd, System.IO.StreamWriter file)
        {
            SetAllUnused();

            NodeTraces allNodeTrace = new NodeTraces();
            //NodeTraces extraNodeTrace = new NodeTraces();

            List<ContactSimple> inters = new List<ContactSimple>();
            inters.Add(nd.arcCollection[0]);
            //List<LineStruct> lines = new List<LineStruct>();
            //if (diffusionException.FindIndex(nameUnit => nameUnit == nd.name) >= 0)
            //	allNodeTrace.lines.Add( GetFixedLine(inters, inters[0].layer, nd.name) );

            List<int> currentConnection = new List<int>();
            for (int i = 0; i < nd.arcCollection.Count; i++)
            {

                if (currentConnection.FindIndex(el => el == i) < 0)
                {
                    List<int> curList = nodeDistanceDict[nd.name].GetConnectedPoints(i);
                    int curStart = curList.Min();

                    foreach (int curEnd in curList)
                    {
                        if (curStart != curEnd)
                        {
                            //NodeTraces curTrace = new NodeTraces();

                            int numbFixedWith = nodeDistanceDict[nd.name].GetFixedPointTo(curEnd);
                            if ((curStart == numbFixedWith) && (diffusionException.FindIndex(nameUnit => nameUnit == nd.name) >= 0))
                                allNodeTrace.AddTrace(RecoveryFixedPath(nd.arcCollection[curEnd], nd.name));
                            else
                                allNodeTrace.AddTrace(RecoveryUnicPath(allNodeTrace.lines, nd.arcCollection[curEnd],
                                                           nd.arcCollection[curStart], nd.name));
                            currentConnection.Add(curEnd);

                            //allNodeTrace.AddTrace(curTrace);
                        }
                    }
                }
            }

            //allNodeTrace.DefineCrossContacts(this);
            //allNodeTrace.AddTrace(extraNodeTrace);

            return allNodeTrace;
        }