Exemplo n.º 1
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.º 2
0
        public Dome()
        {
            tl = new TraceLogger("", "ArduinoDome");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl.LogMessage("Dome", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Dome", "Completed initialisation");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EqPlatformAdapter"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            driverID = Marshal.GenerateProgIdForType(this.GetType());

            tl = SharedResources.GetTraceLogger();

            tl.LogMessage("Telescope", "Starting initialisation");

            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            transform      = new Transform();

            tl.LogMessage("Telescope", "Completed initialisation");
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TSwitch"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public SSSwitch(string DriverID, byte DriverType)
        {
            tl = new TraceLogger("", "TSwitch");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl.LogMessage("Switch", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Switch", "Completed initialisation");
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenAstroTracker"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Focuser()
        {
            _driverId = Marshal.GenerateProgIdForType(this.GetType());

            _tl         = SharedResources.tl;
            _tl.Enabled = Profile.TraceState;

            _tl.LogMessage("Focuser", "Starting initialisation");

            utilities      = new Util();        //Initialise util object
            astroUtilities = new AstroUtils();  // Initialise astro-utilities object

            _tl.LogMessage("Focuser", "Completed initialisation");
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EQFocuser"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Focuser()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl         = new TraceLogger("", "EQFocuser");
            tl.Enabled = traceState;
            tl.LogMessage("Focuser", "Starting initialisation");

            //connectedState = false; // Initialise connected to false
            utilities = new Util();            //Initialise util object

            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            tl.LogMessage("Focuser", "Completed initialisation");
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GS_touch"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Focuser()
        {
            ReadProfile();
            tl         = new TraceLogger("", "GS_touch");
            tl.Enabled = traceState;
            tl.LogMessage("Focuser", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Focuser", "Completed initialisation");
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Acme"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public FilterWheel()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl         = new TraceLogger("", "Acme");
            tl.Enabled = traceState;
            tl.LogMessage("FilterWheel", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("FilterWheel", "Completed initialisation");
        }
Exemplo n.º 9
0
        static DriverLoader()
        {
            tlog = new TraceLogger("AscomDriverLoader");
#if DEBUG
            tlog.EchoDebug   = true;
            tlog.EchoConsole = true;
#endif
            AppSettings appSettings = new AppSettings();
            _devInstances = new Dictionary <Type, IAscomDriver>();
            tlog.LogMessage("AscomDriverLoader", $"Initializing AscomDriverLoader...");
            _apiMap = new Dictionary <Type, Type>()
            {
                { typeof(ICameraV2), typeof(Camera) },
                { typeof(IDomeV2), typeof(Dome) },
                { typeof(IRotatorV2), typeof(Rotator) },
                { typeof(IFilterWheelV2), typeof(FilterWheel) },
                { typeof(IFocuserV2), typeof(Focuser) },
                { typeof(IObservingConditions), typeof(ObservingConditions) },
                { typeof(ISafetyMonitor), typeof(SafetyMonitor) },
                { typeof(ISwitchV2), typeof(Switch) },
                { typeof(ITelescopeV3), typeof(Telescope) },
                { typeof(IVideo), typeof(Video) }
            };
            DriverRoot = appSettings.PathSettings.DriverRoot?.Trim() ?? "";
            if (String.IsNullOrWhiteSpace(DriverRoot))
            {
                DriverRoot = "Drivers";
            }
            if (!Path.IsPathRooted(DriverRoot))
            {
                DriverRoot = $"{appSettings.PathSettings.Application}\\{DriverRoot}";
            }
        }
Exemplo n.º 10
0
 private void Log(String message)
 {
     if (m_logger != null)
     {
         m_logger.LogMessage("SonyCamera", message);
     }
 }
Exemplo n.º 11
0
        /// <summary>
        /// Checks that we are connected and the switch id is in range and throws an InvalidValueException if it isn't
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="id">The id.</param>
        private void Validate(string message, short id)
        {
            if (id < 0 || id >= switches.Count)
            {
                tl.LogMessage(message, string.Format("Switch {0} not available, range is 0 to {1}", id, switches.Count - 1));
                throw new InvalidValueException(message, id.ToString(), string.Format("0 to {0}", switches.Count - 1));
            }

            CheckConnected(message);

            if (NumStates(id) < 2)
            {
                tl.LogMessage(message, string.Format("Device {0} has too few states", id));
                throw new InvalidValueException(message, switches[id].Name, "too few states");
            }
        }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            try
            {
                TL         = new TraceLogger("", "SetFireWallRules");
                TL.Enabled = true;

                Version version = Assembly.GetEntryAssembly().GetName().Version;
                TL.LogMessage("SetFireWallRules", string.Format("Version {0}, Run on {1}", version.ToString(), DateTime.Now.ToString("dddd d MMMM yyyy HH:mm:ss")));
                TL.BlankLine();

                // Add the event handler for handling non-UI thread exceptions to the event.

                CommandLine.Parser.Default.ParseArguments <Options>(args)
                .WithParsed <Options>(opts => ProcessOptions(opts))
                .WithNotParsed <Options>((errs) => HandleParseError(errs));

                TL.Enabled = false;
                TL         = null;
            }
            catch (Exception ex)
            {
                TraceLogger TL = new TraceLogger("SetFireWallRulesMainException")
                {
                    Enabled = true
                };
                TL.LogMessageCrLf("Main", "Unhandled exception: " + ex.ToString());
                TL.Enabled = false;
                TL.Dispose();
                TL = null;
            }
        }
Exemplo n.º 13
0
        static void Main()
        {
#if !DEBUG // Exclude the unhandled exception handlers from the Debug version so that the application can be debugged in Visual Studio
            // Add the event handler for handling UI thread exceptions to the event.
            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);

            // Set the unhandled exception mode to force all Windows Forms errors to go through our handler.
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

            // Add the event handler for handling non-UI thread exceptions to the event.
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
#endif
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ServerForm serverForm = new ServerForm();
            Application.Run(serverForm);

            if (serverForm.RestartApplication)
            {
                Application.Restart(); // Restart the application if the network permissions have been changed
            }
#if DEBUG                              // When debugging, include a log to show the time of close down
            TraceLogger TL = new TraceLogger("ASCOMRemoteEnded")
            {
                Enabled = true
            };
            TL.LogMessage("ASCOMRemoteEnded", "Application has exited");
            TL.Enabled = false;
            TL.Dispose();
            TL = null;
#endif
        }
Exemplo n.º 14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="camfiZF"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Focuser()
        {
            tl = new TraceLogger("", "camfiZF");
            try
            {
                ReadProfile(); // Read device configuration from the ASCOM Profile store

                tl.LogMessage("Focuser", "Starting initialisation");
                connectedState = false;            // Initialise connected to false
                utilities      = new Util();       //Initialise util object
                astroUtilities = new AstroUtils(); // Initialise astro-utilities object
                                                   //TODO: Implement your additional construction here
            }
            catch { }
            tl.LogMessage("Focuser", "Completed initialisation");
        }
Exemplo n.º 15
0
        internal static void LogMessage(string identifier, string message, params object[] args)
        {
            lock (lockObject)
            {
                var msg = string.Format(message, args);

                if (Buffer.Count > 0)
                {
                    // Do not log repeated lines
                    if (Buffer[0] == msg)
                    {
                        return;
                    }

                    if (Buffer.Count > 1023)
                    {
                        Buffer.RemoveAt(Buffer.Count - 1);
                    }
                }

                Buffer.Insert(0, string.Format("[{0}] {1}", identifier, msg));

                if (ASCOMTrace != null)
                {
                    ASCOMTrace.LogMessage(identifier, msg);
                }
                if (Form != null)
                {
                    UpdateUI();
                }
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NSMount"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            tl = new TraceLogger("", "NSMount");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl.LogMessage("Telescope", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
                                               //   SlewState        = false; // Initialise Slewing false
            MotorEnableState = true;           // Initialise Motor enable

            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Telescope", "Completed initialisation");
        }
Exemplo n.º 17
0
 /// <summary>
 /// Log helper function that takes formatted strings and arguments
 /// </summary>
 /// <param name="identifier"></param>
 /// <param name="message"></param>
 /// <param name="args"></param>
 internal void LogMessage(string identifier, string message, params object[] args)
 {
     if (tl.Enabled)
     {
         var msg = string.Format(message, args);
         tl.LogMessage(identifier, msg);
     }
 }
Exemplo n.º 18
0
        public Telescope()
        {
            // Read device configuration from the ASCOM Profile store
            ReadProfile();

            traceLogger         = new TraceLogger("", "ArduinoST4");
            traceLogger.Enabled = traceState;
            traceLogger.LogMessage("Telescope", "Starting initialisation");

            deviceController = new DeviceController();

            //Setup the axes
            axisControllers = new AxisController[2];
            axisControllers[(int)Axis.RA]  = new AxisController(Axis.RA, this.deviceController, -Constants.RA_PER_SECOND * rightAscensionSideralRateMinus, Constants.RA_PER_SECOND * rightAscensionSideralRatePlus);
            axisControllers[(int)Axis.DEC] = new AxisController(Axis.DEC, this.deviceController, -Constants.DEGREES_PER_SECOND * declinationSideralRateMinus, Constants.DEGREES_PER_SECOND * declinationSideralRatePlus);
            traceLogger.LogMessage("Telescope", "Completed initialisation");
        }
Exemplo n.º 19
0
        public static int CACHE_OUTPUT_MAX_INTERVAL = 2;                               //how often to held hardware checking (in seconds)

        /// <summary>
        /// Constructor of Web_switch_hardware_class
        /// </summary>
        public Web_switch_hardware_class(bool traceState)
        {
            tl         = new TraceLogger("", "Vedrus_Hardware");
            tl.Enabled = traceState; //now we can set trace state, specified by user

            tlsem         = new TraceLogger("", "Vedrus_Switch_hardware_semaphore");
            tlsem.Enabled = true;


            tl.LogMessage("Switch_constructor", "Starting initialisation");

            hardware_connected_flag = false;

            VedrusSemaphore = new Semaphore(1, 2, "VedrusSwitch");

            tl.LogMessage("Switch_constructor", "Exit");
        }
Exemplo n.º 20
0
 public TECControl(string comPort, bool traceEnabled)
 {
     tecComPort = new SerialPort(comPort, baudrate, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
     rxBuf = new byte[rxBufferSize];
     tectl = new TraceLogger("", "tec_cam85_v02");
     tectl.Enabled = traceEnabled;
     tectl.LogMessage("TECControl", "Initialization finished");
 }
Exemplo n.º 21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TalonSuccessor"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Dome()
        {
            s_csDriverID          = Marshal.GenerateProgIdForType(this.GetType());
            s_csDriverDescription = "Talon Successor";

            tl = new TraceLogger("", "TalonSuccessor");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl.LogMessage("Dome", "Starting initialisation");

            // connectedState = false; // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Dome", "Completed initialisation");
        }
Exemplo n.º 22
0
 internal static void LogMessage(string identifier, string message, params object[] args)
 {
     if (started)
     {
         Log.LogFinish(" ...");
     }
     log.LogMessage(identifier, string.Format(message, args));
 }
Exemplo n.º 23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Norgate"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl         = new TraceLogger("", "Norgate");
            tl.Enabled = traceState;
            tl.LogMessage("Telescope", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here
            raAxisController  = new RAAxisController(this);
            decAxisController = new DecAxisController(this);

            tl.LogMessage("Telescope", "Completed initialisation");
        }
Exemplo n.º 24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HakosRoof"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Dome()
        {
            tl = new TraceLogger("", "HakosRoof");
            System.Diagnostics.Debug.WriteLine("Hello World");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl.LogMessage("Dome", "Starting initialisation");



            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Dome", "Completed initialisation");
        }
Exemplo n.º 25
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DeviceHub"/> class.
        /// </summary>
        public Focuser()
        {
            _driverID          = Marshal.GenerateProgIdForType(this.GetType());
            _driverDescription = GetDriverDescriptionFromAttribute();

            _logger = new TraceLogger("", "DeviceHubFocuser");
            ReadProfile();             // Read device configuration from the ASCOM Profile store

            _logger.LogMessage("Focuser", "Starting initialization");

            ConnectedState = false;             // Initialise connected to false
            Utilities      = new Util();        //Initialise util object

            // We need this to get the focuser ID.

            AppSettingsManager.LoadAppSettings();
            _logger.LogMessage("Focuser", "Completed initialization");
        }
Exemplo n.º 26
0
        /// <summary>
        /// Initializes a new instance of the <see cref="YNUDome"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Dome()
        {
            tl = new TraceLogger("", "YNUDome");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl.LogMessage("Dome", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            MySerialPort = new SerialPort();
            RecvBuf      = new byte[17];
            MyToolbox    = new Toolbox(this);

            tl.LogMessage("Dome", "Completed initialisation");
        }
Exemplo n.º 27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Shutter"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Switch()
        {
            tl = new TraceLogger("", "Shutter");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl.LogMessage("Switch", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Switch", "Completed initialisation");

            /// Byte packet that gets sent to bus.
            //bus = new BusInterface();
            //bus.PacketReceivedEvent += bus_PacketReceivedEvent;
        }
Exemplo n.º 28
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Vantage"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public ObservingConditions()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl         = new TraceLogger("", "Vantage");
            tl.Enabled = debugger.Tracing;
            tl.LogMessage("ObservingConditions", "Starting initialisation");

            _connected     = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object

            tl.LogMessage("ObservingConditions", "Completed initialisation");
            if (_reportFile != null && _reportFile != string.Empty && File.Exists(_reportFile))
            {
                Refresh();
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Skeleton2"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            tl = new TraceLogger("", "Skeleton2");
            Guid _guid = SharedResources.GetGuid();

            MessageBox.Show("Shared Resources = " + _guid.ToString(), "Message");
            driverID = Marshal.GenerateProgIdForType(this.GetType());
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl.LogMessage("Telescope", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
                                               //TODO: Implement your additional construction here

            tl.LogMessage("Telescope", "Completed initialisation");
        }
Exemplo n.º 30
0
        /// <summary>
        /// Constructor of IP9212_switch_class
        /// </summary>
        public Hardware_class(Dome DomeDriver_ext)
        {
            DomeDriverLnk = DomeDriver_ext;

            tl = Dome.tl; //the same logger with Dome Driver

            //tl.Enabled = true; //default value before reading settings

            //RegisterSettings();
            //readSettings();
            tl.LogMessage("Switch_constructor", "Starting initialisation");

            hardware_connected_flag = false;

            DeviceSemaphore = new Semaphore(1, 2, "ip9212");

            tl.LogMessage("Switch_constructor", "Exit");
        }
Exemplo n.º 31
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StarGen"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Camera()
        {
            tl = new TraceLogger("", "StarGen");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl.LogMessage("Camera", "Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Camera", "Completed initialisation");

            _simulator = new PhotoSimulator(new Random());

            _simulator.AddStars(1000, 60000, 2.12, 5, 40);
        }
Exemplo n.º 32
0
        public AAF2(bool traceState)
        {
            string traceDir = getTraceDir();   // Get the trace dir from registry.
            if (traceDir == "")                // if no value set it to C:\
                traceDir = "c:\\";

            tl = new TraceLogger(traceDir + "\\AAF2" + DateTime.Now.ToString("yyyyMMddHHmmss"), "AAF2_aaf2");      // Trace Logger
            tl.Enabled = traceState;
            tl.LogMessage("AAF2", "Constructed");
        }
Exemplo n.º 33
0
		/// <summary>
		/// Initializes a new instance of the <see cref="GenericCCDCamera"/> class.
		/// Must be public for COM registration.
		/// </summary>
		public Video()
		{
			ReadProfile(); // Read device configuration from the ASCOM Profile store

			m_tl = new TraceLogger("", "GenericCCDCamera");
			m_tl.Enabled = m_traceState;
			m_tl.LogMessage("Video", "Starting initialisation");

			m_connectedState = false; // Initialise connected to false
			m_utilities = new Util(); //Initialise util object
			m_astroUtilities = new AstroUtils(); // Initialise astro utilities object
			//TODO: Implement your additional construction here

			m_tl.LogMessage("Video", "Completed initialisation");
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="CelestronAdvancedBlueTooth"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store
            _telescopeV3 = this;

            tl = new TraceLogger("", "CelestronAdvancedBlueTooth");
            tl.Enabled = profile.TraceState;
            tl.LogMessage("Telescope", "Starting initialisation");

            connectedState = false; // Initialise connected to false
            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            try
            {
                //Initialize();
            }
            catch (Exception err)
            {

            }
            tl.LogMessage("Telescope", "Completed initialisation");
            _handControl = new HandControl();
            //_handControl.SetForm(telescopeWorker);
        }
Exemplo n.º 35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="cam86"/> class.
 /// Must be public for COM registration.
 /// </summary>
 public Camera()
 {
     // Read device configuration from the ASCOM Profile store
     ReadProfile();
     //Init debug logger
     tl = new TraceLogger("", "cam86");
     tl.Enabled = traceState;
     tl.LogMessage("Camera", "Starting initialisation");
     // Initialise connected to false
     cameraConnectedState = false;
     //Initialise util object
     utilities = new Util();
     //New form for gain/offset settings
     settingsForm = new camSettings();
     settingsForm.gain = gainState;
     settingsForm.offset = offsetState;
     settingsForm.onTop = onTopState;
     settingsForm.slowCoolingEnabled = slowCoolingEnabledState;
     settingsForm.slowCoolingSpeed = slowCoolingSpeedState;
     slowCoolingTimer = new System.Timers.Timer(60000);
     slowCoolingTimer.Enabled = false;
     slowCoolingTimer.Elapsed += slowCoolingTimerTick;
     tl.LogMessage("Camera", "Completed initialisation");
 }
Exemplo n.º 36
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StellarFocus"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Focuser()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl = new TraceLogger("", "StellarFocus");
            tl.Enabled = traceState;
            tl.LogMessage("Focuser", "Starting initialisation");

            connectedState = false; // Initialise connected to false
            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            serialPort = new ASCOM.Utilities.Serial();

            ConnectStatus = 0;
            Homing = false;

            tl.LogMessage("Focuser", "Completed initialisation");
        }
Exemplo n.º 37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="cam85_v02"/> class.
 /// Must be public for COM registration.
 /// </summary>
 public Camera()
 {
     // Read device configuration from the ASCOM Profile store
     ReadProfile();
     //Init debug logger
     tl = new TraceLogger("", "cam85_v02");
     tl.Enabled = traceState;
     tl.LogMessage("Camera", "Starting initialisation");
     // Initialise connected to false
     cameraConnectedState = false;
     //Initialise util object
     utilities = new Util();
     // Initialise astro utilities object
     astroUtilities = new AstroUtils();
     //New form for gain/offset settings
     settingsForm = new camSettings();
     settingsForm.gain = gainState;
     settingsForm.offset = offsetState;
     settingsForm.onTop = onTopState;
     if (!coolerEnabledState) settingsForm.tecStatus = "disabled";
     settingsForm.baudrateAdjust = baudrateAdjustState;
     tec = new TECControl(coolerComPortState, traceState);
     tl.LogMessage("Camera", "Completed initialisation");
 }
Exemplo n.º 38
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Arduino"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Dome()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl = new TraceLogger("", "Arduino");

            tl.Enabled = traceState;
            tl.LogMessage("Doem", "Starting Dome");
            tl.LogMessage("Dome", "Setting Chooser Form");
            try
            {
                SetupDialog();
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("Cancel")) return;
                else throw ex;
            }

            tl.LogMessage("Dome", "Starting initialisation");
            
            connectedState = false;             // Initialise connected to false
            utilities = new Util();             //Initialise util object
            astroUtilities = new AstroUtils();  // Initialise astro utilities object
            //TODO: Implement your additional construction here
            using (Profile p = new Profile())
            {
                p.DeviceType = "Dome";
                comPort = p.GetValue(driverID, "comPort");
                _arduino = new ArduinoDome(comPort, isArduinoBootLoader);
            }
            RegisterASCOM((Type)null);
            _position = 0.0;
            Parked = true;
            ParkPosition = 0.0;
            IsSlewing = false;
            Threshold = 2.0;
            connectedState = false;
//            Braking = 0.0;
            DomeTimer = new System.Windows.Threading.DispatcherTimer();
            DomeTimer.Interval = TimeSpan.FromSeconds(3);//new TimeSpan(0, 0, 3);
            DomeTimer.Tick += DomeTimer_Tick;
            DomeTimer.IsEnabled = true;
            DomeTimer.Stop();

            slewThread.WorkerReportsProgress = true;
            slewThread.WorkerSupportsCancellation = true;
            slewThread.DoWork += new DoWorkEventHandler(slewThread_Body);
            slewThread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(slewThread_Completed);
            //slewThread.DoWork += slewThread_Body;
            //slewThread.RunWorkerCompleted += slewThread_Completed;
            tl.LogMessage("Dome", "Completed initialisation");
        }
Exemplo n.º 39
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IP9212_rolloffroof3"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Dome()
        {
            tl = new TraceLogger("", "IP9212_rolloffroof2");
            #if DEBUG
            tl.Enabled = true; //at least for debugging - log will be always created no matter the value of traceState
            tl.LogMessage("Dome", "Init traceloger (debug mode)");
            #endif

            Hardware = new IP9212_switch_class(this);

            ReadProfile(); // Read device configuration from the ASCOM Profile store

            //set the correct logger state
            tl.Enabled = traceState;
            tl.LogMessage("Dome", "Starting initialisation");

            connectedState = false; // Initialise connected to false
         
            //utilities = new Util(); //Initialise util object
            //astroUtilities = new AstroUtils(); // Initialise astro utilities object

            tl.LogMessage("Dome", "Completed initialisation");
        }
Exemplo n.º 40
0
        public Telescope()
        {
            // Read device configuration from the ASCOM Profile store
            ReadProfile();

            traceLogger = new TraceLogger("", "ArduinoST4");
            traceLogger.Enabled = traceState;
            traceLogger.LogMessage("Telescope", "Starting initialisation");

            deviceController = new DeviceController();

            //Setup the axes
            axisControllers = new AxisController[2];
            axisControllers[(int)Axis.RA] = new AxisController(Axis.RA, this.deviceController, -Constants.RA_PER_SECOND * rightAscensionSideralRateMinus, Constants.RA_PER_SECOND * rightAscensionSideralRatePlus);
            axisControllers[(int)Axis.DEC] = new AxisController(Axis.DEC, this.deviceController, -Constants.DEGREES_PER_SECOND * declinationSideralRateMinus, Constants.DEGREES_PER_SECOND * declinationSideralRatePlus);
            traceLogger.LogMessage("Telescope", "Completed initialisation");
        }
Exemplo n.º 41
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Norgate"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl = new TraceLogger("", "Norgate");
            tl.Enabled = traceState;
            tl.LogMessage("Telescope", "Starting initialisation");

            connectedState = false; // Initialise connected to false
            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here
            raAxisController = new RAAxisController(this);
            decAxisController = new DecAxisController(this);

            tl.LogMessage("Telescope", "Completed initialisation");
        }
Exemplo n.º 42
0
        private AAF2 aaf2;  // tekkydave

        #endregion

        /// <summary>
        /// Initializes a new instance of the <see cref="AAF2"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Focuser()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            aaf2 = new AAF2(traceState);  // tekkydave - instantiate aaf2 object for Arduino calls, passing in the tracestate.

            string traceDir = aaf2.getTraceDir();   // tekkydave - get the trace dir from registry.
            if (traceDir == "")                     // if no value set it to C:\
                traceDir = "c:\\";

            tl = new TraceLogger(traceDir + "\\Driver" + DateTime.Now.ToString("yyyyMMddHHmmss"), "AAF2_Driver");      // tekkydave - Added path to trace file
            tl.Enabled = traceState;
            tl.LogMessage("Focuser", "Starting initialisation");

            connectedState = false; // Initialise connected to false
            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here
            tl.LogMessage("Focuser", "Completed initialisation");
        }
Exemplo n.º 43
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ATA50"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Dome()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl = new TraceLogger("", "ATA50");
            tl.Enabled = traceState;
            tl.LogMessage("Dome", "Starting initialisation");

            connectedState = false; // Initialise connected to false
            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Dome", "Completed initialisation");
        }
Exemplo n.º 44
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ATA50KubbeDriver"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Dome()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl = new TraceLogger("", "ATA50KubbeDriver");
            tl.Enabled = true;
            tl.LogMessage("Dome", "baslatiliyor..wait..wait..wait..");

            connectedState = false; // Initialise connected to false
            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Dome", "Tamamlandi..");
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Sepikascope2"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl = new TraceLogger("", "Sepikascope2");
            tl.Enabled = traceState;
            tl.LogMessage("Telescope", "Starting initialisation");

            connectedState = false; // Initialise connected to false
            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Telescope", "Completed initialisation");

            actionsArrayList = new ArrayList();

            //NOTE : DOUBLE CHECK - EACH ONE
            //       UPDATE LIST!

            //actionsArrayList.Add("CanMoveAxis"); //can move Alt, Azm
            //actionsArrayList.Add("MoveAxis"); //not sure how to implement
            actionsArrayList.Add("SlewToAltAz"); //functional
            //actionsArrayList.Add("Slewing"); //untested, not written?
            actionsArrayList.Add("AbortSlew"); //functional
            actionsArrayList.Add("Altitude"); //functional
            actionsArrayList.Add("Azimuth");  //functional
            //actionsArrayList.Add("SyncToAltAz"); //functional
            actionsArrayList.Add("SupportedActions"); //redundant
        }
Exemplo n.º 46
0
        int SHUTTERSTATUS_CHECK_INTERVAL_REDUCED = 2; //how often to chech true shutter status (in seconds) when shutter is moving

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Constructor of IP9212_switch_class
        /// </summary>
        public IP9212_switch_class()
        {
            tl = new TraceLogger("", "IP9212_Switch");
            tl.Enabled = true; //default value before reading settings

            RegisterSettings();
            readSettings();

            tl.Enabled = traceState; //now we can set trace state, specified by user
            tl.LogMessage("Switch_constructor", "Starting initialisation");

            hardware_connected_flag = false;

            IP9212Semaphore = new Semaphore(1, 2, "ip9212");

            tl.LogMessage("Switch_constructor", "Exit");
        }
Exemplo n.º 47
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Sepikascope001"/> class.
        /// Must be public for COM registration.
        /// 
        /// TODO :
        /// INITIALIZE ALL RELEVANT FIELDS HERE!!!
        /// 
        /// </summary>
        public Telescope()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl = new TraceLogger("", "Sepikascope001");
            tl.Enabled = traceState;
            tl.LogMessage("Telescope", "Starting initialisation");

            connectedState = false; // Initialise connected to false
            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Telescope", "Completed initialisation");

            actionsArrayList = new ArrayList();

            actionsArrayList.Add("CanMoveAxis"); // returns true for azimuth
            //actionsArrayList.Add("MoveAxis");
            actionsArrayList.Add("SlewToAltAz"); // slews azimuth, not altitude yet
            actionsArrayList.Add("Slewing"); // returns false until
                                             // I implement threads
            //actionsArrayList.Add("AbortSlew");
            actionsArrayList.Add("Altitude"); // not implemented yet
            actionsArrayList.Add("Azimuth");  // returns arcminutes
            //actionsArrayList.Add("SyncToAltAz");
            actionsArrayList.Add("SupportedActions");
        }
Exemplo n.º 48
0
        //public FTDIio io = new FTDIio();
        
        /// <summary>
        /// Initializes a new instance of the <see cref="Pictavore_4021a"/> class.
        /// Must be public for COM registration.
        /// </summary>
        /// 
        public Camera()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

#if Server
            string s_csDriverID = Marshal.GenerateProgIdForType(this.GetType());
#endif
            
            tl = new TraceLogger("", "Pictavore_4021a");
            tl.Enabled = traceState;
            tl.LogMessage("Camera", "Starting initialisation");

            connectedState = FTDIio.Connected;
            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here

            tl.LogMessage("Camera", "Completed initialisation");
        }