Compare commits

..

No commits in common. "fcf6b2af51aaca7b156c12fb7a6f62879c3d4748" and "a98a81776db316781fb72cce59df4dcddf748ad4" have entirely different histories.

View File

@ -89,7 +89,7 @@ namespace FarmmapsKPI
TimeSpan tsTotalEstimated; TimeSpan tsTotalEstimated;
//Per default just 1 run per field. For debugging check if when we run multiple times do we get (should be) always the same output? //Per default just 1 run per field. For debugging check if when we run multiple times do we get (should be) always the same output?
int nrun = 5; int nrun = 1;
for (int run = 1; run <= nrun; run++) { for (int run = 1; run <= nrun; run++) {
for (int i = 0; i < fieldsInputs.Count; i++) for (int i = 0; i < fieldsInputs.Count; i++)
//for (int i = 3; i < 4; i++) // for testing //for (int i = 3; i < 4; i++) // for testing
@ -365,11 +365,7 @@ namespace FarmmapsKPI
int nOperationsInput = input.DataOperations.Length; int nOperationsInput = input.DataOperations.Length;
int nOperationsCropfield = crprecChildren.Count; int nOperationsCropfield = crprecChildren.Count;
if (nOperationsInput != nOperationsCropfield) if (nOperationsInput != nOperationsCropfield)
{ throw new Exception(String.Format($"run {run}: nOperationsInput != nOperationsCropfield?!"));
_logger.LogWarning(String.Format($"1. run {run}: nOperationsInput != nOperationsCropfield?!"));
//throw new Exception(String.Format($"run {run}: nOperationsInput != nOperationsCropfield?!"));
}
//Check totalNfertiliser input and Cropfield //Check totalNfertiliser input and Cropfield
for (int o = 0; o < crprecChildren.Count; o++) for (int o = 0; o < crprecChildren.Count; o++)
@ -378,10 +374,7 @@ namespace FarmmapsKPI
totalNferiliserCropfield = totalNferiliserCropfield + (double)data.n; totalNferiliserCropfield = totalNferiliserCropfield + (double)data.n;
} }
if (totalNferiliserInput != totalNferiliserCropfield) if (totalNferiliserInput != totalNferiliserCropfield)
{ throw new Exception(String.Format($"run {run}: totalNferiliserInput != totalNferiliserCropfield?!"));
_logger.LogWarning(String.Format($"2. run {run}: totalNferiliserInput != totalNferiliserCropfield?!"));
//throw new Exception(String.Format($"run {run}: totalNferiliserInput != totalNferiliserCropfield?!"));
}
//Now get the KPIs for this cropfield, mounted with operations & cropyield //Now get the KPIs for this cropfield, mounted with operations & cropyield
@ -527,13 +520,8 @@ namespace FarmmapsKPI
//Check if totalNferiliserInput is equal to what comes out of the KPI calculation //Check if totalNferiliserInput is equal to what comes out of the KPI calculation
//PO20240515: Hier gaat het mis!!! //PO20240515: Hier gaat het mis!!!
if (elementName == "nFertilizerNKgHa") if (elementName == "nFertilizerNKgHa")
{
if (totalNferiliserInput != Convert.ToDouble(elementValue)) if (totalNferiliserInput != Convert.ToDouble(elementValue))
{ throw new Exception(String.Format($"run {run}: totalNferiliserInput != nFertilizerNKgHa?!"));
_logger.LogWarning(String.Format($"3. run {run}: totalNferiliserInput != nFertilizerNKgHa"));
//throw new Exception(String.Format($"run {run}: totalNferiliserInput != nFertilizerNKgHa"));
}
}
} }
} }
else if (kpio.id == "B2") else if (kpio.id == "B2")