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

            tl         = new TraceLogger("", "Focuser");
            tl.Enabled = traceState;
            tl.LogMessage("Focuser", "Starting initialisation");
            Focuser.traceState = true;
            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
            arduino = new Arduino();
            try
            {
                sw              = new StreamReader("c:\\configf.dat");
                comPort         = Convert.ToString(sw.ReadLine());
                Analog          = Convert.ToBoolean(sw.ReadLine());
                focuserPosition = Convert.ToInt64(sw.ReadLine());
                sw.Close();
            }
            catch (Exception ex)
            {
                StreamWriter sr = new StreamWriter("c:\\configf.dat");
                sr.WriteLine(comPort.ToString());
                sr.WriteLine(Analog.ToString());
                sr.WriteLine(focuserPosition.ToString());
                sr.Close();
                System.Windows.Forms.MessageBox.Show("Error in saving config" + ex.Message);
            }

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

            tl.Enabled = traceState;
            tl.LogMessage("Switch", "Starting initialisation");

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

            Serial2 = new Utilities.Serial();
            tl.LogMessage("Switch", "Completed initialisation");
            if (File.Exists(path + "\\relay2Chsettings.txt"))
            {
                fileread();
            }
            else
            {
                // default values for relay assignments
                relay0 = "Ch 1";
                relay1 = "Ch 2";
                filewrite();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SSFocuser"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Focuser()
        {
            tl = new TraceLogger("", "SSFocuser");
            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

            tl.LogMessage("Focuser", "Completed initialisation");
            //这里是setupdialog后才初始化
            MySerialPort = new SerialPort();
            //buffer = new byte[1024];
            RecvBuf = "";
            m_rCmd  = 'U';

            MyToolbox = new Toolbox(this);

            m_IsMoving          = false;
            m_TempComp          = false;
            m_TempCompAvailable = true;
        }
Ejemplo n.º 4
0
        private void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                // cleanup managed resources (none to cleanup for now)
            }

            // Clean up the tracelogger and util objects
            if (m_mount != null)
            {
                SharedResources.DisconnectMount();
                m_mount  = null;
                m_camera = null;
            }

            SharedResources.PutTraceLogger();
            tl = null;

            utilities.Dispose();
            utilities = null;
            astroUtilities.Dispose();
            astroUtilities = null;
            transform.Dispose();
            transform = null;

            disposed = true;
        }
Ejemplo n.º 5
0
        public void init()
        {
            if (initialized)
            {
                return;
            }

            och = new ObservingConditions("ASCOM.OCH.ObservingConditions");
            if (tl == null)
            {
                tl = new TraceLogger("", "Wise40.SafeToOpen");
            }
            name              = "Wise40 SafeToOpen";
            driverID          = Const.wiseSafeToOperateDriverID;
            driverDescription = string.Format("ASCOM Wise40.SafeToOpen v{0}", version.ToString());

            if (_profile == null)
            {
                _profile = new Profile()
                {
                    DeviceType = "SafetyMonitor"
                };
            }

            humiditySensor          = new HumiditySensor(this);
            windSensor              = new WindSensor(this);
            sunSensor               = new SunSensor(this);
            cloudsSensor            = new CloudsSensor(this);
            rainSensor              = new RainSensor(this);
            humanInterventionSensor = new HumanInterventionSensor(this);
            _sensors = new List <Sensor>()
            {
                windSensor,
                cloudsSensor,
                rainSensor,
                humiditySensor,
                sunSensor,
                humanInterventionSensor
            };

            tl.Enabled = debugger.Tracing;
            tl.LogMessage("SafetyMonitor", "Starting initialisation");

            _connected = false;

            novas31    = new NOVAS31();
            astroutils = new AstroUtils();
            ascomutils = new Util();

            siteLatitude  = ascomutils.DMSToDegrees("30:35:50.43");
            siteLongitude = ascomutils.DMSToDegrees("34:45:43.86");
            siteElevation = 882.9;
            novas31.MakeOnSurface(siteLatitude, siteLongitude, siteElevation, 0.0, 0.0, ref onSurface);
            novas31.MakeObject(0, Convert.ToInt16(Body.Sun), "Sun", new CatEntry3(), ref Sun);

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

            tl.LogMessage("SafetyMonitor", "Completed initialisation");
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GotoStar"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            LogDebug = false;

            ReadProfile(); // Read device configuration from the ASCOM Profile store
            // initialize serilog in debug or info mode
            if (LogDebug)
            {
                Log.Logger = new LoggerConfiguration()
                             .MinimumLevel.Debug()
                             .WriteTo.Console()
                             .WriteTo.File("logfile.log", rollingInterval: RollingInterval.Day)
                             .CreateLogger();
            }
            else
            {
                Log.Logger = new LoggerConfiguration()
                             .MinimumLevel.Information()
                             .WriteTo.Console()
                             .WriteTo.File("logfile.log", rollingInterval: RollingInterval.Day)
                             .CreateLogger();
            }
            Log.Information("Starting GotoStar driver");
            Log.Debug("Telescope - Starting initialisation");

            connectedState = false;            // Initialise connected to false
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            // initialize mount communication
            gotoStar = new GotoStarCommunication();
            Log.Debug("Telescope - Completed initialisation");
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenSynscan"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            tl = new TraceLogger("", "OpenSynscan");
            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
            mMutex         = new Mutex();
            mSender        = new UdpClient(TX_PORT);
            mReceiver      = new UdpClient(RX_PORT);

            mDevice   = null;
            mTxPkt    = new Byte[TX_PKT_LEN];
            mRxPkt    = new Byte[RX_PKT_LEN];
            mTxPkt[0] = PULSE_PKT_START;
            mRxEvent  = new SocketAsyncEventArgs();
            mRxEvent.SetBuffer(mRxPkt, 0, RX_PKT_LEN);
            mRxEvent.RemoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
            mRxEvent.UserToken      = mReceiver.Client;
            mRxEvent.Completed     += new EventHandler <SocketAsyncEventArgs>(RecvCompleted);
            mReceiver.Client.ReceiveFromAsync(mRxEvent);

            tl.LogMessage("Telescope", "Completed initialisation");
        }
