Пример #1
0
 protected override void OnClosed(EventArgs e)
 {
     if (clsGlobal.ScriptDone)
     {
         m_SChildform = null;
     }
 }
Пример #2
0
 public static frmPython GetChildInstance()
 {
     if (m_SChildform == null)
     {
         m_SChildform = new frmPython();
     }
     return m_SChildform;
 }
Пример #3
0
 public frmPython()
 {
     this.InitializeComponent();
     Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false);
     this.InitializePythonEngine();
     this.InitPythonEngineGlobals();
     m_SChildform = this;
 }
Пример #4
0
 public static frmPython GetChildInstance()
 {
     if (m_SChildform == null)
     {
         m_SChildform = new frmPython();
     }
     return(m_SChildform);
 }
Пример #5
0
 public frmPython()
 {
     this.InitializeComponent();
     Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false);
     this.InitializePythonEngine();
     this.InitPythonEngineGlobals();
     m_SChildform = this;
 }
Пример #6
0
 protected override void OnClosed(EventArgs e)
 {
     if (clsGlobal.ScriptDone)
     {
         m_SChildform = null;
     }
 }
Пример #7
0
 private void autoTestRunBtn_Click(object sender, EventArgs e)
 {
     if (this.objPython != null)
     {
         this.objPython.Close();
     }
     this.objPython.Dispose();
     this.objPython = null;
     clsGlobal.g_objfrmMDIMain.ClearPortList();
     this.objPython = new frmPython();
     this.objPython.MdiParent = base.MdiParent;
     this.objPython.Show();
     this.objPython.BringToFront();
     if (!clsGlobal.ScriptDone)
     {
         this.autoTestAbort();
     }
     else
     {
         this.autoTestThread = new Thread(new ThreadStart(this.autoTestStart));
         this.autoTestThread.IsBackground = true;
         this.autoTestThread.Start();
     }
 }
Пример #8
0
 public void autoTestRunSingle()
 {
     if ((this.objPython == null) || this.objPython.IsDisposed)
     {
         this.objPython = new frmPython();
     }
     if (!this.objPython.Visible)
     {
         this.objPython.Show();
         this.objPython.BringToFront();
     }
     if (clsGlobal.ScriptDone)
     {
         if (fileIdx >= this.toRunList.Count)
         {
             this.testResults = this.testResults + "Log files at: " + clsGlobal.LogDirectory + "\n";
             this.testResults = this.testResults + "\nBest Regards,\n\nSiRFLive Team\n";
             this.autoTestReport(this.testResults);
         }
         else if (clsGlobal.Abort)
         {
             this.testResults = this.testResults + "\r\n *** Test Aborted ***\r\n";
             this.testResults = this.testResults + "Log files at: " + clsGlobal.LogDirectory + "\n";
             this.testResults = this.testResults + "\nBest Regards,\n\nSiRFLive Team\n";
             this.autoTestReport(this.testResults);
             fileIdx = this.toRunList.Count + 1;
             clsGlobal.Abort = false;
         }
         else
         {
             this.testResults = this.testResults + this.crossThreadUpdateIntf.GetSelectedCheckListBoxIdx(this.autoTestToRunScriptsListVal, fileIdx) + "\n";
             clsGlobal.ScriptDone = false;
             string fileName = this.toRunListArray[fileIdx];
             clsGlobal.TestScriptPath = fileName;
             fileIdx++;
             this.objPython.engine.ExecuteFile(fileName);
         }
     }
 }
