/// <summary> /// Saves the transformed data corresponding to the checked radio button to a permanent file. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonSave_Click(object sender, EventArgs e) { try { string rbName = FormUtilities.GetCheckedRadioButton(panelOutput).Name; int hingeIndex = int.Parse(rbName.Substring(rbName.Length - 2, 1)); int bearingIndex = int.Parse(rbName.Substring(rbName.Length - 1)); if (rbName.Contains("GPS")) { _transform.SaveData(hingeIndex, bearingIndex, true); _transform.CreateReportTable(hingeIndex, hingeIndex, bearingIndex, true, _viewedTransforms); } else if (rbName.Contains("Compass")) { _transform.SaveData(hingeIndex, bearingIndex, false); _transform.CreateReportTable(hingeIndex, hingeIndex, bearingIndex, false, _viewedTransforms); } if (_transform.GetFullErrorMessage() != null) { ShowError(_transform.GetFullErrorMessage()); } ChampExtension.GetExtension().GetDockableWindow().Show(false); } catch (Exception ex) { ShowError(ex.Message); } }
/// <summary> /// Transforms and saves the data. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void saveButton_Click(object sender, EventArgs e) { try { // Get spatial reference IFeatureClass benchmarks = (IFeatureClass)_benchmarkName.Open(); _transform.SetSpatialReference(((IGeoDataset)benchmarks).SpatialReference); // Set benchmarks for (int i = 1; i < 4; i++) { IFeature feature = benchmarks.GetFeature(i); _transform.SetBenchmarkPoint(i, (IPoint)feature.ShapeCopy); } // Set total station benchmarks _transform.SetTSBenchmark(1, benchmark1ComboBox.Text); _transform.SetTSBenchmark(2, benchmark2ComboBox.Text); _transform.SetTSBenchmark(3, benchmark3ComboBox.Text); // Add data to be transformed foreach (IDatasetName dsName in EsriUtilities.GetFeatureClassNames(esriGeometryType.esriGeometryAny, _inputDatasetName)) { _transform.AddData((IFeatureClassName)dsName); } // Transform data IQueryFilter query = new QueryFilterClass(); query.WhereClause = "\"Chosen\" = 1"; ITable table = (ITable)_transformTableName.Open(); ICursor cursor = table.Search(query, true); IRow row = cursor.NextRow(); int hinge = Convert.ToInt32(((string)row.get_Value(table.FindField("Hinge"))).Split(' ')[1]); int toBM = Convert.ToInt32(((string)row.get_Value(table.FindField("Bearing"))).Split(' ')[2]); _transform.SaveData(hinge, toBM); // Close dialog Init(); ChampExtension.GetExtension().GetApplyDockableWindow().Show(false); ArcMap.Document.ActiveView.Refresh(); } catch (Exception ex) { ShowError(ex.Message); } }
/// <summary> /// Cancels the dialog. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cancelButton_Click(object sender, EventArgs e) { Init(); ChampExtension.GetExtension().GetApplyDockableWindow().Show(false); }
// Close the dockable window. private void buttonCancel_Click(object sender, EventArgs e) { ChampExtension.GetExtension().GetDockableWindow().Show(false); }