|
From: <jac...@us...> - 2013-10-18 20:56:12
|
Revision: 3320
http://sourceforge.net/p/openlcb/svn/3320
Author: jacobsen
Date: 2013-10-18 20:56:10 +0000 (Fri, 18 Oct 2013)
Log Message:
-----------
with address space fix
Modified Paths:
--------------
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
Modified: trunk/prototypes/java/openlcb-demo.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/openlcb.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2013-12-01 23:57:36
|
Revision: 3374
http://sourceforge.net/p/openlcb/svn/3374
Author: jacobsen
Date: 2013-12-01 23:57:33 +0000 (Sun, 01 Dec 2013)
Log Message:
-----------
AliasMap drops entry on AMR
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/can/AliasMap.java
trunk/prototypes/java/test/org/openlcb/can/AliasMapTest.java
Modified: trunk/prototypes/java/src/org/openlcb/can/AliasMap.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/can/AliasMap.java 2013-12-01 23:57:15 UTC (rev 3373)
+++ trunk/prototypes/java/src/org/openlcb/can/AliasMap.java 2013-12-01 23:57:33 UTC (rev 3374)
@@ -23,6 +23,9 @@
Integer alias = Integer.valueOf(f.getSourceAlias());
NodeID nid = f.getNodeID();
insert(alias, nid);
+ } else if (f.isAliasMapReset()) {
+ Integer alias = Integer.valueOf(f.getSourceAlias());
+ remove(alias);
}
}
@@ -31,6 +34,13 @@
iMap.put(nid, alias);
}
+ public void remove(int alias) {
+ NodeID nid = getNodeID(alias);
+ if (nid == null) return;
+ nMap.remove(alias);
+ iMap.remove(nid);
+ }
+
public NodeID getNodeID(int alias) {
NodeID retVal = nMap.get(Integer.valueOf(alias));
if (retVal != null) return retVal;
Modified: trunk/prototypes/java/test/org/openlcb/can/AliasMapTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/can/AliasMapTest.java 2013-12-01 23:57:15 UTC (rev 3373)
+++ trunk/prototypes/java/test/org/openlcb/can/AliasMapTest.java 2013-12-01 23:57:33 UTC (rev 3374)
@@ -17,7 +17,6 @@
AliasMap map = new AliasMap();
Assert.assertEquals("get Alias", -1, map.getAlias(new NodeID(new byte[]{0,1,2,3,4,5})));
-
Assert.assertEquals("get NodeID", new NodeID(), map.getNodeID(0));
}
@@ -28,6 +27,7 @@
f.setInitializationComplete(0x123, new NodeID(new byte[]{0,1,2,3,4,5}));
map.processFrame(f);
Assert.assertEquals("check NodeID", new NodeID(new byte[]{0,1,2,3,4,5}), map.getNodeID(0x123));
+ Assert.assertEquals("check alias", 0x123, map.getAlias(new NodeID(new byte[]{0,1,2,3,4,5})));
}
public void testAfterInsert() {
@@ -35,8 +35,23 @@
map.insert(0x123, new NodeID(new byte[]{0,1,2,3,4,5}));
Assert.assertEquals("check NodeID", new NodeID(new byte[]{0,1,2,3,4,5}), map.getNodeID(0x123));
+ Assert.assertEquals("check alias", 0x123, map.getAlias(new NodeID(new byte[]{0,1,2,3,4,5})));
}
+ public void testAfterAMR() {
+ AliasMap map = new AliasMap();
+
+ map.insert(0x123, new NodeID(new byte[]{0,1,2,3,4,5}));
+
+ // remove with AMR
+ OpenLcbCanFrame f = new OpenLcbCanFrame(0x123);
+ f.setAMR(0x123, new NodeID(new byte[]{0,1,2,3,4,5}));
+ map.processFrame(f);
+
+ Assert.assertEquals("get Alias", -1, map.getAlias(new NodeID(new byte[]{0,1,2,3,4,5})));
+ Assert.assertEquals("get NodeID", new NodeID(), map.getNodeID(0));
+ }
+
// from here down is testing infrastructure
public AliasMapTest(String s) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2014-07-13 03:46:39
|
Revision: 3580
http://sourceforge.net/p/openlcb/svn/3580
Author: jacobsen
Date: 2014-07-13 03:46:36 +0000 (Sun, 13 Jul 2014)
Log Message:
-----------
from current code
Modified Paths:
--------------
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
Modified: trunk/prototypes/java/openlcb-demo.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/openlcb.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2014-07-23 09:57:11
|
Revision: 3595
http://sourceforge.net/p/openlcb/svn/3595
Author: jacobsen
Date: 2014-07-23 09:57:09 +0000 (Wed, 23 Jul 2014)
Log Message:
-----------
consistent w latest code
Modified Paths:
--------------
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
Modified: trunk/prototypes/java/openlcb-demo.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/openlcb.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2015-06-20 15:15:20
|
Revision: 3886
http://sourceforge.net/p/openlcb/svn/3886
Author: jacobsen
Date: 2015-06-20 15:15:17 +0000 (Sat, 20 Jun 2015)
Log Message:
-----------
JDOM 2
Modified Paths:
--------------
trunk/prototypes/java/lib/README
trunk/prototypes/java/manifest
trunk/prototypes/java/nbproject/ide-file-targets.xml
trunk/prototypes/java/nbproject/project.xml
trunk/prototypes/java/runtest.bat
trunk/prototypes/java/runtest.csh
trunk/prototypes/java/src/org/openlcb/cdi/jdom/JdomCdiReader.java
trunk/prototypes/java/src/org/openlcb/cdi/jdom/JdomCdiRep.java
trunk/prototypes/java/test/org/openlcb/cdi/jdom/JdomCdiRepTest.java
trunk/prototypes/java/test/org/openlcb/cdi/jdom/SampleFactory.java
trunk/prototypes/java/test/org/openlcb/cdi/swing/CdiPanelTest.java
trunk/prototypes/java/test/tools/jmri/DecoderDefnToCdi.java
Added Paths:
-----------
trunk/prototypes/java/lib/jdom-2.0.5.jar
Removed Paths:
-------------
trunk/prototypes/java/lib/jdom.jar
Modified: trunk/prototypes/java/lib/README
===================================================================
--- trunk/prototypes/java/lib/README 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/lib/README 2015-06-20 15:15:17 UTC (rev 3886)
@@ -7,9 +7,11 @@
jdom.jar
version 1.1
+jdom-2.0.5.jar
Used for testing only, not in main jar
from <jdom.org>
-
+
+
junit.jar
version 3.8.2
Used for testing only, not at runtime
Added: trunk/prototypes/java/lib/jdom-2.0.5.jar
===================================================================
(Binary files differ)
Index: trunk/prototypes/java/lib/jdom-2.0.5.jar
===================================================================
--- trunk/prototypes/java/lib/jdom-2.0.5.jar 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/lib/jdom-2.0.5.jar 2015-06-20 15:15:17 UTC (rev 3886)
Property changes on: trunk/prototypes/java/lib/jdom-2.0.5.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Deleted: trunk/prototypes/java/lib/jdom.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/manifest
===================================================================
--- trunk/prototypes/java/manifest 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/manifest 2015-06-20 15:15:17 UTC (rev 3886)
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Main-Class: scenarios.ScenarioRunner
-Class-Path: lib/junit.jar lib/jdom.jar lib/jlfgr-1_0.jar
+Class-Path: lib/junit.jar lib/jdom-2.0.5.jar lib/jdom.jar lib/jlfgr-1_0.jar
Name: org.openlcb
Specification-Title: OpenLCB
Modified: trunk/prototypes/java/nbproject/ide-file-targets.xml
===================================================================
--- trunk/prototypes/java/nbproject/ide-file-targets.xml 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/nbproject/ide-file-targets.xml 2015-06-20 15:15:17 UTC (rev 3886)
@@ -20,7 +20,7 @@
</ant>
<java classname="${run.class}" failonerror="true" fork="true">
<classpath>
- <pathelement path="lib/junit.jar:lib/jdom.jar:lib/jlfgr-1_0.jar:lib/annotations.jar:lib/jsr305.jar:src"/>
+ <pathelement path="lib/junit.jar:lib/jdom-2.0.5.jar:lib/jdom.jar:lib/jlfgr-1_0.jar:lib/annotations.jar:lib/jsr305.jar:src"/>
<pathelement location="classes"/>
</classpath>
</java>
@@ -35,7 +35,7 @@
</ant>
<java classname="${run.class}" failonerror="true" fork="true">
<classpath>
- <pathelement path="lib/jdom.jar:lib/jlfgr-1_0.jar:lib/annotations.jar:lib/jsr305.jar"/>
+ <pathelement path="lib/jdom-2.0.5.jar:lib/jdom.jar:lib/jlfgr-1_0.jar:lib/annotations.jar:lib/jsr305.jar"/>
<pathelement location="classes"/>
</classpath>
</java>
Modified: trunk/prototypes/java/nbproject/project.xml
===================================================================
--- trunk/prototypes/java/nbproject/project.xml 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/nbproject/project.xml 2015-06-20 15:15:17 UTC (rev 3886)
@@ -139,7 +139,7 @@
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
<compilation-unit>
<package-root>src</package-root>
- <classpath mode="compile">lib/jdom.jar:lib/jlfgr-1_0.jar:lib/annotations.jar:lib/jsr305.jar</classpath>
+ <classpath mode="compile">lib/jdom-2.0.5.jar:lib/jdom.jar:lib/jlfgr-1_0.jar:lib/annotations.jar:lib/jsr305.jar</classpath>
<built-to>classes</built-to>
<javadoc-built-to>doc</javadoc-built-to>
<source-level>1.6</source-level>
@@ -147,7 +147,7 @@
<compilation-unit>
<package-root>test</package-root>
<unit-tests/>
- <classpath mode="compile">lib/junit.jar:lib/jdom.jar:lib/jlfgr-1_0.jar:lib/annotations.jar:lib/jsr305.jar:src</classpath>
+ <classpath mode="compile">lib/junit.jar:lib/jdom-2.0.5.jar:lib/jdom.jar:lib/jlfgr-1_0.jar:lib/annotations.jar:lib/jsr305.jar:src</classpath>
<built-to>classes</built-to>
<source-level>1.6</source-level>
</compilation-unit>
Modified: trunk/prototypes/java/runtest.bat
===================================================================
--- trunk/prototypes/java/runtest.bat 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/runtest.bat 2015-06-20 15:15:17 UTC (rev 3886)
@@ -1 +1 @@
-java -noverify -Dsun.java2d.noddraw -Djava.library.path=.:lib/ -cp .;classes;lib/junit.jar;lib/jdom.jar;lib/jlfgr-1_0.jar $1 $2 $3
+java -noverify -Dsun.java2d.noddraw -Djava.library.path=.:lib/ -cp .;classes;lib/junit.jar;lib/jdom-2.0.5.jar;lib/jdom.jar;lib/jlfgr-1_0.jar $1 $2 $3
Modified: trunk/prototypes/java/runtest.csh
===================================================================
--- trunk/prototypes/java/runtest.csh 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/runtest.csh 2015-06-20 15:15:17 UTC (rev 3886)
@@ -12,5 +12,5 @@
-Dapple.laf.useScreenMenuBar=true \
-Dlog4j.ignoreTCL=true \
-Djava.library.path=.:lib/ \
- -cp .:classes:lib/junit.jar:lib/xercesImpl.jar:lib/jdom.jar:lib/jlfgr-1_0.jar \
+ -cp .:classes:lib/junit.jar:lib/xercesImpl.jar:lib/jdom-2.0.5.jar:lib/jdom.jar:lib/jlfgr-1_0.jar \
$1 $2 $3
Modified: trunk/prototypes/java/src/org/openlcb/cdi/jdom/JdomCdiReader.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/cdi/jdom/JdomCdiReader.java 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/src/org/openlcb/cdi/jdom/JdomCdiReader.java 2015-06-20 15:15:17 UTC (rev 3886)
@@ -3,8 +3,8 @@
import org.openlcb.cdi.*;
import java.io.*;
-import org.jdom.*;
-import org.jdom.input.SAXBuilder;
+import org.jdom2.*;
+import org.jdom2.input.SAXBuilder;
/**
* JDOM-based OpenLCB loader
Modified: trunk/prototypes/java/src/org/openlcb/cdi/jdom/JdomCdiRep.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/cdi/jdom/JdomCdiRep.java 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/src/org/openlcb/cdi/jdom/JdomCdiRep.java 2015-06-20 15:15:17 UTC (rev 3886)
@@ -1,7 +1,7 @@
package org.openlcb.cdi.jdom;
-import org.jdom.Attribute;
-import org.jdom.Element;
+import org.jdom2.Attribute;
+import org.jdom2.Element;
import org.openlcb.cdi.CdiRep;
/**
@@ -118,7 +118,7 @@
try {
if (a == null) return 0;
else return a.getIntValue();
- } catch (org.jdom.DataConversionException e1) { return 0; }
+ } catch (org.jdom2.DataConversionException e1) { return 0; }
}
@Override
@@ -127,7 +127,7 @@
try {
if (a == null) return 0;
else return a.getIntValue();
- } catch (org.jdom.DataConversionException e1) { return 0; }
+ } catch (org.jdom2.DataConversionException e1) { return 0; }
}
}
@@ -212,7 +212,7 @@
try {
if (a == null) return 0;
else return a.getIntValue();
- } catch (org.jdom.DataConversionException e) { return 0; }
+ } catch (org.jdom2.DataConversionException e) { return 0; }
}
}
@@ -225,7 +225,7 @@
try {
if (a == null) return 0;
else return a.getIntValue();
- } catch (org.jdom.DataConversionException e1) { return 0; }
+ } catch (org.jdom2.DataConversionException e1) { return 0; }
}
@Override
@@ -234,7 +234,7 @@
try {
if (a == null) return 0;
else return a.getIntValue();
- } catch (org.jdom.DataConversionException e1) { return 0; }
+ } catch (org.jdom2.DataConversionException e1) { return 0; }
}
@Override
@@ -264,7 +264,7 @@
try {
if (a == null) return 1;
else return a.getIntValue();
- } catch (org.jdom.DataConversionException e1) { return 0; }
+ } catch (org.jdom2.DataConversionException e1) { return 0; }
}
}
@@ -280,7 +280,7 @@
try {
if (a == null) return 1;
else return a.getIntValue();
- } catch (org.jdom.DataConversionException e1) { return 0; }
+ } catch (org.jdom2.DataConversionException e1) { return 0; }
}
}
@@ -294,7 +294,7 @@
try {
if (a == null) return 1;
else return a.getIntValue();
- } catch (org.jdom.DataConversionException e1) { return 0; }
+ } catch (org.jdom2.DataConversionException e1) { return 0; }
}
}
Modified: trunk/prototypes/java/test/org/openlcb/cdi/jdom/JdomCdiRepTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/cdi/jdom/JdomCdiRepTest.java 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/test/org/openlcb/cdi/jdom/JdomCdiRepTest.java 2015-06-20 15:15:17 UTC (rev 3886)
@@ -5,7 +5,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.jdom.*;
+import org.jdom2.*;
import org.openlcb.cdi.CdiRep;
Modified: trunk/prototypes/java/test/org/openlcb/cdi/jdom/SampleFactory.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/cdi/jdom/SampleFactory.java 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/test/org/openlcb/cdi/jdom/SampleFactory.java 2015-06-20 15:15:17 UTC (rev 3886)
@@ -1,6 +1,6 @@
package org.openlcb.cdi.jdom;
-import org.jdom.*;
+import org.jdom2.*;
import org.openlcb.cdi.CdiRep;
@@ -134,9 +134,9 @@
Document doc = new Document(root);
try {
- org.jdom.output.XMLOutputter fmt = new org.jdom.output.XMLOutputter();
+ org.jdom2.output.XMLOutputter fmt = new org.jdom2.output.XMLOutputter();
- fmt.setFormat(org.jdom.output.Format.getPrettyFormat());
+ fmt.setFormat(org.jdom2.output.Format.getPrettyFormat());
fmt.output(doc, System.out);
} catch (Exception e) {
Modified: trunk/prototypes/java/test/org/openlcb/cdi/swing/CdiPanelTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/cdi/swing/CdiPanelTest.java 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/test/org/openlcb/cdi/swing/CdiPanelTest.java 2015-06-20 15:15:17 UTC (rev 3886)
@@ -13,8 +13,8 @@
import java.net.URL;
import javax.swing.*;
-import org.jdom.*;
-import org.jdom.input.SAXBuilder;
+import org.jdom2.*;
+import org.jdom2.input.SAXBuilder;
/**
* @author Bob Jacobsen Copyright 2012
Modified: trunk/prototypes/java/test/tools/jmri/DecoderDefnToCdi.java
===================================================================
--- trunk/prototypes/java/test/tools/jmri/DecoderDefnToCdi.java 2015-06-20 15:13:56 UTC (rev 3885)
+++ trunk/prototypes/java/test/tools/jmri/DecoderDefnToCdi.java 2015-06-20 15:15:17 UTC (rev 3886)
@@ -8,10 +8,10 @@
import java.util.Iterator;
import javax.swing.*;
-import org.jdom.*;
-import org.jdom.input.SAXBuilder;
-import org.jdom.output.Format;
-import org.jdom.output.XMLOutputter;
+import org.jdom2.*;
+import org.jdom2.input.SAXBuilder;
+import org.jdom2.output.Format;
+import org.jdom2.output.XMLOutputter;
/**
* Small stand-alone utility to read a JMRI
@@ -32,7 +32,7 @@
// add schema definitions
root.setAttribute("noNamespaceSchemaLocation", // NOI18N
"http://openlcb.org/trunk/specs/schema/cdi.xsd", // NOI18N
- org.jdom.Namespace.getNamespace("xsi", // NOI18N
+ org.jdom2.Namespace.getNamespace("xsi", // NOI18N
"http://www.w3.org/2001/XMLSchema-instance")); // NOI18N
doc = new Document(root);
@@ -48,7 +48,7 @@
doc.addContent(0,p);
}
- public void convert(Element inRoot) throws org.jdom.DataConversionException {
+ public void convert(Element inRoot) throws org.jdom2.DataConversionException {
addHeader(inRoot);
addAcdiElement();
addCommonCDI();
@@ -166,7 +166,7 @@
}
public void addVariables(Element inRoot)
- throws org.jdom.DataConversionException {
+ throws org.jdom2.DataConversionException {
Element vs = inRoot.getChild("decoder").getChild("variables");
Element segment = new Element("segment");
@@ -237,7 +237,7 @@
}
public Element handleEnumVal(Element type, long cv, String name, String comment, String mask)
- throws org.jdom.DataConversionException {
+ throws org.jdom2.DataConversionException {
Element r;
if (mask != null && !mask.equals("")) {
r = new Element("bit");
@@ -335,7 +335,7 @@
}
// Main entry point
- static public void main(String[] args) throws org.jdom.DataConversionException {
+ static public void main(String[] args) throws org.jdom2.DataConversionException {
if (args.length == 0) {
System.err.println("Usage: ./runtest.csh tools.jmri.DecoderDefnToCdi /Users/jake/JMRI/projects/HEAD/xml/decoders/SoundTraxx_Tsu_Steam.xml > SoundTraxx_Tsu_Steam.cdi.xml");
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2015-06-20 15:16:50
|
Revision: 3888
http://sourceforge.net/p/openlcb/svn/3888
Author: jacobsen
Date: 2015-06-20 15:16:48 +0000 (Sat, 20 Jun 2015)
Log Message:
-----------
fix problem with decoding config mem read replies with error codes
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/implementations/MemoryConfigurationService.java
trunk/prototypes/java/test/org/openlcb/implementations/MemoryConfigurationServiceTest.java
Modified: trunk/prototypes/java/src/org/openlcb/implementations/MemoryConfigurationService.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/MemoryConfigurationService.java 2015-06-20 15:16:06 UTC (rev 3887)
+++ trunk/prototypes/java/src/org/openlcb/implementations/MemoryConfigurationService.java 2015-06-20 15:16:48 UTC (rev 3888)
@@ -36,8 +36,15 @@
if (readMemo != null) {
// figure out address space uses byte?
boolean spaceByte = ((data[1] & 0x03) == 0);
- byte[] content = new byte[data.length-6+(spaceByte ? -1 : 0)];
- for (int i = 0; i<content.length; i++) content[i] = (byte)data[i+6+(spaceByte?1:0)];
+ byte[] content;
+ if ((data[1]&0x08) == 0) {
+ // normal read reply
+ content = new byte[data.length-6+(spaceByte ? -1 : 0)];
+ for (int i = 0; i<content.length; i++) content[i] = (byte)data[i+6+(spaceByte?1:0)];
+ } else {
+ // error read reply, return zero length
+ content = new byte[0];
+ }
McsReadMemo memo = readMemo;
readMemo = null;
memo.handleReadData(dest, memo.space, memo.address, content);
Modified: trunk/prototypes/java/test/org/openlcb/implementations/MemoryConfigurationServiceTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/MemoryConfigurationServiceTest.java 2015-06-20 15:16:06 UTC (rev 3887)
+++ trunk/prototypes/java/test/org/openlcb/implementations/MemoryConfigurationServiceTest.java 2015-06-20 15:16:48 UTC (rev 3888)
@@ -212,6 +212,72 @@
}
+ public void testSimpleReadFails() {
+ int space = 0xFD;
+ long address = 0x12345678;
+ int length = 4;
+ MemoryConfigurationService.McsReadMemo memo =
+ new MemoryConfigurationService.McsReadMemo(farID, space, address, length) {
+ @Override
+ public void handleWriteReply(int code) {
+ flag = true;
+ }
+ @Override
+ public void handleReadData(NodeID dest, int readSpace, long readAddress, byte[] readData) {
+ flag = true;
+ Assert.assertEquals("space", space, readSpace);
+ Assert.assertEquals("address", address, readAddress);
+
+ // data length is zero because of error
+ Assert.assertEquals("data length", 0, readData.length);
+ }
+ };
+
+ // test executes the callbacks instantly; real connections might not
+ Assert.assertTrue(!flag);
+ service.request(memo);
+ Assert.assertTrue(!flag);
+
+ // should have sent datagram
+ Assert.assertEquals(1,messagesReceived.size());
+ Assert.assertTrue(messagesReceived.get(0) instanceof DatagramMessage);
+
+ // check format of datagram read
+ int[] content = ((DatagramMessage)messagesReceived.get(0)).getData();
+ Assert.assertTrue(content.length >= 6);
+ Assert.assertEquals("datagram type", 0x20, content[0]);
+ Assert.assertEquals("read command", 0x40, (content[1]&0xFC));
+
+ Assert.assertEquals("address", address, ((long)content[2]<<24)+((long)content[3]<<16)+((long)content[4]<<8)+(long)content[5] );
+
+ if (space >= 0xFD) {
+ Assert.assertEquals("space bits", space&0x3, content[1]&0x3);
+ Assert.assertEquals("data length", length, content[6]);
+ } else {
+ Assert.assertEquals("space byte", space, content[6]);
+ Assert.assertEquals("data length", length, content[7]);
+ }
+
+ // datagram reply comes back
+ Message m = new DatagramAcknowledgedMessage(farID, hereID);
+
+ Assert.assertTrue(!flag);
+ datagramService.put(m, null);
+ Assert.assertTrue(flag);
+
+ // now return data
+ flag = false;
+ content[1] = content[1]|0x04|0x08; //change command to error response
+ content[content.length-1] = 0xAA; // 1st data byte which is error
+
+ m = new DatagramMessage(farID, hereID, content);
+
+ Assert.assertTrue(!flag);
+ datagramService.put(m, null);
+ Assert.assertTrue(flag);
+
+ }
+
public void testSimpleReadFromSpace1() {
int space = 0x01;
long address = 0x12345678;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2015-06-20 15:19:16
|
Revision: 3889
http://sourceforge.net/p/openlcb/svn/3889
Author: jacobsen
Date: 2015-06-20 15:19:13 +0000 (Sat, 20 Jun 2015)
Log Message:
-----------
jar files as of today, made with Java 1.8
Modified Paths:
--------------
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
Modified: trunk/prototypes/java/openlcb-demo.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/openlcb.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2015-06-20 15:20:29
|
Revision: 3890
http://sourceforge.net/p/openlcb/svn/3890
Author: jacobsen
Date: 2015-06-20 15:20:27 +0000 (Sat, 20 Jun 2015)
Log Message:
-----------
0.6.4 consistent set with Java 1.8
Modified Paths:
--------------
trunk/prototypes/java/manifest
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
Modified: trunk/prototypes/java/manifest
===================================================================
--- trunk/prototypes/java/manifest 2015-06-20 15:19:13 UTC (rev 3889)
+++ trunk/prototypes/java/manifest 2015-06-20 15:20:27 UTC (rev 3890)
@@ -4,9 +4,9 @@
Name: org.openlcb
Specification-Title: OpenLCB
-Specification-Version: 0.6.1
+Specification-Version: 0.6.4
Specification-Vendor: OpenLCB group
Package-Title: openlcb
-Package-Version: 0.6.3
+Package-Version: 0.6.4
Package-Vendor: OpenLCB group
Modified: trunk/prototypes/java/openlcb-demo.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/openlcb.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2015-07-12 17:12:57
|
Revision: 3892
http://sourceforge.net/p/openlcb/svn/3892
Author: jacobsen
Date: 2015-07-12 17:12:55 +0000 (Sun, 12 Jul 2015)
Log Message:
-----------
as of today
Modified Paths:
--------------
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
Modified: trunk/prototypes/java/openlcb-demo.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/openlcb.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2015-08-16 01:46:36
|
Revision: 3907
http://sourceforge.net/p/openlcb/svn/3907
Author: jacobsen
Date: 2015-08-16 01:46:35 +0000 (Sun, 16 Aug 2015)
Log Message:
-----------
support generating UML-illustrated JavaDoc
Modified Paths:
--------------
trunk/prototypes/java/build.xml
Added Paths:
-----------
trunk/prototypes/java/lib/UmlGraph-5.7.jar
Modified: trunk/prototypes/java/build.xml
===================================================================
--- trunk/prototypes/java/build.xml 2015-08-09 03:43:41 UTC (rev 3906)
+++ trunk/prototypes/java/build.xml 2015-08-16 01:46:35 UTC (rev 3907)
@@ -142,6 +142,66 @@
</javadoc>
</target>
+ <!-- The structure of the following should closely follow the -->
+ <!-- main 'javadoc' target directly above. The only difference -->
+ <!-- is the doclet clause referencing the UML generator, the -->
+ <!-- use of the public option in the main task definition, and -->
+ <!-- the execution of "dot" at the bottom. -->
+ <!-- Requires Graphviz from http://www.graphviz.org -->
+ <target name="javadoc-uml" depends="init" description="create JavaDocs with UML">
+ <javadoc packagenames="org.*"
+ maxmemory="512m"
+ sourcepath="${source}"
+ overview="${source}/overview.html"
+ destdir="${doctarget}"
+ additionalparam="-breakiterator"
+ author="true"
+ version="false"
+ package="yes"
+ use="true"
+ windowtitle="OpenLCB API">
+ <arg value="-Xdoclint:all,-missing,-accessibility,-html,-syntax"/> <!-- dropping some 1.8 warnings -->
+ <doclet name="org.umlgraph.doclet.UmlGraphDoc"
+ path="lib/UmlGraph-5.7.jar">
+ <param name="-attributes"/>
+ <param name="-operations"/>
+ <param name="-qualify"/>
+ <param name="-types"/>
+ <!-- <param name="-visibility"/> not used, as only showing public visibility -->
+ <param name="-collapsible"/> <!-- hide images at first on web pages -->
+ <param name="-inferdepvis" value="public"/> <!-- only show public -->
+ </doclet>
+
+ <classpath refid="project.class.path"/>
+ <doctitle><![CDATA[<h1>OpenLCB API</h1>]]></doctitle>
+ <bottom><![CDATA[<a href="http://openlcb.org/Copyright.html">Information on copyright, trademarks and licenses is linked here.</a>
+ <br>Site hosted by:
+ <a href="http://sourceforge.net/projects/jmri">
+ <img src="http://sflogo.sourceforge.net/sflogo.php?group_id=26788&type=12" width="120" height="30" border="0" alt="Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads"/></a>
+ ]]>
+ </bottom>
+ <link href="http://docs.oracle.com/javase/8/docs/api/"/>
+ <link href="http://download.oracle.com/javase/8/docs/api/"/>
+ <link href="http://java.sun.com/products/javacomm/reference/api/"/>
+ <link href="http://www.jdom.org/docs/apidocs/"/>
+ <link href="http://javacsv.sourceforge.net/"/> <!-- A -->
+ <link href="http://fasterxml.github.io/jackson-databind/javadoc/2.0.6"/>
+ <link href="http://logging.apache.org/log4j/1.2/apidocs/"/>
+<!-- <link href="http://java.sun.com/javase/technologies/desktop/java3d/forDevelopers/j3dapi/"/> failes, so bypassed -->
+ <link href="https://jogamp.org/deployment/jogamp-next/javadoc/joal/javadoc/"/>
+ <link href="https://commons.apache.org/proper/commons-lang/javadocs/api-release"/>
+
+ </javadoc>
+ <apply executable="dot" dest="${doctarget}" parallel="false">
+ <arg value="-Tpng"/>
+ <arg value="-o"/>
+ <targetfile/>
+ <srcfile/>
+ <fileset dir="${doctarget}" includes="*.dot"/>
+ <mapper type="glob" from="*.dot" to="*.png"/>
+ </apply>
+ </target>
+
<target name="javadocall" depends="init" description="create JavaDoc for all code including tests">
<javadoc packagenames="org.*, tools.*, simulations.*, scenarios.*"
maxmemory="512m"
Added: trunk/prototypes/java/lib/UmlGraph-5.7.jar
===================================================================
(Binary files differ)
Index: trunk/prototypes/java/lib/UmlGraph-5.7.jar
===================================================================
--- trunk/prototypes/java/lib/UmlGraph-5.7.jar 2015-08-09 03:43:41 UTC (rev 3906)
+++ trunk/prototypes/java/lib/UmlGraph-5.7.jar 2015-08-16 01:46:35 UTC (rev 3907)
Property changes on: trunk/prototypes/java/lib/UmlGraph-5.7.jar
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jac...@us...> - 2015-08-16 02:08:50
|
Revision: 3912
http://sourceforge.net/p/openlcb/svn/3912
Author: jacobsen
Date: 2015-08-16 02:08:45 +0000 (Sun, 16 Aug 2015)
Log Message:
-----------
Version 0.6.4 libraries and documentation. Note: This project may now be orphaned. Not clear what the future will bring. If you don't see updates here after a reasonable time, perhaps it's been moved to another group, but it may also be dead. If you're interested in reviving, see the README file.
Modified Paths:
--------------
trunk/prototypes/java/README
trunk/prototypes/java/doc/allclasses-frame.html
trunk/prototypes/java/doc/allclasses-noframe.html
trunk/prototypes/java/doc/constant-values.html
trunk/prototypes/java/doc/deprecated-list.html
trunk/prototypes/java/doc/help-doc.html
trunk/prototypes/java/doc/index-all.html
trunk/prototypes/java/doc/index.html
trunk/prototypes/java/doc/org/openlcb/AbstractConnection.html
trunk/prototypes/java/doc/org/openlcb/AddressedMessage.html
trunk/prototypes/java/doc/org/openlcb/ConfigurationPortal.html
trunk/prototypes/java/doc/org/openlcb/Connection.ConnectionListener.html
trunk/prototypes/java/doc/org/openlcb/Connection.html
trunk/prototypes/java/doc/org/openlcb/ConsumerIdentifiedMessage.html
trunk/prototypes/java/doc/org/openlcb/DatagramAcknowledgedMessage.html
trunk/prototypes/java/doc/org/openlcb/DatagramMessage.html
trunk/prototypes/java/doc/org/openlcb/DatagramRejectedMessage.html
trunk/prototypes/java/doc/org/openlcb/EventID.html
trunk/prototypes/java/doc/org/openlcb/Gateway.html
trunk/prototypes/java/doc/org/openlcb/IdentifyConsumersMessage.html
trunk/prototypes/java/doc/org/openlcb/IdentifyEventsMessage.html
trunk/prototypes/java/doc/org/openlcb/IdentifyProducersMessage.html
trunk/prototypes/java/doc/org/openlcb/InitializationCompleteMessage.html
trunk/prototypes/java/doc/org/openlcb/LearnEventMessage.html
trunk/prototypes/java/doc/org/openlcb/Message.html
trunk/prototypes/java/doc/org/openlcb/MessageDecoder.html
trunk/prototypes/java/doc/org/openlcb/MessageTypeIdentifier.html
trunk/prototypes/java/doc/org/openlcb/MimicNodeStore.NodeMemo.html
trunk/prototypes/java/doc/org/openlcb/MimicNodeStore.html
trunk/prototypes/java/doc/org/openlcb/Node.html
trunk/prototypes/java/doc/org/openlcb/NodeID.html
trunk/prototypes/java/doc/org/openlcb/OpenLcb.html
trunk/prototypes/java/doc/org/openlcb/ProducerConsumerEventReportMessage.html
trunk/prototypes/java/doc/org/openlcb/ProducerIdentifiedMessage.html
trunk/prototypes/java/doc/org/openlcb/ProtocolIdentification.html
trunk/prototypes/java/doc/org/openlcb/ProtocolIdentificationReplyMessage.html
trunk/prototypes/java/doc/org/openlcb/ProtocolIdentificationRequestMessage.html
trunk/prototypes/java/doc/org/openlcb/SimpleNodeIdent.html
trunk/prototypes/java/doc/org/openlcb/SimpleNodeIdentInfoReplyMessage.html
trunk/prototypes/java/doc/org/openlcb/SimpleNodeIdentInfoRequestMessage.html
trunk/prototypes/java/doc/org/openlcb/SingleLinkNode.html
trunk/prototypes/java/doc/org/openlcb/StreamDataCompleteMessage.html
trunk/prototypes/java/doc/org/openlcb/StreamDataProceedMessage.html
trunk/prototypes/java/doc/org/openlcb/StreamDataSendMessage.html
trunk/prototypes/java/doc/org/openlcb/StreamInitReplyMessage.html
trunk/prototypes/java/doc/org/openlcb/StreamInitRequestMessage.html
trunk/prototypes/java/doc/org/openlcb/Utilities.html
trunk/prototypes/java/doc/org/openlcb/VerifiedNodeIDNumberMessage.html
trunk/prototypes/java/doc/org/openlcb/VerifyNodeIDNumberMessage.html
trunk/prototypes/java/doc/org/openlcb/can/AliasMap.html
trunk/prototypes/java/doc/org/openlcb/can/CanFrame.html
trunk/prototypes/java/doc/org/openlcb/can/MessageBuilder.html
trunk/prototypes/java/doc/org/openlcb/can/NIDa.html
trunk/prototypes/java/doc/org/openlcb/can/NIDaAlgorithm.html
trunk/prototypes/java/doc/org/openlcb/can/OpenLcbCanFrame.html
trunk/prototypes/java/doc/org/openlcb/can/class-use/AliasMap.html
trunk/prototypes/java/doc/org/openlcb/can/class-use/CanFrame.html
trunk/prototypes/java/doc/org/openlcb/can/class-use/MessageBuilder.html
trunk/prototypes/java/doc/org/openlcb/can/class-use/NIDa.html
trunk/prototypes/java/doc/org/openlcb/can/class-use/NIDaAlgorithm.html
trunk/prototypes/java/doc/org/openlcb/can/class-use/OpenLcbCanFrame.html
trunk/prototypes/java/doc/org/openlcb/can/package-frame.html
trunk/prototypes/java/doc/org/openlcb/can/package-summary.html
trunk/prototypes/java/doc/org/openlcb/can/package-tree.html
trunk/prototypes/java/doc/org/openlcb/can/package-use.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.BitRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.EventID.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Group.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Identification.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.IntegerRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Item.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Map.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Segment.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.StringRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.BitRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.EventID.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.Group.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.Identification.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.IntegerRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.Item.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.Map.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.Segment.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.StringRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/class-use/CdiRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/CdiMemConfigReader.ReaderAccess.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/CdiMemConfigReader.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiReader.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.BitRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.EventID.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Group.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Identification.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.IntRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Item.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Map.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Segment.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.StringRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/CdiMemConfigReader.ReaderAccess.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/CdiMemConfigReader.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiReader.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.BitRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.EventID.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.Group.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.Identification.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.IntRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.Item.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.Map.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.Segment.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.StringRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/package-frame.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/package-summary.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/package-tree.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/package-use.html
trunk/prototypes/java/doc/org/openlcb/cdi/package-frame.html
trunk/prototypes/java/doc/org/openlcb/cdi/package-summary.html
trunk/prototypes/java/doc/org/openlcb/cdi/package-tree.html
trunk/prototypes/java/doc/org/openlcb/cdi/package-use.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.ReadReturn.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.ReadWriteAccess.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.ReadReturn.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.ReadWriteAccess.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/package-frame.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/package-summary.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/package-tree.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/package-use.html
trunk/prototypes/java/doc/org/openlcb/class-use/AbstractConnection.html
trunk/prototypes/java/doc/org/openlcb/class-use/AddressedMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/ConfigurationPortal.html
trunk/prototypes/java/doc/org/openlcb/class-use/Connection.ConnectionListener.html
trunk/prototypes/java/doc/org/openlcb/class-use/Connection.html
trunk/prototypes/java/doc/org/openlcb/class-use/ConsumerIdentifiedMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/DatagramAcknowledgedMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/DatagramMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/DatagramRejectedMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/EventID.html
trunk/prototypes/java/doc/org/openlcb/class-use/Gateway.html
trunk/prototypes/java/doc/org/openlcb/class-use/IdentifyConsumersMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/IdentifyEventsMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/IdentifyProducersMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/InitializationCompleteMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/LearnEventMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/Message.html
trunk/prototypes/java/doc/org/openlcb/class-use/MessageDecoder.html
trunk/prototypes/java/doc/org/openlcb/class-use/MessageTypeIdentifier.html
trunk/prototypes/java/doc/org/openlcb/class-use/MimicNodeStore.NodeMemo.html
trunk/prototypes/java/doc/org/openlcb/class-use/MimicNodeStore.html
trunk/prototypes/java/doc/org/openlcb/class-use/Node.html
trunk/prototypes/java/doc/org/openlcb/class-use/NodeID.html
trunk/prototypes/java/doc/org/openlcb/class-use/OpenLcb.html
trunk/prototypes/java/doc/org/openlcb/class-use/ProducerConsumerEventReportMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/ProducerIdentifiedMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/ProtocolIdentification.html
trunk/prototypes/java/doc/org/openlcb/class-use/ProtocolIdentificationReplyMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/ProtocolIdentificationRequestMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/SimpleNodeIdent.html
trunk/prototypes/java/doc/org/openlcb/class-use/SimpleNodeIdentInfoReplyMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/SimpleNodeIdentInfoRequestMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/SingleLinkNode.html
trunk/prototypes/java/doc/org/openlcb/class-use/StreamDataCompleteMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/StreamDataProceedMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/StreamDataSendMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/StreamInitReplyMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/StreamInitRequestMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/Utilities.html
trunk/prototypes/java/doc/org/openlcb/class-use/VerifiedNodeIDNumberMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/VerifyNodeIDNumberMessage.html
trunk/prototypes/java/doc/org/openlcb/implementations/BlueGoldEngine.html
trunk/prototypes/java/doc/org/openlcb/implementations/BlueGoldExtendedEngine.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramMeteringBuffer.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramReceiver.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramService.DatagramServiceReceiveMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramService.DatagramServiceTransmitMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramService.ReplyMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramService.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramTransmitter.html
trunk/prototypes/java/doc/org/openlcb/implementations/EventFilterGateway.html
trunk/prototypes/java/doc/org/openlcb/implementations/MemoryConfigurationService.AddrSpaceDatagramMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/MemoryConfigurationService.ConfigDatagramMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/MemoryConfigurationService.McsAddrSpaceMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/MemoryConfigurationService.McsConfigMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/MemoryConfigurationService.McsReadMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/MemoryConfigurationService.McsWriteMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/MemoryConfigurationService.ReadDatagramMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/MemoryConfigurationService.WriteDatagramMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/MemoryConfigurationService.html
trunk/prototypes/java/doc/org/openlcb/implementations/ScatterGather.html
trunk/prototypes/java/doc/org/openlcb/implementations/SingleConsumer.html
trunk/prototypes/java/doc/org/openlcb/implementations/SingleConsumerNode.html
trunk/prototypes/java/doc/org/openlcb/implementations/SingleProducer.html
trunk/prototypes/java/doc/org/openlcb/implementations/SingleProducerNode.html
trunk/prototypes/java/doc/org/openlcb/implementations/StreamReceiver.html
trunk/prototypes/java/doc/org/openlcb/implementations/StreamTransmitter.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/BlueGoldEngine.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/BlueGoldExtendedEngine.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/DatagramMeteringBuffer.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/DatagramReceiver.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/DatagramService.DatagramServiceReceiveMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/DatagramService.DatagramServiceTransmitMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/DatagramService.ReplyMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/DatagramService.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/DatagramTransmitter.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/EventFilterGateway.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/MemoryConfigurationService.AddrSpaceDatagramMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/MemoryConfigurationService.ConfigDatagramMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/MemoryConfigurationService.McsAddrSpaceMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/MemoryConfigurationService.McsConfigMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/MemoryConfigurationService.McsReadMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/MemoryConfigurationService.McsWriteMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/MemoryConfigurationService.ReadDatagramMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/MemoryConfigurationService.WriteDatagramMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/MemoryConfigurationService.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/ScatterGather.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/SingleConsumer.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/SingleConsumerNode.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/SingleProducer.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/SingleProducerNode.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/StreamReceiver.html
trunk/prototypes/java/doc/org/openlcb/implementations/class-use/StreamTransmitter.html
trunk/prototypes/java/doc/org/openlcb/implementations/package-frame.html
trunk/prototypes/java/doc/org/openlcb/implementations/package-summary.html
trunk/prototypes/java/doc/org/openlcb/implementations/package-tree.html
trunk/prototypes/java/doc/org/openlcb/implementations/package-use.html
trunk/prototypes/java/doc/org/openlcb/package-frame.html
trunk/prototypes/java/doc/org/openlcb/package-summary.html
trunk/prototypes/java/doc/org/openlcb/package-tree.html
trunk/prototypes/java/doc/org/openlcb/package-use.html
trunk/prototypes/java/doc/org/openlcb/swing/ConsumerPane.html
trunk/prototypes/java/doc/org/openlcb/swing/EventIdTextField.html
trunk/prototypes/java/doc/org/openlcb/swing/MonPane.html
trunk/prototypes/java/doc/org/openlcb/swing/NodeSelector.html
trunk/prototypes/java/doc/org/openlcb/swing/ProducerPane.html
trunk/prototypes/java/doc/org/openlcb/swing/class-use/ConsumerPane.html
trunk/prototypes/java/doc/org/openlcb/swing/class-use/EventIdTextField.html
trunk/prototypes/java/doc/org/openlcb/swing/class-use/MonPane.html
trunk/prototypes/java/doc/org/openlcb/swing/class-use/NodeSelector.html
trunk/prototypes/java/doc/org/openlcb/swing/class-use/ProducerPane.html
trunk/prototypes/java/doc/org/openlcb/swing/memconfig/MemConfigDescriptionPane.html
trunk/prototypes/java/doc/org/openlcb/swing/memconfig/MemConfigReadWritePane.html
trunk/prototypes/java/doc/org/openlcb/swing/memconfig/class-use/MemConfigDescriptionPane.html
trunk/prototypes/java/doc/org/openlcb/swing/memconfig/class-use/MemConfigReadWritePane.html
trunk/prototypes/java/doc/org/openlcb/swing/memconfig/package-frame.html
trunk/prototypes/java/doc/org/openlcb/swing/memconfig/package-summary.html
trunk/prototypes/java/doc/org/openlcb/swing/memconfig/package-tree.html
trunk/prototypes/java/doc/org/openlcb/swing/memconfig/package-use.html
trunk/prototypes/java/doc/org/openlcb/swing/networktree/NodeTreeRep.html
trunk/prototypes/java/doc/org/openlcb/swing/networktree/TreePane.html
trunk/prototypes/java/doc/org/openlcb/swing/networktree/class-use/NodeTreeRep.html
trunk/prototypes/java/doc/org/openlcb/swing/networktree/class-use/TreePane.html
trunk/prototypes/java/doc/org/openlcb/swing/networktree/package-frame.html
trunk/prototypes/java/doc/org/openlcb/swing/networktree/package-summary.html
trunk/prototypes/java/doc/org/openlcb/swing/networktree/package-tree.html
trunk/prototypes/java/doc/org/openlcb/swing/networktree/package-use.html
trunk/prototypes/java/doc/org/openlcb/swing/package-frame.html
trunk/prototypes/java/doc/org/openlcb/swing/package-summary.html
trunk/prototypes/java/doc/org/openlcb/swing/package-tree.html
trunk/prototypes/java/doc/org/openlcb/swing/package-use.html
trunk/prototypes/java/doc/overview-frame.html
trunk/prototypes/java/doc/overview-summary.html
trunk/prototypes/java/doc/overview-tree.html
trunk/prototypes/java/doc/package-list
trunk/prototypes/java/doc/serialized-form.html
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
trunk/prototypes/java/src/org/openlcb/Version.java
Added Paths:
-----------
trunk/prototypes/java/doc/org/openlcb/AbstractConnection.png
trunk/prototypes/java/doc/org/openlcb/AddressedMessage.png
trunk/prototypes/java/doc/org/openlcb/ConfigurationPortal.png
trunk/prototypes/java/doc/org/openlcb/Connection.ConnectionListener.png
trunk/prototypes/java/doc/org/openlcb/Connection.png
trunk/prototypes/java/doc/org/openlcb/ConsumerIdentifiedMessage.png
trunk/prototypes/java/doc/org/openlcb/DatagramAcknowledgedMessage.png
trunk/prototypes/java/doc/org/openlcb/DatagramMessage.png
trunk/prototypes/java/doc/org/openlcb/DatagramRejectedMessage.png
trunk/prototypes/java/doc/org/openlcb/EventID.png
trunk/prototypes/java/doc/org/openlcb/Gateway.png
trunk/prototypes/java/doc/org/openlcb/IdentifyConsumersMessage.png
trunk/prototypes/java/doc/org/openlcb/IdentifyEventsMessage.png
trunk/prototypes/java/doc/org/openlcb/IdentifyProducersMessage.png
trunk/prototypes/java/doc/org/openlcb/InitializationCompleteMessage.png
trunk/prototypes/java/doc/org/openlcb/LearnEventMessage.png
trunk/prototypes/java/doc/org/openlcb/Message.png
trunk/prototypes/java/doc/org/openlcb/MessageDecoder.png
trunk/prototypes/java/doc/org/openlcb/MessageTypeIdentifier.png
trunk/prototypes/java/doc/org/openlcb/MimicNodeStore.NodeMemo.png
trunk/prototypes/java/doc/org/openlcb/MimicNodeStore.png
trunk/prototypes/java/doc/org/openlcb/Node.png
trunk/prototypes/java/doc/org/openlcb/NodeID.png
trunk/prototypes/java/doc/org/openlcb/OpenLcb.png
trunk/prototypes/java/doc/org/openlcb/OptionalIntRejectedMessage.html
trunk/prototypes/java/doc/org/openlcb/OptionalIntRejectedMessage.png
trunk/prototypes/java/doc/org/openlcb/ProducerConsumerEventReportMessage.png
trunk/prototypes/java/doc/org/openlcb/ProducerIdentifiedMessage.png
trunk/prototypes/java/doc/org/openlcb/ProtocolIdentification.Protocol.html
trunk/prototypes/java/doc/org/openlcb/ProtocolIdentification.Protocol.png
trunk/prototypes/java/doc/org/openlcb/ProtocolIdentification.png
trunk/prototypes/java/doc/org/openlcb/ProtocolIdentificationReplyMessage.png
trunk/prototypes/java/doc/org/openlcb/ProtocolIdentificationRequestMessage.png
trunk/prototypes/java/doc/org/openlcb/SimpleNodeIdent.png
trunk/prototypes/java/doc/org/openlcb/SimpleNodeIdentInfoReplyMessage.png
trunk/prototypes/java/doc/org/openlcb/SimpleNodeIdentInfoRequestMessage.png
trunk/prototypes/java/doc/org/openlcb/SingleLinkNode.png
trunk/prototypes/java/doc/org/openlcb/StreamDataCompleteMessage.png
trunk/prototypes/java/doc/org/openlcb/StreamDataProceedMessage.png
trunk/prototypes/java/doc/org/openlcb/StreamDataSendMessage.png
trunk/prototypes/java/doc/org/openlcb/StreamInitReplyMessage.png
trunk/prototypes/java/doc/org/openlcb/StreamInitRequestMessage.png
trunk/prototypes/java/doc/org/openlcb/Throttle.html
trunk/prototypes/java/doc/org/openlcb/Throttle.png
trunk/prototypes/java/doc/org/openlcb/Utilities.png
trunk/prototypes/java/doc/org/openlcb/VerifiedNodeIDNumberMessage.png
trunk/prototypes/java/doc/org/openlcb/VerifyNodeIDNumberMessage.png
trunk/prototypes/java/doc/org/openlcb/Version.html
trunk/prototypes/java/doc/org/openlcb/Version.png
trunk/prototypes/java/doc/org/openlcb/can/AliasMap.png
trunk/prototypes/java/doc/org/openlcb/can/CanFrame.png
trunk/prototypes/java/doc/org/openlcb/can/MessageBuilder.AccumulationMemo.html
trunk/prototypes/java/doc/org/openlcb/can/MessageBuilder.AccumulationMemo.png
trunk/prototypes/java/doc/org/openlcb/can/MessageBuilder.png
trunk/prototypes/java/doc/org/openlcb/can/NIDa.png
trunk/prototypes/java/doc/org/openlcb/can/NIDaAlgorithm.png
trunk/prototypes/java/doc/org/openlcb/can/OpenLcbCanFrame.png
trunk/prototypes/java/doc/org/openlcb/can/class-use/MessageBuilder.AccumulationMemo.html
trunk/prototypes/java/doc/org/openlcb/can/org.openlcb.can.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.BitRep.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.EventID.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Group.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Identification.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.IntegerRep.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Item.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Map.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.Segment.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.StringRep.png
trunk/prototypes/java/doc/org/openlcb/cdi/CdiRep.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/CdiMemConfigReader.ReaderAccess.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/CdiMemConfigReader.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiReader.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.BitRep.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.EventID.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Group.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Identification.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.IntRep.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Item.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Map.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Nested.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Nested.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.Segment.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.StringRep.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/JdomCdiRep.png
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/class-use/JdomCdiRep.Nested.html
trunk/prototypes/java/doc/org/openlcb/cdi/jdom/org.openlcb.cdi.jdom.png
trunk/prototypes/java/doc/org/openlcb/cdi/org.openlcb.cdi.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.BitPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.BitPane.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.DisplayPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.DisplayPane.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.EventIdPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.EventIdPane.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.GroupPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.GroupPane.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.GuiItemFactory.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.GuiItemFactory.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.IntPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.IntPane.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.ReadReturn.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.ReadWriteAccess.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.StringPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.StringPane.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/CdiPanel.png
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.BitPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.DisplayPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.EventIdPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.GroupPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.GuiItemFactory.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.IntPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/class-use/CdiPanel.StringPane.html
trunk/prototypes/java/doc/org/openlcb/cdi/swing/org.openlcb.cdi.swing.png
trunk/prototypes/java/doc/org/openlcb/class-use/OptionalIntRejectedMessage.html
trunk/prototypes/java/doc/org/openlcb/class-use/ProtocolIdentification.Protocol.html
trunk/prototypes/java/doc/org/openlcb/class-use/Throttle.html
trunk/prototypes/java/doc/org/openlcb/class-use/Version.html
trunk/prototypes/java/doc/org/openlcb/implementations/BlueGoldEngine.png
trunk/prototypes/java/doc/org/openlcb/implementations/BlueGoldExtendedEngine.png
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramMeteringBuffer.Consumer.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramMeteringBuffer.Consumer.png
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramMeteringBuffer.MessageMemo.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramMeteringBuffer.MessageMemo.png
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramMeteringBuffer.ReplyHandler.html
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramMeteringBuffer.ReplyHandler.png
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramMeteringBuffer.png
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramReceiver.png
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramService.DatagramServiceReceiveMemo.png
trunk/prototypes/java/doc/org/openlcb/implementations/DatagramService.DatagramServiceTransmitMemo.png
trunk/prototypes/java/doc/org/open...
[truncated message content] |
|
From: <br...@us...> - 2015-09-08 21:23:17
|
Revision: 3924
http://sourceforge.net/p/openlcb/svn/3924
Author: bracz
Date: 2015-09-08 21:23:14 +0000 (Tue, 08 Sep 2015)
Log Message:
-----------
patch by Bob Jacobsen: "Fixes timing issue in memory write replies."
This patch includes several changes:
- fixes a bug in the datagram transmit handler that could cause the transmit Memo pointer to be lost. Previously if the transmit callback would immediately send a new datagram, the new datagram would incorrectly not be entered as the next pending transmit Memo pointer.
- adds scaffolding for support in Memory Config protocol writes that may send back a (possibly delayed) return datagram instead of just a success/failure to the write request datagram. The write responses are not fully plumbed through to the caller though.
- extends unittests for datagram transmit Memo objects.
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/implementations/DatagramService.java
trunk/prototypes/java/src/org/openlcb/implementations/MemoryConfigurationService.java
trunk/prototypes/java/test/org/openlcb/implementations/DatagramServiceTest.java
Modified: trunk/prototypes/java/src/org/openlcb/implementations/DatagramService.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/DatagramService.java 2015-09-08 20:30:17 UTC (rev 3923)
+++ trunk/prototypes/java/src/org/openlcb/implementations/DatagramService.java 2015-09-08 21:23:14 UTC (rev 3924)
@@ -83,7 +83,7 @@
rcvMemo.handleData(msg.getSourceNodeID(), msg.getData(), replyMemo);
// check that client replied
if (! replyMemo.hasReplied())
- System.err.println("No internal reply received to datagram with contents "+Utilities.toHexDotsString(msg.getData()));
+ System.err.println("No internal reply received to datagram with contents "+Utilities.toHexDotsString(msg.getData())); //log
} else {
// reject
replyMemo.acceptData(retval);
@@ -108,9 +108,10 @@
@Override
public void handleDatagramAcknowledged(DatagramAcknowledgedMessage msg, Connection sender){
if (xmtMemo != null && msg.getDestNodeID().equals(here) && xmtMemo.dest.equals(msg.getSourceNodeID()) ) {
- xmtMemo.handleReply(0);
+ DatagramServiceTransmitMemo temp = xmtMemo;
+ xmtMemo = null;
+ temp.handleReply(0);
}
- xmtMemo = null;
}
DatagramServiceReceiveMemo rcvMemo;
@@ -218,7 +219,7 @@
// TODO are these really immutable, given that subclass will inherit and change them?
@Immutable
@ThreadSafe
- static protected class DatagramServiceTransmitMemo {
+ static public class DatagramServiceTransmitMemo {
public DatagramServiceTransmitMemo(NodeID dest, int[] data) {
this.data = data;
this.dest = dest;
Modified: trunk/prototypes/java/src/org/openlcb/implementations/MemoryConfigurationService.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/MemoryConfigurationService.java 2015-09-08 20:30:17 UTC (rev 3923)
+++ trunk/prototypes/java/src/org/openlcb/implementations/MemoryConfigurationService.java 2015-09-08 21:23:14 UTC (rev 3924)
@@ -27,12 +27,15 @@
// connect to be notified of config service
downstream.registerForReceive(new DatagramService.DatagramServiceReceiveMemo(DATAGRAM_TYPE){
+ // Process a datagram received here; previous request state part of decoding
+ //
// does not allow for overlapping operations, either to a single node nor or multiple types
// nor to multiple nodes
//
// doesn't check for match of reply to memo, but eventually should.
@Override
public void handleData(NodeID dest, int[] data, DatagramService.ReplyMemo service) {
+ //log System.out.println("OLCB: handleData");
service.acceptData(0);
if (readMemo != null) {
// figure out address space uses byte?
@@ -74,6 +77,13 @@
configMemo = null;
memo.handleConfigData(dest, commands, options, highSpace, lowSpace,"");
}
+ if (writeMemo != null) {
+ // needs code to handle delayed reply
+ System.err.println("MemoryConfiguration Service: Code for delayed reply not yet present"); //log
+ McsWriteMemo memo = writeMemo;
+ writeMemo = null;
+ //memo.handleConfigData(dest, commands, options, highSpace, lowSpace,"");
+ }
}
});
}
@@ -86,8 +96,10 @@
this(mcs.here, mcs.downstream);
}
+ McsWriteMemo writeMemo; // can receive a delayed reply
public void request(McsWriteMemo memo) {
// forward as write Datagram
+ writeMemo = memo;
WriteDatagramMemo dg = new WriteDatagramMemo(memo.dest, memo.space, memo.address, memo.data, memo);
downstream.sendData(dg);
}
@@ -233,7 +245,6 @@
public int hashCode() { return this.data.length+this.data[0]+dest.hashCode()+((int)address)+space; }
/**
- * Overload this for notification of response
* @param code 0 for OK, non-zero for error reply
*/
public void handleWriteReply(int code) {
@@ -266,6 +277,10 @@
this.memo = memo;
}
McsWriteMemo memo;
+ /**
+ * Handle immediate write reply from datagram.
+ * Should refer back to the memo request
+ */
public void handleReply(int code) {
memo.handleWriteReply(code);
}
Modified: trunk/prototypes/java/test/org/openlcb/implementations/DatagramServiceTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/DatagramServiceTest.java 2015-09-08 20:30:17 UTC (rev 3923)
+++ trunk/prototypes/java/test/org/openlcb/implementations/DatagramServiceTest.java 2015-09-08 21:23:14 UTC (rev 3924)
@@ -36,6 +36,7 @@
public void testCtorViaSetup() {
}
+
public void testRcvMemoIsRealClass() {
DatagramService.DatagramServiceReceiveMemo m20 =
new DatagramService.DatagramServiceReceiveMemo(0x20);
@@ -51,21 +52,33 @@
public void testXmtMemoIsRealClass() {
DatagramService.DatagramServiceTransmitMemo m20 =
new DatagramService.DatagramServiceTransmitMemo(farID,new int[]{1});
+
DatagramService.DatagramServiceTransmitMemo m21 =
new DatagramService.DatagramServiceTransmitMemo(farID,new int[]{1});
DatagramService.DatagramServiceTransmitMemo m22 =
new DatagramService.DatagramServiceTransmitMemo(farID,new int[]{2});
DatagramService.DatagramServiceTransmitMemo m23 =
new DatagramService.DatagramServiceTransmitMemo(farID,new int[]{1,2});
+ DatagramService.DatagramServiceTransmitMemo m24 =
+ new DatagramService.DatagramServiceTransmitMemo(hereID,new int[]{1,2});
+ Assert.assertTrue(!m20.equals(null));
+ Assert.assertTrue(!m21.equals(null));
+ Assert.assertTrue(!m22.equals(null));
+ Assert.assertTrue(!m23.equals(null));
+ Assert.assertTrue(!m24.equals(null));
+
Assert.assertTrue(m20.equals(m20));
Assert.assertTrue(m20.equals(m21));
- Assert.assertTrue(!m20.equals(null));
- Assert.assertTrue(!m20.equals(m22));
- Assert.assertTrue(!m20.equals(m23));
- Assert.assertTrue(!m22.equals(m20));
- Assert.assertTrue(!m23.equals(m20));
+
+ Assert.assertTrue(!m21.equals(m22));
+ Assert.assertTrue(!m21.equals(m23));
+ Assert.assertTrue(!m21.equals(m24));
+ Assert.assertTrue(!m22.equals(m23));
+ Assert.assertTrue(!m22.equals(m24));
+ Assert.assertTrue(!m23.equals(m24));
+
}
public void testRegisterForData() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2015-09-08 21:35:14
|
Revision: 3925
http://sourceforge.net/p/openlcb/svn/3925
Author: bracz
Date: 2015-09-08 21:35:10 +0000 (Tue, 08 Sep 2015)
Log Message:
-----------
renames 0nmraCDI.xml to NMRAnetDatabaseTrainNode.xml to make unittest happy.
Modified Paths:
--------------
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
Added Paths:
-----------
trunk/prototypes/java/NMRAnetDatabaseTrainNode.xml
Removed Paths:
-------------
trunk/prototypes/java/0nmraCDI.xml
Deleted: trunk/prototypes/java/0nmraCDI.xml
===================================================================
--- trunk/prototypes/java/0nmraCDI.xml 2015-09-08 21:23:14 UTC (rev 3924)
+++ trunk/prototypes/java/0nmraCDI.xml 2015-09-08 21:35:10 UTC (rev 3925)
@@ -1,1971 +0,0 @@
-<cdi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://openlcb.org/trunk/specs/schema/cdi.xsd">
- <identification>
- <manufacturer>NMRA</manufacturer>
- <model>NMRA standard CV definitions</model>
- <hardwareVersion />
- <softwareVersion />
- <map>
- <relation>
- <property>Model</property>
- <value>NMRA standard CV definitions</value>
- </relation>
- </map>
- </identification>
- <acdi />
- <segment origin="1" space="253">
- <group replication="256">
- <name>CVs</name>
- <repname>CV</repname>
- <description>Raw CV access</description>
- <int size="1">
- <min>0</min>
- <max>255</max>
- </int>
- </group>
- </segment>
- <segment space="253">
- <int origin="1">
- <name>Primary Address</name>
- <description>Short address</description>
- </int>
- <int origin="17" size="2">
- <name>Extended Address</name>
- </int>
- <bit size="8" mask="32" origin="29">
- <name>Address Format</name>
- <map>
- <relation>
- <property>0</property>
- <value>One byte (short) address</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Two byte (extended) address</value>
- </relation>
- </map>
- </bit>
- <int origin="3">
- <name>Acceleration Rate</name>
- </int>
- <int origin="4">
- <name>Deceleration Rate</name>
- </int>
- <int origin="2">
- <name>Vstart</name>
- <description>A value of 255 corresponds to 100%</description>
- </int>
- <int origin="5">
- <name>Vhigh</name>
- </int>
- <int origin="6">
- <name>Vmid</name>
- </int>
- <int origin="7">
- <name>Manufacturer Version No:</name>
- </int>
- <int origin="8">
- <name>Manufacturer ID:</name>
- </int>
- <int origin="9">
- <name>Total PWM Period</name>
- </int>
- <int origin="10">
- <name>EMF Feedback Cutout</name>
- </int>
- <int origin="11">
- <name>Packet Time-out Value</name>
- </int>
- <bit size="8" mask="1" origin="12">
- <name>Analog Power Conversion</name>
- <map>
- <relation>
- <property>0</property>
- <value>disabled</value>
- </relation>
- <relation>
- <property>1</property>
- <value>enabled</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="12">
- <name>Radio Power Conversion</name>
- <map>
- <relation>
- <property>0</property>
- <value>disabled</value>
- </relation>
- <relation>
- <property>1</property>
- <value>enabled</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="12">
- <name>Zero-1 Power Conversion</name>
- <map>
- <relation>
- <property>0</property>
- <value>disabled</value>
- </relation>
- <relation>
- <property>1</property>
- <value>enabled</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="12">
- <name>Trix Power Conversion</name>
- <map>
- <relation>
- <property>0</property>
- <value>disabled</value>
- </relation>
- <relation>
- <property>1</property>
- <value>enabled</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="12">
- <name>CTC/Railcommand Power Conversion</name>
- <map>
- <relation>
- <property>0</property>
- <value>disabled</value>
- </relation>
- <relation>
- <property>1</property>
- <value>enabled</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="1" origin="13">
- <name>Analog Mode Function Status - F1</name>
- <map>
- <relation>
- <property>0</property>
- <value>Off</value>
- </relation>
- <relation>
- <property>1</property>
- <value>On</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="13">
- <name>Analog Mode Function Status - F2</name>
- <map>
- <relation>
- <property>0</property>
- <value>Off</value>
- </relation>
- <relation>
- <property>1</property>
- <value>On</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="13">
- <name>Analog Mode Function Status - F3</name>
- <map>
- <relation>
- <property>0</property>
- <value>Off</value>
- </relation>
- <relation>
- <property>1</property>
- <value>On</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="13">
- <name>Analog Mode Function Status - F4</name>
- <map>
- <relation>
- <property>0</property>
- <value>Off</value>
- </relation>
- <relation>
- <property>1</property>
- <value>On</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="13">
- <name>Analog Mode Function Status - F5</name>
- <map>
- <relation>
- <property>0</property>
- <value>Off</value>
- </relation>
- <relation>
- <property>1</property>
- <value>On</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="32" origin="13">
- <name>Analog Mode Function Status - F6</name>
- <map>
- <relation>
- <property>0</property>
- <value>Off</value>
- </relation>
- <relation>
- <property>1</property>
- <value>On</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="64" origin="13">
- <name>Analog Mode Function Status - F7</name>
- <map>
- <relation>
- <property>0</property>
- <value>Off</value>
- </relation>
- <relation>
- <property>1</property>
- <value>On</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="128" origin="13">
- <name>Analog Mode Function Status - F8</name>
- <map>
- <relation>
- <property>0</property>
- <value>Off</value>
- </relation>
- <relation>
- <property>1</property>
- <value>On</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="7" origin="16">
- <name>Decoder Lock ID number</name>
- </bit>
- <bit size="8" mask="1" origin="21">
- <name>Consist Address Active For F1</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="21">
- <name>Consist Address Active For F2</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="21">
- <name>Consist Address Active For F3</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="21">
- <name>Consist Address Active For F4</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="21">
- <name>Consist Address Active For F5</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="32" origin="21">
- <name>Consist Address Active For F6</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="64" origin="21">
- <name>Consist Address Active For F7</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="128" origin="21">
- <name>Consist Address Active For F8</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="1" origin="22">
- <name>Consist Address Active For FL in Forward</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="22">
- <name>Consist Address Active For FL in Reverse</name>
- <map>
- <relation>
- <property>0</property>
- <value>Locomotive Address Only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Respond to Consist Address</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="127" origin="19">
- <name>Consist Address</name>
- </bit>
- <bit size="8" mask="128" origin="19">
- <name>Consist Direction</name>
- <map>
- <relation>
- <property>0</property>
- <value>forward</value>
- </relation>
- <relation>
- <property>1</property>
- <value>reverse</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="127" origin="23">
- <name>Consist Acceleration Adjustment</name>
- </bit>
- <bit size="8" mask="128" origin="23">
- <name>Consist Acceleration Adjustment Sign</name>
- <map>
- <relation>
- <property>0</property>
- <value>Adjustment Added</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Adjustment Subtracted</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="127" origin="24">
- <name>Consist Deceleration Adjustment</name>
- </bit>
- <bit size="8" mask="128" origin="24">
- <name>Consist Deceleration Adjustment Sign</name>
- <map>
- <relation>
- <property>0</property>
- <value>Adjustment Added</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Adjustment Subtracted</value>
- </relation>
- </map>
- </bit>
- <int origin="25">
- <name>Speed Table/Mid Range Cab Speed Step</name>
- <description>See RP 9.2.2 for more information. Values from 2 to 127 indicate preloaded speed tables. 0 or 1 means not used. Values between 128 and 154 define the cab throttle position where the mid range decoder speed value is applied</description>
- </int>
- <bit size="8" mask="1" origin="29">
- <name>Locomotive Direction</name>
- <map>
- <relation>
- <property>0</property>
- <value>forward</value>
- </relation>
- <relation>
- <property>1</property>
- <value>reverse</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="29">
- <name>FL Location</name>
- <map>
- <relation>
- <property>0</property>
- <value>14 speed step format</value>
- </relation>
- <relation>
- <property>1</property>
- <value>28 speed step format</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="29">
- <name>Power Source Conversion</name>
- <map>
- <relation>
- <property>0</property>
- <value>NMRA Digital only</value>
- </relation>
- <relation>
- <property>1</property>
- <value>DC conversion enabled</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="29">
- <name>Advanced Decoder Acknowledgement</name>
- <map>
- <relation>
- <property>0</property>
- <value>disabled</value>
- </relation>
- <relation>
- <property>1</property>
- <value>enabled</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="29">
- <name>Speed Table Definition</name>
- <map>
- <relation>
- <property>0</property>
- <value>Use Vstart, Vmid, Vhigh</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Use table in CVs 66 through 95</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="1" origin="33">
- <name>FL(f) controls output 1</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="33">
- <name>FL(f) controls output 2</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="33">
- <name>FL(f) controls output 3</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="33">
- <name>FL(f) controls output 4</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="33">
- <name>FL(f) controls output 5</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="32" origin="33">
- <name>FL(f) controls output 6</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="64" origin="33">
- <name>FL(f) controls output 7</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="128" origin="33">
- <name>FL(f) controls output 8</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="1" origin="34">
- <name>FL(r) controls output 1</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="34">
- <name>FL(r) controls output 2</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="34">
- <name>FL(r) controls output 3</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="34">
- <name>FL(r) controls output 4</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="34">
- <name>FL(r) controls output 5</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="32" origin="34">
- <name>FL(r) controls output 6</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="64" origin="34">
- <name>FL(r) controls output 7</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="128" origin="34">
- <name>FL(r) controls output 8</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="1" origin="35">
- <name>F1 controls output 1</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="35">
- <name>F1 controls output 2</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="35">
- <name>F1 controls output 3</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="35">
- <name>F1 controls output 4</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="35">
- <name>F1 controls output 5</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="32" origin="35">
- <name>F1 controls output 6</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="64" origin="35">
- <name>F1 controls output 7</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="128" origin="35">
- <name>F1 controls output 8</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="1" origin="36">
- <name>F2 controls output 1</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="36">
- <name>F2 controls output 2</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="36">
- <name>F2 controls output 3</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="36">
- <name>F2 controls output 4</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="36">
- <name>F2 controls output 5</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="32" origin="36">
- <name>F2 controls output 6</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="64" origin="36">
- <name>F2 controls output 7</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="128" origin="36">
- <name>F2 controls output 8</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="1" origin="37">
- <name>F3 controls output 1</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="37">
- <name>F3 controls output 2</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="37">
- <name>F3 controls output 3</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="37">
- <name>F3 controls output 4</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="37">
- <name>F3 controls output 5</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="32" origin="37">
- <name>F3 controls output 6</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="64" origin="37">
- <name>F3 controls output 7</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="128" origin="37">
- <name>F3 controls output 8</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="1" origin="38">
- <name>F4 controls output 4</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="2" origin="38">
- <name>F4 controls output 5</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="4" origin="38">
- <name>F4 controls output 6</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="8" origin="38">
- <name>F4 controls output 7</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="16" origin="38">
- <name>F4 controls output 8</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="32" origin="38">
- <name>F4 controls output 9</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property>1</property>
- <value>Yes</value>
- </relation>
- </map>
- </bit>
- <bit size="8" mask="64" origin="38">
- <name>F4 controls output 10</name>
- <map>
- <relation>
- <property>0</property>
- <value>No</value>
- </relation>
- <relation>
- <property...
[truncated message content] |
|
From: <br...@us...> - 2015-09-08 21:40:54
|
Revision: 3926
http://sourceforge.net/p/openlcb/svn/3926
Author: bracz
Date: 2015-09-08 21:40:51 +0000 (Tue, 08 Sep 2015)
Log Message:
-----------
Recompiles jar files after patches are applied.
Modified Paths:
--------------
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
Modified: trunk/prototypes/java/openlcb-demo.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/openlcb.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2015-09-16 07:36:57
|
Revision: 3927
http://sourceforge.net/p/openlcb/svn/3927
Author: bracz
Date: 2015-09-16 07:36:54 +0000 (Wed, 16 Sep 2015)
Log Message:
-----------
Packages version 0.6.5 of the java library for OpenLCB.
Modified Paths:
--------------
trunk/prototypes/java/manifest
trunk/prototypes/java/openlcb-demo.jar
trunk/prototypes/java/openlcb.jar
trunk/prototypes/java/src/org/openlcb/Version.java
Modified: trunk/prototypes/java/manifest
===================================================================
--- trunk/prototypes/java/manifest 2015-09-08 21:40:51 UTC (rev 3926)
+++ trunk/prototypes/java/manifest 2015-09-16 07:36:54 UTC (rev 3927)
@@ -7,6 +7,6 @@
Specification-Version: 0.6.4
Specification-Vendor: OpenLCB group
Package-Title: openlcb
-Package-Version: 0.6.4
+Package-Version: 0.6.5
Package-Vendor: OpenLCB group
Modified: trunk/prototypes/java/openlcb-demo.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/openlcb.jar
===================================================================
(Binary files differ)
Modified: trunk/prototypes/java/src/org/openlcb/Version.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/Version.java 2015-09-08 21:40:51 UTC (rev 3926)
+++ trunk/prototypes/java/src/org/openlcb/Version.java 2015-09-16 07:36:54 UTC (rev 3927)
@@ -34,7 +34,7 @@
/* Library modifier - updated periodically
*/
- static final public int libMod = 4;
+ static final public int libMod = 5;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2016-01-01 20:04:45
|
Revision: 3957
http://sourceforge.net/p/openlcb/svn/3957
Author: bracz
Date: 2016-01-01 20:04:42 +0000 (Fri, 01 Jan 2016)
Log Message:
-----------
Renames TrainNode to RemoteTrainNode to better represent the intention of this class (as opposed to Node classes that act as a node on the bus).
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/implementations/throttle/AbstractNodeCache.java
trunk/prototypes/java/src/org/openlcb/implementations/throttle/TrainNodeCache.java
trunk/prototypes/java/src/org/openlcb/implementations/throttle/dcc/DccProxyCache.java
trunk/prototypes/java/test/org/openlcb/implementations/throttle/PackageTest.java
trunk/prototypes/java/test/org/openlcb/implementations/throttle/dcc/DccProxyCacheTest.java
Added Paths:
-----------
trunk/prototypes/java/src/org/openlcb/implementations/throttle/RemoteTrainNode.java
trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeCacheTest.java
trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeTest.java
Removed Paths:
-------------
trunk/prototypes/java/src/org/openlcb/implementations/throttle/TrainNode.java
trunk/prototypes/java/test/org/openlcb/implementations/throttle/TrainNodeCacheTest.java
trunk/prototypes/java/test/org/openlcb/implementations/throttle/TrainNodeTest.java
Modified: trunk/prototypes/java/src/org/openlcb/implementations/throttle/AbstractNodeCache.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/throttle/AbstractNodeCache.java 2016-01-01 20:04:22 UTC (rev 3956)
+++ trunk/prototypes/java/src/org/openlcb/implementations/throttle/AbstractNodeCache.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -1,18 +1,20 @@
package org.openlcb.implementations.throttle;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import org.openlcb.Connection;
import org.openlcb.EventID;
import org.openlcb.NodeID;
import org.openlcb.MessageDecoder;
import org.openlcb.ProducerConsumerEventReportMessage;
+import org.openlcb.ProducerIdentifiedMessage;
/**
* Maintains a cache of nodes seen to emit a particular EventID.
*
* @TODO: Type of node needs to be made generic T
- *
+ *
* @TODO: make sure name and semantics of contained property are correct for a Bean, e.g.
* it has the right name and related methods are present.
* http://docs.oracle.com/javase/tutorial/javabeans/writing/properties.html
@@ -25,9 +27,11 @@
public AbstractNodeCache(EventID indicator) {
this.indicator = indicator;
}
+ // Stores which nodes we've seen so far and at what index they are.
+ HashMap<NodeID, Integer> index = new HashMap<>();
ArrayList<T> list = new ArrayList<T>();
EventID indicator;
-
+
// for indexed Bean form
public T[] getCache() {
return (T[])list.toArray();
@@ -35,27 +39,44 @@
public T getCache(int index) throws ArrayIndexOutOfBoundsException {
return list.get(index);
}
-
+
public List<T> getList() {
return list;
}
+ @Override
public void handleProducerConsumerEventReport(ProducerConsumerEventReportMessage msg, Connection sender) {
EventID evt = msg.getEventID();
- if (evt.equals(indicator)) {
- // get source as Node ID for train node
- T node = newObject(msg.getSourceNodeID());
- list.add(node);
- firePropertyChange("cache", null, node);
+ processEvent(msg.getSourceNodeID(), evt);
+ }
+
+ private synchronized void processEvent(NodeID src, EventID evt) {
+ if (!evt.equals(indicator)) {
+ return;
}
+ if (index.containsKey(src)) {
+ return;
+ }
+ // get source as Node ID for train node
+ T node = newObject(src);
+ list.add(node);
+ int last = list.size() - 1;
+ index.put(src, last);
+ firePropertyChange("cache", null, node);
}
-
+
+ @Override
+ public void handleProducerIdentified(ProducerIdentifiedMessage msg, Connection sender) {
+ EventID evt = msg.getEventID();
+ processEvent(msg.getSourceNodeID(), evt);
+ }
+
/**
* Implement this for specific type to be created in this cache - inelegant!
*/
protected abstract T newObject(NodeID id);
-
+
java.beans.PropertyChangeSupport pcs = new java.beans.PropertyChangeSupport(this);
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
pcs.addPropertyChangeListener(l);
Copied: trunk/prototypes/java/src/org/openlcb/implementations/throttle/RemoteTrainNode.java (from rev 3956, trunk/prototypes/java/src/org/openlcb/implementations/throttle/TrainNode.java)
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/throttle/RemoteTrainNode.java (rev 0)
+++ trunk/prototypes/java/src/org/openlcb/implementations/throttle/RemoteTrainNode.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -0,0 +1,24 @@
+package org.openlcb.implementations.throttle;
+
+import net.jcip.annotations.Immutable;
+import net.jcip.annotations.ThreadSafe;
+import org.openlcb.*;
+
+/**
+ * Represents local view about a remote Train Node, a node that implements the Traction protocol.
+ *
+ *
+ * @author Bob Jacobsen Copyright 2012
+ * @version $Revision$
+ */
+@Immutable
+@ThreadSafe
+public class RemoteTrainNode {
+
+ public RemoteTrainNode(NodeID node) {
+ this.node = node;
+ }
+ NodeID node;
+
+ public NodeID getNodeId() { return node; }
+}
Deleted: trunk/prototypes/java/src/org/openlcb/implementations/throttle/TrainNode.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/throttle/TrainNode.java 2016-01-01 20:04:22 UTC (rev 3956)
+++ trunk/prototypes/java/src/org/openlcb/implementations/throttle/TrainNode.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -1,24 +0,0 @@
-package org.openlcb.implementations.throttle;
-
-import net.jcip.annotations.Immutable;
-import net.jcip.annotations.ThreadSafe;
-import org.openlcb.*;
-
-/**
- * Represents a TrainNode, a node that implements the Train protocol.
- *
- *
- * @author Bob Jacobsen Copyright 2012
- * @version $Revision$
- */
-@Immutable
-@ThreadSafe
-public class TrainNode {
-
- public TrainNode(NodeID node) {
- this.node = node;
- }
- NodeID node;
-
- public NodeID getNode() { return node; }
-}
Modified: trunk/prototypes/java/src/org/openlcb/implementations/throttle/TrainNodeCache.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/throttle/TrainNodeCache.java 2016-01-01 20:04:22 UTC (rev 3956)
+++ trunk/prototypes/java/src/org/openlcb/implementations/throttle/TrainNodeCache.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -1,7 +1,5 @@
package org.openlcb.implementations.throttle;
-import net.jcip.annotations.Immutable;
-import net.jcip.annotations.ThreadSafe;
import org.openlcb.*;
/**
@@ -11,14 +9,17 @@
* @author Bob Jacobsen Copyright 2012
* @version $Revision$
*/
-public class TrainNodeCache extends AbstractNodeCache<TrainNode> {
+public class TrainNodeCache extends AbstractNodeCache<RemoteTrainNode> {
- public TrainNodeCache() {
- super(new EventID("01.01.00.00.00.00.03.01"));
+ private final OlcbInterface iface;
+
+ public TrainNodeCache(OlcbInterface iface) {
+ super(CommonIdentifiers.IS_TRAIN);
+ this.iface = iface;
}
- protected TrainNode newObject(NodeID id) {
- return new TrainNode(id);
+ protected RemoteTrainNode newObject(NodeID id) {
+ return new RemoteTrainNode(id);
}
}
Modified: trunk/prototypes/java/src/org/openlcb/implementations/throttle/dcc/DccProxyCache.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/throttle/dcc/DccProxyCache.java 2016-01-01 20:04:22 UTC (rev 3956)
+++ trunk/prototypes/java/src/org/openlcb/implementations/throttle/dcc/DccProxyCache.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -1,11 +1,9 @@
package org.openlcb.implementations.throttle.dcc;
-import net.jcip.annotations.Immutable;
-import net.jcip.annotations.ThreadSafe;
import org.openlcb.*;
import org.openlcb.implementations.throttle.AbstractNodeCache;
-import org.openlcb.implementations.throttle.TrainNode;
+import org.openlcb.implementations.throttle.RemoteTrainNode;
/**
* Maintain a cache of Train objects on OpenLCB network
@@ -14,13 +12,13 @@
* @author Bob Jacobsen Copyright 2012
* @version $Revision$
*/
-public class DccProxyCache extends AbstractNodeCache<TrainNode> {
+public class DccProxyCache extends AbstractNodeCache<RemoteTrainNode> {
public DccProxyCache() {
super(new EventID("01.01.00.00.00.00.04.01"));
}
- protected TrainNode newObject(NodeID id) {
- return new TrainNode(id);
+ protected RemoteTrainNode newObject(NodeID id) {
+ return new RemoteTrainNode(id);
}
}
Modified: trunk/prototypes/java/test/org/openlcb/implementations/throttle/PackageTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/throttle/PackageTest.java 2016-01-01 20:04:22 UTC (rev 3956)
+++ trunk/prototypes/java/test/org/openlcb/implementations/throttle/PackageTest.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -1,6 +1,5 @@
package org.openlcb.implementations.throttle;
-import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@@ -32,8 +31,8 @@
suite.addTest(Float16Test.suite());
suite.addTest(ThrottleSpeedDatagramTest.suite());
suite.addTest(ThrottleImplementationTest.suite());
- suite.addTest(TrainNodeTest.suite());
- suite.addTest(TrainNodeCacheTest.suite());
+ suite.addTest(RemoteTrainNodeTest.suite());
+ suite.addTest(RemoteTrainNodeCacheTest.suite());
suite.addTest(org.openlcb.implementations.throttle.dcc.PackageTest.suite());
Added: trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeCacheTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeCacheTest.java (rev 0)
+++ trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeCacheTest.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -0,0 +1,112 @@
+package org.openlcb.implementations.throttle;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.openlcb.CommonIdentifiers;
+import org.openlcb.EventID;
+import org.openlcb.FakeOlcbInterface;
+import org.openlcb.Message;
+import org.openlcb.NodeID;
+import org.openlcb.OptionalIntRejectedMessage;
+import org.openlcb.ProducerConsumerEventReportMessage;
+import org.openlcb.ProducerIdentifiedMessage;
+
+/**
+ * @author Bob Jacobsen Copyright 2012
+ * @version $Revision$
+ */
+public class RemoteTrainNodeCacheTest extends TestCase {
+ TrainNodeCache cache;
+ FakeOlcbInterface fakeInterface;
+
+ public RemoteTrainNodeCacheTest(String s) {
+ super(s);
+ }
+
+ // Main entry point
+ static public void main(String[] args) {
+ String[] testCaseName = {RemoteTrainNodeCacheTest.class.getName()};
+ junit.swingui.TestRunner.main(testCaseName);
+ }
+
+ // test suite from all defined tests
+ public static Test suite() {
+ TestSuite suite = new TestSuite(RemoteTrainNodeCacheTest.class);
+ return suite;
+ }
+
+ public void testSetup() {
+ Assert.assertTrue(cache != null);
+ }
+
+ public void testEmpty() {
+ Assert.assertTrue(cache.getList() != null);
+ Assert.assertEquals(0, cache.getList().size());
+ }
+
+ public void testIgnoresMessage() {
+
+ Message m = new OptionalIntRejectedMessage(null, null, 0, 0);
+
+ cache.put(m, null);
+ Assert.assertTrue(cache.getList() != null);
+ Assert.assertEquals(0, cache.getList().size());
+ }
+
+ public void testIgnoresEvent() {
+
+ Message m = new ProducerConsumerEventReportMessage(null, new EventID("01.02.03.04.05.06" +
+ ".07.08"));
+
+ cache.put(m, null);
+ Assert.assertTrue(cache.getList() != null);
+ Assert.assertEquals(0, cache.getList().size());
+ }
+
+ // from here down is testing infrastructure
+
+ public void testSeesIsTrainEvent() {
+ Message m = new ProducerConsumerEventReportMessage(new NodeID(new byte[]{1, 1, 0, 0, 4,
+ 4}), CommonIdentifiers.IS_TRAIN);
+
+ cache.put(m, null);
+ Assert.assertTrue(cache.getList() != null);
+ Assert.assertEquals(1, cache.getList().size());
+
+ RemoteTrainNode tn = cache.getList().get(0);
+
+ Assert.assertTrue(tn.getNodeId().equals(new NodeID(new byte[]{1, 1, 0, 0, 4, 4})));
+ }
+
+ public void testNoDuplicates() {
+ Message m = new ProducerConsumerEventReportMessage(new NodeID(new byte[]{1, 1, 0, 0, 4,
+ 4}), CommonIdentifiers.IS_TRAIN);
+
+ cache.put(m, null);
+ Assert.assertTrue(cache.getList() != null);
+ Assert.assertEquals(1, cache.getList().size());
+
+ m = new ProducerIdentifiedMessage(new NodeID(new byte[]{1, 1, 0, 0, 4, 4}),
+ CommonIdentifiers.IS_TRAIN);
+ cache.put(m, null);
+
+ Assert.assertEquals(1, cache.getList().size());
+
+ m = new ProducerIdentifiedMessage(new NodeID(new byte[]{1, 1, 0, 0, 4, 5}), new EventID
+ ("01.01.00.00.00.00.03.03"));
+ cache.put(m, null);
+
+ Assert.assertEquals(2, cache.getList().size());
+
+ Assert.assertEquals(new NodeID(new byte[]{1, 1, 0, 0, 4, 4}), cache.getCache(0).getNodeId());
+ Assert.assertEquals(new NodeID(new byte[]{1, 1, 0, 0, 4, 5}), cache.getCache(1).getNodeId());
+ }
+
+ public void setUp() {
+ fakeInterface = new FakeOlcbInterface();
+ cache = new TrainNodeCache(fakeInterface);
+ }
+}
Copied: trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeTest.java (from rev 3956, trunk/prototypes/java/test/org/openlcb/implementations/throttle/TrainNodeTest.java)
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeTest.java (rev 0)
+++ trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeTest.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -0,0 +1,43 @@
+package org.openlcb.implementations.throttle;
+
+import org.openlcb.*;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ *
+ * @author Bob Jacobsen Copyright 2012
+ * @version $Revision$
+ */
+public class RemoteTrainNodeTest extends TestCase {
+
+ public void testCtor() {
+ new RemoteTrainNode(new NodeID(new byte[]{1,2,3,4,5,6}));
+ }
+
+ public void testNodeMemory() {
+ RemoteTrainNode node = new RemoteTrainNode(new NodeID(new byte[]{1,2,3,4,5,6}));
+ Assert.assertTrue(new NodeID(new byte[]{1,2,3,4,5,6}).equals(node.getNodeId()));
+ }
+
+ // from here down is testing infrastructure
+
+ public RemoteTrainNodeTest(String s) {
+ super(s);
+ }
+
+ // Main entry point
+ static public void main(String[] args) {
+ String[] testCaseName = {RemoteTrainNodeTest.class.getName()};
+ junit.swingui.TestRunner.main(testCaseName);
+ }
+
+ // test suite from all defined tests
+ public static Test suite() {
+ TestSuite suite = new TestSuite(RemoteTrainNodeTest.class);
+ return suite;
+ }
+}
Deleted: trunk/prototypes/java/test/org/openlcb/implementations/throttle/TrainNodeCacheTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/throttle/TrainNodeCacheTest.java 2016-01-01 20:04:22 UTC (rev 3956)
+++ trunk/prototypes/java/test/org/openlcb/implementations/throttle/TrainNodeCacheTest.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -1,80 +0,0 @@
-package org.openlcb.implementations.throttle;
-
-import org.openlcb.*;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- *
- * @author Bob Jacobsen Copyright 2012
- * @version $Revision$
- */
-public class TrainNodeCacheTest extends TestCase {
- TrainNodeCache cache;
-
- public void testSetup() {
- Assert.assertTrue(cache != null);
- }
-
- public void testEmpty() {
- Assert.assertTrue(cache.getList() != null);
- Assert.assertEquals(0, cache.getList().size());
- }
-
- public void testIgnoresMessage() {
-
- Message m = new OptionalIntRejectedMessage(null, null, 0, 0);
-
- cache.put(m, null);
- Assert.assertTrue(cache.getList() != null);
- Assert.assertEquals(0, cache.getList().size());
- }
-
- public void testIgnoresEvent() {
-
- Message m = new ProducerConsumerEventReportMessage(null, new EventID("01.02.03.04.05.06.07.08"));
-
- cache.put(m, null);
- Assert.assertTrue(cache.getList() != null);
- Assert.assertEquals(0, cache.getList().size());
- }
-
- public void testSeesIsTrainEvent() {
-
- Message m = new ProducerConsumerEventReportMessage(new NodeID(new byte[]{1,1,0,0,4,4}), new EventID("01.01.00.00.00.00.03.01"));
-
- cache.put(m, null);
- Assert.assertTrue(cache.getList() != null);
- Assert.assertEquals(1, cache.getList().size());
-
- TrainNode tn = cache.getList().get(0);
-
- Assert.assertTrue(tn.getNode().equals(new NodeID(new byte[]{1,1,0,0,4,4})));
-
- }
-
- public void setUp() {
- cache = new TrainNodeCache();
- }
-
- // from here down is testing infrastructure
-
- public TrainNodeCacheTest(String s) {
- super(s);
- }
-
- // Main entry point
- static public void main(String[] args) {
- String[] testCaseName = {TrainNodeCacheTest.class.getName()};
- junit.swingui.TestRunner.main(testCaseName);
- }
-
- // test suite from all defined tests
- public static Test suite() {
- TestSuite suite = new TestSuite(TrainNodeCacheTest.class);
- return suite;
- }
-}
Deleted: trunk/prototypes/java/test/org/openlcb/implementations/throttle/TrainNodeTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/throttle/TrainNodeTest.java 2016-01-01 20:04:22 UTC (rev 3956)
+++ trunk/prototypes/java/test/org/openlcb/implementations/throttle/TrainNodeTest.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -1,43 +0,0 @@
-package org.openlcb.implementations.throttle;
-
-import org.openlcb.*;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- *
- * @author Bob Jacobsen Copyright 2012
- * @version $Revision$
- */
-public class TrainNodeTest extends TestCase {
-
- public void testCtor() {
- new TrainNode(new NodeID(new byte[]{1,2,3,4,5,6}));
- }
-
- public void testNodeMemory() {
- TrainNode node = new TrainNode(new NodeID(new byte[]{1,2,3,4,5,6}));
- Assert.assertTrue(new NodeID(new byte[]{1,2,3,4,5,6}).equals(node.getNode()));
- }
-
- // from here down is testing infrastructure
-
- public TrainNodeTest(String s) {
- super(s);
- }
-
- // Main entry point
- static public void main(String[] args) {
- String[] testCaseName = {TrainNodeTest.class.getName()};
- junit.swingui.TestRunner.main(testCaseName);
- }
-
- // test suite from all defined tests
- public static Test suite() {
- TestSuite suite = new TestSuite(TrainNodeTest.class);
- return suite;
- }
-}
Modified: trunk/prototypes/java/test/org/openlcb/implementations/throttle/dcc/DccProxyCacheTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/throttle/dcc/DccProxyCacheTest.java 2016-01-01 20:04:22 UTC (rev 3956)
+++ trunk/prototypes/java/test/org/openlcb/implementations/throttle/dcc/DccProxyCacheTest.java 2016-01-01 20:04:42 UTC (rev 3957)
@@ -52,9 +52,9 @@
Assert.assertTrue(cache.getList() != null);
Assert.assertEquals(1, cache.getList().size());
- TrainNode tn = cache.getList().get(0);
+ RemoteTrainNode tn = cache.getList().get(0);
- Assert.assertTrue(tn.getNode().equals(new NodeID(new byte[]{1,1,0,0,4,4})));
+ Assert.assertTrue(tn.getNodeId().equals(new NodeID(new byte[]{1,1,0,0,4,4})));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2016-01-01 20:05:26
|
Revision: 3959
http://sourceforge.net/p/openlcb/svn/3959
Author: bracz
Date: 2016-01-01 20:05:24 +0000 (Fri, 01 Jan 2016)
Log Message:
-----------
Implementing traction protocol messages:
- adds new abstract message base class: AddressedPayloadMessage, with common handling for parsing and serializing.
- adds MTI values for traction control/proxy command/request
- adds message implementation classes for traction control/proxy command/request messages.
- adds CAN frame serializing for generic AddressedPayloadMessage.
- adds CAN frame parsing for these four messages.
- adds some unit test coverage.
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/MessageDecoder.java
trunk/prototypes/java/src/org/openlcb/MessageTypeIdentifier.java
trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java
trunk/prototypes/java/src/org/openlcb/can/OpenLcbCanFrame.java
trunk/prototypes/java/test/org/openlcb/MessageTypeIdentifierTest.java
trunk/prototypes/java/test/org/openlcb/can/MessageBuilderTest.java
Added Paths:
-----------
trunk/prototypes/java/src/org/openlcb/AddressedPayloadMessage.java
trunk/prototypes/java/src/org/openlcb/messages/
trunk/prototypes/java/src/org/openlcb/messages/TractionControlReplyMessage.java
trunk/prototypes/java/src/org/openlcb/messages/TractionControlRequestMessage.java
trunk/prototypes/java/src/org/openlcb/messages/TractionProxyReplyMessage.java
trunk/prototypes/java/src/org/openlcb/messages/TractionProxyRequestMessage.java
Added: trunk/prototypes/java/src/org/openlcb/AddressedPayloadMessage.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/AddressedPayloadMessage.java (rev 0)
+++ trunk/prototypes/java/src/org/openlcb/AddressedPayloadMessage.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -0,0 +1,34 @@
+package org.openlcb;
+
+/**
+ * Common base class for Addressed messages carrying a payload. This base class is easy
+ * to serialize and deserialize from an interface like CAN.
+ *
+ * Created by bracz on 12/29/15.
+ */
+public abstract class AddressedPayloadMessage extends AddressedMessage {
+ protected byte[] payload;
+
+ public byte[] getPayload() { return payload; }
+
+ public AddressedPayloadMessage(NodeID source, NodeID dest, byte[] payload) {
+ super(source, dest);
+ if (payload == null) {
+ this.payload = new byte[0];
+ } else {
+ this.payload = payload.clone();
+ }
+ }
+
+ public String toString() {
+ return super.toString() + " " + getEMTI().toString() + " with payload " + Utilities
+ .toHexSpaceString(payload);
+ }
+
+ public abstract MessageTypeIdentifier getEMTI();
+
+ @Override
+ public int getMTI() {
+ return getEMTI().mti();
+ }
+}
Modified: trunk/prototypes/java/src/org/openlcb/MessageDecoder.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/MessageDecoder.java 2016-01-01 20:05:02 UTC (rev 3958)
+++ trunk/prototypes/java/src/org/openlcb/MessageDecoder.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -1,5 +1,10 @@
package org.openlcb;
+import org.openlcb.messages.TractionControlReplyMessage;
+import org.openlcb.messages.TractionControlRequestMessage;
+import org.openlcb.messages.TractionProxyReplyMessage;
+import org.openlcb.messages.TractionProxyRequestMessage;
+
/**
* This class provides a basic double-dispatch mechanism for handling
* messages. OpenLCB messages in this implementation
@@ -176,4 +181,32 @@
public void handleOptionalIntRejected(OptionalIntRejectedMessage msg, Connection sender){
defaultHandler(msg, sender);
}
+
+ /**
+ * Handle "Traction Control Request" message
+ */
+ public void handleTractionControlRequest(TractionControlRequestMessage msg, Connection sender) {
+ defaultHandler(msg, sender);
+ }
+
+ /**
+ * Handle "Traction Control Reply" message
+ */
+ public void handleTractionControlReply(TractionControlReplyMessage msg, Connection sender) {
+ defaultHandler(msg, sender);
+ }
+
+ /**
+ * Handle "Traction Proxy Request" message
+ */
+ public void handleTractionProxyRequest(TractionProxyRequestMessage msg, Connection sender) {
+ defaultHandler(msg, sender);
+ }
+
+ /**
+ * Handle "Traction Proxy Reply" message
+ */
+ public void handleTractionProxyReply(TractionProxyReplyMessage msg, Connection sender) {
+ defaultHandler(msg, sender);
+ }
}
Modified: trunk/prototypes/java/src/org/openlcb/MessageTypeIdentifier.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/MessageTypeIdentifier.java 2016-01-01 20:05:02 UTC (rev 3958)
+++ trunk/prototypes/java/src/org/openlcb/MessageTypeIdentifier.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -27,6 +27,8 @@
// Type number
// Modifier (0-3)
// Name
+
+ // addr, event, simpl, S, P, Ty, M, Name
InitializationComplete ( false, false, false, 0, 0, 8, 0, "InitializationComplete"),
VerifyNodeIdAddressed ( true, false, false, 0, 1, 4, 0, "VerifyNodeIdAddressed"),
@@ -53,9 +55,14 @@
IdentifyEventsAddressed ( true, false, false, 0, 2, 11, 0, "IdentifyEventsAddressed"),
IdentifyEventsGlobal ( false, false, true, 0, 2, 11, 0, "IdentifyEventsGlobal"),
- LearnEvent ( false, true, true, 0, 1, 12, 0, "LearnEvent"),
- ProducerConsumerEventReport ( false, true, true, 0, 1, 13, 0, "ProducerConsumerEventReport"),
-
+ LearnEvent ( false, true, true, 0, 1, 12, 0, "LearnEvent"),
+ ProducerConsumerEventReport ( false, true, true, 0, 1, 13, 0, "ProducerConsumerEventReport"),
+
+ TractionControlRequest ( true, false, false, 0, 1, 15, 3, "TractionControlRequest" ),
+ TractionControlReply ( true, false, false, 0, 0, 15, 1, "TractionControlReply" ),
+ TractionProxyRequest ( true, false, false, 0, 1, 15, 2, "TractionProxyRequest" ),
+ TractionProxyReply ( true, false, false, 0, 0, 15, 0, "TractionProxyReply" ),
+
SimpleNodeIdentInfoRequest ( true, false, false, 0, 3, 15, 0, "SimpleNodeIdentInfoRequest"),
SimpleNodeIdentInfoReply ( true, false, false, 0, 2, 16, 0, "SimpleNodeIdentInfoReply"),
Modified: trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java 2016-01-01 20:05:02 UTC (rev 3958)
+++ trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -4,6 +4,10 @@
import java.util.HashMap;
import java.util.List;
import org.openlcb.*;
+import org.openlcb.messages.TractionControlReplyMessage;
+import org.openlcb.messages.TractionControlRequestMessage;
+import org.openlcb.messages.TractionProxyReplyMessage;
+import org.openlcb.messages.TractionProxyRequestMessage;
/**
* Converts CAN frame messages to regular messages
@@ -117,7 +121,9 @@
NodeID dest = null;
int mti = getMTI(f);
byte[] data = f.getData();
-
+
+ byte[] content = null;
+
if ( ((mti&0x008) != 0) && (f.getNumDataElements() >= 2) ) {
// addressed message
dest = map.getNodeID( ( (f.getElement(0) << 8) + (f.getElement(1) & 0xff) ) & 0xFFF );
@@ -143,6 +149,9 @@
// we're going to continue processing with the accumulated data
data = mold.data;
accumulations.remove(f.getHeader());
+
+ content = new byte[data.length-2];
+ System.arraycopy(data, 2, content, 0, content.length);
}
MessageTypeIdentifier value = MessageTypeIdentifier.get(mti);
@@ -187,7 +196,18 @@
case ProtocolSupportReply:
retlist.add(new ProtocolIdentificationReplyMessage(source, dest, f.dataAsLong()));
return retlist;
-
+ case TractionControlRequest:
+ retlist.add(new TractionControlRequestMessage(source, dest, content));
+ return retlist;
+ case TractionControlReply:
+ retlist.add(new TractionControlReplyMessage(source, dest, content));
+ return retlist;
+ case TractionProxyRequest:
+ retlist.add(new TractionProxyRequestMessage(source, dest, content));
+ return retlist;
+ case TractionProxyReply:
+ retlist.add(new TractionProxyReplyMessage(source, dest, content));
+ return retlist;
case IdentifyConsumer:
retlist.add(new IdentifyConsumersMessage(source, getEventID(f)));
return retlist;
@@ -215,10 +235,7 @@
case SimpleNodeIdentInfoRequest:
retlist.add(new SimpleNodeIdentInfoRequestMessage(source, dest));
return retlist;
- case SimpleNodeIdentInfoReply:
- byte[] content = new byte[data.length-2];
- System.arraycopy(data, 2, content, 0, content.length);
-
+ case SimpleNodeIdentInfoReply:
retlist.add(new SimpleNodeIdentInfoReplyMessage(source, dest, content));
return retlist;
@@ -353,7 +370,27 @@
return retlist;
}
-
+
+ private void handleAddressedPayloadMessage(AddressedPayloadMessage msg, Connection sender) {
+ byte[] payload = msg.getPayload();
+ if (payload == null) {
+ payload = new byte[0];
+ }
+ for (int i = 0; i < Math.max(1, payload.length); i += 6) {
+ // Note that the order of these calls are carefully chosen so that internally
+ // OpenLcbCanFrame does not overwrite parts of the payload with each other.
+ OpenLcbCanFrame f = new OpenLcbCanFrame(map.getAlias(msg.getSourceNodeID()));
+ f.setOpenLcbMTI(msg.getEMTI().mti());
+ int thislen = Math.min(6, payload.length - i);
+ byte[] data = new byte[thislen + 2];
+ System.arraycopy(payload, i, data, 2, thislen);
+ f.setData(data);
+ f.setDestAlias(map.getAlias(msg.getDestNodeID()));
+ f.setContinuation(i == 0, (i + 6 >= payload.length));
+ retlist.add(f);
+ }
+ }
+
/**
* Handle "Initialization Complete" message
*/
@@ -461,7 +498,37 @@
public void handleLearnEvent(LearnEventMessage msg, Connection sender){
defaultHandler(msg, sender);
}
+
+ @Override
/**
+ * Handle "Traction Control Request" message
+ */
+ public void handleTractionControlRequest(TractionControlRequestMessage msg, Connection sender) {
+ handleAddressedPayloadMessage(msg, sender);
+ }
+
+ /**
+ * Handle "Traction Control Reply" message
+ */
+ public void handleTractionControlReply(TractionControlReplyMessage msg, Connection sender) {
+ handleAddressedPayloadMessage(msg, sender);
+ }
+
+ /**
+ * Handle "Traction Proxy Request" message
+ */
+ public void handleTractionProxyRequest(TractionProxyRequestMessage msg, Connection sender) {
+ handleAddressedPayloadMessage(msg, sender);
+ }
+
+ /**
+ * Handle "Traction Proxy Reply" message
+ */
+ public void handleTractionProxyReply(TractionProxyReplyMessage msg, Connection sender) {
+ handleAddressedPayloadMessage(msg, sender);
+ }
+
+ /**
* Handle "Simple Node Ident Info Request" message
*/
@Override
Modified: trunk/prototypes/java/src/org/openlcb/can/OpenLcbCanFrame.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/can/OpenLcbCanFrame.java 2016-01-01 20:05:02 UTC (rev 3958)
+++ trunk/prototypes/java/src/org/openlcb/can/OpenLcbCanFrame.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -103,7 +103,14 @@
data[1] = (byte)(a&0xFF);
length = (length<2) ? 2 : length;
}
-
+
+ /** Sets the continuation bits for an addressed frame. */
+ void setContinuation(boolean first, boolean last) {
+ data[0] &= CONTINUATION_BITS_MASK;
+ if (!first) data[0] |= CONTINUATION_BITS_NOT_FIRST_FRAME;
+ if (!last) data[0] |= CONTINUATION_BITS_NOT_LAST_FRAME;
+ }
+
void setFrameTypeCAN() {
id &= ~MASK_FRAME_TYPE;
}
@@ -420,4 +427,9 @@
static final int FRAME_FORMAT_ADDRESSED_NON_DATAGRAM = 6;
static final int FRAME_FORMAT_STREAM_CODE = 7;
+ // Continuation bits
+ static final byte CONTINUATION_BITS_MASK = (byte) 0xCF;
+ static final byte CONTINUATION_BITS_NOT_FIRST_FRAME = (byte) 0x20;
+ static final byte CONTINUATION_BITS_NOT_LAST_FRAME = (byte) 0x10;
+
}
Added: trunk/prototypes/java/src/org/openlcb/messages/TractionControlReplyMessage.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/messages/TractionControlReplyMessage.java (rev 0)
+++ trunk/prototypes/java/src/org/openlcb/messages/TractionControlReplyMessage.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -0,0 +1,34 @@
+package org.openlcb.messages;
+
+import net.jcip.annotations.Immutable;
+import net.jcip.annotations.ThreadSafe;
+
+import org.openlcb.AddressedMessage;
+import org.openlcb.AddressedPayloadMessage;
+import org.openlcb.Connection;
+import org.openlcb.MessageDecoder;
+import org.openlcb.MessageTypeIdentifier;
+import org.openlcb.NodeID;
+
+/**
+ * Traction Control Reply message implementation.
+ * <p/>
+ * Created by bracz on 12/29/15.
+ */
+@Immutable
+@ThreadSafe
+public class TractionControlReplyMessage extends AddressedPayloadMessage {
+ public TractionControlReplyMessage(NodeID source, NodeID dest, byte[] payload) {
+ super(source, dest, payload);
+ }
+
+ @Override
+ public void applyTo(MessageDecoder decoder, Connection sender) {
+ decoder.handleTractionControlReply(this, sender);
+ }
+
+ @Override
+ public MessageTypeIdentifier getEMTI() {
+ return MessageTypeIdentifier.TractionControlReply;
+ }
+}
Added: trunk/prototypes/java/src/org/openlcb/messages/TractionControlRequestMessage.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/messages/TractionControlRequestMessage.java (rev 0)
+++ trunk/prototypes/java/src/org/openlcb/messages/TractionControlRequestMessage.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -0,0 +1,34 @@
+package org.openlcb.messages;
+
+import net.jcip.annotations.Immutable;
+import net.jcip.annotations.ThreadSafe;
+
+import org.openlcb.AddressedPayloadMessage;
+import org.openlcb.Connection;
+import org.openlcb.MessageDecoder;
+import org.openlcb.MessageTypeIdentifier;
+import org.openlcb.NodeID;
+
+/**
+ * Traction Control Request message implementation.
+ * <p/>
+ * Created by bracz on 12/29/15.
+ */
+@Immutable
+@ThreadSafe
+public class TractionControlRequestMessage extends AddressedPayloadMessage {
+ public TractionControlRequestMessage(NodeID source, NodeID dest, byte[] payload) {
+ super(source, dest, payload);
+ this.payload = payload.clone();
+ }
+
+ @Override
+ public void applyTo(MessageDecoder decoder, Connection sender) {
+ decoder.handleTractionControlRequest(this, sender);
+ }
+
+ @Override
+ public MessageTypeIdentifier getEMTI() {
+ return MessageTypeIdentifier.TractionControlRequest;
+ }
+}
Added: trunk/prototypes/java/src/org/openlcb/messages/TractionProxyReplyMessage.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/messages/TractionProxyReplyMessage.java (rev 0)
+++ trunk/prototypes/java/src/org/openlcb/messages/TractionProxyReplyMessage.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -0,0 +1,34 @@
+package org.openlcb.messages;
+
+import net.jcip.annotations.Immutable;
+import net.jcip.annotations.ThreadSafe;
+
+import org.openlcb.AddressedMessage;
+import org.openlcb.AddressedPayloadMessage;
+import org.openlcb.Connection;
+import org.openlcb.MessageDecoder;
+import org.openlcb.MessageTypeIdentifier;
+import org.openlcb.NodeID;
+
+/**
+ * Traction Proxy Reply message implementation.
+ * <p/>
+ * Created by bracz on 12/29/15.
+ */
+@Immutable
+@ThreadSafe
+public class TractionProxyReplyMessage extends AddressedPayloadMessage {
+ public TractionProxyReplyMessage(NodeID source, NodeID dest, byte[] payload) {
+ super(source, dest, payload);
+ }
+
+ @Override
+ public void applyTo(MessageDecoder decoder, Connection sender) {
+ decoder.handleTractionProxyReply(this, sender);
+ }
+
+ @Override
+ public MessageTypeIdentifier getEMTI() {
+ return MessageTypeIdentifier.TractionProxyReply;
+ }
+}
Added: trunk/prototypes/java/src/org/openlcb/messages/TractionProxyRequestMessage.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/messages/TractionProxyRequestMessage.java (rev 0)
+++ trunk/prototypes/java/src/org/openlcb/messages/TractionProxyRequestMessage.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -0,0 +1,35 @@
+package org.openlcb.messages;
+
+import net.jcip.annotations.Immutable;
+import net.jcip.annotations.ThreadSafe;
+
+import org.openlcb.AddressedMessage;
+import org.openlcb.AddressedPayloadMessage;
+import org.openlcb.Connection;
+import org.openlcb.MessageDecoder;
+import org.openlcb.MessageTypeIdentifier;
+import org.openlcb.NodeID;
+
+/**
+ * Traction Proxy Request message implementation.
+ * <p/>
+ * Created by bracz on 12/29/15.
+ */
+@Immutable
+@ThreadSafe
+public class TractionProxyRequestMessage extends AddressedPayloadMessage {
+ public TractionProxyRequestMessage(NodeID source, NodeID dest, byte[] payload) {
+ super(source, dest, payload);
+ }
+
+ @Override
+ public void applyTo(MessageDecoder decoder, Connection sender) {
+ decoder.handleTractionProxyRequest(this, sender);
+ }
+
+ @Override
+ public MessageTypeIdentifier getEMTI() {
+ return MessageTypeIdentifier.TractionProxyRequest;
+ }
+
+}
Modified: trunk/prototypes/java/test/org/openlcb/MessageTypeIdentifierTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/MessageTypeIdentifierTest.java 2016-01-01 20:05:02 UTC (rev 3958)
+++ trunk/prototypes/java/test/org/openlcb/MessageTypeIdentifierTest.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -66,6 +66,11 @@
Assert.assertEquals(0x0594, MessageTypeIdentifier.LearnEvent.mti());
Assert.assertEquals(0x05B4, MessageTypeIdentifier.ProducerConsumerEventReport.mti());
+ Assert.assertEquals(0x05EB, MessageTypeIdentifier.TractionControlRequest.mti());
+ Assert.assertEquals(0x01E9, MessageTypeIdentifier.TractionControlReply.mti());
+ Assert.assertEquals(0x05EA, MessageTypeIdentifier.TractionProxyRequest.mti());
+ Assert.assertEquals(0x01E8, MessageTypeIdentifier.TractionProxyReply.mti());
+
Assert.assertEquals(0x0DE8, MessageTypeIdentifier.SimpleNodeIdentInfoRequest.mti());
Assert.assertEquals(0x0A08, MessageTypeIdentifier.SimpleNodeIdentInfoReply.mti());
Modified: trunk/prototypes/java/test/org/openlcb/can/MessageBuilderTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/can/MessageBuilderTest.java 2016-01-01 20:05:02 UTC (rev 3958)
+++ trunk/prototypes/java/test/org/openlcb/can/MessageBuilderTest.java 2016-01-01 20:05:24 UTC (rev 3959)
@@ -1,6 +1,10 @@
package org.openlcb.can;
import org.openlcb.*;
+import org.openlcb.messages.TractionControlReplyMessage;
+import org.openlcb.messages.TractionControlRequestMessage;
+import org.openlcb.messages.TractionProxyReplyMessage;
+import org.openlcb.messages.TractionProxyRequestMessage;
import java.util.List;
@@ -95,6 +99,75 @@
compareContent(event.getContents(), f0);
}
+ public void testTractionControlRequestMessageSingle() {
+ Message m = new TractionControlRequestMessage(source, destination, new byte[]{(byte)0xCC,
+ (byte)0xAA, 0x55, 4, 5, 6});
+ MessageBuilder b = new MessageBuilder(map);
+
+ List<OpenLcbCanFrame> list = b.processMessage(m);
+
+ Assert.assertEquals("count", 1, list.size());
+ CanFrame f0 = list.get(0);
+ Assert.assertEquals("header", toHexString(0x195EB123), toHexString(f0.getHeader()));
+ compareContent(Utilities.bytesFromHexString("03 21 CC AA 55 04 05 06"), f0);
+ }
+
+ public void testTractionControlRequestMessageMulti() {
+ Message m = new TractionControlRequestMessage(source, destination, new byte[]{(byte)0xCC,
+ (byte)0xAA, 0x55, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14});
+ MessageBuilder b = new MessageBuilder(map);
+
+ List<OpenLcbCanFrame> list = b.processMessage(m);
+
+ Assert.assertEquals("count", 3, list.size());
+ CanFrame f0 = list.get(0);
+ Assert.assertEquals("header", toHexString(0x195EB123), toHexString(list.get(0).getHeader()));
+ Assert.assertEquals("header", toHexString(0x195EB123), toHexString(list.get(1).getHeader()));
+ Assert.assertEquals("header", toHexString(0x195EB123), toHexString(list.get(2).getHeader()));
+ compareContent(Utilities.bytesFromHexString("13 21 CC AA 55 04 05 06"), list.get(0));
+ compareContent(Utilities.bytesFromHexString("33 21 07 08 09 0a 0b 0c"), list.get(1));
+ compareContent(Utilities.bytesFromHexString("23 21 0d 0e"), list.get(2));
+ }
+
+ public void testTractionControlReplyMessage() {
+ Message m = new TractionControlReplyMessage(source, destination, new byte[]{(byte)0xCC,
+ (byte)0xAA, 0x55, 4, 5, 6});
+ MessageBuilder b = new MessageBuilder(map);
+
+ List<OpenLcbCanFrame> list = b.processMessage(m);
+
+ Assert.assertEquals("count", 1, list.size());
+ CanFrame f0 = list.get(0);
+ Assert.assertEquals("header", toHexString(0x191E9123), toHexString(f0.getHeader()));
+ compareContent(Utilities.bytesFromHexString("03 21 CC AA 55 04 05 06"), f0);
+ }
+
+ public void testTractionProxyRequestMessage() {
+ Message m = new TractionProxyRequestMessage(source, destination, new byte[]{(byte)0xCC,
+ (byte)0xAA, 0x55, 4, 5, 6});
+ MessageBuilder b = new MessageBuilder(map);
+
+ List<OpenLcbCanFrame> list = b.processMessage(m);
+
+ Assert.assertEquals("count", 1, list.size());
+ CanFrame f0 = list.get(0);
+ Assert.assertEquals("header", toHexString(0x195EA123), toHexString(f0.getHeader()));
+ compareContent(Utilities.bytesFromHexString("03 21 CC AA 55 04 05 06"), f0);
+ }
+
+ public void testTractionProxyReplyMessage() {
+ Message m = new TractionProxyReplyMessage(source, destination, new byte[]{(byte)0xCC,
+ (byte)0xAA, 0x55, 4, 5, 6});
+ MessageBuilder b = new MessageBuilder(map);
+
+ List<OpenLcbCanFrame> list = b.processMessage(m);
+
+ Assert.assertEquals("count", 1, list.size());
+ CanFrame f0 = list.get(0);
+ Assert.assertEquals("header", toHexString(0x191E8123), toHexString(f0.getHeader()));
+ compareContent(Utilities.bytesFromHexString("03 21 CC AA 55 04 05 06"), f0);
+ }
+
public void testDatagramMessageShort() {
int[] data = new int[]{21,22,23};
Message m = new DatagramMessage(source, destination, data);
@@ -390,6 +463,21 @@
}
+ public void testTractionControlRequestParseSingle() {
+ OpenLcbCanFrame frame = new OpenLcbCanFrame(0x123);
+ frame.setHeader(0x195EB123);
+ frame.setData(new byte[]{0x03, 0x21, 0x12, 0x34});
+
+ MessageBuilder b = new MessageBuilder(map);
+ List<Message> list = b.processFrame(frame);
+
+ Assert.assertEquals("count", 1, list.size());
+
+ Message msg = list.get(0);
+ Assert.assertTrue(msg instanceof TractionControlRequestMessage);
+ Assert.assertEquals("payload", "12 34", Utilities.toHexSpaceString(((AddressedPayloadMessage)msg).getPayload()));
+ }
+
public void testAliasExtraction() {
NodeID high = new NodeID(new byte[]{11,12,13,14,15,16});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2016-01-01 20:06:22
|
Revision: 3962
http://sourceforge.net/p/openlcb/svn/3962
Author: bracz
Date: 2016-01-01 20:06:18 +0000 (Fri, 01 Jan 2016)
Log Message:
-----------
Adds factory methods to traction control request message.
Adds new test suite class for the new directories.
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/implementations/throttle/Float16.java
trunk/prototypes/java/src/org/openlcb/messages/TractionControlRequestMessage.java
trunk/prototypes/java/test/org/openlcb/PackageTest.java
Added Paths:
-----------
trunk/prototypes/java/test/org/openlcb/messages/
trunk/prototypes/java/test/org/openlcb/messages/PackageTest.java
trunk/prototypes/java/test/org/openlcb/messages/TractionControlRequestMessageTest.java
Modified: trunk/prototypes/java/src/org/openlcb/implementations/throttle/Float16.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/throttle/Float16.java 2016-01-01 20:05:59 UTC (rev 3961)
+++ trunk/prototypes/java/src/org/openlcb/implementations/throttle/Float16.java 2016-01-01 20:06:18 UTC (rev 3962)
@@ -70,7 +70,10 @@
public int getInt() {
return ((byte1&0xFF)<<8)|(byte2&0xFF);
}
-
+
+ public byte getByte1() { return byte1; }
+ public byte getByte2() { return byte2; }
+
public float getFloat() {
if (byte1 == 0 && byte2 == 0) return 0.0f;
int ch = (byte2&0xFF) | ((byte1&0x3)<<8) | 0x400;
Modified: trunk/prototypes/java/src/org/openlcb/messages/TractionControlRequestMessage.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/messages/TractionControlRequestMessage.java 2016-01-01 20:05:59 UTC (rev 3961)
+++ trunk/prototypes/java/src/org/openlcb/messages/TractionControlRequestMessage.java 2016-01-01 20:06:18 UTC (rev 3962)
@@ -8,6 +8,7 @@
import org.openlcb.MessageDecoder;
import org.openlcb.MessageTypeIdentifier;
import org.openlcb.NodeID;
+import org.openlcb.implementations.throttle.Float16;
/**
* Traction Control Request message implementation.
@@ -17,11 +18,103 @@
@Immutable
@ThreadSafe
public class TractionControlRequestMessage extends AddressedPayloadMessage {
+ public final static byte CMD_SET_SPEED = 0x00;
+ public final static byte CMD_SET_FN = 0x01;
+ public final static byte CMD_ESTOP = 0x02;
+ public final static byte CMD_GET_SPEED = 0x10;
+ public final static byte CMD_GET_FN = 0x11;
+
+ public final static byte CMD_CONTROLLER = 0x20;
+ public final static byte SUBCMD_CONTROLLER_ASSIGN = 1;
+ public final static byte SUBCMD_CONTROLLER_RELEASE = 2;
+ public final static byte SUBCMD_CONTROLLER_QUERY = 3;
+ public final static byte SUBCMD_CONTROLLER_CHANGE = 4;
+
+ public final static byte CMD_CONSIST = 0x30;
+ public final static byte SUBCMD_CONSIST_ATTACH = 1;
+ public final static byte SUBCMD_CONSIST_DETACH = 2;
+ public final static byte SUBCMD_CONSIST_QUERY = 3;
+
+ public final static byte CMD_MGMT = 0x20;
+ public final static byte SUBCMD_MGMT_RESERVE = 1;
+ public final static byte SUBCMD_MGMT_RELEASE = 2;
+
+
public TractionControlRequestMessage(NodeID source, NodeID dest, byte[] payload) {
super(source, dest, payload);
this.payload = payload.clone();
}
+ static TractionControlRequestMessage createSetSpeed(NodeID source, NodeID dest, boolean
+ isForward, double speed) {
+ if (isForward) {
+ if (speed < 0) speed = -speed;
+ } else {
+ if (speed >= 0) speed = -speed;
+ }
+ Float16 sp = new Float16(speed);
+ byte[] payload = new byte[]{CMD_SET_SPEED, sp.getByte1(), sp.getByte2()};
+ return new TractionControlRequestMessage(source, dest, payload);
+ }
+
+ static TractionControlRequestMessage createGetSpeed(NodeID source, NodeID dest) {
+ return new TractionControlRequestMessage(source, dest, new byte[]{CMD_GET_SPEED});
+ }
+
+ static TractionControlRequestMessage createSetFn(NodeID source, NodeID dest, int fn, int val) {
+ byte[] payload = new byte[]{CMD_SET_FN, (byte) ((fn >> 16) & 0xff), (byte) ((fn >> 8) &
+ 0xff), (byte) (fn & 0xff), (byte) ((val >> 8) & 0xff), (byte) (val & 0xff)};
+ return new TractionControlRequestMessage(source, dest, payload);
+ }
+
+ static TractionControlRequestMessage createGetFn(NodeID source, NodeID dest, int fn) {
+ byte[] payload = new byte[]{CMD_GET_FN, (byte) ((fn >> 16) & 0xff), (byte) ((fn >> 8) &
+ 0xff), (byte) (fn & 0xff)};
+ return new TractionControlRequestMessage(source, dest, payload);
+ }
+
+ // Assigns the 'source' as controller id.
+ static TractionControlRequestMessage createAssignController(NodeID source, NodeID dest) {
+ byte[] payload = new byte[]{CMD_CONTROLLER, SUBCMD_CONTROLLER_ASSIGN, 0, 1, 2, 3, 4, 5, 6};
+ System.arraycopy(source.getContents(), 0, payload, 3, 6);
+ return new TractionControlRequestMessage(source, dest, payload);
+ }
+
+ // Releases the controller, filling source as the controlling id.
+ static TractionControlRequestMessage createReleaseController(NodeID source, NodeID dest) {
+ byte[] payload = new byte[]{CMD_CONTROLLER, SUBCMD_CONTROLLER_RELEASE, 0, 1, 2, 3, 4, 5, 6};
+ System.arraycopy(source.getContents(), 0, payload, 3, 6);
+ return new TractionControlRequestMessage(source, dest, payload);
+ }
+
+ // Releases the controller, filling source as the controlling id.
+ static TractionControlRequestMessage createQueryController(NodeID source, NodeID dest) {
+ byte[] payload = new byte[]{CMD_CONTROLLER, SUBCMD_CONTROLLER_QUERY};
+ return new TractionControlRequestMessage(source, dest, payload);
+ }
+
+ // Releases the controller, filling source as the controlling id.
+ static TractionControlRequestMessage createControllerChangeNotify(NodeID source, NodeID dest,
+ NodeID new_controller) {
+ byte[] payload = new byte[]{CMD_CONTROLLER, SUBCMD_CONTROLLER_CHANGE, 0, 1, 2, 3, 4, 5, 6};
+ System.arraycopy(new_controller.getContents(), 0, payload, 3, 6);
+ return new TractionControlRequestMessage(source, dest, payload);
+ }
+
+ public byte getCmd() throws ArrayIndexOutOfBoundsException {
+ return payload[0];
+ }
+
+ // Valid for messages that contain a subcommand.
+ public byte getSubCmd() throws ArrayIndexOutOfBoundsException {
+ return payload[1];
+ }
+
+ // Valid for SetSpeed message
+ public Float16 getSpeed() throws ArrayIndexOutOfBoundsException {
+ return new Float16((((int)payload[1]) << 8) | (payload[2] & 0xff));
+ }
+
@Override
public void applyTo(MessageDecoder decoder, Connection sender) {
decoder.handleTractionControlRequest(this, sender);
Modified: trunk/prototypes/java/test/org/openlcb/PackageTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/PackageTest.java 2016-01-01 20:05:59 UTC (rev 3961)
+++ trunk/prototypes/java/test/org/openlcb/PackageTest.java 2016-01-01 20:06:18 UTC (rev 3962)
@@ -81,6 +81,7 @@
// test implementation classes
suite.addTest(org.openlcb.implementations.PackageTest.suite());
+ suite.addTest(org.openlcb.messages.PackageTest.suite());
suite.addTest(org.openlcb.swing.PackageTest.suite());
suite.addTest(org.openlcb.cdi.PackageTest.suite());
Added: trunk/prototypes/java/test/org/openlcb/messages/PackageTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/messages/PackageTest.java (rev 0)
+++ trunk/prototypes/java/test/org/openlcb/messages/PackageTest.java 2016-01-01 20:06:18 UTC (rev 3962)
@@ -0,0 +1,48 @@
+package org.openlcb.messages;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.openlcb.implementations.BlueGoldEngineTest;
+import org.openlcb.implementations.DatagramMeteringBufferTest;
+import org.openlcb.implementations.DatagramReceiverTest;
+import org.openlcb.implementations.DatagramServiceTest;
+import org.openlcb.implementations.DatagramTransmitterTest;
+import org.openlcb.implementations.EventFilterGatewayTest;
+import org.openlcb.implementations.MemoryConfigurationServiceTest;
+import org.openlcb.implementations.ScatterGatherTest;
+import org.openlcb.implementations.SingleConsumerNodeTest;
+import org.openlcb.implementations.SingleProducerNodeTest;
+import org.openlcb.implementations.StreamReceiverTest;
+import org.openlcb.implementations.StreamTransmitterTest;
+
+/**
+ * @author Bob Jacobsen Copyright 2009, 2012
+ * @version $Revision$
+ */
+public class PackageTest extends TestCase {
+ public void testStart() {
+ }
+
+ // from here down is testing infrastructure
+
+ public PackageTest(String s) {
+ super(s);
+ }
+
+ // Main entry point
+ static public void main(String[] args) {
+ String[] testCaseName = {PackageTest.class.getName()};
+ junit.swingui.TestRunner.main(testCaseName);
+ }
+
+ // test suite from all defined tests
+ public static Test suite() {
+ TestSuite suite = new TestSuite(PackageTest.class);
+
+ suite.addTest(TractionControlRequestMessageTest.suite());
+
+ return suite;
+ }
+}
Added: trunk/prototypes/java/test/org/openlcb/messages/TractionControlRequestMessageTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/messages/TractionControlRequestMessageTest.java (rev 0)
+++ trunk/prototypes/java/test/org/openlcb/messages/TractionControlRequestMessageTest.java 2016-01-01 20:06:18 UTC (rev 3962)
@@ -0,0 +1,54 @@
+package org.openlcb.messages;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.openlcb.NodeID;
+import org.openlcb.Utilities;
+import org.openlcb.implementations.throttle.Float16;
+
+/**
+ * Created by bracz on 12/30/15.
+ */
+public class TractionControlRequestMessageTest extends TestCase {
+ protected NodeID src = new NodeID(new byte[]{6,5,5,4,4,3});
+ protected NodeID dst = new NodeID(new byte[]{2,2,2,4,4,4});
+
+ public void testGetSpeed() throws Exception {
+ double speed = 13.5;
+ TractionControlRequestMessage msg = TractionControlRequestMessage.createSetSpeed(src,
+ dst, true, speed);
+ assertEquals(0, msg.getCmd());
+ Float16 sp = msg.getSpeed();
+ assertEquals(13.5, sp.getFloat(), 0.01);
+ }
+
+ public void testAssignController() throws Exception {
+ TractionControlRequestMessage msg = TractionControlRequestMessage.createAssignController
+ (src,
+ dst);
+ byte[] payload = msg.getPayload();
+ assertEquals("20 01 00 06 05 05 04 04 03", Utilities.toHexSpaceString(payload));
+ assertEquals(src, msg.getSourceNodeID());
+ assertEquals(dst, msg.getDestNodeID());
+ }
+
+ // from here down is testing infrastructure
+
+ public TractionControlRequestMessageTest(String s) {
+ super(s);
+ }
+
+ // Main entry point
+ static public void main(String[] args) {
+ String[] testCaseName = {TractionControlRequestMessageTest.class.getName()};
+ junit.swingui.TestRunner.main(testCaseName);
+ }
+
+ // test suite from all defined tests
+ public static Test suite() {
+ TestSuite suite = new TestSuite(TractionControlRequestMessageTest.class);
+ return suite;
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dph...@us...> - 2016-01-06 22:42:07
|
Revision: 3977
http://sourceforge.net/p/openlcb/svn/3977
Author: dpharris
Date: 2016-01-06 22:42:04 +0000 (Wed, 06 Jan 2016)
Log Message:
-----------
Fix Stream tests
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java
trunk/prototypes/java/test/org/openlcb/can/MessageBuilderTest.java
trunk/prototypes/java/test/org/openlcb/implementations/StreamTransmitterTest.java
Modified: trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java 2016-01-03 13:30:08 UTC (rev 3976)
+++ trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java 2016-01-06 22:42:04 UTC (rev 3977)
@@ -252,7 +252,7 @@
retlist.add(new StreamInitiateRequestMessage(source,dest,content[2]<<8+content[3],content[4], content[5]));
return retlist;
case StreamInitiateReply:
- retlist.add(new StreamInitiateRequestMessage(source,dest,content[2]<<8+content[3],content[4], content[5]));
+ retlist.add(new StreamInitiateReplyMessage(source,dest,content[0]<<8+content[1],content[2], content[3]));
return retlist;
// case StreamData is Format 7
case StreamDataProceed:
Modified: trunk/prototypes/java/test/org/openlcb/can/MessageBuilderTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/can/MessageBuilderTest.java 2016-01-03 13:30:08 UTC (rev 3976)
+++ trunk/prototypes/java/test/org/openlcb/can/MessageBuilderTest.java 2016-01-06 22:42:04 UTC (rev 3977)
@@ -574,17 +574,17 @@
Assert.assertEquals("source", source, msg.getSourceNodeID());
Assert.assertEquals("destination", high, ((StreamInitiateRequestMessage)msg).getDestNodeID());
- Assert.assertEquals("max buffer ",6,f.getElement(0));
- Assert.assertEquals("flags ",0,f.getElement(1));
- Assert.assertEquals("sourceStreamID ",4,f.getElement(2));
+ Assert.assertEquals("max buffer ",6,(f.getElement(2)<<8)+f.getElement(3));
+ Assert.assertEquals("flags ",0,(f.getElement(4)<<8)+f.getElement(5));
+ Assert.assertEquals("sourceStreamID ",4,f.getElement(6));
}
public void testStreamInitiateReplyMessage() {
NodeID high = new NodeID(new byte[]{11,12,13,14,15,16});
map.insert(0x0FFF, high);
OpenLcbCanFrame f = new OpenLcbCanFrame(0x123);
f.setHeader(0x19868123);
- // dest(2), flags(2),sourceStream, destinationStream
- f.setData(new byte[]{(byte)0x0F, (byte)0xFF, 0, 0, 4, 6});
+ // dest(2), bufferesize(2), flags(2),sourceStream, destinationStream
+ f.setData(new byte[]{(byte)0x0F, (byte)0xFF, 0, 64, 0, 0, 4, 6});
MessageBuilder b = new MessageBuilder(map);
@@ -594,14 +594,15 @@
Message msg = list.get(0);
Assert.assertTrue(msg instanceof StreamInitiateReplyMessage);
- int[] data = ((DatagramMessage)msg).getData();
+ //int[] data = ((DatagramMessage)msg).getData();
Assert.assertEquals("source", source, msg.getSourceNodeID());
Assert.assertEquals("destination", high, ((StreamInitiateReplyMessage)msg).getDestNodeID());
- Assert.assertEquals("max buffer ",64,data[2]<<8+data[3]);
- Assert.assertEquals("flags ",0,data[4]<<8+data[5]);
- Assert.assertEquals("sourceStreamID ",4,data[6]);
- Assert.assertEquals("destinationStreamID ",6,data[7]);
+ Assert.assertEquals("max buffer ",64,(f.getElement(2)<<8)+f.getElement(3));
+ Assert.assertEquals("flags ",0,(f.getElement(4)<<8)+f.getElement(5));
+ Assert.assertEquals("sourceStreamID ",4,f.getElement(6));
+ Assert.assertEquals("destinationStreamID ",6,f.getElement(7));
}
+/*
public void testTwoStreamData() {
OpenLcbCanFrame frame = new OpenLcbCanFrame(0x123);
frame.setHeader(0x1F321123);
@@ -635,6 +636,7 @@
Assert.assertEquals(14,data[8]);
Assert.assertEquals(15,data[9]);
}
+ */
public void testStreamDataProceedMessage() {
NodeID high = new NodeID(new byte[]{11,12,13,14,15,16});
map.insert(0x0FFF, high);
@@ -651,12 +653,11 @@
Message msg = list.get(0);
Assert.assertTrue(msg instanceof StreamDataProceedMessage);
- int[] data = ((DatagramMessage)msg).getData();
Assert.assertEquals("source", source, msg.getSourceNodeID());
Assert.assertEquals("destination", high, ((StreamDataProceedMessage)msg).getDestNodeID());
- Assert.assertEquals("sourceStreamID ",data[2],4);
- Assert.assertEquals("destinationStreamID ",data[3],6);
- Assert.assertEquals("flags ",data[4]<<8+data[5],0);
+ Assert.assertEquals("sourceStreamID ",frame.getElement(2),4);
+ Assert.assertEquals("destinationStreamID ",frame.getElement(3),6);
+ Assert.assertEquals("flags ",(frame.getElement(4)<<8)+frame.getElement(5),0);
}
public void testStreamDataCompleteMessage() {
NodeID high = new NodeID(new byte[]{11,12,13,14,15,16});
@@ -674,12 +675,11 @@
Message msg = list.get(0);
Assert.assertTrue(msg instanceof StreamDataCompleteMessage);
- int[] data = ((DatagramMessage)msg).getData();
Assert.assertEquals("source", source, msg.getSourceNodeID());
Assert.assertEquals("destination", high, ((StreamDataCompleteMessage)msg).getDestNodeID());
- Assert.assertEquals("sourceStreamID ",data[2],4);
- Assert.assertEquals("destinationStreamID ",data[3],6);
- Assert.assertEquals("flags ",data[4]<<8+data[5],0);
+ Assert.assertEquals("sourceStreamID ",frame.getElement(2),4);
+ Assert.assertEquals("destinationStreamID ",frame.getElement(3),6);
+ Assert.assertEquals("flags ",(frame.getElement(4)<<8)+frame.getElement(5),0);
}
Modified: trunk/prototypes/java/test/org/openlcb/implementations/StreamTransmitterTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/StreamTransmitterTest.java 2016-01-03 13:30:08 UTC (rev 3976)
+++ trunk/prototypes/java/test/org/openlcb/implementations/StreamTransmitterTest.java 2016-01-06 22:42:04 UTC (rev 3977)
@@ -34,7 +34,7 @@
Assert.assertTrue(messagesReceived.size() == 1); // startup message
Assert.assertTrue(messagesReceived.get(0)
- .equals(new StreamInitiateRequestMessage(hereID, farID, 64, (byte)0, (byte)0)));
+ .equals(new StreamInitiateRequestMessage(hereID, farID, 64, (byte)4, (byte)0)));
}
public void testShortStream() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2016-01-09 04:06:56
|
Revision: 3986
http://sourceforge.net/p/openlcb/svn/3986
Author: bracz
Date: 2016-01-09 04:06:53 +0000 (Sat, 09 Jan 2016)
Log Message:
-----------
Adds differentiation of various producer identified and consumer identified messages by the Event State.
Updates unit tests as well.
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/ConsumerIdentifiedMessage.java
trunk/prototypes/java/src/org/openlcb/ProducerIdentifiedMessage.java
trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java
trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java
trunk/prototypes/java/src/org/openlcb/implementations/SingleConsumerNode.java
trunk/prototypes/java/src/org/openlcb/implementations/SingleProducerNode.java
trunk/prototypes/java/test/org/openlcb/ConsumerIdentifiedMessageTest.java
trunk/prototypes/java/test/org/openlcb/MimicNodeStoreTest.java
trunk/prototypes/java/test/org/openlcb/ProducerIdentifiedMessageTest.java
trunk/prototypes/java/test/org/openlcb/implementations/EventFilterGatewayTest.java
trunk/prototypes/java/test/org/openlcb/implementations/SingleConsumerNodeTest.java
trunk/prototypes/java/test/org/openlcb/implementations/SingleProducerNodeTest.java
trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeCacheTest.java
trunk/prototypes/java/test/org/openlcb/swing/networktree/TreePaneTest.java
Added Paths:
-----------
trunk/prototypes/java/src/org/openlcb/EventState.java
Modified: trunk/prototypes/java/src/org/openlcb/ConsumerIdentifiedMessage.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/ConsumerIdentifiedMessage.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/src/org/openlcb/ConsumerIdentifiedMessage.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -14,21 +14,25 @@
@ThreadSafe
public class ConsumerIdentifiedMessage extends Message {
- public ConsumerIdentifiedMessage(NodeID source, EventID eventID) {
+ public ConsumerIdentifiedMessage(NodeID source, EventID eventID, EventState eventState) {
super(source);
if (eventID == null)
throw new IllegalArgumentException("EventID cannot be null");
this.eventID = eventID;
+ this.eventState = eventState;
}
@SuppressWarnings("JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS")
EventID eventID;
+ private final EventState eventState;
// because EventID is immutable, can directly return object
public EventID getEventID() {
return eventID;
}
-
+
+ public EventState getEventState() { return eventState; }
+
/**
* Implement message-type-specific
* processing when this message
@@ -58,8 +62,7 @@
@Override
public String toString() {
- return super.toString()
- +" Consumer Identified for "+eventID.toString();
+ return super.toString() + " Consumer Identified " + eventState.toString() + " for "+eventID.toString();
}
public int getMTI() { return MTI_CONSUMER_IDENTIFIED; }
Added: trunk/prototypes/java/src/org/openlcb/EventState.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/EventState.java (rev 0)
+++ trunk/prototypes/java/src/org/openlcb/EventState.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -0,0 +1,43 @@
+package org.openlcb;
+
+/**
+ * Created by bracz on 1/6/16.
+ */
+public enum EventState {
+ Valid (0),
+ Invalid (1),
+ Unknown (3),
+ Reserved (2);
+
+ private final int modifier;
+
+ EventState(int modifier) {
+ this.modifier = modifier;
+ }
+
+ public int getModifier() {
+ return modifier;
+ }
+
+ public MessageTypeIdentifier getProducerIdentifierMti() {
+ int rawMti = MessageTypeIdentifier.ProducerIdentifiedValid.mti();
+ rawMti &= ~3;
+ rawMti |= modifier;
+ return MessageTypeIdentifier.get(rawMti);
+ }
+
+ public MessageTypeIdentifier getConsumerIdentifierMti() {
+ int rawMti = MessageTypeIdentifier.ConsumerIdentifiedValid.mti();
+ rawMti &= ~3;
+ rawMti |= modifier;
+ return MessageTypeIdentifier.get(rawMti);
+ }
+
+ public EventState inverted() {
+ switch(this) {
+ case Valid: return Invalid;
+ case Invalid: return Valid;
+ default: return this;
+ }
+ }
+}
Modified: trunk/prototypes/java/src/org/openlcb/ProducerIdentifiedMessage.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/ProducerIdentifiedMessage.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/src/org/openlcb/ProducerIdentifiedMessage.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -13,21 +13,25 @@
@Immutable
@ThreadSafe
public class ProducerIdentifiedMessage extends Message {
-
- public ProducerIdentifiedMessage(NodeID source, EventID eventID) {
+
+ public ProducerIdentifiedMessage(NodeID source, EventID eventID, EventState eventState) {
super(source);
if (eventID == null)
throw new IllegalArgumentException("EventID cannot be null");
this.eventID = eventID;
+ this.eventState = eventState;
}
- EventID eventID;
+ private final EventID eventID;
+ private final EventState eventState;
// because EventID is immutable, can directly return object
public EventID getEventID() {
return eventID;
}
-
+
+ public EventState getEventState() { return eventState; }
+
/**
* Implement message-type-specific
* processing when this message
@@ -43,12 +47,12 @@
public boolean equals(Object o) {
if (!super.equals(o)) return false;
ProducerIdentifiedMessage p = (ProducerIdentifiedMessage) o;
- return eventID.equals(p.eventID);
+ if (!eventID.equals(p.eventID)) return false;
+ return eventState == p.eventState;
}
public String toString() {
- return super.toString()
- +" Producer Identified for "+eventID.toString();
+ return super.toString() + " Producer Identified " + eventState.toString() + " for " + eventID.toString();
}
public int getMTI() { return MTI_PRODUCER_IDENTIFIED; }
Modified: trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/src/org/openlcb/can/MessageBuilder.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -214,18 +214,26 @@
retlist.add(new IdentifyConsumersMessage(source, getEventID(f)));
return retlist;
case ConsumerIdentifiedUnknown:
- case ConsumerIdentifiedValid:
- case ConsumerIdentifiedInvalid:
- retlist.add(new ConsumerIdentifiedMessage(source, getEventID(f)));
+ retlist.add(new ConsumerIdentifiedMessage(source, getEventID(f), EventState.Unknown));
return retlist;
+ case ConsumerIdentifiedValid:
+ retlist.add(new ConsumerIdentifiedMessage(source, getEventID(f), EventState.Valid));
+ return retlist;
+ case ConsumerIdentifiedInvalid:
+ retlist.add(new ConsumerIdentifiedMessage(source, getEventID(f), EventState.Invalid));
+ return retlist;
case IdentifyProducer:
retlist.add(new IdentifyProducersMessage(source, getEventID(f)));
return retlist;
- case ProducerIdentifiedUnknown:
- case ProducerIdentifiedValid:
- case ProducerIdentifiedInvalid:
- retlist.add(new ProducerIdentifiedMessage(source, getEventID(f)));
+ case ProducerIdentifiedUnknown:
+ retlist.add(new ProducerIdentifiedMessage(source, getEventID(f), EventState.Unknown));
return retlist;
+ case ProducerIdentifiedValid:
+ retlist.add(new ProducerIdentifiedMessage(source, getEventID(f), EventState.Valid));
+ return retlist;
+ case ProducerIdentifiedInvalid:
+ retlist.add(new ProducerIdentifiedMessage(source, getEventID(f), EventState.Invalid));
+ return retlist;
case ProducerConsumerEventReport:
retlist.add(new ProducerConsumerEventReportMessage(source, getEventID(f)));
return retlist;
Modified: trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -1,8 +1,11 @@
package org.openlcb.implementations;
-import org.openlcb.AbstractConnection;
import org.openlcb.Connection;
+import org.openlcb.ConsumerIdentifiedMessage;
import org.openlcb.EventID;
+import org.openlcb.EventState;
+import org.openlcb.IdentifyConsumersMessage;
+import org.openlcb.IdentifyProducersMessage;
import org.openlcb.Message;
import org.openlcb.MessageDecoder;
import org.openlcb.OlcbInterface;
@@ -10,13 +13,14 @@
/**
* Maintains a bit represented by two event IDs: one off, one on.
- *
+ * <p/>
* Created by bracz on 1/6/16.
*/
public class BitProducerConsumer extends MessageDecoder {
private final EventID eventOn;
private final EventID eventOff;
private final OlcbInterface iface;
+ private VersionedValue<Boolean> value = null;
public BitProducerConsumer(OlcbInterface iface, EventID eventOn, EventID eventOff) {
this.iface = iface;
@@ -31,12 +35,36 @@
});
}
+ private EventState getOnEventState() {
+ if (value == null) return EventState.Unknown;
+ if (value.getLatestData()) return EventState.Valid;
+ return EventState.Invalid;
+ }
+
+ private EventState getOffEventState() {
+ return getOnEventState().inverted();
+ }
+
private void sendIdentifiedMessages(boolean queryState) {
Message msg;
- msg = new ProducerIdentifiedMessage(iface.getNodeId(), eventOn);
-
+ msg = new ProducerIdentifiedMessage(iface.getNodeId(), eventOn, getOnEventState());
+ iface.getOutputConnection().put(msg, this);
+ msg = new ProducerIdentifiedMessage(iface.getNodeId(), eventOff, getOffEventState());
+ iface.getOutputConnection().put(msg, this);
+ msg = new ConsumerIdentifiedMessage(iface.getNodeId(), eventOn, getOnEventState());
+ iface.getOutputConnection().put(msg, this);
+ msg = new ConsumerIdentifiedMessage(iface.getNodeId(), eventOff, getOffEventState());
+ iface.getOutputConnection().put(msg, this);
+ if (queryState) {
+ msg = new IdentifyProducersMessage(iface.getNodeId(), eventOn);
+ iface.getOutputConnection().put(msg, this);
+ msg = new IdentifyConsumersMessage(iface.getNodeId(), eventOn);
+ iface.getOutputConnection().put(msg, this);
+ }
}
+
+
public void release() {
iface.unRegisterMessageListener(this);
}
Modified: trunk/prototypes/java/src/org/openlcb/implementations/SingleConsumerNode.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/SingleConsumerNode.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/src/org/openlcb/implementations/SingleConsumerNode.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -34,7 +34,7 @@
public void initialize() {
super.initialize();
// announce which event is being sent
- connection.put(new ConsumerIdentifiedMessage(nodeID, eventID), this);
+ connection.put(new ConsumerIdentifiedMessage(nodeID, eventID, EventState.Unknown), this);
}
/**
Modified: trunk/prototypes/java/src/org/openlcb/implementations/SingleProducerNode.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/SingleProducerNode.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/src/org/openlcb/implementations/SingleProducerNode.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -30,7 +30,7 @@
public void initialize() {
super.initialize();
// announce which event is being sent
- connection.put(new ProducerIdentifiedMessage(nodeID, eventID), this);
+ connection.put(new ProducerIdentifiedMessage(nodeID, eventID, EventState.Unknown), this);
}
/**
Modified: trunk/prototypes/java/test/org/openlcb/ConsumerIdentifiedMessageTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/ConsumerIdentifiedMessageTest.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/test/org/openlcb/ConsumerIdentifiedMessageTest.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -20,32 +20,40 @@
public void testEqualsSame() {
Message m1 = new ConsumerIdentifiedMessage(
- nodeID1, eventID1 );
+ nodeID1, eventID1, EventState.Valid);
Message m2 = new ConsumerIdentifiedMessage(
- nodeID1, eventID1 );
+ nodeID1, eventID1, EventState.Valid);
Assert.assertTrue(m1.equals(m2));
}
public void testNotEqualsDifferentNode() {
Message m1 = new ConsumerIdentifiedMessage(
- nodeID1, eventID1 );
+ nodeID1, eventID1, EventState.Valid);
Message m2 = new ConsumerIdentifiedMessage(
- nodeID2, eventID1 );
+ nodeID2, eventID1, EventState.Valid);
Assert.assertTrue( ! m1.equals(m2));
}
public void testNotEqualsDifferentEvent() {
Message m1 = new ConsumerIdentifiedMessage(
- nodeID1, eventID1 );
+ nodeID1, eventID1, EventState.Valid);
Message m2 = new ConsumerIdentifiedMessage(
- nodeID1, eventID2 );
+ nodeID1, eventID2, EventState.Valid);
Assert.assertTrue( ! m1.equals(m2));
}
+ public void testNotEqualsDifferentState() {
+ Message m1 = new ConsumerIdentifiedMessage(
+ nodeID1, eventID1, EventState.Valid);
+ Message m2 = new ConsumerIdentifiedMessage(
+ nodeID1, eventID2, EventState.Unknown);
+ Assert.assertTrue( ! m1.equals(m2));
+ }
+
public void testHandling() {
result = false;
Node n = new Node(){
@@ -56,7 +64,7 @@
};
Message m = new ConsumerIdentifiedMessage(
new NodeID(new byte[]{1,2,3,4,5,6}),
- eventID1 );
+ eventID1, EventState.Unknown);
n.put(m, null);
Modified: trunk/prototypes/java/test/org/openlcb/MimicNodeStoreTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/MimicNodeStoreTest.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/test/org/openlcb/MimicNodeStoreTest.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -19,10 +19,10 @@
NodeID nid2 = new NodeID(new byte[]{2,3,3,4,5,6});
ProducerIdentifiedMessage pim1 = new ProducerIdentifiedMessage(nid1,
- new EventID(new byte[]{1,0,0,0,0,0,1,0}));
+ new EventID(new byte[]{1,0,0,0,0,0,1,0}), EventState.Unknown);
ProducerIdentifiedMessage pim2 = new ProducerIdentifiedMessage(nid2,
- new EventID(new byte[]{1,0,0,0,0,0,1,0}));
+ new EventID(new byte[]{1,0,0,0,0,0,1,0}), EventState.Unknown);
SimpleNodeIdentInfoReplyMessage snii1 = new SimpleNodeIdentInfoReplyMessage(nid1, nid2,
new byte[]{1,'a','b','c'});
Modified: trunk/prototypes/java/test/org/openlcb/ProducerIdentifiedMessageTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/ProducerIdentifiedMessageTest.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/test/org/openlcb/ProducerIdentifiedMessageTest.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -20,32 +20,40 @@
public void testEqualsSame() {
Message m1 = new ProducerIdentifiedMessage(
- nodeID1, eventID1 );
+ nodeID1, eventID1, EventState.Valid);
Message m2 = new ProducerIdentifiedMessage(
- nodeID1, eventID1 );
+ nodeID1, eventID1, EventState.Valid);
Assert.assertTrue(m1.equals(m2));
}
public void testNotEqualsDifferentNode() {
Message m1 = new ProducerIdentifiedMessage(
- nodeID1, eventID1 );
+ nodeID1, eventID1, EventState.Valid );
Message m2 = new ProducerIdentifiedMessage(
- nodeID2, eventID1 );
+ nodeID2, eventID1, EventState.Valid );
Assert.assertTrue( ! m1.equals(m2));
}
public void testNotEqualsDifferentEvent() {
Message m1 = new ProducerIdentifiedMessage(
- nodeID1, eventID1 );
+ nodeID1, eventID1, EventState.Valid );
Message m2 = new ProducerIdentifiedMessage(
- nodeID1, eventID2 );
+ nodeID1, eventID2, EventState.Valid );
Assert.assertTrue( ! m1.equals(m2));
}
+ public void testNotEqualsDifferentState() {
+ Message m1 = new ProducerIdentifiedMessage(
+ nodeID1, eventID1, EventState.Valid );
+ Message m2 = new ProducerIdentifiedMessage(
+ nodeID1, eventID1, EventState.Unknown );
+ Assert.assertTrue( ! m1.equals(m2));
+ }
+
public void testHandling() {
result = false;
Node n = new Node(){
@@ -54,7 +62,7 @@
result = true;
}
};
- Message m = new ProducerIdentifiedMessage(nodeID1, eventID1);
+ Message m = new ProducerIdentifiedMessage(nodeID1, eventID1, EventState.Valid);
n.put(m, null);
Modified: trunk/prototypes/java/test/org/openlcb/implementations/EventFilterGatewayTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/EventFilterGatewayTest.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/test/org/openlcb/implementations/EventFilterGatewayTest.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -54,7 +54,7 @@
public void testReqEventPassesEtoW() {
buildGateway();
- Message m1 = new ConsumerIdentifiedMessage(node2, eventA);
+ Message m1 = new ConsumerIdentifiedMessage(node2, eventA, EventState.Unknown);
cW.put(m1, tW);
checkMovedWestToEastOnly();
@@ -66,7 +66,7 @@
public void testReqEventPassesWtoE() {
buildGateway();
- Message m1 = new ConsumerIdentifiedMessage(node2, eventA);
+ Message m1 = new ConsumerIdentifiedMessage(node2, eventA, EventState.Unknown);
cE.put(m1, tE);
checkMovedEastToWestOnly();
Modified: trunk/prototypes/java/test/org/openlcb/implementations/SingleConsumerNodeTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/SingleConsumerNodeTest.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/test/org/openlcb/implementations/SingleConsumerNodeTest.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -41,7 +41,7 @@
Assert.assertTrue(messagesReceived.get(0)
.equals(new InitializationCompleteMessage(nodeID)));
Assert.assertTrue(messagesReceived.get(1)
- .equals(new ConsumerIdentifiedMessage(nodeID, eventID)));
+ .equals(new ConsumerIdentifiedMessage(nodeID, eventID, EventState.Unknown)));
}
public void testConsumeRight() {
Modified: trunk/prototypes/java/test/org/openlcb/implementations/SingleProducerNodeTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/SingleProducerNodeTest.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/test/org/openlcb/implementations/SingleProducerNodeTest.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -39,7 +39,7 @@
Assert.assertTrue(messagesReceived.get(0)
.equals(new InitializationCompleteMessage(nodeID)));
Assert.assertTrue(messagesReceived.get(1)
- .equals(new ProducerIdentifiedMessage(nodeID, eventID)));
+ .equals(new ProducerIdentifiedMessage(nodeID, eventID, EventState.Unknown)));
}
public void testSend() {
@@ -60,7 +60,7 @@
Assert.assertTrue(messagesReceived.get(0)
.equals(new InitializationCompleteMessage(nodeID)));
Assert.assertTrue(messagesReceived.get(1)
- .equals(new ProducerIdentifiedMessage(nodeID, eventID)));
+ .equals(new ProducerIdentifiedMessage(nodeID, eventID, EventState.Unknown)));
node.send();
Assert.assertTrue(messagesReceived.get(2)
.equals(new ProducerConsumerEventReportMessage(nodeID, eventID)));
Modified: trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeCacheTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeCacheTest.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/test/org/openlcb/implementations/throttle/RemoteTrainNodeCacheTest.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -7,6 +7,7 @@
import org.openlcb.CommonIdentifiers;
import org.openlcb.EventID;
+import org.openlcb.EventState;
import org.openlcb.FakeOlcbInterface;
import org.openlcb.Message;
import org.openlcb.NodeID;
@@ -90,13 +91,13 @@
Assert.assertEquals(1, cache.getList().size());
m = new ProducerIdentifiedMessage(new NodeID(new byte[]{1, 1, 0, 0, 4, 4}),
- CommonIdentifiers.IS_TRAIN);
+ CommonIdentifiers.IS_TRAIN, EventState.Unknown);
cache.put(m, null);
Assert.assertEquals(1, cache.getList().size());
m = new ProducerIdentifiedMessage(new NodeID(new byte[]{1, 1, 0, 0, 4, 5}), new EventID
- ("01.01.00.00.00.00.03.03"));
+ ("01.01.00.00.00.00.03.03"), EventState.Unknown);
cache.put(m, null);
Assert.assertEquals(2, cache.getList().size());
Modified: trunk/prototypes/java/test/org/openlcb/swing/networktree/TreePaneTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/swing/networktree/TreePaneTest.java 2016-01-09 04:06:32 UTC (rev 3985)
+++ trunk/prototypes/java/test/org/openlcb/swing/networktree/TreePaneTest.java 2016-01-09 04:06:53 UTC (rev 3986)
@@ -52,7 +52,7 @@
public void setUp() throws Exception {
store = new MimicNodeStore(connection, nid1);
- Message msg = new ProducerIdentifiedMessage(nid1, eventA);
+ Message msg = new ProducerIdentifiedMessage(nid1, eventA, EventState.Unknown);
store.put(msg, null);
// Test is really popping a window before doing all else
@@ -87,14 +87,14 @@
public void testAfterMessage() {
frame.setTitle("After Message");
- Message msg = new ProducerIdentifiedMessage(nid2, eventA);
+ Message msg = new ProducerIdentifiedMessage(nid2, eventA, EventState.Unknown);
store.put(msg, null);
}
public void testWithProtocolID() {
frame.setTitle("2nd has protocol id");
Message msg;
- msg = new ProducerIdentifiedMessage(nid2, eventA);
+ msg = new ProducerIdentifiedMessage(nid2, eventA, EventState.Unknown);
store.put(msg, null);
store.put(pipmsg, null);
}
@@ -102,7 +102,7 @@
public void testWith1stSNII() {
frame.setTitle("3rd has PIP && 1st SNII");
Message msg;
- msg = new ProducerIdentifiedMessage(nid2, eventA);
+ msg = new ProducerIdentifiedMessage(nid2, eventA, EventState.Unknown);
store.put(msg, null);
store.put(pipmsg, null);
@@ -132,7 +132,7 @@
}
});
Message msg;
- msg = new ProducerIdentifiedMessage(nid2, eventA);
+ msg = new ProducerIdentifiedMessage(nid2, eventA, EventState.Unknown);
store.put(msg, null);
store.put(pipmsg, null);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2016-01-09 04:07:31
|
Revision: 3988
http://sourceforge.net/p/openlcb/svn/3988
Author: bracz
Date: 2016-01-09 04:07:29 +0000 (Sat, 09 Jan 2016)
Log Message:
-----------
Adds a gridconnect parser, formatter to the CAN package and tests for them.
Modified Paths:
--------------
trunk/prototypes/java/test/org/openlcb/can/PackageTest.java
Added Paths:
-----------
trunk/prototypes/java/src/org/openlcb/can/GridConnect.java
trunk/prototypes/java/test/org/openlcb/can/GridConnectTest.java
Added: trunk/prototypes/java/src/org/openlcb/can/GridConnect.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/can/GridConnect.java (rev 0)
+++ trunk/prototypes/java/src/org/openlcb/can/GridConnect.java 2016-01-09 04:07:29 UTC (rev 3988)
@@ -0,0 +1,230 @@
+package org.openlcb.can;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+/**
+ * Created by bracz on 1/8/16.
+ */
+public class GridConnect {
+ private static Logger logger = Logger.getLogger(new Object() {
+ }.getClass().getSuperclass()
+ .getName());
+
+ public static String format(CanFrame frame) {
+ StringBuilder b = new StringBuilder();
+ if (frame.isExtended()) {
+ b.append(String.format(":X%08X", frame.getHeader()));
+ } else {
+ b.append(String.format(":S%03X", frame.getHeader()));
+ }
+ if (frame.isRtr()) {
+ b.append('R');
+ } else {
+ b.append('N');
+ }
+ if (frame.getNumDataElements() > 8) {
+ logger.warning("Output frame with too many data elements: " + Integer.toString(frame
+ .getNumDataElements()));
+ }
+ for (int i = 0; i < frame.getNumDataElements(); ++i) {
+ b.append(String.format("%02X", frame.getElement(i) & 0xff));
+ }
+ b.append(';');
+ return b.toString();
+ }
+
+ public static List<CanFrame> parse(String data) {
+ final List<CanFrame> l = new ArrayList<>();
+ Input parser = new Input() {
+ @Override
+ public void onFrame(CanFrame f) {
+ l.add(f);
+ }
+ };
+ parser.send(data);
+ return l;
+ }
+
+ enum InputState {
+ NOPACKET,
+ EXTENDED,
+ HEADER,
+ REMOTE,
+ BODYHI_OR_END,
+ BODYLO
+ }
+
+ public static abstract class Input {
+ private boolean isExtended;
+ private int header;
+ private boolean isRtr;
+ private InputState state = InputState.NOPACKET;
+ private ArrayList<Byte> data = new ArrayList<>(8);
+
+ private byte currData;
+
+ public void send(String data) {
+ for (int i = 0; i < data.length(); ++i) {
+ send(data.charAt(i));
+ }
+ }
+
+ public void send(char c) {
+ while (true) {
+ switch (state) {
+ case NOPACKET: {
+ if (c == ':') {
+ state = InputState.EXTENDED;
+ }
+ return;
+ }
+ case EXTENDED: {
+ if (c == 'X') {
+ isExtended = true;
+ } else if (c == 'S') {
+ isExtended = false;
+ } else {
+ // Unknown message type character.
+ logger.fine("Unknown gridconnect type character: " + c);
+ state = InputState.NOPACKET;
+ return;
+ }
+ state = InputState.HEADER;
+ header = 0;
+ return;
+ }
+ case HEADER: {
+ int dvalue = Character.digit(c, 16);
+ if (dvalue >= 0) {
+ header <<= 4;
+ header |= dvalue;
+ return;
+ } else {
+ state = InputState.REMOTE;
+ continue;
+ }
+ }
+ case REMOTE: {
+ if (c == 'N') {
+ isRtr = false;
+ } else if (c == 'R') {
+ isRtr = true;
+ } else {
+ // Unknown message format.
+ logger.fine("Unknown gridconnect remote character: " + c);
+ state = InputState.NOPACKET;
+ continue;
+ }
+ state = InputState.BODYHI_OR_END;
+ data.clear();
+ return;
+ }
+ case BODYHI_OR_END: {
+ if (c == ';') {
+ // End of frame.
+ onFrame(new RawCanFrame(isExtended, header, isRtr, data));
+ state = InputState.NOPACKET;
+ return;
+ }
+ int dvalue = Character.digit(c, 16);
+ if (dvalue < 0) {
+ logger.fine("Unknown gridconnect data character: " + c);
+ state = InputState.NOPACKET;
+ continue;
+ }
+ currData = (byte) (dvalue << 4);
+ state = InputState.BODYLO;
+ return;
+ }
+ case BODYLO: {
+ int dvalue = Character.digit(c, 16);
+ if (dvalue < 0) {
+ logger.fine("Unknown gridconnect data character: " + c);
+ state = InputState.NOPACKET;
+ continue;
+ }
+ currData |= (dvalue & 0xf);
+ data.add(currData);
+ state = InputState.BODYHI_OR_END;
+ return;
+ }
+ }
+ }
+ }
+
+ public abstract void onFrame(CanFrame f);
+ }
+
+ static class RawCanFrame implements CanFrame {
+
+ private boolean isExtended;
+ private boolean isRtr;
+ private int header;
+ private int len;
+ private byte[] data;
+
+ public RawCanFrame(boolean isExtended, int header, boolean isRtr, ArrayList<Byte> data) {
+ this.isExtended = isExtended;
+ this.header = header;
+ this.isRtr = isRtr;
+ this.len = data.size();
+ this.data = new byte[this.len];
+ for (int i = 0; i < len; ++i) {
+ this.data[i] = data.get(i);
+ }
+ }
+
+ @Override
+ public int getHeader() {
+ return header;
+ }
+
+ @Override
+ public boolean isExtended() {
+ return this.isExtended;
+ }
+
+ @Override
+ public boolean isRtr() {
+ return this.isRtr;
+ }
+
+ @Override
+ public int getNumDataElements() {
+ return len;
+ }
+
+ @Override
+ public int getElement(int n) {
+ return data[n];
+ }
+
+ @Override
+ public long bodyAsLong() {
+ long retval = 0;
+ for (int i = 0; i < data.length; i++) {
+ retval = retval << 8 | (data[i] & 0xFF);
+ }
+ return retval;
+ }
+
+ @Override
+ public long dataAsLong() {
+ long retval = 0;
+ for (int i = 2; i < data.length; i++) {
+ retval = retval << 8 | (data[i] & 0xFF);
+ }
+ return retval;
+ }
+
+ @Override
+ public byte[] getData() {
+ byte[] b = new byte[len];
+ System.arraycopy(data, 0, b, 0, len);
+ return b;
+ }
+ }
+
+}
Added: trunk/prototypes/java/test/org/openlcb/can/GridConnectTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/can/GridConnectTest.java (rev 0)
+++ trunk/prototypes/java/test/org/openlcb/can/GridConnectTest.java 2016-01-09 04:07:29 UTC (rev 3988)
@@ -0,0 +1,56 @@
+package org.openlcb.can;
+
+import junit.framework.TestCase;
+
+import org.openlcb.Utilities;
+
+import java.util.List;
+
+/**
+ * Created by bracz on 1/8/16.
+ */
+public class GridConnectTest extends TestCase {
+
+ public void testFormat() throws Exception {
+ assertEquals(":X195B4123N01020304;", getCanonical(":X195B4123N01020304;"));
+ assertEquals(":X195B4123N;", getCanonical(":X195B4123N;"));
+ assertEquals(":X00000123N;", getCanonical(":X123N;"));
+ assertEquals(":S123NFFFEFD80;", getCanonical(":S123NFFFEFD80;"));
+ assertEquals(":X195B4123N0102030405060708;", getCanonical(":X195b4123N0102030405060708;"));
+ }
+
+ private void assertFrame(CanFrame f, int header, boolean isExtended, boolean isRtr, byte[]
+ data) {
+ assertEquals("isExtended", isExtended, f.isExtended());
+ assertEquals("isRtr", isRtr, f.isRtr());
+ assertEquals("header", header, f.getHeader());
+ assertEquals(data.length, f.getNumDataElements());
+ assertEquals(Utilities.toHexSpaceString(data), Utilities.toHexSpaceString(f.getData()));
+ for (int i = 0; i < data.length; ++i) {
+ assertEquals(data[i], f.getElement(i));
+ }
+ }
+
+ private void assertParse(String fmt, int header, boolean isExtended, boolean isRtr, byte[]
+ data) {
+ List<CanFrame> l = GridConnect.parse(fmt);
+ assertEquals(1, l.size());
+ CanFrame f = l.get(0);
+ assertFrame(f, header, isExtended, isRtr, data);
+ }
+
+ private String getCanonical(String orig) {
+ List<CanFrame> l = GridConnect.parse(orig);
+ assertEquals(1, l.size());
+ CanFrame f = l.get(0);
+ return GridConnect.format(f);
+ }
+
+ public void testParse() throws Exception {
+ assertParse(":X195B4123N01020304;", 0x195b4123, true, false, new byte[]{1, 2, 3, 4});
+ assertParse(":X195B4123N;", 0x195b4123, true, false, new byte[0]);
+ assertParse(":S121Nffffff;", 0x121, false, false, new byte[]{(byte) 255, (byte) 255,
+ (byte) 255});
+ assertParse(":S121Nffffff;", 0x121, false, false, new byte[]{-1, -1, -1});
+ }
+}
\ No newline at end of file
Modified: trunk/prototypes/java/test/org/openlcb/can/PackageTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/can/PackageTest.java 2016-01-09 04:07:11 UTC (rev 3987)
+++ trunk/prototypes/java/test/org/openlcb/can/PackageTest.java 2016-01-09 04:07:29 UTC (rev 3988)
@@ -34,6 +34,7 @@
suite.addTest(NIDaTest.suite());
suite.addTest(NIDaAlgorithmTest.suite());
suite.addTest(AliasMapTest.suite());
+ suite.addTest(new TestSuite(GridConnectTest.class));
return suite;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2016-01-09 04:07:49
|
Revision: 3989
http://sourceforge.net/p/openlcb/svn/3989
Author: bracz
Date: 2016-01-09 04:07:47 +0000 (Sat, 09 Jan 2016)
Log Message:
-----------
Finishes implementation of BitProducerConsumer and adds empty test.
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java
Added Paths:
-----------
trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java
Modified: trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java 2016-01-09 04:07:29 UTC (rev 3988)
+++ trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java 2016-01-09 04:07:47 UTC (rev 3989)
@@ -5,10 +5,12 @@
import org.openlcb.EventID;
import org.openlcb.EventState;
import org.openlcb.IdentifyConsumersMessage;
+import org.openlcb.IdentifyEventsMessage;
import org.openlcb.IdentifyProducersMessage;
import org.openlcb.Message;
import org.openlcb.MessageDecoder;
import org.openlcb.OlcbInterface;
+import org.openlcb.ProducerConsumerEventReportMessage;
import org.openlcb.ProducerIdentifiedMessage;
/**
@@ -21,6 +23,7 @@
private final EventID eventOff;
private final OlcbInterface iface;
private VersionedValue<Boolean> value = null;
+ private VersionedValueListener<Boolean> valueListener = null;
public BitProducerConsumer(OlcbInterface iface, EventID eventOn, EventID eventOff) {
this.iface = iface;
@@ -45,6 +48,12 @@
return getOnEventState().inverted();
}
+ private EventState getEventState(EventID event) {
+ if (event.equals(eventOn)) return getOnEventState();
+ if (event.equals(eventOff)) return getOffEventState();
+ return null;
+ }
+
private void sendIdentifiedMessages(boolean queryState) {
Message msg;
msg = new ProducerIdentifiedMessage(iface.getNodeId(), eventOn, getOnEventState());
@@ -63,11 +72,98 @@
}
}
-
-
public void release() {
iface.unRegisterMessageListener(this);
}
+ @Override
+ public void handleIdentifyConsumers(IdentifyConsumersMessage msg, Connection sender) {
+ EventState st = getEventState(msg.getEventID());
+ if (st != null) {
+ Message m = new ConsumerIdentifiedMessage(iface.getNodeId(), msg.getEventID(), st);
+ iface.getOutputConnection().put(m, this);
+ }
+ }
+ @Override
+ public void handleIdentifyProducers(IdentifyProducersMessage msg, Connection sender) {
+ EventState st = getEventState(msg.getEventID());
+ if (st != null) {
+ Message m = new ProducerIdentifiedMessage(iface.getNodeId(), msg.getEventID(), st);
+ iface.getOutputConnection().put(m, this);
+ }
+ }
+
+ @Override
+ public void handleProducerIdentified(ProducerIdentifiedMessage msg, Connection sender) {
+ boolean isOn;
+ if (msg.getEventID().equals(eventOn)) {
+ isOn = true;
+ } else if (msg.getEventID().equals(eventOff)) {
+ isOn = false;
+ } else {
+ return;
+ }
+ if (msg.getEventState().equals(EventState.Valid)) {
+ setValueFromNetwork(isOn);
+ } else if (msg.getEventState().equals(EventState.Invalid)) {
+ setValueFromNetwork(!isOn);
+ }
+ }
+
+ @Override
+ public void handleConsumerIdentified(ConsumerIdentifiedMessage msg, Connection sender) {
+ boolean isOn;
+ if (msg.getEventID().equals(eventOn)) {
+ isOn = true;
+ } else if (msg.getEventID().equals(eventOff)) {
+ isOn = false;
+ } else {
+ return;
+ }
+ if (msg.getEventState().equals(EventState.Valid)) {
+ setValueFromNetwork(isOn);
+ } else if (msg.getEventState().equals(EventState.Invalid)) {
+ setValueFromNetwork(!isOn);
+ }
+ }
+
+ @Override
+ public void handleProducerConsumerEventReport(ProducerConsumerEventReportMessage msg,
+ Connection sender) {
+ boolean isOn;
+ if (msg.getEventID().equals(eventOn)) {
+ isOn = true;
+ } else if (msg.getEventID().equals(eventOff)) {
+ isOn = false;
+ } else {
+ return;
+ }
+ setValueFromNetwork(isOn);
+ }
+
+ @Override
+ public void handleIdentifyEvents(IdentifyEventsMessage msg, Connection sender) {
+ if (msg.getDestNodeID().equals(iface.getNodeId())) {
+ sendIdentifiedMessages(false);
+ }
+ }
+
+ private void setValueFromNetwork(boolean isOn) {
+ synchronized (this) {
+ if (value == null) {
+ value = new VersionedValue<>(isOn);
+ valueListener = new VersionedValueListener<Boolean>(value) {
+ @Override
+ public void update(Boolean newValue) {
+ Message msg = new ProducerConsumerEventReportMessage(iface.getNodeId(),
+ newValue ? eventOn : eventOff);
+ iface.getOutputConnection().put(msg, BitProducerConsumer.this);
+ }
+ };
+ return;
+ }
+ }
+ valueListener.setFromOwner(isOn);
+ }
}
Added: trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java (rev 0)
+++ trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java 2016-01-09 04:07:47 UTC (rev 3989)
@@ -0,0 +1,77 @@
+package org.openlcb.implementations;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.openlcb.AbstractConnection;
+import org.openlcb.Connection;
+import org.openlcb.EventID;
+import org.openlcb.FakeOlcbInterface;
+import org.openlcb.Message;
+
+import java.util.List;
+
+/**
+ * Created by bracz on 1/8/16.
+ */
+public class BitProducerConsumerTest extends TestCase {
+
+ public static final EventID onEvent = new EventID(new byte[]{5, 4, 3, 2, 1, 0, 7, 8});
+ public static final EventID offEvent = new EventID(new byte[]{5, 4, 3, 2, 1, 0, 7, 9});
+ FakeOlcbInterface iface = new FakeOlcbInterface();
+
+ public BitProducerConsumerTest(String s) {
+ super(s);
+ }
+
+ // Main entry point
+ static public void main(String[] args) {
+ String[] testCaseName = {BitProducerConsumerTest.class.getName()};
+ junit.swingui.TestRunner.main(testCaseName);
+ }
+
+ // test suite from all defined tests
+ public static Test suite() {
+ TestSuite suite = new TestSuite(BitProducerConsumerTest.class);
+ return suite;
+ }
+
+ public void testHandleIdentifyConsumers() throws Exception {
+
+ }
+
+ public void testHandleIdentifyProducers() throws Exception {
+
+ }
+
+ public void testHandleProducerIdentified() throws Exception {
+
+ }
+
+ public void testHandleConsumerIdentified() throws Exception {
+
+ }
+
+ public void testHandleProducerConsumerEventReport() throws Exception {
+
+ }
+
+ public void testHandleIdentifyEvents() throws Exception {
+
+ }
+
+ BitProducerConsumer pc;
+
+ private List<Message> sentMessages() {
+ return iface.fakeOutputConnection.history;
+ }
+
+ @Override
+ public void setUp() {
+ iface.fakeOutputConnection.history.clear();
+ pc = new BitProducerConsumer(iface, onEvent, offEvent);
+ assertEquals("init-size", 8, sentMessages().size());
+
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2016-01-09 04:08:11
|
Revision: 3990
http://sourceforge.net/p/openlcb/svn/3990
Author: bracz
Date: 2016-01-09 04:08:07 +0000 (Sat, 09 Jan 2016)
Log Message:
-----------
Adds mockito as test runner library dependency.
Modified Paths:
--------------
trunk/prototypes/java/build.xml
trunk/prototypes/java/lib/README
Added Paths:
-----------
trunk/prototypes/java/lib/mockito-all-1.10.19-javadoc.jar
trunk/prototypes/java/lib/mockito-all-1.10.19.jar
Modified: trunk/prototypes/java/build.xml
===================================================================
--- trunk/prototypes/java/build.xml 2016-01-09 04:07:47 UTC (rev 3989)
+++ trunk/prototypes/java/build.xml 2016-01-09 04:08:07 UTC (rev 3990)
@@ -35,6 +35,8 @@
<pathelement location="." />
<pathelement location="lib/junit.jar" />
<pathelement location="lib/xercesImpl.jar" /> <!-- only needed for tests compile and run -->
+ <pathelement location="lib/mockito-all-1.10.19-javadoc.jar" /> <!-- only needed for tests compile and run -->
+ <pathelement location="lib/mockito-all-1.10.19.jar" /> <!-- only needed for tests compile and run -->
<pathelement location="lib/jdom-2.0.5.jar" />
<pathelement location="lib/jdom.jar" />
<pathelement location="lib/jlfgr-1_0.jar" />
Modified: trunk/prototypes/java/lib/README
===================================================================
--- trunk/prototypes/java/lib/README 2016-01-09 04:07:47 UTC (rev 3989)
+++ trunk/prototypes/java/lib/README 2016-01-09 04:08:07 UTC (rev 3990)
@@ -25,4 +25,8 @@
Needed to build and run tests
version Xerces-J 2.9.1
from http://www.apache.org/dist/xerces/j/
-
\ No newline at end of file
+
+mockito-all-1.10.19.jar
+ Needed to build and run tests
+ version 1.10.19
+ downloaded from http://jcenter.bintray.com/org/mockito/mockito-core/1.10.19/
Added: trunk/prototypes/java/lib/mockito-all-1.10.19-javadoc.jar
===================================================================
--- trunk/prototypes/java/lib/mockito-all-1.10.19-javadoc.jar (rev 0)
+++ trunk/prototypes/java/lib/mockito-all-1.10.19-javadoc.jar 2016-01-09 04:08:07 UTC (rev 3990)
@@ -0,0 +1,20693 @@
+PK
++++Z\xA4mbiѐhg\xB3\x87\xFD\xEF7I\x89/\xC9ҽ\x80\xA2[\xE4p8\xEFuw\x8B\xFE\x86/\x98\x88U\xF2\x8DST(\x95\xE8\xF6\xEE\xE6\xEE\xF6\xE6\xBB-1\xE7f\xCFGZH
+r\x93[A\xDEЏ7>[\x9Cڗ\xE2\\x90i.\xB8(\xB3w\xBB\xFA\xF3\Ϛ\xA1\xD5z\xB5Y\xAD\xF4\xD0Nr\xBA\xC3G\xC6߲?\x97\xF3 \xFA\x86\xF2\x95,\xC7TᢚV\xB4d;\xBAb_h\xF6\xF8\xF0=t\xC4\xE5\x9E\xD9\xFC\xF9\xE6\xEB
+\xCE8+>M\xCE.\xACb\x92C\x95\xA4\x9F\xE5\x94\xD0\\x94X2Qd\x85(\xA8G\xD1}\xFE\xB0\xDD<j\x8C*;`\xB4\x8Aa\xBB}\xC4K\xAC1\xE0\\xB2\xFD{\xFF\xBB\xC0G\xFA\xB30V3\xAD \x8A\xBD]~*-I\xAD\xB3=\xAA\xC9\xC3"1\xB71s\xCB\xC4\xDC\xDA̭s\xF7f\xEE\xBE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7\xE8\xF4\x9F\xC7E\xBA0g|\xFF\xA4J\xF7/y.u*\xC9\xFF\xF7o\xB0ȄdG\xBA|tu\x81\xD1w\xE8\xE9\xABI,S\xFC\xF4\x996\xDBm\xB2"g\xFA\xFA\xE7S\x98U\x9E\xFEK\x93뿏+\xBC
+\xB4Ċ\x81\xA8\xEFLO\xB5yYM\xA3Q\x82dP<˲$\xB8]e\xA4\xAF\x94W\xD1s\xA4o3"\x81l\x95D\xA4IA:\xC2\xDEd~\xD4Z\x82q穵\xFC\xDBh\xE1-\x8F(\x8D<\xFDY^y\x90\xE1E=9\xC9d\xC1XTV\xADz\x96\x82\xC5x\xA1|...
[truncated message content] |
|
From: <br...@us...> - 2016-01-09 04:09:08
|
Revision: 3993
http://sourceforge.net/p/openlcb/svn/3993
Author: bracz
Date: 2016-01-09 04:09:06 +0000 (Sat, 09 Jan 2016)
Log Message:
-----------
Adds accessor for the value to the BitProducerConsumer.
Adds unit tests.
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java
trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java
trunk/prototypes/java/test/org/openlcb/implementations/PackageTest.java
Modified: trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java 2016-01-09 04:08:48 UTC (rev 3992)
+++ trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java 2016-01-09 04:09:06 UTC (rev 3993)
@@ -38,6 +38,17 @@
});
}
+ public synchronized VersionedValue<Boolean> getValue(boolean defaultValue) {
+ if(value == null) {
+ value = new VersionedValue<>(defaultValue);
+ }
+ return value;
+ }
+
+ public VersionedValue<Boolean> getValue() {
+ return value;
+ }
+
private EventState getOnEventState() {
if (value == null) return EventState.Unknown;
if (value.getLatestData()) return EventState.Valid;
Modified: trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java 2016-01-09 04:08:48 UTC (rev 3992)
+++ trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java 2016-01-09 04:09:06 UTC (rev 3993)
@@ -1,77 +1,185 @@
package org.openlcb.implementations;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.openlcb.AbstractConnection;
-import org.openlcb.Connection;
import org.openlcb.EventID;
-import org.openlcb.FakeOlcbInterface;
-import org.openlcb.Message;
+import org.openlcb.NodeID;
-import java.util.List;
+import static org.mockito.Mockito.*;
/**
* Created by bracz on 1/8/16.
*/
-public class BitProducerConsumerTest extends TestCase {
+public class BitProducerConsumerTest extends org.openlcb.InterfaceTestBase {
public static final EventID onEvent = new EventID(new byte[]{5, 4, 3, 2, 1, 0, 7, 8});
public static final EventID offEvent = new EventID(new byte[]{5, 4, 3, 2, 1, 0, 7, 9});
- FakeOlcbInterface iface = new FakeOlcbInterface();
+ BitProducerConsumer pc;
- public BitProducerConsumerTest(String s) {
- super(s);
+ public void testHandleIdentifyConsumers() throws Exception {
+ sendFrameAndExpectResult( //
+ ":X198F4444N0504030201000709;",
+ ":X194C7333N0504030201000709;");
+ sendFrameAndExpectResult( //
+ ":X198F4444N0504030201000708;",
+ ":X194C7333N0504030201000708;");
+ // Sets to on.
+ sendFrame(":X195B4444N0504030201000708;");
+
+ sendFrameAndExpectResult( //
+ ":X198F4444N0504030201000709;",
+ ":X194C5333N0504030201000709;");
+ sendFrameAndExpectResult( //
+ ":X198F4444N0504030201000708;",
+ ":X194C4333N0504030201000708;");
+
+ // Sets to off.
+ sendFrame(":X195B4444N0504030201000709;");
+
+ sendFrameAndExpectResult( //
+ ":X198F4444N0504030201000709;",
+ ":X194C4333N0504030201000709;");
+ sendFrameAndExpectResult( //
+ ":X198F4444N0504030201000708;",
+ ":X194C5333N0504030201000708;");
}
- // Main entry point
- static public void main(String[] args) {
- String[] testCaseName = {BitProducerConsumerTest.class.getName()};
- junit.swingui.TestRunner.main(testCaseName);
+ public void testHandleIdentifyProducers() throws Exception {
+ sendFrameAndExpectResult( //
+ ":X19914444N0504030201000708;",
+ ":X19547333N0504030201000708;");
+ sendFrameAndExpectResult( //
+ ":X19914444N0504030201000709;",
+ ":X19547333N0504030201000709;");
+
+ // Sets to on.
+ sendFrame(":X195B4444N0504030201000708;");
+ sendFrameAndExpectResult( //
+ ":X19914444N0504030201000708;",
+ ":X19544333N0504030201000708;");
+ sendFrameAndExpectResult( //
+ ":X19914444N0504030201000709;",
+ ":X19545333N0504030201000709;");
+
+ // Sets to off.
+ sendFrame(":X195B4444N0504030201000709;");
+ sendFrameAndExpectResult( //
+ ":X19914444N0504030201000708;",
+ ":X19545333N0504030201000708;");
+ sendFrameAndExpectResult( //
+ ":X19914444N0504030201000709;",
+ ":X19544333N0504030201000709;");
}
- // test suite from all defined tests
- public static Test suite() {
- TestSuite suite = new TestSuite(BitProducerConsumerTest.class);
- return suite;
+ public void testHandleProducerIdentified() throws Exception {
+ helperInputSetClear(":X19544333N0504030201000708;", ":X19545333N0504030201000708;");
}
- public void testHandleIdentifyConsumers() throws Exception {
+ public void testHandleProducerIdentifiedOff() throws Exception {
+ helperInputSetClear(":X19545333N0504030201000709;", ":X19544333N0504030201000709;");
+ }
+ public void testHandleProducerIdentifiedOnOff() throws Exception {
+ helperInputSetClear(":X19544333N0504030201000708;", ":X19544333N0504030201000709;");
}
- public void testHandleIdentifyProducers() throws Exception {
+ public void helperInputSetClear(String frameOn, String frameOff) {
+ assertNull(pc.getValue());
+ sendFrame(frameOn);
+ assertNotNull(pc.getValue());
+ assertTrue(pc.getValue().getLatestData());
+ sendFrame(frameOff);
+ assertFalse(pc.getValue().getLatestData());
- }
+ MockVersionedValueListener<Boolean> listener = new MockVersionedValueListener<>(pc
+ .getValue());
- public void testHandleProducerIdentified() throws Exception {
+ verifyNoMoreInteractions(listener.stub);
+ reset(listener.stub);
+ sendFrame(frameOn);
+ assertTrue(pc.getValue().getLatestData());
+ verify(listener.stub).update(true);
+ verifyNoMoreInteractions(listener.stub);
+ reset(listener.stub);
+
+ // Sending the same thing again shall not update.
+ sendFrame(frameOn);
+ verifyNoMoreInteractions(listener.stub);
+ reset(listener.stub);
+
+ sendFrame(frameOff);
+ verify(listener.stub).update(false);
+ verifyNoMoreInteractions(listener.stub);
+ reset(listener.stub);
+ assertFalse(pc.getValue().getLatestData());
}
public void testHandleConsumerIdentified() throws Exception {
+ helperInputSetClear(":X194C4333N0504030201000708;", ":X194C5333N0504030201000708;");
+ }
+ public void testHandleConsumerIdentifiedOff() throws Exception {
+ helperInputSetClear(":X194C5333N0504030201000709;", ":X194C4333N0504030201000709;");
}
+ public void testHandleConsumerIdentifiedOnOff() throws Exception {
+ helperInputSetClear(":X194C4333N0504030201000708;", ":X194C4333N0504030201000709;");
+ }
+
public void testHandleProducerConsumerEventReport() throws Exception {
+ helperInputSetClear(":X195B4333N0504030201000708;", ":X195B4333N0504030201000709;");
+ }
+ public void testHandleIdentifyEventsUnknown() throws Exception {
+ sendFrame(":X19968444N0333;");
+ //sendFrame(":X19970444N;");
+ expectFrame(":X19547333N0504030201000708;");
+ expectFrame(":X19547333N0504030201000709;");
+ expectFrame(":X194C7333N0504030201000708;");
+ expectFrame(":X194C7333N0504030201000709;");
}
- public void testHandleIdentifyEvents() throws Exception {
+ public void testHandleIdentifyEventsKnown() throws Exception {
+ sendFrame(":X194C5333N0504030201000709;");
+ sendFrame(":X19968444N0333;");
- }
+ expectFrame(":X19544333N0504030201000708;");
+ expectFrame(":X19545333N0504030201000709;");
+ expectFrame(":X194C4333N0504030201000708;");
+ expectFrame(":X194C5333N0504030201000709;");
- BitProducerConsumer pc;
+ sendFrame(":X194C4333N0504030201000709;");
+ sendFrame(":X19968444N0333;");
- private List<Message> sentMessages() {
- return iface.fakeOutputConnection.history;
+ expectFrame(":X19545333N0504030201000708;");
+ expectFrame(":X19544333N0504030201000709;");
+ expectFrame(":X194C5333N0504030201000708;");
+ expectFrame(":X194C4333N0504030201000709;");
+
+ // Other target
+ sendFrame(":X19968444N0444;");
+ expectNoFrames();
}
@Override
+ protected void tearDown() throws Exception {
+ expectNoFrames();
+ super.tearDown();
+ }
+
+ @Override
public void setUp() {
iface.fakeOutputConnection.history.clear();
+ aliasMap.insert(0x444, new NodeID(new byte[]{1,2,3,1,2,3}));
pc = new BitProducerConsumer(iface, onEvent, offEvent);
- assertEquals("init-size", 8, sentMessages().size());
+ expectFrame(":X19547333N0504030201000708;");
+ expectFrame(":X19547333N0504030201000709;");
+ expectFrame(":X194C7333N0504030201000708;");
+ expectFrame(":X194C7333N0504030201000709;");
+ expectFrame(":X19547333N0504030201000708;");
+ expectFrame(":X19914333N0504030201000708;");
+ expectFrame(":X194C7333N0504030201000708;");
+ expectFrame(":X198F4333N0504030201000708;");
+ expectNoFrames();
}
}
\ No newline at end of file
Modified: trunk/prototypes/java/test/org/openlcb/implementations/PackageTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/PackageTest.java 2016-01-09 04:08:48 UTC (rev 3992)
+++ trunk/prototypes/java/test/org/openlcb/implementations/PackageTest.java 2016-01-09 04:09:06 UTC (rev 3993)
@@ -50,6 +50,7 @@
suite.addTest(MemoryConfigurationServiceTest.suite());
suite.addTest(org.openlcb.implementations.throttle.PackageTest.suite());
+ suite.addTest(new TestSuite(BitProducerConsumerTest.class));
return suite;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2016-01-14 17:43:41
|
Revision: 3997
http://sourceforge.net/p/openlcb/svn/3997
Author: bracz
Date: 2016-01-14 17:43:40 +0000 (Thu, 14 Jan 2016)
Log Message:
-----------
Fixes initialization bug with getValue.
Adds unit tests for sending out event reports to the network.
Modified Paths:
--------------
trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java
trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java
Modified: trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java
===================================================================
--- trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java 2016-01-10 16:34:08 UTC (rev 3996)
+++ trunk/prototypes/java/src/org/openlcb/implementations/BitProducerConsumer.java 2016-01-14 17:43:40 UTC (rev 3997)
@@ -40,7 +40,7 @@
public synchronized VersionedValue<Boolean> getValue(boolean defaultValue) {
if(value == null) {
- value = new VersionedValue<>(defaultValue);
+ setValueFromNetwork(defaultValue);
}
return value;
}
Modified: trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java
===================================================================
--- trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java 2016-01-10 16:34:08 UTC (rev 3996)
+++ trunk/prototypes/java/test/org/openlcb/implementations/BitProducerConsumerTest.java 2016-01-14 17:43:40 UTC (rev 3997)
@@ -160,6 +160,29 @@
expectNoFrames();
}
+ public void testGenerateEvents() throws Exception {
+ VersionedValue<Boolean> v = pc.getValue(false);
+ sendFrameAndExpectResult( //
+ ":X19914444N0504030201000708;",
+ ":X19545333N0504030201000708;");
+
+ expectNoFrames();
+
+ v.set(false);
+ expectNoFrames();
+
+ v.set(true);
+ expectFrame(":X195B4333N0504030201000708;");
+ expectNoFrames();
+
+ v.set(true);
+ expectNoFrames();
+
+ v.set(false);
+ expectFrame(":X195B4333N0504030201000709;");
+ expectNoFrames();
+ }
+
@Override
protected void tearDown() throws Exception {
expectNoFrames();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|