public static CoordinatesModel GetAstrometryResults()
        {
            string url = $"jobs/" + ApiHelper.JobId + "/calibration/";

            Properties.Settings.Default.message = "Getting astrometry result...";

            Task <string> task = SendRequest(url);

            task.Wait();

            CoordinatesModel responseObj
                = JsonConvert.DeserializeObject <CoordinatesModel>(task.Result);

            Properties.Settings.Default.message = "Astrometry succesfull";

            return(responseObj);
        }
예제 #2
0
        private void MainRun()
        {
            ApiHelper.InitializeClient();

            if (!ApiHelper.InitializeSession())
            {
                Properties.Settings.Default.message = "Unable to initialize session.";

                return;
            }

            AstrometryProcessor.UploadImage();

            if (!AstrometryProcessor.GetSubmissionStatus())
            {
                Properties.Settings.Default.message = "Astrometry failed";
                return;
            }

            if (!AstrometryProcessor.GeJobStatus())
            {
                Properties.Settings.Default.message = "Astrometry failed";
                return;
            }


            CoordinatesModel coordinates = AstrometryProcessor.GetAstrometryResults();

            this.Dispatcher.Invoke(() =>
            {
                Properties.Settings.Default.Ra     = coordinates.HumanReadableRa();
                Properties.Settings.Default.Dec    = coordinates.HumanReadableDec();
                Properties.Settings.Default.Radius = coordinates.HumanReadableRadius();
                Properties.Settings.Default.Save();

                calculateButton.IsEnabled = true;
            });
        }