Esempio n. 1
0
 /// <summary>
 /// Event changes units of displayed data to kilometres
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CheckKm(object sender, RoutedEventArgs e)
 {
     if (handler != null)
     {
         vel_label.Text = handler.GetVelocityInKmPerHour();
         alt_label.Text = handler.GetAltitudeInKm();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Displays fresh data in labels
        /// </summary>
        /// <param name="dat">Object with gathered data</param>
        public void SetNewData(stationData dat)
        {
            handler         = dat;
            lon_label.Text  = dat.GetLongitude(); // changing labels' content
            lat_label.Text  = dat.GetLatitude();
            time_label.Text = dat.GetDateTime();

            if (km_radio.IsChecked == true)                    // checking radio buttons
            {
                vel_label.Text = dat.GetVelocityInKmPerHour(); // changing units to kilometers
                alt_label.Text = dat.GetAltitudeInKm();
            }
            else
            {
                vel_label.Text = dat.GetVelocityInMPH();  // changing units to miles
                alt_label.Text = dat.GetAltitudeInMiles();
            }
        }