Пример #9
0
 private object GetContentFromPersistString(string persistString)
 {
     if (persistString == typeof(frmAutomationTests).ToString())
     {
         _objFrmAutoTest = CreateAutomationTestWindow();
         return _objFrmAutoTest;
     }
     if (persistString == typeof(frmPerformanceMonitor).ToString())
     {
         _objFrmPerfMonitor = CreatefrmPerformanceMonitorWindow();
         return _objFrmPerfMonitor;
     }
     if (persistString == typeof(frmPython).ToString())
     {
         _objFrmPython = CreatePythonWindow();
         return _objFrmPython;
     }
     if (persistString == typeof(frmCommInputMessage).ToString())
     {
         if ((_objFrmCommOpen != null) && !_objFrmCommOpen.IsDisposed)
         {
             _objFrmCommInputMessage = new frmCommInputMessage();
             _objFrmCommInputMessage.CommWindow = _objFrmCommOpen.comm;
             _objFrmCommOpen._inputCommands = _objFrmCommInputMessage;
         }
         return _objFrmCommInputMessage;
     }
     if (persistString == typeof(frmCommLocationMap).ToString())
     {
         if ((_objFrmCommOpen != null) && !_objFrmCommOpen.IsDisposed)
         {
             _objFrmCommLocationMap = new frmCommLocationMap();
             _objFrmCommLocationMap.CommWindow = _objFrmCommOpen.comm;
             _objFrmCommOpen._locationViewPanel = _objFrmCommLocationMap;
         }
         return _objFrmCommLocationMap;
     }
     if (persistString == typeof(frmCommSignalView).ToString())
     {
         if ((_objFrmCommOpen != null) && !_objFrmCommOpen.IsDisposed)
         {
             _objFrmCommSignalView = new frmCommSignalView();
             _objFrmCommSignalView.CommWindow = _objFrmCommOpen.comm;
             _objFrmCommOpen._signalStrengthPanel = _objFrmCommSignalView;
         }
         return _objFrmCommSignalView;
     }
     if (persistString == typeof(frmEncryCtrl).ToString())
     {
         if ((_objFrmCommOpen != null) && !_objFrmCommOpen.IsDisposed)
         {
             _objFrmEncryCtrl = new frmEncryCtrl(_objFrmCommOpen.comm);
             _objFrmEncryCtrl.CommWindow = _objFrmCommOpen.comm;
         }
         return _objFrmEncryCtrl;
     }
     if (persistString == typeof(frmRFCaptureCtrl).ToString())
     {
         _objFrmCaptureCtrl = CreateRFReplayCaptureWindow();
         return _objFrmCaptureCtrl;
     }
     if (persistString == typeof(frmRFPlaybackConfig).ToString())
     {
         _objFrmRFPlaybackConfig = CreateRFReplayConfigWindow();
         return _objFrmRFPlaybackConfig;
     }
     if (persistString == typeof(frmRFPlaybackCtrl).ToString())
     {
         _objFrmRFPlaybackCtrl = CreateRFReplayPlaybackWindow();
         return _objFrmRFPlaybackCtrl;
     }
     if (persistString == typeof(frmSimplexCtrl).ToString())
     {
         _objFrmSimplexCtrl = frmSimplexCtrl.GetChildInstance();
         return _objFrmSimplexCtrl;
     }
     if (persistString == typeof(frmSPAzCtrl).ToString())
     {
         _objFrmSPAzCtrl = frmSPAzCtrl.GetChildInstance();
         return _objFrmSPAzCtrl;
     }
     if (persistString == typeof(frmRackCtrl).ToString())
     {
         _objFrmRackCtrl = frmRackCtrl.GetChildInstance();
         return _objFrmRackCtrl;
     }
     if (persistString == typeof(frmE911Report).ToString())
     {
         _objFrmE911Report = frmE911Report.GetChildInstance("E911");
         return _objFrmE911Report;
     }
     if (persistString == typeof(frmNavPerformanceReport).ToString())
     {
         _objFrmNavPerformanceReport = frmNavPerformanceReport.GetChildInstance();
         return _objFrmNavPerformanceReport;
     }
     /*
      * //!
     if (persistString == typeof(frmGPIBCtrl).ToString())
     {
         _objFrmGPIBCtrl = frmGPIBCtrl.GetChildInstance();
         return _objFrmNavPerformanceReport;
     }
      */
     if (persistString.Contains("frmCommOpen"))
     {
         _objFrmCommOpen = new frmCommOpen();
         return _objFrmCommOpen;
     }
     return null;
 }
