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

Fixing deserialization of Weather data

parent f2b4da00
Branches
Tags
1 merge request!1Master
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
package no.nibio.vips.model.septoriahumiditymodel; package no.nibio.vips.model.septoriahumiditymodel;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException; import java.io.IOException;
import java.text.ParseException; import java.text.ParseException;
...@@ -311,9 +310,7 @@ public class SeptoriaHumidityModel extends I18nImpl implements Model { ...@@ -311,9 +310,7 @@ public class SeptoriaHumidityModel extends I18nImpl implements Model {
// Object deserialization tool // Object deserialization tool
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
// TODO: Have defaults for these? // TODO: Have defaults for these?
try try
{ {
...@@ -399,7 +396,7 @@ public class SeptoriaHumidityModel extends I18nImpl implements Model { ...@@ -399,7 +396,7 @@ public class SeptoriaHumidityModel extends I18nImpl implements Model {
this.lastSprayingProtectionEnd = DateTimeInterval.getLastEndDate(Arrays.asList(new DateTimeInterval[]{this.protectionPeriod1,this.protectionPeriod2})); this.lastSprayingProtectionEnd = DateTimeInterval.getLastEndDate(Arrays.asList(new DateTimeInterval[]{this.protectionPeriod1,this.protectionPeriod2}));
} }
List<WeatherObservation> observations = mapper.convertValue(config.getConfigParameter("observations"), new TypeReference<List<WeatherObservation>>(){}); List<WeatherObservation> observations = this.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