Exemplo n.º 1
0
        public async Task <bool> Sync(Coordinates coordinates)
        {
            try {
                var transform = coordinates.Transform(TelescopeInfo.EquatorialSystem);
                if (!profileService.ActiveProfile.TelescopeSettings.NoSync && TelescopeInfo.Connected)
                {
                    progress.Report(new ApplicationStatus()
                    {
                        Status = Locale.Loc.Instance["LblSync"]
                    });
                    bool result = Telescope.Sync(transform);
                    await Task.Delay(TimeSpan.FromSeconds(Math.Max(2, profileService.ActiveProfile.TelescopeSettings.SettleTime)));

                    return(result);
                }
                else
                {
                    return(false);
                }
            } finally {
                progress.Report(new ApplicationStatus()
                {
                    Status = string.Empty
                });
            }
        }