Esempio n. 1
0
 /// <summary>
 ///     Connects to the device.
 /// </summary>
 /// <exception cref="ASCOM.DriverException">
 ///     Failed to connect. Open apparently succeeded but then the device reported that
 ///     is was offline.
 /// </exception>
 private void Connect()
 {
     //connectedState = true;
     telescope = SharedResources.ConnectionManager.GoOnline(clientId);
     if (!telescope.IsOnline)
     {
         log.Error("Connect failed - device reported offline");
         throw new DriverException(
                   "Failed to connect. Open apparently succeeded but then the device reported that is was offline.");
     }
     telescope.PerformOnConnectTasks();
 }
 private void EnsureControllerInstanceCreatedAndOpen()
 {
     if (!controllerInstance.Any())
     {
         var controller = new TelescopeController(factory);
         controllerInstance = Maybe<TelescopeController>.From(controller);
     }
     var instance = controllerInstance.Single();
     if (!instance.IsOnline)
     {
         instance.Open();
     }
 }
Esempio n. 3
0
 /// <summary>
 ///     Disconnects from the device.
 /// </summary>
 private void Disconnect()
 {
     //connectedState = false;
     SharedResources.ConnectionManager.GoOffline(clientId);
     telescope = null; //[Sentinel]
 }