[Dive4elements-commits] [PATCH 1 of 2] Flow velocity model parser: more and improved log output
Wald Commits
scm-commit at wald.intevation.org
Fri Jun 21 14:36:45 CEST 2013
# HG changeset patch
# User Tom Gottfried <tom.gottfried at intevation.de>
# Date 1371818046 -7200
# Branch double-precision
# Node ID a81fbbda28e73441f39fd5d69abce1602f7ec45a
# Parent 55a2f9e0d6ab789a456ad0218204c33bdf65990f
Flow velocity model parser: more and improved log output
diff -r 55a2f9e0d6ab -r a81fbbda28e7 backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java Tue Jun 18 19:33:40 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java Fri Jun 21 14:34:06 2013 +0200
@@ -115,18 +115,19 @@
if (m.matches()) {
String mainValueStr = m.group(1);
+ log.debug("mainValueStr = '" + mainValueStr + "'");
String gaugeStr = m.group(2);
Object[] valueData = handleMainValueString(mainValueStr);
Object[] gaugeData = handleGaugeString(gaugeStr);
if (valueData == null || valueData.length < 2) {
- log.warn("skip invalid MainValue part: '" + line + "'");
+ log.warn("skip invalid MainValue part in '" + line + "'");
return;
}
if (gaugeData == null || gaugeData.length < 2) {
- log.warn("skip invalid gauge part: '" + line + "'");
+ log.warn("skip invalid gauge part in '" + line + "'");
return;
}
@@ -151,6 +152,7 @@
protected Object[] handleMainValueString(String mainValueStr) {
Matcher mA = META_MAINVALUE_A.matcher(mainValueStr);
if (mA.matches()) {
+ log.debug("mainValueStr matches META_MAINVALUE_A");
String name = mA.group(0);
return new Object[] { name, name };
@@ -158,6 +160,7 @@
Matcher mB = META_MAINVALUE_B.matcher(mainValueStr);
if (mB.matches()) {
+ log.debug("mainValueStr matches META_MAINVALUE_B");
String lower = mB.group(1);
String upper = mB.group(4);
@@ -166,6 +169,7 @@
Matcher mC = META_MAINVALUE_C.matcher(mainValueStr);
if (mC.matches()) {
+ log.debug("mainValueStr matches META_MAINVALUE_C");
String facA = mC.group(1);
String nameA = mC.group(2);
String facB = mC.group(3);
@@ -181,6 +185,7 @@
Matcher mD = META_MAINVALUE_D.matcher(mainValueStr);
if (mD.matches()) {
+ log.debug("mainValueStr matches META_MAINVALUE_D");
String loFacA = mD.group(2);
String loNameA = mD.group(3);
String loFacB = mD.group(4);
@@ -205,12 +210,14 @@
Matcher mE = META_MAINVALUE_E.matcher(mainValueStr);
if (mE.matches()) {
+ log.debug("mainValueStr matches META_MAINVALUE_E");
String lower = mE.group(1);
String upper = mE.group(4);
return new Object[] { lower, upper };
}
+ log.debug("mainValueStr not matched");
return null;
}
More information about the Dive4elements-commits
mailing list