Files
xmltest/xmlserializetest/Result.cs
2024-03-22 01:35:19 +01:00

139 lines
4.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
namespace xmlserializetest
{
[XmlRoot("result", Namespace = "keytek-result-schema")]
public class Result
{
[XmlAttribute("xmlns")]
public string Xmlns { get; set; }
[XmlAttribute("version")]
public string Version { get; set; }
[XmlAttribute("id")]
public string Id { get; set; }
[XmlAttribute("name")]
public string Name { get; set; }
[XmlAttribute("desc")]
public string Desc { get; set; }
[XmlAttribute("createdOn")]
public string CreatedOn { get; set; }
[XmlAttribute("permissionSet")]
public string PermissionSet { get; set; }
[XmlAttribute("modifiedOn")]
public string ModifiedOn { get; set; }
[XmlAttribute("path")]
public string Path { get; set; }
[XmlAttribute("productLine")]
public string ProductLine { get; set; }
[XmlAttribute("testplanName")]
public string TestplanName { get; set; }
[XmlAttribute("deviceName")]
public string DeviceName { get; set; }
[XmlAttribute("deviceID")]
public string DeviceID { get; set; }
[XmlAttribute("comments")]
public string Comments { get; set; }
[XmlAttribute("operatorName")]
public string OperatorName { get; set; }
[XmlAttribute("rundDate")]
public string RunDate { get; set; }
[XmlAttribute("testOutcome")]
public string TestOutcome { get; set; }
[XmlAttribute("totalRuntime")]
public string TotalRuntime { get; set; }
[XmlAttribute("mappingName")]
public string MappingName { get; set; }
[XmlAttribute("runMode")]
public string RunMode { get; set; }
[XmlAttribute("batchCode")]
public string BatchCode { get; set; }
[XmlAttribute("useParallelZapping")]
public string UseParallelZapping { get; set; }
[XmlAttribute("mappingSelMode")]
public string MappingSelMode { get; set; }
[XmlAttribute("fixtureId")]
public string FixtureId { get; set; }
[XmlAttribute("offsetX")]
public string OffsetX { get; set; }
[XmlAttribute("offsetY")]
public string OffsetY { get; set; }
[XmlAttribute("physicalPsuAssignments")]
public string PhysicalPsuAssignments { get; set; }
[XmlAttribute("offlineData")]
public string OfflineData { get; set; }
[XmlAttribute("socket")]
public string Socket { get; set; }
[XmlAttribute("manualTest")]
public string ManualTest { get; set; }
[XmlAttribute("offlineDeviceName")]
public string OfflineDeviceName { get; set; }
[XmlAttribute("offlineTestplanName")]
public string OfflineTestplanName { get; set; }
[XmlElement("resultHeader")]
public ResultHeader ResultHeader { get; set; }
[XmlElement("dataSection")]
public DataSection DataSection { get; set; }
}
public class ResultHeader
{
[XmlAttribute("shouldSerializeHeaders")]
public string ShouldSerializeHeaders { get; set; }
[XmlElement("metadata")]
public MetaData MetaData { get; set; }
[XmlElement("table", Namespace = "")]
public Table Table { get; set; }
[XmlElement("groups", Namespace = "")]
public Groups Groups { get; set; }
[XmlElement("tests", Namespace = "")]
public Tests Tests { get; set; }
}
public class DataSection
{
[XmlElement("res")]
public Res[] Res { get; set; }
public List<Res> GetResultsByTestNameAndGroups(List<string> testnames, List<string> groupnames)
{
List<Res> results = new List<Res>();
foreach (var res in this.Res)
{
if ((testnames.Contains(res.dO) ) & (groupnames.Contains(res.pG) ))
{
results.Add(res);
}
}
return results;
}
public List<Res> GetResultsByTestNameAndPins(List<string> testnames, List<string> pinnames)
{
List<Res> results = new List<Res>();
foreach (var res in this.Res)
{
if ((testnames.Contains(res.dO)) & (pinnames.Contains(res.pin)))
{
results.Add(res);
}
}
return results;
}
}
}