Exemple #1
0
        private async Task UpdateImagesCoords(string[] date)
        {
            EPICPickRetriever            epicPickRetriever = new EPICPickRetriever(date);
            IEnumerable <EPICRootObject> epicRoot          = await epicPickRetriever.GetEPIC();


            int num = epicRoot.Count();

            int count = 0;

            ViewModel.EPICInfos = new EPICPageViewModel[num];

            foreach (EPICRootObject input in epicRoot)
            {
                EPICPageViewModel ViewModel2 = new EPICPageViewModel();
                ViewModel2.date[0]     = date[0];
                ViewModel2.date[1]     = date[1];
                ViewModel2.date[2]     = date[2];
                ViewModel2.Image       = GetImageURLFromNameDate(input.image, date);
                ViewModel2.distToEarth = Math.Sqrt(Math.Pow(input.dscovr_j2000_position.x, 2) + Math.Pow(input.dscovr_j2000_position.y, 2)
                                                   + Math.Pow(input.dscovr_j2000_position.z, 2));
                ViewModel2.distToSun = Math.Sqrt(Math.Pow(input.sun_j2000_position.x, 2) + Math.Pow(input.sun_j2000_position.y, 2)
                                                 + Math.Pow(input.sun_j2000_position.z, 2)) - ViewModel2.distToSun;
                ViewModel.EPICInfos[count] = ViewModel2;
                count++;
            }
            Date.Text        = "Date it was taken: " + date[0] + date[1] + date[2];
            distToSun.Text   = "Distance from EPIC to Sun: " + ViewModel.EPICInfos[0].distToSun + " km";
            distToEarth.Text = "Distance from EPIC to Earth: " + ViewModel.EPICInfos[0].distToEarth + " km";
            string ImageUrl = ViewModel.EPICInfos[0].Image;

            Url.UriSource = new Uri((string)ImageUrl);
        }
Exemple #2
0
        private async Task UpdateImagesCoords()
        {
            EPICRetriever epicRetriever           = new EPICRetriever();
            IEnumerable <EPICRootObject> epicRoot = await epicRetriever.GetEPIC();

            int num = epicRoot.Count();

            int count = 0;

            ViewModel.EPICInfos = new EPICPageViewModel[num];

            foreach (EPICRootObject input in epicRoot)
            {
                EPICPageViewModel ViewModel2 = new EPICPageViewModel();
                String[]          dates      = input.date.Split('-');
                ViewModel2.date[0]     = dates[0];
                ViewModel2.date[1]     = dates[1];
                ViewModel2.date[2]     = dates[2].Substring(0, dates[2].IndexOf(" "));
                ViewModel2.Image       = GetImageURLFromNameDate(input.image, ViewModel2.date);
                ViewModel2.distToEarth = Math.Sqrt(Math.Pow(input.dscovr_j2000_position.x, 2) + Math.Pow(input.dscovr_j2000_position.y, 2)
                                                   + Math.Pow(input.dscovr_j2000_position.z, 2));
                ViewModel2.distToSun = Math.Sqrt(Math.Pow(input.sun_j2000_position.x, 2) + Math.Pow(input.sun_j2000_position.y, 2)
                                                 + Math.Pow(input.sun_j2000_position.z, 2)) - ViewModel2.distToSun;
                ViewModel.EPICInfos[count] = ViewModel2;
                count++;
            }
            Date.Text        = "Date it was taken: " + ViewModel.EPICInfos[0].date[0] + ViewModel.EPICInfos[0].date[1] + ViewModel.EPICInfos[0].date[2];
            distToSun.Text   = "Distance from EPIC to Sun: " + ViewModel.EPICInfos[0].distToSun + " km";
            distToEarth.Text = "Distance from EPIC to Earth: " + ViewModel.EPICInfos[0].distToEarth + " km";
        }