v2.49.2 36 Tests Passed

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
This commit is contained in:
2023-05-31 10:14:16 -07:00
parent 6f49fa2cee
commit faa4bd4d86
21 changed files with 646 additions and 78 deletions

View File

@ -0,0 +1,29 @@
using System;
namespace Adaptation.FileHandlers.json;
public class Log10
{
#nullable enable
public double Depth { get; }
public double ResistanceRaw { get; }
public double? ResistanceEdited { get; }
public double? Resistivity { get; }
public double? Concentration { get; }
public Log10(double depth,
double raw,
double? edited,
double? resistivity,
double? cd)
{
Depth = Math.Log10(depth);
ResistanceRaw = Math.Log10(raw);
ResistanceEdited = edited is null ? null : Math.Log10(edited.Value);
Resistivity = resistivity is null ? null : Math.Log10(resistivity.Value);
Concentration = cd is null ? null : Math.Log10(cd.Value);
}
}

View File

@ -275,10 +275,10 @@ public partial class ProcessData : IProcessData
UniqueId = string.Concat(uniqueId, "_Point-", profilePoint.Number),
Number = profilePoint.Number.ToString(),
Depth = profilePoint.Depth.ToString(),
Raw = profilePoint.Raw.ToString(),
Edited = string.Concat(profilePoint.Edited),
Raw = profilePoint.ResistanceRaw.ToString(),
Edited = string.Concat(profilePoint.ResistanceEdited),
Resistivity = string.Concat(profilePoint.Resistivity),
CD = string.Concat(profilePoint.CD),
CD = string.Concat(profilePoint.Concentration),
};
details.Add(detail);
}

View File

@ -5,6 +5,8 @@ namespace Adaptation.FileHandlers.json;
public class ProfileHeader
{
#nullable enable
public int NumberOfProfiles { get; }
public List<Profile> Profiles { get; }
public List<ProfilePoint> ProfilePoints { get; }
@ -14,6 +16,8 @@ public class 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;
@ -31,8 +35,9 @@ public class ProfileHeader
);
profiles.Add(profile);
}
foreach (csv.ProfilePoint csvProfilePoint in profileHeader.ProfilePoints)
for (int i = 0; i < profileHeader.ProfilePoints.Count; i++)
{
csvProfilePoint = profileHeader.ProfilePoints[i];
profilePoint = new
(
number: int.Parse(csvProfilePoint.Number),
@ -40,9 +45,11 @@ public class ProfileHeader
raw: double.Parse(csvProfilePoint.Raw),
edited: double.Parse(csvProfilePoint.Edited),
resistivity: double.Parse(csvProfilePoint.Resistivity),
cd: double.Parse(csvProfilePoint.CD)
cd: double.Parse(csvProfilePoint.CD),
lastProfilePoint: lastProfilePoint
);
profilePoints.Add(profilePoint);
lastProfilePoint = profilePoint;
}
}

View File

@ -3,26 +3,42 @@ namespace Adaptation.FileHandlers.json;
public class ProfilePoint
{
#nullable enable
public int Number { get; }
public double Depth { get; }
public double Raw { get; }
public double? Edited { get; }
public double ResistanceRaw { get; }
public double? ResistanceEdited { get; }
public double? Resistivity { get; }
public double? CD { get; }
public double? Concentration { get; }
public double? DeltaPercent { get; }
public ProfilePoint? LastProfilePoint { get; }
public Log10? Log10 { get; }
public ProfilePoint(int number,
double depth,
double raw,
double? edited,
double? resistivity,
double? cd)
double? cd,
ProfilePoint? lastProfilePoint)
{
Number = number;
Depth = depth;
Raw = raw;
Edited = edited;
ResistanceRaw = raw;
ResistanceEdited = edited;
Resistivity = resistivity;
CD = cd;
Concentration = cd;
DeltaPercent = lastProfilePoint is null ? null : (lastProfilePoint.ResistanceRaw - raw) / raw;
LastProfilePoint = lastProfilePoint;
Log10 = new
(
depth: depth,
raw: raw,
edited: edited,
resistivity: resistivity,
cd: cd
);
}
}