Пример #10
0
 private void autoTestStart()
 {
     Thread.CurrentThread.CurrentCulture = clsGlobal.MyCulture;
     _objFrmPython.testResult = "Hi,\nTest Summary:\n\n";
     string machineName = Environment.MachineName;
     string.Format("Hi,\nTest Station: {0}\nTest Summary:\n\n", machineName);
     clsGlobal.ScriptDone = true;
     clsGlobal.Abort = false;
     clsGlobal.AbortSingle = false;
     bool flag = false;
     string fileName = clsGlobal.InstalledDirectory + @"\scripts\core\rxSetup.py";
     string str3 = clsGlobal.InstalledDirectory + @"\scripts\core\portSetup.py";
     try
     {
         _objFrmPython.engine.ExecuteFile(fileName);
         goto Label_00A4;
     }
     catch (Exception exception)
     {
         _objFrmPython.PythonEngineOutput.CloseFile();
         displaySingleTestError(exception.Message);
         return;
     }
     Label_009D:
     Thread.Sleep(100);
     Label_00A4:
     if (!clsGlobal.ScriptDone)
     {
         goto Label_009D;
     }
     if (clsGlobal.ScriptError || clsGlobal.Abort)
     {
         MessageBox.Show("Setup script encountered error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         flag = true;
     }
     if (flag)
     {
         goto Label_013A;
     }
     try
     {
         _objFrmPython.engine.ExecuteFile(str3);
         goto Label_0110;
     }
     catch (Exception exception2)
     {
         _objFrmPython.PythonEngineOutput.CloseFile();
         displaySingleTestError(exception2.Message);
         return;
     }
     Label_0109:
     Thread.Sleep(100);
     Label_0110:
     if (!clsGlobal.ScriptDone)
     {
         goto Label_0109;
     }
     if (clsGlobal.ScriptError || clsGlobal.Abort)
     {
         MessageBox.Show("Port setup script encountered error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         flag = true;
     }
     Label_013A:
     if (flag)
     {
         goto Label_023D;
     }
     try
     {
         _objFrmPython.engine.ExecuteFile(clsGlobal.TestScriptPath);
         goto Label_01FC;
     }
     catch (PythonSyntaxErrorException exception3)
     {
         _objFrmPython.WriteLine("Syntax exception:");
         _objFrmPython.WriteLine(string.Format("Message: {0}\nLineText: {1}\nLine:{2}\nColumn: {3}", new object[] { exception3.Message, exception3.LineText, exception3.Line, exception3.Column }));
         displaySingleTestError(exception3.Message);
         _objFrmPython.PythonEngineOutput.CloseFile();
         return;
     }
     Label_01E4:
     if (!clsGlobal.AbortSingle)
     {
         Thread.Sleep(150);
     }
     if (clsGlobal.Abort)
     {
         goto Label_0203;
     }
     Label_01FC:
     if (!clsGlobal.ScriptDone)
     {
         goto Label_01E4;
     }
     Label_0203:
     if (clsGlobal.Abort)
     {
         MessageBox.Show("Test Aborted!", "Automation Test", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         MessageBox.Show(string.Format("{0} Completed!", _testName), "Automation Test", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
     Label_023D:
     _objFrmPython.BeginInvoke((MethodInvoker)delegate
     {
         _objFrmPython.PythonEngineOutput.CloseFile();
         _objFrmPython.Close();
         _objFrmPython.Dispose();
         _objFrmPython = null;
     });
     try
     {
         clsGlobal.TestsToRun.Clear();
         clsGlobal.CurrentRunningTest = string.Empty;
     }
     catch
     {
     }
 }
Пример #11
0
 private void runSingleTest()
 {
     EventHandler method = null;
     clsGlobal.DoneTests.Clear();
     try
     {
         if ((_objFrmPython != null) && !_objFrmPython.IsDisposed)
         {
             if (method == null)
             {
                 method = delegate {
                     _objFrmPython.Close();
                 };
             }
             _objFrmPython.Invoke(method);
         }
         Cursor = Cursors.WaitCursor;
         _objFrmPython = CreatePythonWindow();
         _objFrmPython.MdiParent = this;
         _objFrmPython.Show();
         _objFrmPython.BringToFront();
         Cursor = Cursors.Default;
     }
     catch (Exception exception)
     {
         Cursor = Cursors.Default;
         MessageBox.Show(string.Format("Test encounters error\n\n{0}", exception.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         _objFrmPython = null;
         clsGlobal.TestsToRun.Clear();
         clsGlobal.CurrentRunningTest = string.Empty;
         return;
     }
     Thread thread = new Thread(new ThreadStart(autoTestStart));
     thread.IsBackground = true;
     thread.Start();
 }
Пример #12
0
 public frmPython CreatePythonWindow()
 {
     frmPython objfrmPython = null;
     base.Invoke((MethodInvoker)delegate
     {
         objfrmPython = frmPython.GetChildInstance();
         if ((objfrmPython == null) || objfrmPython.IsDisposed)
         {
             objfrmPython = new frmPython();
         }
         objfrmPython.MdiParent = this;
         objfrmPython.Show();
         objfrmPython.BringToFront();
     });
     return objfrmPython;
 }