Ejemplo n.º 8
0
        public override void Randomize()
        {
            if (Hyperdrive.seedString == AstroUtils.KERBIN_SYSTEM_COORDS)
            {
                return;
            }
            float value = WarpRNG.GetValue();

            // Atmosphere has a 75% chance of being generated if we are a planet
            // Atmosphere has a 10% chance of being generated if we are a moon
            if (value >= 0.25f && AstroUtils.IsSun(planetData.referenceBody) || value <= 0.1f)
            {
                hasAtmosphere = true;
            }
            if (hasAtmosphere)
            {
                value = WarpRNG.GetValue();
                // 10% chance if atmosphere the atmosphere has oxygen
                if (value >= 0.9f)
                {
                    hasOxygen = true;
                }
                atmosphereHeight       = WarpRNG.GenerateFloat(0.5f, 15.0f);
                atmospherePressureMult = WarpRNG.GenerateFloat(0.1f, 15.0f);
                ambientColor           = new Color(WarpRNG.GetValue() * 0.25f, WarpRNG.GetValue() * 0.25f, WarpRNG.GetValue() * 0.25f);
            }
            // Temperature measured by distance from sun
            if (!IsSun())
            {
                double orbitHeight = planetData.semiMajorAxis / AstroUtils.MAX_SEMI_MAJOR_AXIS;
                double inverseMult = 1.0 - orbitHeight;
                tempMultiplier = 5.0f * (float)inverseMult;
            }
        }
Ejemplo n.º 9
0
        /// <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
        }
