public MetarElement(MetarElementType value, string str) { ElementType = value; SubString = str; if (ElementType != MetarElementType.SurfaceWind) { System.Console.WriteLine("MetarElement type : " + ElementTypeStr() + " " + SubString); } }
public MetarWind(MetarElementType value, string str, string units) : base(value, str) { // parse the str for speed and direction Direction = (int)Convert.ToInt32((str.Substring(0, 3))); Speed = (int)Convert.ToInt32((str.Substring(3, 2))); Units = units; int i = 0; i = str.IndexOf("G"); if ((i == 5) || (i == 6)) { // has gusts Gust = (int)Convert.ToInt32((str.Substring(i + 1, 2))); Console.WriteLine("Gusts {0}", Gust); } i = str.IndexOf("&"); if (i >= 0) { Extension = str.Substring(i); } System.Console.WriteLine("MetarElement type : " + ElementTypeStr() + " " + SubString); }
public MetarWind(MetarElementType value, string str, int Speed, int Direction) : base(value, str) { }