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

Fixing deserialization of Weather data

parent e5a0dd6c
No related branches found
No related tags found
1 merge request!1Fixing deserialization of Weather data
...@@ -220,7 +220,6 @@ public class LygusRugulipennisModel extends I18nImpl implements Model{ ...@@ -220,7 +220,6 @@ public class LygusRugulipennisModel extends I18nImpl implements Model{
public void setConfiguration(ModelConfiguration config) throws ConfigValidationException { public void setConfiguration(ModelConfiguration config) throws ConfigValidationException {
this.dataMatrix = new DataMatrix(); this.dataMatrix = new DataMatrix();
ObjectMapper mapper = new ObjectMapper();
// Setting timezone // Setting timezone
this.timeZone = TimeZone.getTimeZone((String) config.getConfigParameter("timeZone")); this.timeZone = TimeZone.getTimeZone((String) config.getConfigParameter("timeZone"));
// Importing weather data, creating collections // Importing weather data, creating collections
...@@ -230,7 +229,7 @@ public class LygusRugulipennisModel extends I18nImpl implements Model{ ...@@ -230,7 +229,7 @@ public class LygusRugulipennisModel extends I18nImpl implements Model{
// OR lastly hourly values of TM (not optimal, but better than nothing) // OR lastly hourly values of TM (not optimal, but better than nothing)
List<WeatherObservation> TM = new ArrayList<>(); List<WeatherObservation> TM = new ArrayList<>();
WeatherUtil wUtil = new WeatherUtil(); WeatherUtil wUtil = new WeatherUtil();
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