public double getCoordinate() { int degrees = int.Parse(degreeEntry.Text); if (directionCombo.Active == 1) degrees = degrees *-1; double minutes = double.Parse(minuteEntry.Text, CultureInfo.InvariantCulture); ocmengine.DegreeMinutes conv = new ocmengine.DegreeMinutes(degrees, minutes); return conv.GetDecimalDegrees(); }
public void SetCoordinate(double coord, bool isLat) { ocmengine.DegreeMinutes conv = new ocmengine.DegreeMinutes(coord); SetLatBox(isLat); if (conv.Degrees < 0) { degreeEntry.Text = (conv.Degrees * -1).ToString(); directionCombo.Active = 1; } else { degreeEntry.Text = conv.Degrees.ToString(); directionCombo.Active = 0; } minuteEntry.Text = conv.Minutes.ToString("0.000", CultureInfo.InvariantCulture); }
public void SetCoordinate(double coord, bool isLat) { System.Console.WriteLine(coord); ocmengine.DegreeMinutes conv = new ocmengine.DegreeMinutes(coord); SetLatBox(isLat); if (coord < 0) { degreeEntry.Text = (conv.Degrees * -1).ToString(); directionCombo.Active = 1; } else { degreeEntry.Text = conv.Degrees.ToString(); directionCombo.Active = 0; } minuteEntry.Text = conv.Minutes.ToString("0.000", CultureInfo.InvariantCulture); }
public double getCoordinate() { int degrees = int.Parse(degreeEntry.Text); bool isNeg = false; if (directionCombo.Active == 1) { degrees = degrees * -1; isNeg = true; } double minutes = double.Parse(minuteEntry.Text, CultureInfo.InvariantCulture); ocmengine.DegreeMinutes conv = new ocmengine.DegreeMinutes(degrees, minutes, isNeg); // Fix for -0 case if (degrees == 0 && directionCombo.Active == 1) { return(conv.GetDecimalDegrees() * -1); } else { return(conv.GetDecimalDegrees()); } }