//! Update Labels /*! * \param * \return */ private void staDataGridView_SelectionChanged_1(object sender, EventArgs e) { try { Ground.Station st = _MainDataBase.getStationFromDB( staDataGridView.SelectedRows[0].Cells[0].Value.ToString()); label20.Text = st.getName(); label56.Text = st.getLongitude().ToString(); label55.Text = st.getLatitude().ToString(); label54.Text = st.getHeight().ToString() + " m"; label53.Text = st.getNrOfAntennas().ToString(); Pen penSelected = new Pen(Color.Red, 4); Image image = new Bitmap(imgStation); Point p = st.getGeoCoordinate().toPoint(image.Width, image.Height); using (var graphics = Graphics.FromImage(image)) { graphics.DrawRectangle(penSelected, p.X - 10, p.Y - 10, 20, 20); } pictureBox3.Image = image; } catch { label20.Text = " -- "; } }
//! Delete a object from the GroundStations Database /*! * */ private void deleteSelectedToolStripMenuItem_Click(object sender, EventArgs e) { Ground.Station st = _MainDataBase.getStationFromDB( staDataGridView.SelectedRows[0].Cells[0].Value.ToString()); _MainDataBase.deleteStation(st.getName()); UpdateAllLists(); }
//! get the stations selected for Schedule /*! * /param string Logfile */ private List <Ground.Station> getStationData(string logfile) { stationData = new List <Ground.Station>(); //get selected GroundSTations for Calculations for (int i = 0; i < checkedStations.Items.Count; i++) { if (checkedStations.GetItemChecked(i)) { Ground.Station station = _MainDataBase.getStationFromDB(checkedStations.Items[i].ToString()); stationData.Add(station); updateLog(logfile, "Adding Station: " + station.getName()); } } return(stationData); }