From ba1fc17b31d089604ecbd6624f956bc684501adc Mon Sep 17 00:00:00 2001 From: radek2s Date: Mon, 12 Feb 2018 11:55:49 +0100 Subject: [PATCH 1/6] bug/#459 Fix Meta Data Source with alphanumeric data type. --- WebContent/WEB-INF/classes/env.properties | 2 +- .../serotonin/mango/rt/dataImage/SetPointSource.java | 1 + src/org/scada_lts/mango/service/PointValueService.java | 10 ++++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/WebContent/WEB-INF/classes/env.properties b/WebContent/WEB-INF/classes/env.properties index 0b3828295b..7f13831c83 100644 --- a/WebContent/WEB-INF/classes/env.properties +++ b/WebContent/WEB-INF/classes/env.properties @@ -57,7 +57,7 @@ abilit.disableDataSourcesOnServerStart=false abilit.api.replace.alert.onview=true -abilit.cacheEnable=true +abilit.cacheEnable=false abilit.START_UPDATE_UNSILENCED_ALARM_LEVEL=100000 abilit.START_UPDATE_EVENT_DETECTORS=100000 abilit.START_UPDATE_PENDING_EVENTS=100000 diff --git a/src/com/serotonin/mango/rt/dataImage/SetPointSource.java b/src/com/serotonin/mango/rt/dataImage/SetPointSource.java index bc7868a64e..0f0083a6b9 100644 --- a/src/com/serotonin/mango/rt/dataImage/SetPointSource.java +++ b/src/com/serotonin/mango/rt/dataImage/SetPointSource.java @@ -33,6 +33,7 @@ public interface Types { int EVENT_HANDLER = 2; int ANONYMOUS = 3; int POINT_LINK = 4; + int UNKNOWN = 5; } public int getSetPointSourceType(); diff --git a/src/org/scada_lts/mango/service/PointValueService.java b/src/org/scada_lts/mango/service/PointValueService.java index 66f1312fde..124cd51abf 100644 --- a/src/org/scada_lts/mango/service/PointValueService.java +++ b/src/org/scada_lts/mango/service/PointValueService.java @@ -223,7 +223,7 @@ long savePointValueInTrasaction(final int pointId, final int dataType, double dv retries--; } catch (RuntimeException e) { throw new RuntimeException( - "Error saving point value: dataType=" + dataType + "Error transactional saving point value: dataType=" + dataType + ", dvalue=" + dvalue, e); } } @@ -252,7 +252,7 @@ public long savePointValue(final int pointId, final int dataType, double dvalue, retries--; } catch (RuntimeException e) { throw new RuntimeException( - "Error saving point value: dataType=" + dataType + "Error no transaction saving point value: dataType=" + dataType + ", dvalue=" + dvalue, e); } } @@ -273,6 +273,9 @@ private long savePointValueImpl(int pointId, int dataType, double dvalue, long t if (source != null) { sourceType = source.getSetPointSourceType(); sourceId = source.getSetPointSourceId(); + } else { + sourceType = SetPointSource.Types.UNKNOWN; + sourceId = new Integer(1); } String shortString = null; @@ -285,9 +288,8 @@ private long savePointValueImpl(int pointId, int dataType, double dvalue, long t } PointValueAdnnotation pointValueAdnnotation = new PointValueAdnnotation(id,shortString, longString, sourceType, sourceId); - PointValueAdnnotationsDAO.getInstance().create(pointValueAdnnotation); - + } return id; From 2b7bcd6ca684541ca18a58aed339b0565c1398f8 Mon Sep 17 00:00:00 2001 From: radek2s Date: Mon, 12 Feb 2018 12:49:15 +0100 Subject: [PATCH 2/6] #459 travis build test --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 2a23fc4657..fba42a9ff0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ branches: - "/^PROC-.*$/" - "/^develop-sdtabilit.*$/" - "/^#179*$/" + - "/^fix*$/" - "/^master-sdtabilit.*$/" - "/^v*$/" notifications: From 0780436bd703f10879af748a87f4ae435ba39363 Mon Sep 17 00:00:00 2001 From: radek2s Date: Mon, 12 Feb 2018 12:52:03 +0100 Subject: [PATCH 3/6] #459 next travis branch added --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index fba42a9ff0..e9751c54a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ branches: - "/^PROC-.*$/" - "/^develop-sdtabilit.*$/" - "/^#179*$/" + - "/^#459*$/" - "/^fix*$/" - "/^master-sdtabilit.*$/" - "/^v*$/" From bba5940b359fb0ff848dad0c07f9137306d3c793 Mon Sep 17 00:00:00 2001 From: radek2s Date: Mon, 12 Feb 2018 12:55:18 +0100 Subject: [PATCH 4/6] #459 travis bug 3 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e9751c54a4..99bec5354b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ branches: - "/^PROC-.*$/" - "/^develop-sdtabilit.*$/" - "/^#179*$/" - - "/^#459*$/" + - "/^bug/#459*$/" - "/^fix*$/" - "/^master-sdtabilit.*$/" - "/^v*$/" From 1c6c518a60f57a5b9c60acbb84562d8d9fb3d6d2 Mon Sep 17 00:00:00 2001 From: radek2s Date: Mon, 12 Feb 2018 13:02:02 +0100 Subject: [PATCH 5/6] #459 travis build 459 branch --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99bec5354b..c46e035b69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ branches: - "/^PROC-.*$/" - "/^develop-sdtabilit.*$/" - "/^#179*$/" - - "/^bug/#459*$/" + - "/^#459.*/" - "/^fix*$/" - "/^master-sdtabilit.*$/" - "/^v*$/" From 53aff7044ba98c31321787bf7b6b5de88f0a316e Mon Sep 17 00:00:00 2001 From: Radek Jajko Date: Tue, 13 Feb 2018 13:37:23 +0100 Subject: [PATCH 6/6] #459 Master alphanumeric MetaDataSource type fix - revert small changes and save only necessary changes --- .travis.yml | 2 -- WebContent/WEB-INF/classes/env.properties | 2 +- src/org/scada_lts/mango/service/PointValueService.java | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c46e035b69..2a23fc4657 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,8 +39,6 @@ branches: - "/^PROC-.*$/" - "/^develop-sdtabilit.*$/" - "/^#179*$/" - - "/^#459.*/" - - "/^fix*$/" - "/^master-sdtabilit.*$/" - "/^v*$/" notifications: diff --git a/WebContent/WEB-INF/classes/env.properties b/WebContent/WEB-INF/classes/env.properties index 7f13831c83..0b3828295b 100644 --- a/WebContent/WEB-INF/classes/env.properties +++ b/WebContent/WEB-INF/classes/env.properties @@ -57,7 +57,7 @@ abilit.disableDataSourcesOnServerStart=false abilit.api.replace.alert.onview=true -abilit.cacheEnable=false +abilit.cacheEnable=true abilit.START_UPDATE_UNSILENCED_ALARM_LEVEL=100000 abilit.START_UPDATE_EVENT_DETECTORS=100000 abilit.START_UPDATE_PENDING_EVENTS=100000 diff --git a/src/org/scada_lts/mango/service/PointValueService.java b/src/org/scada_lts/mango/service/PointValueService.java index 124cd51abf..66dfd07d3f 100644 --- a/src/org/scada_lts/mango/service/PointValueService.java +++ b/src/org/scada_lts/mango/service/PointValueService.java @@ -223,7 +223,7 @@ long savePointValueInTrasaction(final int pointId, final int dataType, double dv retries--; } catch (RuntimeException e) { throw new RuntimeException( - "Error transactional saving point value: dataType=" + dataType + "Error saving point value: dataType=" + dataType + ", dvalue=" + dvalue, e); } } @@ -252,7 +252,7 @@ public long savePointValue(final int pointId, final int dataType, double dvalue, retries--; } catch (RuntimeException e) { throw new RuntimeException( - "Error no transaction saving point value: dataType=" + dataType + "Error saving point value: dataType=" + dataType + ", dvalue=" + dvalue, e); } }