public List <string> MainAction(List <string> dataFromFile, List <string[]> HeightCorrect, bool IsGSI_16)
        {
            List <string> result  = new List <string>();
            List <string> middle  = new List <string>();
            Station       station = new Station();

            foreach (var item in dataFromFile)
            {
                if (item.Contains("41") & item.Contains("?..."))
                {
                    station.AllMoveDistance             = 0;
                    station.ComulativeSholders          = 0;
                    station.ComulativeStationDifference = 0;
                    station.GroundHeight = 0;
                    middle.Clear();
                }
                if (item.Contains("571.08") && item.Contains("83..08"))
                {
                    middle.Add(item);
                    result.AddRange(RecaculateStation(middle, HeightCorrect, station, IsGSI_16));
                    middle.Clear();
                    continue;
                }
                middle.Add(item);
            }
            return(CONVERT.ChangeNumeric(result, IsGSI_16));
        }
Exemple #2
0
        static public List <string> CreateFile(List <string> data, bool IsGSI_16)
        {
            List <string> result           = new List <string>();
            int           currentCountLine = 0;
            int           startCountLine   = 0;

            string[] forCopy;

            foreach (var item in data)
            {
                if (currentCountLine == 0 & item.Contains("41") && item.Contains("?..."))
                {
                    currentCountLine++;
                    continue;
                }
                if (currentCountLine > 0 & item.Contains("41") && item.Contains("?..."))
                {
                    if (startCountLine > 0)
                    {
                        currentCountLine -= 1;
                        forCopy           = new string[currentCountLine - startCountLine];
                        data.CopyTo(startCountLine, forCopy, 0, currentCountLine - startCountLine);
                        result.AddRange(DivideIn2Move(forCopy, IsGSI_16).Item1);
                        result.AddRange(DivideIn2Move(forCopy, IsGSI_16).Item2);
                        startCountLine = currentCountLine;
                        currentCountLine++;
                    }
                    else
                    {
                        forCopy = new string[currentCountLine - startCountLine];
                        data.CopyTo(startCountLine, forCopy, 0, currentCountLine - startCountLine);
                        result.AddRange(DivideIn2Move(forCopy, IsGSI_16).Item1);
                        result.AddRange(DivideIn2Move(forCopy, IsGSI_16).Item2);
                        startCountLine = currentCountLine;
                        currentCountLine++;
                    }
                }
                if (currentCountLine == data.Count)
                {
                    forCopy = new string[currentCountLine - startCountLine];
                    data.CopyTo(startCountLine, forCopy, 0, currentCountLine - startCountLine);
                    result.AddRange(DivideIn2Move(forCopy, IsGSI_16).Item2);
                    result.AddRange(DivideIn2Move(forCopy, IsGSI_16).Item1);
                    startCountLine = currentCountLine;
                    currentCountLine++;
                }
                currentCountLine++;
            }
            if (result.Count == 0)
            {
                forCopy = new string[currentCountLine - startCountLine];
                data.CopyTo(startCountLine, forCopy, 0, currentCountLine - startCountLine);
                result.AddRange(DivideIn2Move(forCopy, IsGSI_16).Item1);
                result.AddRange(DivideIn2Move(forCopy, IsGSI_16).Item2);
            }
            return(CONVERT.ChangeNumeric(result, IsGSI_16));
        }