private void LogDateTimePicker_ValueChanged(object sender, EventArgs e) { //fill in notes string[] lglines; LogXDataBase lgdb = new LogXDataBase(); char[] splt = { '*' }; string lgstr = lgdb.GetNote(LogDateTimePicker.Value.ToShortDateString()); if (lgstr != null) { lglines = lgstr.Split(splt, StringSplitOptions.RemoveEmptyEntries); foreach (string lg in lglines) { NotesTextBox.AppendText("*" + lg + "\r\n"); } return; } return; }
public void WriteTextLog(string logString) { //Writes the specified logString to the log text box, prepending the current time NotesTextBox.AppendText("* " + DateTime.Now.ToShortTimeString() + ": " + logString + "\r\n"); }
//When a suspect is chosen from the textbox list, parse the line for galaxy name and date // then have TSX open the difference image, the reference image and the current image // then have TSX set the FOV to the size of the galaxy, set the center of the chart to the // coordinates of the suspect and place the target circle over the coordinates. // //Then... // private void SuspectListbox_SelectedIndexChanged(object sender, EventArgs e) { ///If nothing selected then exit /// ///Parse the selected line for the galaxy name and image time. ///Load up the suspect data ///Lay in the clearer follow up image and prep to blink the two latest images /// //Set the cursor to wait UseWaitCursor = true; Show(); FormCrunchingNotice cForm = new FormCrunchingNotice(); cForm.Show(); BlinkButton.BackColor = Color.LightSalmon; //pull the selected suspect entry from the suspect list box string susitem; try { susitem = SuspectListbox.Items[SuspectListbox.SelectedIndex].ToString(); } catch (Exception ex) { return; } //Clear the blink list BlinkList = null; //Parse the selected entry for relavent info and create a suspect object to work with int galLen = susitem.IndexOf("\t"); string galname = susitem.Substring(0, galLen - 1); galname = galname.TrimEnd(); int dateLen = susitem.IndexOf(":") - galLen + 2; string galevent = susitem.Substring(galLen + 1, dateLen); DateTime galdate = Convert.ToDateTime(galevent); CurrentSuspect = new Suspect(); //Check to see if the stored suspect info loads ok, if so then // have TSX upload the image files and target the RA/Dec bool susLoad = CurrentSuspect.Load(galname, galdate); if (susLoad) { CurrentDrillDown = new DrillDown(CurrentSuspect.Event); CurrentDrillDown.Display(galname, CurrentSuspect.SuspectRA, CurrentSuspect.SuspectDec); sky6StarChart tsx_sc = new sky6StarChart(); sky6ObjectInformation tsx_oi = new sky6ObjectInformation(); //Get the galaxy major axis tsx_sc.Find(galname); tsx_oi.Index = 0; tsx_oi.Property(Sk6ObjectInformationProperty.sk6ObjInfoProp_MAJ_AXIS_MINS); double galaxis = tsx_oi.ObjInfoPropOut; //Set the FOV size to the galaxy size tsx_sc.FieldOfView = galaxis / 60; //Set the center of view to the suspect//s RA/Dec and light up the target icon //tsx_sc.Find(suspect.SuspectRA.ToString() + ", " + suspect.SuspectDec.ToString()); tsx_sc.RightAscension = CurrentSuspect.SuspectRA; tsx_sc.Declination = CurrentSuspect.SuspectDec; //Check TNS for supernova reports for 60 arc seconds around this location for the last 10 days TNSReader tnsReport = new TNSReader(); List <string> snList = tnsReport.RunLocaleQuery(CurrentSuspect.SuspectRA, CurrentSuspect.SuspectDec, 60, 10); if (snList != null) { NotesTextBox.AppendText("Supernova reported for " + snList[0] + " at this location\r\n"); } else { NotesTextBox.AppendText("No supernova report for this location\r\n"); } //Give the user an opportunity to clear the suspect by updating its status to cleared -- or not. Clipboard.Clear(); try { Clipboard.SetText(CurrentSuspect.SuspectRA.ToString() + ", " + CurrentSuspect.SuspectDec.ToString()); } catch (Exception ex) { NotesTextBox.AppendText(ex.Message); return; } //Display the suspect position information NotesTextBox.AppendText("Suspect RA and Dec written to clipboard\r\n"); LocationTextBox.Text = CurrentSuspect.SuspectRA.ToString() + ", " + CurrentSuspect.SuspectDec.ToString(); Show(); System.Windows.Forms.Application.DoEvents(); //Show followup Image in picture box CurrentFollowUpImage = CurrentDrillDown.GetFollowUpImage(ImageZoom); ImagePictureBox.SizeMode = PictureBoxSizeMode.CenterImage; ImagePictureBox.Image = CurrentFollowUpImage; BlinkButton.BackColor = Color.LightGreen; ClearButton.BackColor = Color.LightGreen; UseWaitCursor = false; } cForm.Close(); Show(); return; }