private void apply_filter_Click(object sender, EventArgs e) { GPXLog filtered = new GPXLog(); string ssid = ssid_filter.Text; string sec = security_filter.SelectedText; string channel = channel_filter.SelectedText; if (ssid == "") { log_active = log; currIndex = 1; displayRecord(); return; } for (int i = 0; i < log_active.getSize(); i++) { HotSpot hs = log_active.getHotSpot(i); if (hs.getSSID().Contains(ssid)) { filtered.addHotSpot(hs); } } log_active = filtered; displayRecord(); ssid_filter_changed = false; security_filter_changed = false; channel_filter_changed = false; }
private void LoadFile_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "Open File for Processing..."; ofd.Filter = "XML Files (*.XML)|*.xml"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { fn = ofd.FileName; log = new GPXLog(readFile(fn,new List<HotSpot>())); log_active = new GPXLog(readFile(fn, new List<HotSpot>())); loadFile(fn); } }
private void GO_Click(object sender, EventArgs e) { //only executes code if at least one file exists if (fileA == "" && fileB == "") { MessageBox.Show("Must select at least one file."); } else { if (fileA == "") { List<HotSpot> temp = readFile(fileB, new List<HotSpot>()); log = new GPXLog(temp); } else if (fileB == "") { List<HotSpot> temp = readFile(fileA, new List<HotSpot>()); log = new GPXLog(temp); } else { List<HotSpot> temp = readFile(fileA, new List<HotSpot>()); List<HotSpot> combined = readFile(fileB, temp); log = new GPXLog(combined); } log.filterData(); //create new xml file with the filtered data SaveFileDialog sfd = new SaveFileDialog(); sfd.Title = "Save new XML file as..."; sfd.Filter = "XML Files (*.XML)|*.xml"; sfd.RestoreDirectory = true; //forces a valid input for the output file name while (sfd.ShowDialog() != DialogResult.OK) sfd = new SaveFileDialog(); currFile = sfd.FileName; writeNewXML(currFile); MessageBox.Show("DONE!"); loadFile(currFile); } }