示例#1
0
        public List<ContactSimple> ReturnAllWaveProcess(List<ContactSimple> inStart, NodePointProcess pntProcess)
        {
            string currentName = layoutMap[inStart[0].x][inStart[0].y][inStart[0].layer].name;

            List<ContactSimple> nextPoints = new List<ContactSimple>();//inStart.GetArroundPoints(wide);
            nextPoints.AddRange(inStart);
            List<ContactSimple> arround = new List<ContactSimple>();
            List<ContactSimple> passedPoints = new List<ContactSimple>();
            if (diffusionException.FindIndex(el => el == currentName) >= 0)
            {
                List<ContactSimple> thisWave = SetOneWave(nextPoints, passedPoints, pntProcess, currentName);
                SetOneWave(thisWave, passedPoints, pntProcess, currentName);
                nextPoints.AddRange(thisWave);
                passedPoints.AddRange(thisWave);
            }
            passedPoints.AddRange(inStart);

            do
            {
                arround.Clear();
                foreach (ContactSimple cntOneLay in nextPoints)
                {
                    foreach (int layer in Params.allLayersRange[cntOneLay.layer])//GetOppositeLayers(cntOneLay.layer))
                    {
                        ContactSimple cnt = new ContactSimple(cntOneLay, layer);
                        if ( IsPointsConnected(cnt, cntOneLay.layer, layer, currentName) )//GetPoint(cnt).name == currentName)
                        {
                            foreach (ContactSimple cntNebor in cnt.GetArroundPoints(wide))
                            {
                                if ( (GetPoint(cntNebor).name == currentName) &&
                                (passedPoints.FindIndex(el => el == cntNebor) < 0) &&
                                (arround.FindIndex(el => el == cntNebor) < 0) )
                                {
                                    NodePoint pn1 = GetPoint(cntNebor);
                                    NodePoint pn2 = GetPoint(cntOneLay);
                                    if ( pn1.numberNode != pn2.numberNode)
                                        pn1 = GetPoint(cntNebor);

                                    arround.Add(cntNebor);
                                }
                                /*{
                                    if ((cntNebor.layer != cntOneLay.layer) && (cntNebor.layer == Layers.siliconTrace ||
                                                                            cntOneLay.layer == Layers.siliconTrace) &&
                                                                           (GetPoint(cntNebor, Layers.contactTrace).name == Material.diffusionName) )
                                        ;
                                    else
                                    {
                                        NodePoint pn1 = GetPoint(cntNebor);
                                        NodePoint pn2 = GetPoint(cntOneLay);
                                        if ( pn1.numberNode != pn2.numberNode)
                                            pn1 = GetPoint(cntNebor);
                                        if ( cntNebor.x == 31 && (cntNebor.y == 21 || cntNebor.y == 22) && cntNebor.layer == 1)
                                            pn1 = GetPoint(cntNebor);

                                        arround.Add(cntNebor);
                                    }
                                }*/
                            }
                            if (GetPoint(cnt).isSource)
                            {
                                NodePoint np2 = GetPoint(cnt);
                                if (cnt.x == 19 && cnt.y == 33 && cnt.layer == 1)
                                    np2 = GetPoint(cnt);

                                foreach (ContactSimple cntNebor in GetSourceContacts(cnt, currentName))
                                {
                                    NodePoint np1 = GetPoint(cntNebor);
                                    if (cnt.x == 19 && cnt.y == 33 && cnt.layer == 1)
                                        np1 = GetPoint(cntNebor);

                                    if ( GetPoint(cntNebor).isSource && (GetPoint(cntNebor).name == currentName) &&
                                    (passedPoints.FindIndex(el => el == cntNebor) < 0) &&
                                    (arround.FindIndex(el => el == cntNebor) < 0) )//&& FindSource(cnt) && FindSource(cntNebor) )
                                    {
                                        NodePoint pn1 = GetPoint(cntNebor);
                                        NodePoint pn2 = GetPoint(cntOneLay);
                                        if ( pn1.numberNode != pn2.numberNode)
                                            pn1 = GetPoint(cntNebor);

                                        arround.Add(cntNebor);
                                    }
                                }
                            }
                        }
                    }
                }
                nextPoints.Clear();
                nextPoints.AddRange(arround);
                passedPoints.AddRange(arround);

                pntProcess.IncrementNumber();

                bool continueMark  = false;
                do
                {
                    List<ContactSimple> wave = SetOneWave(arround, passedPoints, pntProcess, currentName);
                    nextPoints.AddRange(wave);
                    passedPoints.AddRange(wave);

                    arround = wave;
                    continueMark = false;
                    if (wave.Count > 0)
                        continueMark = true;
                } while (continueMark);
                //passedPoints.AddRange(nextPoints);

                    /*if (cntUnit.x == 14 && cntUnit.y == 5 && cntUnit.layer == Layers.siliconTrace)
                        b = true;*/
            } while (nextPoints.Count > 0);

            NodePoint np3 = GetPoint(inStart[0]);
            foreach(ContactSimple cnt in passedPoints)
            {
                if (cnt.x == 35 && cnt.y == 37 && cnt.layer == 1)
               			np3 = GetPoint(cnt);
            }

            return passedPoints;
        }
