# HG changeset patch # User Carl Byington # Date 1414771080 25200 # Node ID 76efe8fa29b9384bd23a6f3ba5ba6d339fe87fd4 # Parent 651aff5a46c7ae3e11d10a0d4d0fc7c0d700c11b more debugging looking for duplicate transmission diff -r 651aff5a46c7 -r 76efe8fa29b9 src/org/tn5250j/framework/tn5250/Screen5250.java --- a/src/org/tn5250j/framework/tn5250/Screen5250.java Thu Oct 30 16:27:31 2014 -0700 +++ b/src/org/tn5250j/framework/tn5250/Screen5250.java Fri Oct 31 08:58:00 2014 -0700 @@ -3443,8 +3443,42 @@ fireScreenChanged(); } + private int xx_position = 0; + private int xx_length = 0; + private char[] xx_pending = new char[2048]; + + private void xx_flush() { + if (xx_length > 0) { + char[] p = new char[xx_length]; + System.arraycopy(xx_pending, 0, p, xx_length); + Log.i(TAG, String.format("row %d col %d %s", getRow(xx_position), getCol(xx_position), new String(p))); + } + xx_length = 0; + } + + private void xx_debug(int cByte) { + if (cByte == 0) { + xx_flush(); + } + else { + if (xx_length == 0) { + xx_position = lastPos; + xx_pending[xx_length++] = (char)cByte; + } + else if (lastPos == xx_position + xx_length) { + xx_pending[xx_length++] = (char)cByte; + } + else { + xx_flush(); + xx_position = lastPos; + xx_pending[xx_length++] = (char)cByte; + } + } + } + protected void setChar(int cByte) { - //if (cByte != 0) Log.i(TAG, String.format("%d %c %d", lastPos, cByte, cByte)); + xx_debug(cByte); + if (lastPos > 0) { lastAttr = planes.getCharAttr(lastPos - 1); }