private void GetReportButton_Click(object sender, RoutedEventArgs e) { NetworkTables.NetworkTable table = NetworkTables.NetworkTable.GetTable("CamData"); double[] heights = table.GetNumberArray("Height", new double[] { 0 }); foreach (double h in heights) { Console.WriteLine(h); } }
private void TakeSnapshot(object sender, RoutedEventArgs e) { //If a snapshot is already present if (StaticResources.SnapshotEnabled) { Console.WriteLine("Snapshot already enabled. Adding another!"); contourDataAnalyzer.AddSnapshot(); } //First-time else { NetworkTables.NetworkTable table = NetworkTables.NetworkTable.GetTable("CamData"); double[] heights = table.GetNumberArray("Height", new double[] { 1 }); double[] widths = table.GetNumberArray("Width", new double[] { 1 }); try { StaticResources.ContourRatio.Add(widths[0] / heights[0]); StaticResources.SnapshotEnabled = true; TakeSnapButton.Content = "Add Snapshot"; } catch (IndexOutOfRangeException) { MessageBox.Show("Index out of range. Please clear snapshot and try again."); } } }