49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace Adaptation.FileHandlers.json;
|
|
|
|
public class Setup
|
|
{
|
|
|
|
public string Finish { get; }
|
|
public string NorthProbeID { get; }
|
|
public string SouthProbeID { get; }
|
|
public string MeasurementPolarity { get; }
|
|
public double SineBevelAngle { get; }
|
|
public double ContactRadius { get; }
|
|
public double ProbeSpacing { get; }
|
|
public double ProbeLoad { get; }
|
|
public string Orientation { get; }
|
|
public int NumberOfStepSizes { get; }
|
|
public List<Step> Steps { get; }
|
|
|
|
internal Setup(csv.Setup setup)
|
|
{
|
|
Step step;
|
|
List<Step> steps = new();
|
|
Finish = setup.Finish;
|
|
NorthProbeID = setup.NorthProbeID;
|
|
SouthProbeID = setup.SouthProbeID;
|
|
MeasurementPolarity = setup.MeasurementPolarity;
|
|
SineBevelAngle = double.Parse(setup.SineBevelAngle);
|
|
ContactRadius = double.Parse(setup.ContactRadius);
|
|
ProbeSpacing = double.Parse(setup.ProbeSpacing);
|
|
ProbeLoad = double.Parse(setup.ProbeLoad);
|
|
Orientation = setup.Orientation;
|
|
NumberOfStepSizes = int.Parse(setup.NumberOfStepSizes);
|
|
Steps = steps;
|
|
foreach (csv.Step csvStep in setup.Steps)
|
|
{
|
|
Step step1 = new
|
|
(
|
|
number: int.Parse(csvStep.Number),
|
|
points: int.Parse(csvStep.Points),
|
|
x: double.Parse(csvStep.X),
|
|
y: double.Parse(csvStep.Y)
|
|
);
|
|
step = step1;
|
|
steps.Add(step);
|
|
}
|
|
}
|
|
|
|
} |