} //close method update_display_page_events()... /// <summary> /// this method is used to update the main screen of the interface to show the event/image information associated with this day /// </summary> /// <param name="day_to_display"></param> private void update_interface_with_information_on_day(DateTime day_to_display) { //firstly let's update the overall interface variable on what day it is... current_day_on_display = day_to_display; //let's update the UI with what day and day this data is relating to txtDayDisplay.Text = day_to_display.DayOfWeek.ToString(); txtDateDisplay.Text = day_to_display.ToLongDateString(); //now display the time span of the events of this day DateTime day_startTime = new DateTime(); DateTime day_endTime = day_startTime; Image_Rep.GetDayStartEndTime(Window1.OVERALL_userID, day_to_display, ref day_startTime, ref day_endTime); //firstly we get start/end time data directly from the database if (day_startTime != day_endTime) //if the start time isn't equal to the end time, it means that we've successfully retrieved information from the database... { txtTimeFrame.Text = "(" + day_startTime.ToString("HH:mm tt") + " - "; txtTimeFrame.Text += day_endTime.ToString("HH:mm tt") + ")"; } //close if(day_startTime != day_endTime)... else { txtTimeFrame.Text = " - "; //if no data has been retrieved, well then we've no information to show... } //and also let's display the number of images associated with this day... txtImageNumber.Text = Image_Rep.GetNumImagesInDay(Window1.OVERALL_userID, day_to_display).ToString() + " Photos"; //finally give a breakdown of the amount of time spent on various activities... lstDailyActivitySummary.ItemsSource = Daily_Annotation_Summary.getDayAnnotationSummary(Window1.OVERALL_userID, day_to_display); //and also a breakdown of the individual annotated events... lstIndividual_Journeys.ItemsSource = Interface_Code.Event_Activity_Annotation.getAnnotatedEventsDay(Window1.OVERALL_userID, day_to_display); } //end method display_days_events_on_interface()
public static void sortImagesByID(List <Image_Rep> imgList) { //This method uses the BubbleSort algorithm to sort images by ID int i; int j; Image_Rep temp = new Image_Rep(DateTime.Now, "", -99, false); for (i = (imgList.Count - 1); i >= 0; i--) { for (j = 1; j <= i; j++) { if (imgList[j - 1].position > imgList[j].position) { //swap the 2 images if they are in the wrong order temp.position = imgList[j - 1].position; temp.imgPath = imgList[j - 1].imgPath; temp.imgTime = imgList[j - 1].imgTime; temp.scaledImgSource = imgList[j - 1].scaledImgSource; temp.shortImgTime = imgList[j - 1].shortImgTime; imgList[j - 1].position = imgList[j].position; imgList[j - 1].imgPath = imgList[j].imgPath; imgList[j - 1].imgTime = imgList[j].imgTime; imgList[j - 1].scaledImgSource = imgList[j].scaledImgSource; imgList[j - 1].shortImgTime = imgList[j].shortImgTime; imgList[j].position = temp.position; imgList[j].imgPath = temp.imgPath; imgList[j].imgTime = temp.imgTime; imgList[j].scaledImgSource = temp.scaledImgSource; imgList[j].shortImgTime = temp.shortImgTime; } } } }
public Event_Rep( int eventID, DateTime startTime, DateTime endTime, string keyframePath, string comment, bool loadImage) { this.eventID = eventID; this.startTime = startTime; this.endTime = endTime; this.eventDuration = endTime - startTime; this.comment = comment; this.shortComment = GetStringStart(comment, 15); this.keyframePath = keyframePath; this.borderColour = DefaultKeyframeBorderColour; //format time string for UI if (startTime.Hour < 12) { this.strTime = startTime.ToShortTimeString() + " am"; } else { this.strTime = startTime.ToShortTimeString() + " pm"; } this.eventLength = Daily_Annotation_Summary.SecondsToString( (int)eventDuration.TotalSeconds); if (loadImage) { this.keyframeSource = Image_Rep.GetImgBitmap(keyframePath, false); } }
public void loadImage() { //attempts to load the image's bitmap from a given path this.scaledImgSource = Image_Rep.GetImgBitmap(imgPath, true); }
public static void sortImagesByID(List<Image_Rep> imgList) { //This method uses the BubbleSort algorithm to sort images by ID int i; int j; Image_Rep temp = new Image_Rep(DateTime.Now,"",-99, false); for (i = (imgList.Count - 1); i >= 0; i--) { for (j = 1; j <= i; j++) { if (imgList[j - 1].position > imgList[j].position) { //swap the 2 images if they are in the wrong order temp.position = imgList[j - 1].position; temp.imgPath = imgList[j - 1].imgPath; temp.imgTime = imgList[j - 1].imgTime; temp.scaledImgSource = imgList[j - 1].scaledImgSource; temp.shortImgTime = imgList[j - 1].shortImgTime; imgList[j - 1].position = imgList[j].position; imgList[j - 1].imgPath = imgList[j].imgPath; imgList[j - 1].imgTime = imgList[j].imgTime; imgList[j - 1].scaledImgSource = imgList[j].scaledImgSource; imgList[j - 1].shortImgTime = imgList[j].shortImgTime; imgList[j].position = temp.position; imgList[j].imgPath = temp.imgPath; imgList[j].imgTime = temp.imgTime; imgList[j].scaledImgSource = temp.scaledImgSource; imgList[j].shortImgTime = temp.shortImgTime; } } } }
public void loadImage() { //attempts to load the image's bitmap from a given path this.keyframeSource = Image_Rep.GetImgBitmap(keyframePath, true); }