public Station(Shot shot) { this.From = shot.From; this.To = shot.To; this.Distance = shot.Distance; this.Azimuth = shot.Azimuth; this.Inclination = shot.Inclination; this.Comment = shot.Comment; this.flags = shot.flags; this.roll = shot.roll; this.tripIndex = shot.tripIndex; }
private uint LoadSurvexFile(StreamReader b) { uint noShots = 0; int prefix = 600; int prefixAdd = 0; Dictionary<string, int> rPrefix = new Dictionary<string, int>(); while (!b.EndOfStream) { string line = b.ReadLine(); if (line.Trim().Length == 0) continue; List<string> splittedLine = Regex.Split(line, "[\\s]+").ToList(); if (splittedLine[0].Contains(";") || splittedLine[0].Contains("*")) { if (splittedLine[0].Contains("begin")) { rPrefix.Add(splittedLine[1], prefix); int.TryParse(Regex.Match(line, "\\d+").Value, out prefixAdd); } else if (splittedLine[0].Contains("equate")) { string equate0 = splittedLine[1]; string equate1 = splittedLine[2]; Shot connectingShot = new Shot(equate0, equate1, prefix, rPrefix, prefixAdd); this.Shots.Add(connectingShot); noShots += 1; } else { //if (splittedLine[0].Contains("end")) prefix += 1; continue; } } if(splittedLine.Count < 5){ continue; } Shot newShot = new Shot(splittedLine, prefix, prefixAdd); this.Shots.Add(newShot); noShots += 1; } return noShots; }