Ejemplo n.º 10
0
 public void Dispose()
 {
     // Clean up the tracelogger and util objects
     trace = false;
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Wise40Hardware"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Dome()
        {
            wisedome.ReadProfile(); // Read device configuration from the ASCOM Profile store

            utilities      = new Util();
            astroUtilities = new AstroUtils();

            wisedome.SetArrivedAtAzEvent(arrived);
        }
Ejemplo n.º 12
0
 private void CreateSphereOfInfluence()
 {
     sphereOfInfluence = AstroUtils.CalculateSOIFromMass(planetData);
     if (sphereOfInfluence > AstroUtils.KERBIN_SOI * 30)
     {
         // This is where Jool's SOI caps out -- we don't want to go any larger
         sphereOfInfluence = AstroUtils.KERBIN_SOI * 30;
     }
 }
Ejemplo n.º 13
0
 public void Dispose()
 {
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
     wisedome.Dispose();
     wisedome = null;
 }
Ejemplo n.º 14
0
        public void Dispose()
        {
            util.Dispose();
            util = null;

            astroUtils.Dispose();
            astroUtils = null;

            wisetele.Dispose();
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Wise40"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            ReadProfile();                 // Read device configuration from the ASCOM Profile store

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

            wisetele.init();
        }
Ejemplo n.º 16
0
 public void Dispose()
 {
     tl.Enabled = false;
     tl.Dispose();
     tl = null;
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
 }
Ejemplo n.º 17
0
 public void Dispose()
 {
     // Clean up the tracelogger and util objects
     //tl.Enabled = false;
     //tl.Dispose();
     //tl = null;
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
 }
Ejemplo n.º 18
0
 public void Dispose()
 {
     // Clean up the tracelogger and util objects
     tl.Enabled = false;
     tl.Dispose();
     tl = null;
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
     serialPort.Close();
 }
Ejemplo n.º 19
0
 public void Dispose()
 {
     // Clean up the logger and util objects
     Log.Information("Terminating GotoStar driver");
     Log.CloseAndFlush();
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
     gotoStar?.ClosePort();
     gotoStar?.Dispose();
 }
Ejemplo n.º 20
0
 public void Dispose()
 {
     // Clean up the tracelogger and util objects
     tl.Enabled = false;
     tl.Dispose();
     tl = null;
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
     fMounter.Disconnect();
 }
Ejemplo n.º 21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ElmsRemoteTelescopeUdp"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            tl = new TraceLogger("", "ElmsRemoteTelescopeUdp");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

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

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

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

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

            LogMessage("Dome", "Completed initialisation");
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TEMPLATEDEVICENAME"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Focuser()
        {
            _controller        = new DeviceFocuser();
            _controller.Server = comServer;
            _controller.trace  = trace;

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

            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            //TODO: Implement your additional construction here
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ElmsRemoteFocuser"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Focuser()
        {
            tl = new TraceLogger("", "ElmsRemoteFocuser");
            ReadProfile(); // Read device configuration from the ASCOM Profile store

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

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

            tl.LogMessage("Focuser", "Completed initialisation");
        }
Ejemplo n.º 25
0
        public Camera()
        {
            tl = new TraceLogger("", "microlux");
            ReadProfile();

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

            IsConnected    = false;
            utilities      = new Util();
            astroUtilities = new AstroUtils();

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

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

            serialPort     = null;             // Initialise without connection
            utilities      = new Util();       //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object

            tl.LogMessage("Dome", "Completed initialisation");
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AGBHMask"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Switch()
        {
            tl = new TraceLogger("", "AGBHMask");
            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

            tl.LogMessage("Switch", "Completed initialisation");
        }
Ejemplo n.º 28
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());

            logMessage = SharedResources.LogMessageCallback;

            logMessage(LoggingFlags.Focuser, "Starting initialisation");

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

            logMessage(LoggingFlags.Focuser, "Completed initialisation");
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OpenAstroGuider"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Telescope()
        {
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            tl         = new TraceLogger("", "OpenAstroGuider");
            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

            tl.LogMessage("Telescope", "Completed initialisation");
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GSFocus"/> class.
        /// Must be public for COM registration.
        /// </summary>
        /// 



        public Focuser()
        {
            tl = new TraceLogger("", "GSfocus");
            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

            tl.LogMessage("Focuser", "Completed initialisation");
        }
Ejemplo n.º 31
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");
        }
Ejemplo n.º 32
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");
        }
Ejemplo n.º 33
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");
        }
Ejemplo n.º 34
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");
        }
Ejemplo n.º 35
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");
        }
Ejemplo n.º 36
0
 public void Dispose()
 {
     // Clean up the tracelogger, settings form and util objects
     tl.Enabled = false;
     tl.Dispose();
     tl = null;
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
     settingsForm.Dispose();
     tec.Dispose();
 }
Ejemplo 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");
 }
Ejemplo n.º 38
0
        public ArduinoFocuser focuser;  // tekkydave

        #endregion

        /// <summary>
        /// Initializes a new instance of the <see cref="ArduinoFocuser"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public BaseDriver(string deviceType, string driverId, string driverDescription, short driverInterfaceVersion)
        {
            this.deviceType = deviceType;
            this.driverId = driverId;
            this.driverDescription = driverDescription;
            this.driverInterfaceVersion = driverInterfaceVersion;
            ReadProfile(); // Read device configuration from the ASCOM Profile store

            utilities = new Util(); //Initialise util object
            astroUtilities = new AstroUtils(); // Initialise astro utilities object
            focuser = new ArduinoFocuser(this);
        }
        /// <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
        }
Ejemplo n.º 40
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");
        }
Ejemplo n.º 41
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..");
        }
Ejemplo n.º 42
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");
        }
Ejemplo n.º 43
0
		public void Dispose()
		{
			// Clean up the tracelogger and util objects
			m_tl.Enabled = false;
			m_tl.Dispose();
			m_tl = null;
			m_utilities.Dispose();
			m_utilities = null;
			m_astroUtilities.Dispose();
			m_astroUtilities = null;
			if (m_video != null)
			{
				m_video.Dispose();
				m_video = null;
			}
		}
Ejemplo n.º 44
0
 public void Dispose()
 {
     // Clean up the tracelogger and util objects
     tl.Enabled = false;
     tl.Dispose();
     tl = null;
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
 }
Ejemplo n.º 45
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");
		}
 public void Dispose()
 {
     // Clean up the tracelogger and util objects
     StopWorking();
     if (telescopeWorker != null) telescopeWorker.Dispose();
     tl.Enabled = false;
     tl.Dispose();
     tl = null;
     utilities.Dispose();
     utilities = null;
     astroUtilities.Dispose();
     astroUtilities = null;
 }
        /// <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);
        }