示例#2
0
        public int CompleteSpreadWaveProcessRem(List<ContactSimple> inStart, NodePointProcess pntProcess)
        {
            string currentName = layoutMap[inStart[0].x][inStart[0].y][inStart[0].layer].name;

            List<ContactSimple> nextPoints = new List<ContactSimple>(inStart);//inStart.GetArroundPoints(wide);
            //nextPoints.AddRange(inStart);
            List<ContactSimple> arround = new List<ContactSimple>();
            List<ContactSimple> passedPoints = new List<ContactSimple>(inStart);
            //if (diffusionException.FindIndex(el => el == currentName) >= 0)
            {
                List<ContactSimple> thisWave = SetOneWave(nextPoints, passedPoints, pntProcess, currentName);
                SetOneWave(thisWave, passedPoints, pntProcess, currentName);
                nextPoints.AddRange(thisWave);
                passedPoints.AddRange(thisWave);
            }
            //passedPoints.AddRange(inStart); 22 step!!!!!!!!!!! VCC

            do
            {
                /*bool continueMark  = false;
                do
                {
                    List<ContactSimple> wave = SetOneWave(nextPoints, passedPoints, pntProcess, currentName);
                    nextPoints.AddRange(wave);
                    passedPoints.AddRange(wave);

                    arround = wave;
                    continueMark = false;
                    if (wave.Count > 0)
                        continueMark = true;
                } while (continueMark);
                */

                foreach (ContactSimple cntOneLay in nextPoints)
                {
                        //if (GetPoint(cnt).name == currentName)
                        //{
                    foreach (ContactSimple cntNebor in cntOneLay.GetArroundPoints(wide))
                    {
                        if ( (GetPoint(cntNebor).name == currentName) &&
                            (passedPoints.FindIndex(el => el == cntNebor) < 0) &&
                            (arround.FindIndex(el => el == cntNebor) < 0) )
                        {
                            SetPoinProcess(cntNebor, cntNebor, pntProcess);
                            arround.Add(cntNebor);

                            //foreach (int layer in Params.GetOppositeLayers(cntNebor.layer))
                            foreach (ContactSimple cnt in GetPointsInLayers(cntNebor, currentName))
                            {
                                //ContactSimple cnt = new ContactSimple(cntNebor, layer);

                                if ( //IsPointsConnected(cnt, cntNebor.layer, layer, currentName) &&
                                (passedPoints.FindIndex(el => el == cnt) < 0) &&
                                (arround.FindIndex(el => el == cnt) < 0) )
                                {
                                    if (SetPoinProcess(cntNebor, cnt, pntProcess))
                                    {
                                        arround.Add(cnt);

                                        if (GetPoint(cnt).isSource)
                                        {
                                            foreach (ContactSimple sourceContact in GetSourceContacts(cnt, currentName))
                                            {
                                                if ( GetPoint(sourceContact).isSource && FindTrueSource(sourceContact) && (GetPoint(sourceContact).name == currentName) &&
                                                (passedPoints.FindIndex(el => el == sourceContact) < 0) &&
                                                (arround.FindIndex(el => el == sourceContact) < 0) )//&& FindSource(cnt) && FindSource(cntNebor) )
                                                {
                                                    SetPoinProcess(sourceContact, sourceContact, pntProcess);
                                                    arround.Add(sourceContact);
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                            if (GetPoint(cntNebor).isSource)
                            {
                                foreach (ContactSimple sourceContact in GetSourceContacts(cntNebor, currentName))
                                {
                                    if ( GetPoint(sourceContact).isSource && FindTrueSource(sourceContact) && (GetPoint(sourceContact).name == currentName) &&
                                    (passedPoints.FindIndex(el => el == sourceContact) < 0) &&
                                    (arround.FindIndex(el => el == sourceContact) < 0) )//&& FindSource(cnt) && FindSource(cntNebor) )
                                    {
                                        SetPoinProcess(sourceContact, sourceContact, pntProcess);
                                        arround.Add(sourceContact);
                                    }
                                }
                            }
                        }
                    }

                }

                nextPoints.Clear();
                nextPoints.AddRange(arround);
                passedPoints.AddRange(arround);

                pntProcess.IncrementNumber();

                arround.Clear();

            } while (nextPoints.Count > 0);

            return passedPoints.Count;
        }