diff --git a/FarmmapsApi/Services/GeneralService.cs b/FarmmapsApi/Services/GeneralService.cs index 3d542ef..8fde298 100644 --- a/FarmmapsApi/Services/GeneralService.cs +++ b/FarmmapsApi/Services/GeneralService.cs @@ -299,17 +299,17 @@ namespace FarmmapsApi.Services //hier nog definieren waar in de hierarchie een KPI item is? - ////the BOFEK data is a child of the cropfield - //var itemName = "bofek"; - //var bofekItem = await FindChildItemAsync(cropfieldItem.Code, - // SHAPE_PROCESSED_ITEMTYPE, itemName); - //if (bofekItem == null) - //{ - // _logger.LogError("Could not find the BOFEK data as a child item under the cropfield"); - // return null; - //} + //the kpi data is a child of the cropfield + var itemname = "KPI"; + var KPIItem = await FindChildItemAsync(cropfieldItem.Code, + CROPFIELD_ITEMTYPE, itemname); //hier moet ik dus verwijzen naar waar het KPIItem zit? ik gok dat het een cropfield item type is... + if (KPIItem == null) + { + _logger.LogError("could not find the bofek data as a child item under the cropfield"); + return null; + } - return bofekItem; + return KPIItem; } public async Task RunAhnTask(Item cropfieldItem) { diff --git a/FarmmapsKPI/KPIApplication.cs b/FarmmapsKPI/KPIApplication.cs index 7a32a0e..3130c48 100644 --- a/FarmmapsKPI/KPIApplication.cs +++ b/FarmmapsKPI/KPIApplication.cs @@ -144,8 +144,8 @@ namespace FarmmapsKPI // Get KPI data - //_logger.LogInformation("Calculate KPI map for field"); - //var KPIItem = await _generalService.RunKPITask(cropfieldItem); + _logger.LogInformation("Calculate KPI map for field"); + var KPIItem = await _generalService.RunKPITask(cropfieldItem);// hier dus verwijzen naar de KPI task if ((object)null == null) { _logger.LogError("Something went wrong while obtaining the KPI map");