public override void Run() { string BarcodeInput = Interaction.InputBox("Scan Barcode here", "Barcode Scanner", "", -1, -1); Log_BarcodeReader.Info("*********************** Barcode Reading **************"); Log_BarcodeReader.Info("*************************>> " + BarcodeInput + " <<*****************************"); }
public override void Run() { LogS_Configure.Info("Selected Start Frequency :" + StartFrequency.ToString()); LogS_Configure.Info("Selected Stop Frequency :" + StopFrequency.ToString()); LogS_Configure.Info("Selected IF Bandwidth :" + IFBandwidth.ToString()); LogS_Configure.Info("Selected Power Level :" + Power_Level.ToString()); MyENA_Instrument.ENAConfigure(StartFrequency, StopFrequency, IFBandwidth, Sweep_Points, Power_Level, _s_parameters); }
public override void Run() { // There are four levels of log messages Info, Warning, Error, Debug. MyLog.Info("Info from Run"); for (int i = 0; i < 10; i++) { MyLog.Debug("Debug {0} from Run", i); // MyLog.X works like string.Format with regards to arguments. } MyLog.Warning("Warning from Run"); MyLog.Error("Error from Run"); // The Log can accept a Stopwatch Object to be used for timing analysis. Stopwatch sw1 = Stopwatch.StartNew(); TapThread.Sleep(100); MyLog.Info(sw1, "Info from Run"); Stopwatch sw2 = Stopwatch.StartNew(); TapThread.Sleep(200); MyLog.Error(sw2, "Error from step"); // Tracebar can be used to show results in the MyLog. var traceBar = new TraceBar(); traceBar.LowerLimit = -3.0; for (var i = -2; i < 11; i++) { traceBar.UpperLimit = i < 5 ? 3 : 15; // GetBar returns a string with value, low limit, a dashed line // indicating magnitude, the upper limit, and (if failing), a fail indicator. string temp = traceBar.GetBar(i); MyLog.Info("MyResult: " + temp); TapThread.Sleep(200); } // Sample output shown below. // MyResult: 2.00 - 3-------------------------|----- 3 // MyResult: 3.00 - 3------------------------------ | 3 // MyResult: 4.00 - 3------------------------------ > 3 Fail // MyResult: 5.00 - 3------------ -| -----------------15 // MyResult: 6.00 - 3-------------- -| ---------------15 // TraceBar remembers if any results failed, so it can be used for the verdict. UpgradeVerdict(traceBar.CombinedVerdict); // The log also supports showing stack traces. // Useful for debugging. try { throw new Exception("My exception"); } catch (Exception e) { MyLog.Error("Caught exception: '{0}'", e.Message); MyLog.Debug(e); // Prints the stack trace to the MyLog. } }
public override void Run() { LogS_Parameter.Info("Selected Parameter :" + _s_parameters.ToString()); MyENA_Instrument.SelectS_Parameter(_s_parameters); List <string> allParameters = MyENA_Instrument.SParameter(); Results.Publish(_s_parameters.ToString() + " Plot", allParameters); }
void printSummary(TestStepRun run, int maxIndent, int idx, ILookup <Guid, TestStepRun> lookup) { int indentcnt = stepRunIndent(run); string indent = new String(' ', indentcnt * 2); string inverseIndent = new String(' ', maxIndent * 2 - indentcnt * 2); var(timeString, unit) = ShortTimeSpan.FromSeconds(run.Duration.TotalSeconds).ToStringParts(); string v = run.Verdict == Verdict.NotSet ? "" : run.Verdict.ToString(); var name = run.TestStepName; summaryLog.Info("{4} {0,-43} {5}{1,5:0} {7,-4}{2,-7}", name, timeString, v, idx, indent, inverseIndent, 0, unit); int idx2 = 0; foreach (TestStepRun run2 in lookup[run.Id]) { printSummary(run2, maxIndent, idx2, lookup); } }
internal static string EmitVersion(string title) { //check whether OpenTAP application is 32-bit or 64-bit string tapPlatform = Environment.Is64BitProcess ? "64-bit" : "32-bit"; var tapVersion = PluginManager.GetOpenTapAssembly().SemanticVersion; var initt = DateTime.Now - Process.GetCurrentProcess().StartTime; log.Info(initt, "{0} version '{1}' {2} initialized {3}", title, tapVersion, tapPlatform, DateTime.Now.ToString("MM/dd/yyyy")); if (tapVersion.PreRelease != null && tapVersion.PreRelease.StartsWith("alpha")) { return(tapVersion.ToString(5)); } return(tapVersion.ToString(4)); }
static void TraceListener_FileSizeLimitReached(object sender, EventArgs e) { traceListener.FileSizeLimitReached -= TraceListener_FileSizeLimitReached; Task.Factory.StartNew(() => { lock (sessionLogRotateLock) { string newname = currentLogFile.Replace("__" + sessionLogCount.ToString(), ""); sessionLogCount += 1; var nextFile = addLogRotateNumber(newname, sessionLogCount); log.Info("Switching log to the file {0}", nextFile); Log.RemoveListener((FileTraceListener)sender); rename(nextFile, newFile: true); } }); }
/// <summary> /// /// </summary> /// <param name="LogOutput"></param> /// <param name="enableOutputACP"></param> /// <param name="enableOutputBPower"></param> /// <param name="enableOutputChPower"></param> /// <param name="ACPowerNo"></param> /// <param name="BPOWerNo"></param> /// <param name="CHPowerNo"></param> /// <param name="_OutputACP"></param> /// <param name="_OutputBPower"></param> /// <param name="_OutputChPower"></param> public void Measurements(OpenTap.TraceSource LogOutput, bool enableOutputACP, bool enableOutputBPower, bool enableOutputChPower, uint ACPowerNo, uint BPOWerNo, uint CHPowerNo, ref Single[] _OutputACP, ref Single[] _OutputBPower, ref Single[] _OutputChPower) { ScpiCommand(":FORMat:TRACe:DATA REAL,32"); ScpiCommand(":FORMat:BORDer SWAP"); if (enableOutputACP == true) { _OutputACP = ScpiQueryBlock <System.Single>(Scpi.Format(":MEASure:ACPower{0}?", ACPowerNo)); LogOutput.Info("*********************** AC Power ******************"); LogOutput.Info("************************* " + _OutputACP + " dB *************************"); } if (enableOutputBPower == true) { _OutputBPower = ScpiQueryBlock <System.Single>(Scpi.Format(":MEASure:BPOWer{0}?", BPOWerNo)); LogOutput.Info("*********************** Burst Power ******************"); LogOutput.Info("************************* " + _OutputBPower + " dB *************************"); } if (enableOutputChPower == true) { _OutputChPower = ScpiQueryBlock <System.Single>(Scpi.Format(":MEASure:CHPower{0}?", CHPowerNo)); LogOutput.Info("*********************** Channel Power ******************"); LogOutput.Info("************************* " + _OutputChPower + " dB *************************"); } }
public override void Run() { MyENA_Instrument.ReadMarkerVaules(_s_parameters, Marker_1_Frequency, Marker_2_Frequency, Marker_3_Frequency); string[] MarkerFrequencies = new string[] { Marker_1_Frequency.ToString(), Marker_2_Frequency.ToString(), Marker_3_Frequency.ToString() }; string[] result_of_execution; result_of_execution = MyENA_Instrument.GetS_ParameterMarkerValues(); string Marker1 = result_of_execution[1]; string Marker2 = result_of_execution[2]; string Marker3 = result_of_execution[3]; LogS_Parameter.Info("*********************** Marker1 Value Parameters ******************"); LogS_Parameter.Info("************************* " + Marker1 + " dB *************************"); LogS_Parameter.Info("********************************************************"); LogS_Parameter.Info(""); LogS_Parameter.Info(""); LogS_Parameter.Info("*********************** Marker2 Value Parameters ******************"); LogS_Parameter.Info("************************* " + Marker2 + " dB *************************"); LogS_Parameter.Info("********************************************************"); LogS_Parameter.Info(""); LogS_Parameter.Info(""); LogS_Parameter.Info("*********************** Marker3 Value Parameters ******************"); LogS_Parameter.Info("************************* " + Marker3 + " dB *************************"); LogS_Parameter.Info("********************************************************"); LogS_Parameter.Info(""); LogS_Parameter.Info(""); //Results.PublishTable("S-Parameter", new List<string> { "Result", "Mean Value", "Screenshot Path" }, result_of_execution); //Results.PublishTable(_s_parameters.ToString(), new List<string> { Marker_1_Frequency.ToString(), Marker_2_Frequency.ToString(), Marker_3_Frequency.ToString() }, result_of_execution); Results.Publish(_s_parameters.ToString() + "-Parameter", new List <string> { "DUT-Barcode", "Freq1: " + Marker_1_Frequency.ToString(), "Freq2: " + Marker_2_Frequency.ToString(), "Freq3: " + Marker_3_Frequency.ToString(), "Verdict" }, result_of_execution); //UpgradeVerdict(Verdict.Pass); }