public void AscomProfileTest()
        {
            string driverType = "Telescope";
            string devName    = "ASCOM.Simulator.Telescope";

            debug.WriteLine("AscomProfileTest:");
            debug.WriteLine($"\tDriver Type: {driverType}");
            debug.WriteLine($"\tDevice Name: {devName}");
            Profile prf = new Profile()
            {
                DeviceType = driverType
            };
            IASCOMProfile aprf = prf.GetProfile(devName);

            debug.WriteLine($"\t[Values]");
            foreach (var kvp in aprf.ProfileValues)
            {
                string key = kvp.Key;
                foreach (var skvp in kvp.Value)
                {
                    string skey = skvp.Key;
                    string sval = skvp.Value;
                    debug.WriteLine($"\t[{key}]\\[{skey}]:{sval}");
                }
            }
        }
        //[ValidateAntiForgeryToken]
        //[Route("RegisteredDevices/{driverType}/{devName}")]
        public IActionResult GetProfile(string devName)
        {
            Profile p = new Profile()
            {
                DeviceType = DriverType
            };

            if (!p.IsRegistered(devName))
            {
                return(new NotFoundObjectResult($"{DriverType}:{devName}"));
            }
            IASCOMProfile prf = p.GetProfile(devName);

            return(new JsonResult(prf.ToDictionary()));
        }
        //[ValidateAntiForgeryToken]
        //[Route("RegisteredDevices/{driverType}/{devName}")]
        public IActionResult GetDeviceProfile(string driverType, string devName)
        {
            Profile p = new Profile()
            {
                DeviceType = driverType
            };

            if (!p.IsRegistered(devName))
            {
                return(new NotFoundObjectResult($"{driverType}:{devName}"));
            }
            IASCOMProfile prf = p.GetProfile(devName);

            return(new RascomResult(prf).JsonResult);
        }
Exemple #4
0
 public void SetProfile(string DriverId, IASCOMProfile XmlProfile)
 {
     throw new System.NotImplementedException();
 }