Ejemplo n.º 1
0
        //Method for initiating an abort event as called from a method that wants to speak one
        public void AbortIt(string abortmessage)
        {
            //Logs the abort event
            LogEvent lg = new LogEvent();

            lg.LogIt("Abort Initiated: " + abortmessage);

            //Raises an abort event for anyone who is listening
            RaiseAbortEvent(abortmessage);
            //tell the operations class that there is an abort
            FormHumason.SetAbort();
        }
Ejemplo n.º 2
0
        private static void GracefulAbort()
        {
            //Abort has been pushed or automatically called by procedure due to some error
            //If start is not active or attended is checked then we want to just park the scope and disconnect all
            //devices.
            //If start is active, then we want to treat this as a catastrophic event and simply
            //stop everything by parking
            SessionControl openSession = new SessionControl();

            LogEvent lg = new LogEvent();

            lg.LogIt("Aborting and Closing Down");
            FormHumason.SetAbort();

            //All done.  Abort autoguiding, assuming is running -- should be off, but you never know
            AutoGuide.AutoGuideStop();

            //If autorun set and we're running unattended, then shut down, or... just park the mount, home the dome and disconnect
            if (openSession.IsAutoRunEnabled && !openSession.IsAttended)
            {
                LaunchPad.RunShutDownApp();
            }
            else if (FormHumason.SessionState != FormHumason.SessionStateFlag.Stopped)
            {
                lg.LogIt("Parking Mount");
                try { TSXLink.Mount.Park(); }
                catch (Exception ex) { lg.LogIt("Could not Park: " + ex.Message); }
                //home dome (don't close as autorun is not enabled
                lg.LogIt("Homing Dome");
                if (openSession.IsDomeAddOnEnabled)
                {
                    TSXLink.Dome.HomeDome();
                }
                lg.LogIt("Disconnecting all devices");
                TSXLink.Connection.DisconnectAllDevices();
                FormHumason.SetStopped();
            }
            lg.LogIt("Abort Completed -- awaiting new orders, Captain");
            return;
        }