Example #1
0
        private DialogResult autoTestAbort()
        {
            DialogResult yes = DialogResult.Yes;

            if (!clsGlobal.ScriptDone)
            {
                yes = MessageBox.Show("Test in progress -- Abort?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                if (yes != DialogResult.Yes)
                {
                    return(yes);
                }
                clsGlobal.Abort = true;
                this.objPython.PythonEngineOutput.CloseFile();
                this.objPython.WriteLine("Test aborted!");
                try
                {
                    if (frmRFPlaybackCtrl.GetChildInstance() != null)
                    {
                        frmRFPlaybackCtrl.GetChildInstance().PlaybackStop();
                    }
                }
                catch
                {
                }
                clsGlobal.g_objfrmMDIMain.CancelDelay();
                clsGlobal.AbortEvent.SiRFLiveEventSet();
                this.objPython.engine.Shutdown();
                this.objPython.engine.Dispose();
                foreach (string str in clsGlobal.g_objfrmMDIMain.PortManagerHash.Keys)
                {
                    PortManager manager = (PortManager)clsGlobal.g_objfrmMDIMain.PortManagerHash[str];
                    if (manager != null)
                    {
                        manager.CloseAll();
                    }
                }
                clsGlobal.ScriptDone = true;
                this._running        = false;
            }
            return(yes);
        }