/// /// This demonstrates how to attach a graph to a Step /// [TestMethod] public void DemonstrateGraphStep() { TDM api = new TDM(); //Create api api.InitializeAPI(true); //Initialize it Assert.AreEqual(api.Status, APIStatusType.Online); //Check api status UUTReport uut = api.CreateUUTReport("oper", "PartNo1", "Rev1", "SNGraphTest1", "10", "Seq1", "1.0.0"); //UUT is ready to add steps //Example 1: Fibonacci numbers with mean value //This will go into a graph series where x=0,1,2,3,4... and y is fibionacci(x) double[] yValuesFibonacci = new double[] { 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 }; NumericLimitStep fibonacciStep = uut.GetRootSequenceCall().AddNumericLimitStep("Fibionacci"); double meanFib = yValuesFibonacci.ToList().Average(); //Take the mean value fibonacciStep.AddTest(meanFib, "Number"); //Add a test with no limits on the mean value Chart fibChart=fibonacciStep.AddChart(ChartType.Line, "Fibonacci numbers", "X", "", "Y", ""); fibChart.AddSeries("Fibionacci", yValuesFibonacci); //1 series fibChart.AddSeries("Mean", new double[,] { { 0, yValuesFibonacci.Length - 1 }, { meanFib, meanFib } }); //Also plot the mean value //Example 2: Some measured current values over time using a multiple numberic step //This will go into a graph series where x=Minutes from start and y=Current measured double[] xValuesCurrent = new double[] { 0, 17, 47, 76 }; //Minutes from start double[] yValuesCurrent = new double[] { 60.72, 61.886, 62.6, 0 }; //Ampere measured NumericLimitStep currentStep = uut.GetRootSequenceCall().AddNumericLimitStep("Current from burn-in test"); currentStep.AddMultipleTest(yValuesCurrent.ToList().Min(), CompOperatorType.GE, 52, "A", "MinValue"); //The minimum should not be under 52 Amps currentStep.AddMultipleTest(yValuesCurrent.ToList().Max(), CompOperatorType.LE, 72, "A", "MaxValue"); //The minimum should not be over 72 Amps currentStep.AddMultipleTest(yValuesCurrent.ToList().Average(),"A", "Mean"); Chart currentChart = currentStep.AddChart(ChartType.Line, "Current", "Minutes", "min", "Current", "A"); currentChart.AddSeries("Current", yValuesCurrent); currentChart.AddSeries("Mean", new double[,] { { 0, yValuesCurrent.Length - 1 }, { yValuesCurrent.ToList().Average(), yValuesCurrent.ToList().Average() } }); currentChart.AddSeries("LowLimit", new double[,] { { 0, yValuesCurrent.Length - 1 }, { 52,52 } }); currentChart.AddSeries("HighLimit", new double[,] { { 0, yValuesCurrent.Length - 1 }, { 72,72 } }); //Further notes: //ChartType also be logaritmic, use LineLogXY, LineLogX, LineLogY //A chart can be attached to any type of Step //If you have many values (lets say more 1000 in a series), please extract samples (e.g. use mean over time) //to reduce amount of data as this will degrade performance and consume space in the database. //Send the report api.Submit(SubmitMethod.Automatic,uut); }