diff --git a/WebCms/Utility/QueryFilter.cs b/WebCms/Utility/QueryFilter.cs
index fb2599a..31b25bf 100644
--- a/WebCms/Utility/QueryFilter.cs
+++ b/WebCms/Utility/QueryFilter.cs
@@ -72,18 +72,21 @@ namespace LeafWeb.WebCms.Utility
lid.Site.Longitude <= longitude + range)
select li;
}
-
+
+ // co2s
if (!string.IsNullOrEmpty(query.co2s))
{
- var co2s = double.Parse(query.co2s);
+ var p = double.Parse(query.co2s);
resultItems =
from li in resultItems
- where co2s >=
- li.LeafInputData.Max(lid =>
- lid.Data.Max(d => d.CO2S) -
- lid.Data.Min(d => d.CO2S)
- )
+ where
+ // maximum range inside LeafInputFiles
+ li.LeafInputData.Max(lid =>
+ // range of LeafInputData
+ lid.Data.Max(d => d.CO2S)
+ - lid.Data.Min(d => d.CO2S))
+ >= p
select li;
}
diff --git a/WebCms/Views/Shared/DisplayTemplates/LeafInputDataViewModels.cshtml b/WebCms/Views/Shared/DisplayTemplates/LeafInputDataViewModels.cshtml
index 32db1f8..9e11507 100644
--- a/WebCms/Views/Shared/DisplayTemplates/LeafInputDataViewModels.cshtml
+++ b/WebCms/Views/Shared/DisplayTemplates/LeafInputDataViewModels.cshtml
@@ -11,17 +11,34 @@
@RendDistinctValues("Latitude [°]", Model.Select(m => m.Site.Latitude?.ToString()))
@RendDistinctValues("Longitude [°]", Model.Select(m => m.Site.Longitude?.ToString()))
@RendDistinctValues("Elevation [m]", Model.Select(m => m.Site.Elevation?.ToString()))
-@RendDistinctValues("CO2S",
- Model.Select(m =>
- m.SiteName + ": "
- + string.Join(", ",
+@RendDistinctValues("CO2S",
+ Model.Select(m =>
+ m.SiteName + " (" + m.Id + "): " +
+ string.Join(", ",
m.Data?.Select(d => d.CO2S?.ToString())
)
- )
+
+ ), "
"
)
-@RendDistinctValues("CO2S Min", Model.Select(m => m.Data?.Min(d => d.CO2S).ToString()))
-@RendDistinctValues("CO2S Average", Model.Select(m => m.Data?.Average(d => d.CO2S).ToString()))
-@RendDistinctValues("CO2S Max", Model.Select(m => m.Data?.Max(d => d.CO2S).ToString()))
+@RendDistinctValues("CO2S Min", Model.Select(m =>
+ m.SiteName + " (" + m.Id + "): " +
+ m.Data?.Min(d => d.CO2S).ToString()), "
")
+@RendDistinctValues("CO2S Average", Model.Select(m =>
+ m.SiteName + " (" + m.Id + "): " +
+ m.Data?.Average(d => d.CO2S).ToString()), "
")
+@RendDistinctValues("CO2S Max", Model.Select(m =>
+ m.SiteName + " (" + m.Id + "): " +
+ m.Data?.Max(d => d.CO2S).ToString()), "
")
+@RendDistinctValues("CO2S Range", Model.Select(m =>
+ m.SiteName + " (" + m.Id + "): " +
+ (m.Data?.Max(d => d.CO2S)
+ - m.Data?.Min(d => d.CO2S))), "
")
+@RendValue("CO2S Max Range", Model.Max(m =>
+ m.Data?.Max(d => d.CO2S)
+ - m.Data?.Min(d => d.CO2S))?.ToString())
+@RendValue("CO2S Min Range", Model.Min(m =>
+ m.Data?.Max(d => d.CO2S)
+ - m.Data?.Min(d => d.CO2S))?.ToString())
@helper RendValue(string label, string value)
@@ -31,13 +48,13 @@
@Html.Raw(label)