internal class Program {
private static async Task Main (string[] args) {
using (var padfx = Channel.Padfx.Open ("Sample.padfx")) {
// download workspace
var info = (await padfx.GetWorkspaces ()).First ();
var workspace = await padfx.DownloadWorkspace (info);
// get autosequence from workspace
var autosequence = workspace.StructureObjects.Flatten ()
.SelectMany (_ => _.Tests)
.OfType<AutoSequence> ()
.FirstOrDefault ();
// access singletest measurements
var measurements = new List<Measurement> (autosequence.Tests.OfType<SingleTest> ().Select (_ => _.Measurement));
foreach (var measurement in measurements) {
Console.WriteLine ($"Measurement = {measurement.Info.Name}");
}
// access inspections
var inspections = new List<PredefinedInspection> (autosequence.Tests.OfType<PredefinedInspection> ());
foreach (var inspection in inspections) {
Console.WriteLine ($"Inspection = {inspection.Info.Name}");
}
// access custom inspections
var customInspections = new List<CustomInspection> (autosequence.Tests.OfType<CustomInspection> ());
foreach (var inspection in customInspections) {
Console.WriteLine ($"Custom inspection = {inspection.Name}");
}
}
}
}
C#