Exemplo n.º 1
0
 /// <summary>
 /// Creates an instance of the camera class.
 /// </summary>
 /// <param name="cameraId">The ProgID for the camera</param>
 public Camera(string cameraId)
 {
     TL                      = new TraceLogger("", "DriverAccessCamera");
     TL.Enabled              = RegistryCommonCode.GetBool(GlobalConstants.DRIVERACCESS_TRACE, GlobalConstants.DRIVERACCESS_TRACE_DEFAULT);
     _memberFactory          = new MemberFactory(cameraId, TL);
     _driverInterfaceVersion = InterfaceVersion;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of the <see cref="AscomDriver"/> class.
        /// </summary>
        /// <param name="deviceProgId">The prog id. of the device being created.</param>
        public AscomDriver(string deviceProgId)
        {
            // Create a new TraceLogger and enable if appropriate
            TL         = new TraceLogger("", "DriverAccess");
            TL.Enabled = RegistryCommonCode.GetBool(GlobalConstants.DRIVERACCESS_TRACE, GlobalConstants.DRIVERACCESS_TRACE_DEFAULT);
            TL.LogMessage("AscomDriver", "Successfully created TraceLogger");
            TL.LogMessage("AscomDriver", "Device ProgID: " + deviceProgId);

            //deviceType = deviceProgId.Substring(deviceProgId.LastIndexOf(".") + 1).ToUpper();
            deviceType = this.GetType().Name.ToUpperInvariant();
            TL.LogMessage("AscomDriver", "Device type: " + this.GetType().Name);

            memberFactory = new MemberFactory(deviceProgId, TL); // Create a MemberFactory object and pass in the TraceLogger
        }
Exemplo n.º 3
0
 /// <summary>
 /// Disposes of managed and unmanged resources
 /// </summary>
 /// <param name="disposing">True to dispose of managed resources, false to dispose of unmanged resources</param>
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposedValue)
     {
         if (disposing)
         {
             if (memberFactory != null)
             {
                 memberFactory.Dispose();
                 memberFactory = null;
             }
             if (TL != null)
             {
                 TL.Dispose();
             }
         }
     }
     this.disposedValue = true;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a focuser object with the given Prog ID
 /// </summary>
 /// <param name="focuserId">ProgID of the focuser device to be accessed.</param>
 public Focuser(string focuserId)
     : base(focuserId)
 {
     memberFactory = base.MemberFactory;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a SafetyMonitor object with the given Prog ID
 /// </summary>
 /// <param name="safetyMonitorId">ProgID of the device to be accessed.</param>
 public SafetyMonitor(string safetyMonitorId)
     : base(safetyMonitorId)
 {
     _memberFactory = MemberFactory;
 }
Exemplo n.º 6
0
 /// <summary>
 ///   Creates a Switch object with the given Prog ID
 /// </summary>
 /// <param name = "switchId"></param>
 public Switch(string switchId)
 {
     TL             = new TraceLogger("", "DriverAccessSwitch");
     TL.Enabled     = RegistryCommonCode.GetBool(GlobalConstants.DRIVERACCESS_TRACE, GlobalConstants.DRIVERACCESS_TRACE_DEFAULT);
     _memberFactory = new MemberFactory(switchId, TL);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Creates a rotator object with the given ProgID
 /// </summary>
 /// <param name="rotatorId">ProgID of the rotator to be accessed.</param>
 public Rotator(string rotatorId)
     : base(rotatorId)
 {
     memberFactory = base.MemberFactory;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Creates a CoverCalibrator object with the given ProgID
 /// </summary>
 /// <param name="coverCalibratorId">ProgID of the CoverCalibrator device to be accessed.</param>
 public CoverCalibrator(string coverCalibratorId)
     : base(coverCalibratorId)
 {
     memberFactory = base.MemberFactory;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Creates a Switch object with the given Prog ID
 /// </summary>
 /// <param name="switchId">ProgID of the Switch device to be accessed.</param>
 public Switch(string switchId)
     : base(switchId)
 {
     memberFactory = base.MemberFactory; //Get the member factory created by the base class
 }
Exemplo n.º 10
0
 /// <summary>
 /// Creates an ObservingConditions object with the given Prog ID
 /// </summary>
 /// <param name="observingConditionsId">ProgID of the device to be accessed.</param>
 public ObservingConditions(string observingConditionsId)
     : base(observingConditionsId)
 {
     _memberFactory = MemberFactory;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Creates a FilterWheel object with the given Prog ID
 /// </summary>
 /// <param name="filterWheelId">ProgID of the filterwheel device to be accessed.</param>
 public FilterWheel(string filterWheelId)
     : base(filterWheelId)
 {
     //memberFactory = new MemberFactory(filterWheelID);
     memberFactory = base.MemberFactory; //Get the member factory created by the base class
 }
Exemplo n.º 12
0
 /// <summary>
 /// Constructor for Dome class. Creates a Dome based on the ProgID in the DomeID string.
 /// </summary>
 /// <param name="domeId">The progID of the dome to be instantiated</param>
 public Dome(string domeId)
     : base(domeId)
 {
     memberFactory = base.MemberFactory;
 }
Exemplo n.º 13
0
 /// <summary>
 /// Creates a FilterWheel object with the given Prog ID
 /// </summary>
 /// <param name="filterWheelId"></param>
 public FilterWheel(string filterWheelId)
 {
     TL             = new TraceLogger("", "DriverAccessFilterWheel");
     TL.Enabled     = RegistryCommonCode.GetBool(GlobalConstants.DRIVERACCESS_TRACE, GlobalConstants.DRIVERACCESS_TRACE_DEFAULT);
     _memberFactory = new MemberFactory(filterWheelId, TL);
 }