private void on_modify_utc(object sender, EventArgs e) { if (editing) { return; } editing = true; try { cur = new utc( int.Parse(textBox1.Text), int.Parse(textBox2.Text), int.Parse(textBox3.Text), int.Parse(textBox5.Text), int.Parse(textBox7.Text), int.Parse(textBox10.Text) ); lc = cur.offset_hour(time_differ); mjd = new MJDTime(cur); gpst = new GPSTime(cur); get_doy(); update(); label6.Text = ""; } catch (Exception exce) { label6.Text = "猪"; } editing = false; }
private void on_modify_mjd(object sender, EventArgs e) { if (editing) { return; } editing = true; try { mjd = new MJDTime( int.Parse(textBox8.Text), double.Parse(textBox11.Text) ); cur = new utc(mjd); gpst = new GPSTime(mjd); lc = cur.offset_hour(time_differ); get_doy(); update(); label6.Text = ""; } catch (Exception exce) { label6.Text = "猪"; } editing = false; }
public MJDTime(GPSTime gps) { double sum = (gps.sec / 86400.0) + 44244 + 7 * gps.week; days = (int)sum; frac_day = sum - days; }
public Form1() { InitializeComponent(); editing = true; System.DateTime lcn = System.DateTime.Now; System.DateTime currentTime = System.DateTime.UtcNow; time_differ = (int)(lcn - currentTime).TotalHours; lc = new utc(lcn.Year - (lcn.Year / 100) * 100, lcn.Month, lcn.Day, lcn.Hour, lcn.Minute, lcn.Second); cur = new utc(currentTime.Year - (currentTime.Year / 100) * 100, currentTime.Month, currentTime.Day, currentTime.Hour, currentTime.Minute, currentTime.Second); mjd = new MJDTime(cur); gpst = new GPSTime(cur); get_doy(); update(); editing = false; }
private void on_modify_doy(object sender, EventArgs e) { if (editing) { return; } editing = true; try { doy = int.Parse(textBox9.Text); cur.change_to_doy(doy); mjd = new MJDTime(cur); gpst = new GPSTime(mjd); lc = cur.offset_hour(time_differ); update(); label6.Text = ""; } catch (Exception exce) { label6.Text = "猪"; } editing = false; }