Exemple #1
0
        public async Task <(Dms, Dms)> GetAzAlt()
        {
            var line = await Interact("z");

            var split = line.Split(',');

            if (split.Length != 2)
            {
                throw new Exception($"Invalid response to 'z': {line}");
            }
            var az  = Convert.ToUInt32(split[0], 16) / (uint.MaxValue + 1.0);
            var alt = Convert.ToUInt32(split[1], 16) / (uint.MaxValue + 1.0);

            return(Dms.From0to1(az), Dms.From0to1(alt));
        }
Exemple #2
0
        public async Task <(Dms, Dms)> GetRaDec()
        {
            var line = await Interact("e");

            var split = line.Split(',');

            if (split.Length != 2)
            {
                throw new Exception($"Invalid response to 'e': {line}");
            }
            var ra  = Convert.ToUInt32(split[0], 16) / (uint.MaxValue + 1.0);
            var dec = Convert.ToUInt32(split[1], 16) / (uint.MaxValue + 1.0);

            return(Dms.From0to1(ra), Dms.From0to1(dec));
        }