comparison src/org/tn5250j/framework/tn5250/Screen5250.java @ 423:76efe8fa29b9

more debugging looking for duplicate transmission
author Carl Byington <carl@five-ten-sg.com>
date Fri, 31 Oct 2014 08:58:00 -0700
parents 651aff5a46c7
children 09c1d3aae3f0
comparison
equal deleted inserted replaced
422:651aff5a46c7 423:76efe8fa29b9
3441 } 3441 }
3442 3442
3443 fireScreenChanged(); 3443 fireScreenChanged();
3444 } 3444 }
3445 3445
3446 private int xx_position = 0;
3447 private int xx_length = 0;
3448 private char[] xx_pending = new char[2048];
3449
3450 private void xx_flush() {
3451 if (xx_length > 0) {
3452 char[] p = new char[xx_length];
3453 System.arraycopy(xx_pending, 0, p, xx_length);
3454 Log.i(TAG, String.format("row %d col %d %s", getRow(xx_position), getCol(xx_position), new String(p)));
3455 }
3456 xx_length = 0;
3457 }
3458
3459 private void xx_debug(int cByte) {
3460 if (cByte == 0) {
3461 xx_flush();
3462 }
3463 else {
3464 if (xx_length == 0) {
3465 xx_position = lastPos;
3466 xx_pending[xx_length++] = (char)cByte;
3467 }
3468 else if (lastPos == xx_position + xx_length) {
3469 xx_pending[xx_length++] = (char)cByte;
3470 }
3471 else {
3472 xx_flush();
3473 xx_position = lastPos;
3474 xx_pending[xx_length++] = (char)cByte;
3475 }
3476 }
3477 }
3478
3446 protected void setChar(int cByte) { 3479 protected void setChar(int cByte) {
3447 //if (cByte != 0) Log.i(TAG, String.format("%d %c %d", lastPos, cByte, cByte)); 3480 xx_debug(cByte);
3481
3448 if (lastPos > 0) { 3482 if (lastPos > 0) {
3449 lastAttr = planes.getCharAttr(lastPos - 1); 3483 lastAttr = planes.getCharAttr(lastPos - 1);
3450 } 3484 }
3451 3485
3452 if (cByte > 0 && (char)cByte < ' ') { 3486 if (cByte > 0 && (char)cByte < ' ') {