comparison src/org/tn5250j/framework/tn5250/tnvt.java @ 216:cd07c1648016

test buffer changed when 5250 keyboard unlocks
author Carl Byington <carl@five-ten-sg.com>
date Tue, 08 Jul 2014 10:02:11 -0700
parents 2d93d5063e3d
children 1048515a2852
comparison
equal deleted inserted replaced
215:2d93d5063e3d 216:cd07c1648016
983 while (keepTrucking) { 983 while (keepTrucking) {
984 try { 984 try {
985 Object e = dsq.take(); 985 Object e = dsq.take();
986 986
987 if ((e instanceof Integer) && ((Integer)e == 0)) { 987 if ((e instanceof Integer) && ((Integer)e == 0)) {
988 buffer.testChanged(); 988 //buffer.testChanged();
989 continue; 989 continue;
990 }; 990 };
991 991
992 bk.initialize((byte[])e); 992 bk.initialize((byte[])e);
993 } 993 }
995 Log.w(TAG, " vt thread interrupted and stopping "); 995 Log.w(TAG, " vt thread interrupted and stopping ");
996 keepTrucking = false; 996 keepTrucking = false;
997 continue; 997 continue;
998 } 998 }
999 999
1000 // lets play nicely with the others on the playground
1001 // me.yield();
1002 Thread.yield();
1003 invited = false; 1000 invited = false;
1004 screen52.setCursorActive(false); 1001 screen52.setCursorActive(false);
1005 1002
1006 // System.out.println("operation code: " + bk.getOpCode()); 1003 if (bk == null) continue;
1007 if (bk == null)
1008 continue;
1009 1004
1010 switch (bk.getOpCode()) { 1005 switch (bk.getOpCode()) {
1011 case 00: 1006 case 00:
1012 Log.d(TAG, "No operation"); 1007 Log.d(TAG, "No operation");
1013 break; 1008 break;
1014 1009
1015 case 1: 1010 case 1:
1016 Log.d(TAG, "Invite Operation"); 1011 Log.d(TAG, "Invite Operation");
1017 parseIncoming(); 1012 parseIncoming();
1018 // screen52.setKeyboardLocked(false);
1019 pendingUnlock = true; 1013 pendingUnlock = true;
1020 cursorOn = true; 1014 cursorOn = true;
1021 setInvited(); 1015 setInvited();
1016 buffer.testChanged();
1022 break; 1017 break;
1023 1018
1024 case 2: 1019 case 2:
1025 Log.d(TAG, "Output Only"); 1020 Log.d(TAG, "Output Only");
1026 parseIncoming(); 1021 parseIncoming();
1119 if (cursorOn && !screen52.getOIA().isKeyBoardLocked()) { 1114 if (cursorOn && !screen52.getOIA().isKeyBoardLocked()) {
1120 screen52.setCursorActive(true); 1115 screen52.setCursorActive(true);
1121 cursorOn = false; 1116 cursorOn = false;
1122 } 1117 }
1123 1118
1124 // lets play nicely with the others on the playground
1125 //me.yield();
1126 Thread.yield();
1127 } 1119 }
1128 } 1120 }
1129 1121
1130 public void dumpStuff() { 1122 public void dumpStuff() {
1131 Log.d(TAG, " Pending unlock " + pendingUnlock); 1123 Log.d(TAG, " Pending unlock " + pendingUnlock);
2252 } 2244 }
2253 2245
2254 private final void writeErrorCodeToWindow() throws Exception { 2246 private final void writeErrorCodeToWindow() throws Exception {
2255 int fromCol = bk.getNextByte() & 0xff; // from column 2247 int fromCol = bk.getNextByte() & 0xff; // from column
2256 int toCol = bk.getNextByte() & 0xff; // to column 2248 int toCol = bk.getNextByte() & 0xff; // to column
2257 screen52.setCursor(screen52.getErrorLine(), fromCol); // Skip the control 2249 screen52.setCursor(screen52.getErrorLine(), fromCol); // Skip the control byte
2258 // byte
2259 screen52.setStatus(Screen5250.STATUS_ERROR_CODE, 2250 screen52.setStatus(Screen5250.STATUS_ERROR_CODE,
2260 Screen5250.STATUS_VALUE_ON, null); 2251 Screen5250.STATUS_VALUE_ON, null);
2261 screen52.saveErrorLine(); 2252 screen52.saveErrorLine();
2262 cursorOn = true; 2253 cursorOn = true;
2263 } 2254 }