private void WriteTargetList() { //Load the Target Plan datagridview TargetPlans tPlans = new TargetPlans(); List <string> tpList = tPlans.PlanList; TargetDataGrid.Rows.Clear(); int ridx = 0; foreach (string tp in tpList) { string targetName = tp.Split('.')[0]; TargetSpecs tt = new TargetSpecs(targetName); TargetDataGrid.Rows.Add(); TargetDataGrid.Rows[ridx].Cells[0].Value = tt.TargetName; TargetDataGrid.Rows[ridx].Cells[1].Value = tt.TargetType; TargetDataGrid.Rows[ridx].Cells[2].Value = tt.RiseTime.ToString(@"hh\:mm"); TargetDataGrid.Rows[ridx].Cells[3].Value = tt.TransitTime.ToString(@"hh\:mm"); TargetDataGrid.Rows[ridx].Cells[4].Value = tt.SetTime.ToString(@"hh\:mm"); TargetDataGrid.Rows[ridx].Cells[5].Value = tt.Constellation; ridx++; } TargetDataGrid.ClearSelection(); TargetDataGrid.Update(); Show(); return; }
public FormNightShift() { InitializeComponent(); // Acquire the version information and put it in the form header try { this.Text = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString(); } catch { this.Text = " in Debug"; } //probably in debug, no version info available this.Text = "NightShift V" + this.Text; TargetSpecs ts = new TargetSpecs("Sun"); SunRiseTextBox.Text = ts.RiseTime.ToString(@"hh\:mm"); SunSetTextBox.Text = ts.SetTime.ToString(@"hh\:mm"); TwilightTextBox.Text = ts.TwilightEODTime.ToString(@"hh\:mm"); DawnTextBox.Text = ts.TwilightSODTime.ToString(@"hh\:mm"); TargetSpecs tm = new TargetSpecs("Moon"); MoonRiseTextBox.Text = tm.RiseTime.ToString(@"hh\:mm"); MoonSetTextBox.Text = tm.SetTime.ToString(@"hh\:mm"); MoonTransitTextBox.Text = tm.TransitTime.ToString(@"hh\:mm"); MoonPhaseTextBox.Text = (tm.PhasePercent.ToString("0")) + "%"; //Test to see which buttons have installed applications QualifyToolKitButtons(); //Load the Target Plan datagridview WriteTargetList(); //Load the task list datagridview LogXDataBase tldb = new LogXDataBase(); List <string> taskList = tldb.GetTasks(); TaskDataGrid.Rows.Clear(); int tidx = 0; if (taskList != null) { foreach (string task in taskList) { TaskDataGrid.Rows.Add(); TaskDataGrid.Rows[tidx].Cells[0].Value = task; TaskDataGrid.Rows[tidx].Cells[1].Value = false; tidx++; } } Show(); TaskDataGrid.ClearSelection(); //Set the display date the the current date LogDateTimePicker.Value = DateTime.Now; //Create Humason Log content for Humason Log tab //Open log based on the most recent log HumasonReader hReader = new HumasonReader(DateTime.Now); //Get full list of logs in Log directory List <DateTime> hLogList = hReader.HumasonLogDates; foreach (DateTime ldate in hLogList) { HumasonLogFileListBox.Items.Add(ldate.ToShortDateString()); } HumasonLogFileListBox.SelectedIndex = HumasonLogFileListBox.Items.Count - 1; Show(); return; }