Skip to content
Snippets Groups Projects
Commit 9bdf4a33 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Fixing deserialization of Weather data

parent 4039b36c
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,7 @@ import no.nibio.vips.model.ConfigValidationException; ...@@ -37,6 +37,7 @@ import no.nibio.vips.model.ConfigValidationException;
import no.nibio.vips.model.Model; import no.nibio.vips.model.Model;
import no.nibio.vips.model.ModelExcecutionException; import no.nibio.vips.model.ModelExcecutionException;
import no.nibio.vips.model.ModelId; import no.nibio.vips.model.ModelId;
import no.nibio.vips.util.ModelUtil;
import no.nibio.vips.util.WeatherElements; import no.nibio.vips.util.WeatherElements;
import no.nibio.vips.util.WeatherObservationListException; import no.nibio.vips.util.WeatherObservationListException;
import no.nibio.vips.util.WeatherUtil; import no.nibio.vips.util.WeatherUtil;
...@@ -284,8 +285,8 @@ public class GrassDryingModel extends I18nImpl implements Model{ ...@@ -284,8 +285,8 @@ public class GrassDryingModel extends I18nImpl implements Model{
// ############ Weather data ############## // ############ Weather data ##############
// Getting weather data, validating // Getting weather data, validating
List<WeatherObservation> observations = mapper.convertValue(config.getConfigParameter("observations"), new TypeReference<List<WeatherObservation>>(){}); ModelUtil modelUtil = new ModelUtil();
List<WeatherObservation> observations = modelUtil.extractWeatherObservationList(config.getConfigParameter("observations"));
for(WeatherObservation o:observations) for(WeatherObservation o:observations)
{ {
switch(o.getElementMeasurementTypeId()) switch(o.getElementMeasurementTypeId())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment