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

Renamed Observation to WeatherObservation

parent f38a794c
Branches
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import no.bioforsk.vips.i18n.I18nImpl;
import no.bioforsk.vips.entity.ModelConfiguration;
import no.bioforsk.vips.entity.Observation;
import no.bioforsk.vips.entity.WeatherObservation;
import no.bioforsk.vips.entity.Result;
import no.bioforsk.vips.entity.ResultImpl;
import no.bioforsk.vips.model.ConfigValidationException;
......@@ -33,12 +33,12 @@ public class NaerstadModel extends I18nImpl implements Model{
private boolean DEBUG = false;
private Collection<Observation> TM;
private Collection<Observation> UM;
private Collection<Observation> RR;
private Collection<WeatherObservation> TM;
private Collection<WeatherObservation> UM;
private Collection<WeatherObservation> RR;
//private Collection<KlimaTimeverdiBO> FM2;
private Collection<Observation> Q0;
private Collection<Observation> BT;
private Collection<WeatherObservation> Q0;
private Collection<WeatherObservation> BT;
private Date calculationStart;
private Date calculationEnd;
......@@ -201,8 +201,8 @@ public class NaerstadModel extends I18nImpl implements Model{
this.calculationStart = mapper.convertValue(config.getConfigParameter("calculationStart"), new TypeReference<Date>(){});
this.calculationEnd = mapper.convertValue(config.getConfigParameter("calculationEnd"), new TypeReference<Date>(){});
List<Observation> observations = mapper.convertValue(config.getConfigParameter("observations"), new TypeReference<List<Observation>>(){});
for(Observation o:observations)
List<WeatherObservation> observations = mapper.convertValue(config.getConfigParameter("observations"), new TypeReference<List<WeatherObservation>>(){});
for(WeatherObservation o:observations)
{
switch(o.getElementMeasurementTypeId())
{
......@@ -263,15 +263,15 @@ public class NaerstadModel extends I18nImpl implements Model{
Collections.sort((List)this.BT);
Collections.sort((List)this.Q0);
Observation[] TMliste = new Observation[0];
WeatherObservation[] TMliste = new WeatherObservation[0];
TMliste = this.TM.toArray(TMliste);
Observation[] UMliste = new Observation[0];
WeatherObservation[] UMliste = new WeatherObservation[0];
UMliste = this.UM.toArray(UMliste);
Observation[] RRliste = new Observation[0];
WeatherObservation[] RRliste = new WeatherObservation[0];
RRliste = this.RR.toArray(RRliste);
Observation[] BTliste = new Observation[0];
WeatherObservation[] BTliste = new WeatherObservation[0];
BTliste = this.BT.toArray(BTliste);
Observation[] Q0liste = new Observation[0];
WeatherObservation[] Q0liste = new WeatherObservation[0];
Q0liste = this.Q0.toArray(Q0liste);
......
......@@ -14,7 +14,7 @@ import java.util.logging.Logger;
import static junit.framework.Assert.fail;
import junit.framework.TestCase;
import no.bioforsk.vips.entity.ModelConfiguration;
import no.bioforsk.vips.entity.Observation;
import no.bioforsk.vips.entity.WeatherObservation;
import no.bioforsk.vips.model.ConfigValidationException;
import no.bioforsk.vips.model.ModelExcecutionException;
import no.bioforsk.vips.util.JSONUtil;
......@@ -158,7 +158,7 @@ public class NaerstadModelTest extends TestCase {
JsonFactory f = new MappingJsonFactory();
JsonParser jp = f.createJsonParser(inputStream);
JsonNode all = jp.readValueAsTree();
List<Observation> observations = new ArrayList<>();
List<WeatherObservation> observations = new ArrayList<>();
ObjectMapper mapper = new ObjectMapper();
Date firstDate = null;
......@@ -176,7 +176,7 @@ public class NaerstadModelTest extends TestCase {
lastDate = timeMeasured;
}
//System.out.println(node.toString());
Observation observation = new Observation();
WeatherObservation observation = new WeatherObservation();
observation.setTimeMeasured(timeMeasured);
observation.setLogIntervalId(node.get("logIntervalId").getIntValue());
observation.setElementMeasurementTypeId(node.get("elementMeasurementTypeId").getTextValue());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment