private void OnConvertEllipsod(object sender, EventArgs e) { try { double lat = Double.Parse(m_latitudeTextBox.Text); double lon = Double.Parse(m_longitudeTextBox.Text); double h = Double.Parse(m_ellipsoidTextBox.Text); m_geoidTextBox.Text = m_geoid.ConvertHeight(lat, lon, h, Geoid.ConvertFlag.ELLIPSOIDTOGEOID).ToString(); } catch (Exception xcpt) { MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void OnValidate(object sender, EventArgs e) { try { Geoid g = new Geoid(m_fileName, m_path, false, false); g.CacheArea(20.0, -30.0, 30.0, -20.0); g.CacheAll(); double h2 = g.Height(32.0, -60.0); g.ConvertHeight(32.0, -60.0, 100.0, Geoid.ConvertFlag.ELLIPSOIDTOGEOID); MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception xcpt) { MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void OnValidate(object sender, EventArgs e) { try { Geoid g = new Geoid(m_fileName, m_path, false, false); g.CacheArea(20.0, -30.0, 30.0, -20.0); g.CacheAll(); double gradx, grady; double h1 = g.Height(32.0, -60.0, out gradx, out grady); double h2 = g.Height(32.0, -60.0); if (h1 != h2) throw new Exception("Error in Geoid.Height"); g.ConvertHeight(32.0, -60.0, 100.0, Geoid.ConvertFlag.ELLIPSOIDTOGEOID); MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception xcpt) { MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }