Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions API/Models/Analysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ public class Analysis
public int Id { get; set; }
[XmlIgnore]
public int SoilId { get; set; } // foreign key property
public List<double> Thickness { get; set; } = null!;
public List<double>? Rocks { get; set; } = null;
public List<string>? RocksMetadata { get; set; } = null;
public List<string>? Texture { get; set; } = null;
public List<string>? TextureMetadata { get; set; } = null;
public List<double> PH { get; set; } = null!;
public List<string>? PHMetadata { get; set; } = null;
public List<double>? EC { get; set; } = null;
public List<string>? ECMetadata { get; set; } = null;
public List<double>? CL { get; set; } = null;
public List<string>? CLMetadata { get; set; } = null;
public List<double>? CEC { get; set; } = null;
public List<string>? CECMetadata { get; set; } = null;
public List<double>? ESP { get; set; } = null;
public List<string>? ESPMetadata { get; set; } = null;
public List<double>? ParticleSizeSand { get; set; } = null;
public List<string>? ParticleSizeSandMetadata { get; set; } = null;
public List<double>? ParticleSizeSilt { get; set; } = null;
public List<string>? ParticleSizeSiltMetadata { get; set; } = null;
public List<double>? ParticleSizeClay { get; set; } = null;
public List<string>? ParticleSizeClayMetadata { get; set; } = null;
public double[] Thickness { get; set; } = null!;
public double[]? Rocks { get; set; } = null;
public string[]? RocksMetadata { get; set; } = null;
public string[]? Texture { get; set; } = null;
public string[]? TextureMetadata { get; set; } = null;
public double[] PH { get; set; } = null!;
public string[]? PHMetadata { get; set; } = null;
public double[]? EC { get; set; } = null;
public string[]? ECMetadata { get; set; } = null;
public double[]? CL { get; set; } = null;
public string[]? CLMetadata { get; set; } = null;
public double[]? CEC { get; set; } = null;
public string[]? CECMetadata { get; set; } = null;
public double[]? ESP { get; set; } = null;
public string[]? ESPMetadata { get; set; } = null;
public double[]? ParticleSizeSand { get; set; } = null;
public string[]? ParticleSizeSandMetadata { get; set; } = null;
public double[]? ParticleSizeSilt { get; set; } = null;
public string[]? ParticleSizeSiltMetadata { get; set; } = null;
public double[]? ParticleSizeClay { get; set; } = null;
public string[]? ParticleSizeClayMetadata { get; set; } = null;
public string? PHUnits { get; set; } = null;
public string? BoronUnits { get; set; } = null;
}
10 changes: 5 additions & 5 deletions API/Models/SoilCrop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public class SoilCrop

