nuget server name Added Last and Log10 to json Simplified by adding loop variables Simplified by only drawling using FillEllipse Added GetImageBytes back to prove-in ChartJs
56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace Adaptation.FileHandlers.json;
|
|
|
|
public class ProfileHeader
|
|
{
|
|
|
|
#nullable enable
|
|
|
|
public int NumberOfProfiles { get; }
|
|
public List<Profile> Profiles { get; }
|
|
public List<ProfilePoint> ProfilePoints { get; }
|
|
|
|
internal ProfileHeader(csv.ProfileHeader profileHeader)
|
|
{
|
|
Profile profile;
|
|
ProfilePoint profilePoint;
|
|
List<Profile> profiles = new();
|
|
csv.ProfilePoint csvProfilePoint;
|
|
ProfilePoint? lastProfilePoint = null;
|
|
List<ProfilePoint> profilePoints = new();
|
|
NumberOfProfiles = int.Parse(profileHeader.NumberOfProfiles);
|
|
Profiles = profiles;
|
|
ProfilePoints = profilePoints;
|
|
foreach (csv.Profile csvProfile in profileHeader.Profiles)
|
|
{
|
|
profile = new
|
|
(
|
|
id: csvProfile.Id,
|
|
name: csvProfile.Name,
|
|
label: csvProfile.Label,
|
|
allocated: int.Parse(csvProfile.Allocated),
|
|
used: int.Parse(csvProfile.Used),
|
|
list: csvProfile.List
|
|
);
|
|
profiles.Add(profile);
|
|
}
|
|
for (int i = 0; i < profileHeader.ProfilePoints.Count; i++)
|
|
{
|
|
csvProfilePoint = profileHeader.ProfilePoints[i];
|
|
profilePoint = new
|
|
(
|
|
number: int.Parse(csvProfilePoint.Number),
|
|
depth: double.Parse(csvProfilePoint.Depth),
|
|
raw: double.Parse(csvProfilePoint.Raw),
|
|
edited: double.Parse(csvProfilePoint.Edited),
|
|
resistivity: double.Parse(csvProfilePoint.Resistivity),
|
|
cd: double.Parse(csvProfilePoint.CD),
|
|
lastProfilePoint: lastProfilePoint
|
|
);
|
|
profilePoints.Add(profilePoint);
|
|
lastProfilePoint = profilePoint;
|
|
}
|
|
}
|
|
|
|
} |