using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Drawing; using Google.Protobuf; using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.PMR.Stubs; using Tango.PMR.Diagnostics; using Tango.FSE.Common.Connection; using Tango.FSE.Common.Diagnostics; using Tango.FSE.Procedures; namespace Tango.FSE.Procedures.Examples.Diagnostics { #region Example public class Program { public void OnExecute(IProcedureContext context) { //Initialize a new list of dancer angle values. List dancerValues = new List(); //Collect 100 samples of the middle dancer angle. for (int i = 0; i < 100; i++) { //Get the current diagnostics package. (set 'true' to block the execution until a fresh diagnostics frame arrives) DiagnosticsPackage package = context.GetDiagnosticsPackage(true); //Add the last value in the array to the list. dancerValues.Add(package.GetMonitorLastValue(TechMonitors.Dancer2Angle)); } //Plot the dancer samples to a graph result. context.AddGraphResult(ResultType.Passed, "Dancer Angle", dancerValues); } } #endregion }