55 lines
2.0 KiB
C#
55 lines
2.0 KiB
C#
using System.Collections.ObjectModel;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Adaptation.FileHandlers.RsM;
|
|
|
|
internal class Line9
|
|
{
|
|
|
|
[JsonConstructor]
|
|
public Line9(string waferSize, string edgeEx, string xll, string yll, string xur, string yur, string x, string y, string cutCorners)
|
|
{
|
|
WaferSize = waferSize;
|
|
EdgeEx = edgeEx;
|
|
Xll = xll;
|
|
Yll = yll;
|
|
Xur = xur;
|
|
Yur = yur;
|
|
X = x;
|
|
Y = y;
|
|
CutCorners = cutCorners;
|
|
}
|
|
|
|
[JsonPropertyName("WaferSize")] public string WaferSize { get; }
|
|
[JsonPropertyName("EdgeEx")] public string EdgeEx { get; }
|
|
[JsonPropertyName("xll")] public string Xll { get; }
|
|
[JsonPropertyName("yll")] public string Yll { get; }
|
|
[JsonPropertyName("xur")] public string Xur { get; }
|
|
[JsonPropertyName("yur")] public string Yur { get; }
|
|
[JsonPropertyName("x")] public string X { get; }
|
|
[JsonPropertyName("y")] public string Y { get; }
|
|
[JsonPropertyName("CutCorners")] public string CutCorners { get; }
|
|
|
|
internal static Line9 Get(string[] segments)
|
|
{
|
|
Line9 result;
|
|
ReadOnlyCollection<string> collection = Complete.GetCollection(segments);
|
|
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
|
collection.Count < 2 ? string.Empty : collection[1],
|
|
collection.Count < 3 ? string.Empty : collection[2],
|
|
collection.Count < 4 ? string.Empty : collection[3],
|
|
collection.Count < 5 ? string.Empty : collection[4],
|
|
collection.Count < 6 ? string.Empty : collection[5],
|
|
collection.Count < 7 ? string.Empty : collection[6],
|
|
collection.Count < 8 ? string.Empty : collection[7],
|
|
collection.Count < 9 ? string.Empty : collection[8]);
|
|
return result;
|
|
}
|
|
|
|
}
|
|
|
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
|
[JsonSerializable(typeof(Line9))]
|
|
internal partial class Line9SourceGenerationContext : JsonSerializerContext
|
|
{
|
|
} |