[XmlAttribute("name")]
public string Name { get; set; } = null!;
public List<double> Thickness { get; set; } = null!;
public List<double> LL { get; set; } = null!;
public List<double> KL { get; set; } = null!;
public List<double> XF { get; set; } = null!;
public List<string>? LLMetadata { get; set; } = null;
public double[] Thickness { get; set; } = null!;
public double[] LL { get; set; } = null!;
public double[] KL { get; set; } = null!;
public double[]? XF { get; set; } = null;
public string[]? LLMetadata { get; set; } = null;
}
10 changes: 5 additions & 5 deletions API/Models/SoilOrganicMatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class SoilOrganicMatter
public double SoilCN { get; set; }
public double EnrACoeff { get; set; }
public double EnrBCoeff { get; set; }
public List<double> Thickness { get; set; } = null!;
public List<double> OC { get; set; } = null!;
public List<string>? OCMetadata { get; set; }
public List<double> FBiom { get; set; } = null!;
public List<double> FInert { get; set; } = null!;
public double[] Thickness { get; set; } = null!;
public double[] OC { get; set; } = null!;
public string[]? OCMetadata { get; set; }
public double[]? FBiom { get; set; } = null;
public double[]? FInert { get; set; } = null;
public string? OCUnits { get; set; }
}
4 changes: 2 additions & 2 deletions API/Models/SoilWater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public class SoilWater
public double? DischargeWidth { get; set; }
public double? CatchmentArea { get; set; }
public double? MaxPond { get; set; }
public List<double> Thickness { get; set; } = null!;
public List<double> SWCON { get; set; } = null!;
public double[] Thickness { get; set; } = null!;
public double[] SWCON { get; set; } = null!;
}
24 changes: 12 additions & 12 deletions API/Models/Water.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ public class Water
public int Id { get; set; }
[XmlIgnore]
public int SoilId { get; set; } // foreign key property
public List<double> Thickness { get; set; } = null!;
public List<double> BD { get; set; } = null!;
public List<double> AirDry { get; set; } = null!;
public List<double> LL15 { get; set; } = null!;
public List<double> DUL { get; set; } = null!;
public List<double> SAT { get; set; } = null!;
public List<double>? KS { get; set; } = null;
public List<string>? BDMetadata { get; set; } = null;
public List<string>? AirDryMetadata { get; set; } = null;
public List<string>? LL15Metadata { get; set; } = null;
public List<string>? DULMetadata { get; set; } = null;
public List<string>? SATMetadata { get; set; } = null;
public double[] Thickness { get; set; } = null!;
public double[] BD { get; set; } = null!;
public double[] AirDry { get; set; } = null!;
public double[] LL15 { get; set; } = null!;
public double[] DUL { get; set; } = null!;
public double[] SAT { get; set; } = null!;
public double[]? KS { get; set; } = null;
public string[]? BDMetadata { get; set; } = null;
public string[]? AirDryMetadata { get; set; } = null;
public string[]? LL15Metadata { get; set; } = null;
public string[]? DULMetadata { get; set; } = null;
public string[]? SATMetadata { get; set; } = null;
[XmlElement("SoilCrop")]
public List<SoilCrop>? SoilCrops { get; set; } = null;
}
24 changes: 12 additions & 12 deletions API/Services/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,20 @@ public static Models.SoilInfo ToInfo(this Models.Soil soil)
Site = soil.Site,
Region = soil.Region,
NearestTown = soil.NearestTown,
Thickness = soil.Water?.Thickness.ToArray(),
Texture = soil.Analysis?.Texture.ToArray(),
DUL = soil.Water?.DUL.ToArray(),
LL15 = soil.Water?.LL15.ToArray(),
EC = soil.Analysis?.EC.ToArray(),
CL = soil.Analysis?.CL.ToArray(),
ESP = soil.Analysis?.ESP.ToArray(),
PH = soil.Analysis?.PH.ToArray(),
Crops = soil.Water?.SoilCrops.Select(c => new Models.SoilCropInfo
Thickness = soil.Water?.Thickness,
Texture = soil.Analysis?.Texture,
DUL = soil.Water?.DUL,
LL15 = soil.Water?.LL15,
EC = soil.Analysis?.EC,
CL = soil.Analysis?.CL,
ESP = soil.Analysis?.ESP,
PH = soil.Analysis?.PH,
Crops = soil.Water?.SoilCrops?.Select(c => new Models.SoilCropInfo
{
Name = c.Name,
LL = c.LL.ToArray(),
KL = c.KL.ToArray(),
XF = c.XF.ToArray()
LL = c.LL,
KL = c.KL,
XF = c.XF
}).ToList()
};
}
Expand Down
20 changes: 10 additions & 10 deletions API/Services/OldToNewSoilMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ public static APSIM.Soils.Soil ToAPSIMSoil(this Models.Soil soil)
var apsimSoil = mapper.Map<APSIM.Soils.Soil>(soil);

// Some manual mapping. Can't find a way for AutoMapper to do it.
apsimSoil.Physical.Rocks = soil.Analysis.Rocks;
apsimSoil.Physical.RocksMetadata = soil.Analysis.RocksMetadata;
apsimSoil.Physical.Texture = soil.Analysis.Texture;
apsimSoil.Physical.TextureMetadata = soil.Analysis.TextureMetadata;
apsimSoil.Physical.ParticleSizeClay = soil.Analysis.ParticleSizeClay;
apsimSoil.Physical.ParticleSizeClayMetadata = soil.Analysis.ParticleSizeClayMetadata;
apsimSoil.Physical.ParticleSizeSand = soil.Analysis.ParticleSizeSand;
apsimSoil.Physical.ParticleSizeSandMetadata = soil.Analysis.ParticleSizeSandMetadata;
apsimSoil.Physical.ParticleSizeSilt = soil.Analysis.ParticleSizeSilt;
apsimSoil.Physical.ParticleSizeSiltMetadata = soil.Analysis.ParticleSizeSiltMetadata;
apsimSoil.Physical.Rocks = soil.Analysis.Rocks.ToList();
apsimSoil.Physical.RocksMetadata = soil.Analysis.RocksMetadata.ToList();
apsimSoil.Physical.Texture = soil.Analysis.Texture.ToList();
apsimSoil.Physical.TextureMetadata = soil.Analysis.TextureMetadata.ToList();
apsimSoil.Physical.ParticleSizeClay = soil.Analysis.ParticleSizeClay.ToList();
apsimSoil.Physical.ParticleSizeClayMetadata = soil.Analysis.ParticleSizeClayMetadata.ToList();
apsimSoil.Physical.ParticleSizeSand = soil.Analysis.ParticleSizeSand.ToList();
apsimSoil.Physical.ParticleSizeSandMetadata = soil.Analysis.ParticleSizeSandMetadata.ToList();
apsimSoil.Physical.ParticleSizeSilt = soil.Analysis.ParticleSizeSilt.ToList();
apsimSoil.Physical.ParticleSizeSiltMetadata = soil.Analysis.ParticleSizeSiltMetadata.ToList();
return apsimSoil;
}

Expand Down