private void SearchForFirstStud(SWB_point point)
        {
            bool newHeadFlag = true;

            foreach (SWB_point firstPoint in firstPointsOfHead)
            {
                if (firstPoint.toolNumber == point.toolNumber)
                {
                    newHeadFlag = false;
                }
            }

            if (newHeadFlag == true)
            {
                firstPointsOfHead.Add(point);
            }
        }
        private void RefreshProcessPointList()
        {
            for (int i = 0; i < srcArray.Length; i++)
            {
                string line = srcArray[i];
                if (line.Contains(";FOLD PTP <SWBMRA2_"))
                {
                    if (line.Contains("Head"))
                    {
                        SWB_point point = new SWB_point();
                        string[]  words = line.Split(' ', ':', ';', '<', '>');
                        for (int j = 0; j < words.Length; j++)
                        {
                            if (words[j].Contains("SWB"))
                            {
                                point.pointName   = words[j];
                                point.pointNumber = words[j].Substring(words[j].IndexOf("_") + 1);
                            }
                            else if (words[j].Contains("Vel"))
                            {
                                point.velocity = GetNumberFromString(words[j]);
                            }
                            else if (words[j].Contains("PDAT"))
                            {
                                point.PDAT = words[j];
                            }
                            else if (words[j].Contains("Tool"))
                            {
                                point.toolNumber = GetNumberFromString(words[j]);
                                point.toolName   = GetToolName(point.toolNumber);
                            }
                            else if (words[j].Contains("Base"))
                            {
                                point.baseNumber = GetNumberFromString(words[j]);
                                point.baseName   = words[j + 1];
                            }
                            else if (words[j].Contains("Head"))
                            {
                                point.headNumber = GetNumberFromString(words[j]);
                            }
                        }


                        /*point.pointName= line.Substring(line.IndexOf("<") + 1, line.IndexOf(">") - line.IndexOf("<") - 1);
                         * point.pointNumber=point.pointName.Substring(8);
                         * point.toolNumber= line.Substring(line.IndexOf("Tool[") + 5, line.IndexOf("]: Base") - line.IndexOf("Tool[") - 5);*/
                        point.lineInTask = i;

                        if (firstPointLine > i || firstPointLine == 0)
                        {
                            firstPointLine = i;
                        }

                        /*int headstart =line.IndexOf("Head");
                         * point.headNumber = line.Substring(headstart + 5, 1);*/
                        if (point.pointNumber.Length != 7)
                        {
                            errors.Add("Point: " + point.pointName + " has wrong number. Stud number should consist of 7 numbers.");
                        }
                        processPoints.Add(point);
                        SearchForFirstStud(point);
                    }
                    else
                    {
                        string pointName = line.Substring(line.IndexOf("<") + 1, line.IndexOf(">") - line.IndexOf("<") - 1);
                        errors.Add("Point " + pointName + " is not SWB point !");
                    }
                }
                else if (line.Contains(";FOLD Stud.INIT"))
                {
                    initsLines.Add(i);
                }
                else if (line.Contains(";FOLD PTP HP"))
                {
                    Point    point = new Point();
                    string[] words = line.Split(' ', ':', ';');

                    point.lineInTask = i;
                    if (firstPointLine > i || firstPointLine == 0)
                    {
                        firstPointLine = i;
                    }

                    for (int j = 0; j < words.Length; j++)
                    {
                        if (words[j].Contains("HP"))
                        {
                            point.pointName = words[j];
                        }
                        else if (words[j].Contains("Tool"))
                        {
                            point.toolNumber = GetNumberFromString(words[j]);
                            point.toolName   = words[j + 1];
                        }
                        else if (words[j].Contains("Base"))
                        {
                            point.baseNumber = GetNumberFromString(words[j]);
                            point.baseName   = words[j + 1];
                        }
                    }

                    otherPoints.Add(point);
                }
            }
        }