|
From: <br...@us...> - 2016-07-14 17:22:43
|
Revision: 4184
http://sourceforge.net/p/openlcb/svn/4184
Author: bracz
Date: 2016-07-14 17:22:40 +0000 (Thu, 14 Jul 2016)
Log Message:
-----------
Adds a string rendering of the last visible value for CDI entries, updated on every change notification.
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/cdi/impl/ConfigRepresentation.java
Modified: trunk/prototypes/java/src/org/openlcb/cdi/impl/ConfigRepresentation.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/cdi/impl/ConfigRepresentation.java 2016-07-14 17:22:22 UTC (rev 4183)
+++ trunk/prototypes/java/src/org/openlcb/cdi/impl/ConfigRepresentation.java 2016-07-14 17:22:40 UTC (rev 4184)
@@ -299,10 +299,14 @@
public int size;
/// Internal key for this variable or group
public String key;
+ /// String-rendered value of this entry. Populated for leaf entries.
+ public String lastVisibleValue = null;
public abstract CdiRep.Item getCdiItem();
+ protected void updateVisibleValue() {}
public void fireUpdate() {
+ updateVisibleValue();
firePropertyChange(UPDATE_ENTRY_DATA, null, null);
}
@@ -486,6 +490,11 @@
return rep;
}
+ @Override
+ protected void updateVisibleValue() {
+ lastVisibleValue = Long.toString(getValue());
+ }
+
public long getValue() {
MemorySpaceCache cache = getCacheForSpace(space);
byte[] b = cache.read(origin, size);
@@ -530,6 +539,11 @@
return rep;
}
+ @Override
+ protected void updateVisibleValue() {
+ lastVisibleValue = getValue().toString();
+ }
+
public EventID getValue() {
MemorySpaceCache cache = getCacheForSpace(space);
byte[] b = cache.read(origin, size);
@@ -564,6 +578,11 @@
return rep;
}
+ @Override
+ protected void updateVisibleValue() {
+ lastVisibleValue = getValue();
+ }
+
public String getValue() {
MemorySpaceCache cache = getCacheForSpace(space);
byte[] b = cache.read(origin, size);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|