[Lada-commits] [PATCH] We need a wider range to allow arbitrary input formated +-9.99e+-99
Wald Commits
scm-commit at wald.intevation.org
Fri Apr 8 17:18:15 CEST 2016
# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1460128626 -7200
# Node ID 54e83373bfaef7242cf66fa63f5ab54692388e4d
# Parent adc0a47b7b9d5e931355c0e9a2e68f92e65628ff
We need a wider range to allow arbitrary input formated +-9.99e+-99
diff -r adc0a47b7b9d -r 54e83373bfae db_schema/lada_schema.sql
--- a/db_schema/lada_schema.sql Fri Apr 08 12:32:34 2016 +0200
+++ b/db_schema/lada_schema.sql Fri Apr 08 17:17:06 2016 +0200
@@ -302,9 +302,9 @@
messungs_id integer NOT NULL,
messgroesse_id integer NOT NULL,
messwert_nwg character varying(1),
- messwert real NOT NULL,
+ messwert double precision NOT NULL,
messfehler real,
- nwg_zu_messwert real,
+ nwg_zu_messwert double precision,
meh_id smallint NOT NULL,
grenzwertueberschreitung boolean DEFAULT false,
letzte_aenderung timestamp without time zone DEFAULT now()
@@ -495,10 +495,10 @@
id integer DEFAULT nextval('zusatz_wert_id_seq'::regclass) NOT NULL,
probe_id integer NOT NULL,
pzs_id character varying(3) NOT NULL,
- messwert_pzs real,
+ messwert_pzs double precision,
messfehler real,
letzte_aenderung timestamp without time zone DEFAULT now(),
- nwg_zu_messwert real
+ nwg_zu_messwert double precision
);
diff -r adc0a47b7b9d -r 54e83373bfae src/main/java/de/intevation/lada/factory/ProbeFactory.java
--- a/src/main/java/de/intevation/lada/factory/ProbeFactory.java Fri Apr 08 12:32:34 2016 +0200
+++ b/src/main/java/de/intevation/lada/factory/ProbeFactory.java Fri Apr 08 17:17:06 2016 +0200
@@ -213,7 +213,7 @@
LMesswert wert = new LMesswert();
wert.setMessgroesseId(mw);
wert.setMessungsId(messung.getId());
- wert.setMesswert(0f);
+ wert.setMesswert(0d);
wert.setMehId(1);
repository.create(wert, "land");
}
diff -r adc0a47b7b9d -r 54e83373bfae src/main/java/de/intevation/lada/importer/laf/AttributeMapper.java
--- a/src/main/java/de/intevation/lada/importer/laf/AttributeMapper.java Fri Apr 08 12:32:34 2016 +0200
+++ b/src/main/java/de/intevation/lada/importer/laf/AttributeMapper.java Fri Apr 08 17:17:06 2016 +0200
@@ -416,8 +416,7 @@
wert = wert.substring(2);
messwert.setGrenzwertueberschreitung(true);
}
- float fWert = Float.valueOf(wert);
- messwert.setMesswert(fWert);
+ messwert.setMesswert(Double.valueOf(wert));
QueryBuilder<MessEinheit> builder =
new QueryBuilder<MessEinheit>(
@@ -552,7 +551,7 @@
return null;
}
wert.setPzsId(zusatz.get(0).getId());
- wert.setMesswertPzs(Float.valueOf(w));
+ wert.setMesswertPzs(Double.valueOf(w));
wert.setMessfehler(Float.valueOf(fehler));
return wert;
}
@@ -580,7 +579,7 @@
ndx = v.indexOf(" ");
String fehler = v.substring(ndx + 2);
wert.setPzsId(groesse);
- wert.setMesswertPzs(Float.valueOf(w));
+ wert.setMesswertPzs(Double.valueOf(w));
wert.setMessfehler(Float.valueOf(fehler));
return wert;
}
diff -r adc0a47b7b9d -r 54e83373bfae src/main/java/de/intevation/lada/model/Messwert.java
--- a/src/main/java/de/intevation/lada/model/Messwert.java Fri Apr 08 12:32:34 2016 +0200
+++ b/src/main/java/de/intevation/lada/model/Messwert.java Fri Apr 08 17:17:06 2016 +0200
@@ -48,13 +48,13 @@
@Column(name="messungs_id")
private Integer messungsId;
- private Float messwert;
+ private Double messwert;
@Column(name="messwert_nwg")
private String messwertNwg;
@Column(name="nwg_zu_messwert")
- private Float nwgZuMesswert;
+ private Double nwgZuMesswert;
@Transient
private boolean owner;
@@ -121,11 +121,11 @@
this.messungsId = messungsId;
}
- public Float getMesswert() {
+ public Double getMesswert() {
return this.messwert;
}
- public void setMesswert(Float messwert) {
+ public void setMesswert(Double messwert) {
this.messwert = messwert;
}
@@ -137,11 +137,11 @@
this.messwertNwg = messwertNwg;
}
- public Float getNwgZuMesswert() {
+ public Double getNwgZuMesswert() {
return this.nwgZuMesswert;
}
- public void setNwgZuMesswert(Float nwgZuMesswert) {
+ public void setNwgZuMesswert(Double nwgZuMesswert) {
this.nwgZuMesswert = nwgZuMesswert;
}
diff -r adc0a47b7b9d -r 54e83373bfae src/main/java/de/intevation/lada/model/ZusatzWert.java
--- a/src/main/java/de/intevation/lada/model/ZusatzWert.java Fri Apr 08 12:32:34 2016 +0200
+++ b/src/main/java/de/intevation/lada/model/ZusatzWert.java Fri Apr 08 17:17:06 2016 +0200
@@ -38,10 +38,10 @@
private Float messfehler;
@Column(name="messwert_pzs")
- private Float messwertPzs;
+ private Double messwertPzs;
@Column(name="nwg_zu_messwert")
- private Float nwgZuMesswert;
+ private Double nwgZuMesswert;
@Column(name="probe_id")
private Integer probeId;
@@ -82,19 +82,19 @@
this.messfehler = messfehler;
}
- public Float getMesswertPzs() {
+ public Double getMesswertPzs() {
return this.messwertPzs;
}
- public void setMesswertPzs(Float messwertPzs) {
+ public void setMesswertPzs(Double messwertPzs) {
this.messwertPzs = messwertPzs;
}
- public Float getNwgZuMesswert() {
+ public Double getNwgZuMesswert() {
return this.nwgZuMesswert;
}
- public void setNwgZuMesswert(Float nwgZuMesswert) {
+ public void setNwgZuMesswert(Double nwgZuMesswert) {
this.nwgZuMesswert = nwgZuMesswert;
}
diff -r adc0a47b7b9d -r 54e83373bfae src/main/java/de/intevation/lada/validation/rules/messwert/HasMessunsicherheit.java
--- a/src/main/java/de/intevation/lada/validation/rules/messwert/HasMessunsicherheit.java Fri Apr 08 12:32:34 2016 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/messwert/HasMessunsicherheit.java Fri Apr 08 17:17:06 2016 +0200
@@ -25,8 +25,8 @@
public Violation execute(Object object) {
LMesswert messwert = (LMesswert)object;
Float unsicherheit = messwert.getMessfehler();
- Float nachweisgrenze = messwert.getNwgZuMesswert();
- Float wert = messwert.getMesswert();
+ Double nachweisgrenze = messwert.getNwgZuMesswert();
+ Double wert = messwert.getMesswert();
if (unsicherheit != null && unsicherheit > 0f) {
return null;
}
More information about the Lada-commits
mailing list