Skip to content
Snippets Groups Projects
Commit 3f47dd39 authored by rswindell's avatar rswindell
Browse files

Resolve perform issue (> 1 second lag after key-press and screen update

on rPi3) by using Frame.home() and Frame.cleartoeol() rather than
Frame.clear().
parent a52a890c
Branches
Tags
No related merge requests found
...@@ -62,6 +62,7 @@ frame.cycle(); ...@@ -62,6 +62,7 @@ frame.cycle();
var key; var key;
var zone; var zone;
var high_water = 0;
console.ungetstr(KEY_UP); console.ungetstr(KEY_UP);
while (!js.terminated) { while (!js.terminated) {
key = console.getkey(); key = console.getkey();
...@@ -69,15 +70,49 @@ while (!js.terminated) { ...@@ -69,15 +70,49 @@ while (!js.terminated) {
tree.getcmd(key); tree.getcmd(key);
if (key == KEY_UP || key == KEY_DOWN || key == KEY_HOME || key == KEY_END) { if (key == KEY_UP || key == KEY_DOWN || key == KEY_HOME || key == KEY_END) {
zone = tree.currentItem.__ftn_setup; zone = tree.currentItem.__ftn_setup;
info_frame.clear(); function crlf() {
info_frame.putmsg('\1h\1w' + zone.name + '\r\n'); info_frame.cleartoeol();
if (zone.desc) info_frame.putmsg('\1n\1w' + zone.desc + '\r\n\r\n'); info_frame.crlf();
if (zone.info) info_frame.putmsg('\1h\1cInformation\1w:\r\n\1n' + zone.info + '\r\n\r\n'); }
if (zone.coord) info_frame.putmsg('\1h\1cCoordinator\1w:\r\n\1n' + zone.coord + '\r\n\r\n'); info_frame.home();
if (zone.email) info_frame.putmsg('\1h\1cEmail\1w:\r\n\1n' + zone.email + '\r\n\r\n'); info_frame.putmsg('\1h\1w' + zone.name);
crlf();
if (zone.desc) {
info_frame.putmsg('\1n\1w' + zone.desc);
crlf();
crlf();
}
if (zone.info) {
info_frame.putmsg('\1h\1cInformation\1w:');
crlf();
info_frame.putmsg('\1n' + zone.info);
crlf();
crlf();
}
if (zone.coord) {
info_frame.putmsg('\1h\1cCoordinator\1w:');
crlf();
info_frame.putmsg('\1n' + zone.coord);
crlf();
crlf();
}
if (zone.email) {
info_frame.putmsg('\1h\1cEmail\1w:');
crlf();
info_frame.putmsg('\1n' + zone.email);
crlf();
crlf();
}
if (addrs[zone._zone_number]) { if (addrs[zone._zone_number]) {
info_frame.putmsg('\1h\1rExisting address found: ' + addrs[zone._zone_number]); info_frame.putmsg('\1h\1rExisting address found: ' + addrs[zone._zone_number]);
crlf();
} }
var y = info_frame.cursor.y;
while(high_water > y) {
crlf();
high_water--;
}
high_water = y;
} }
if (frame.cycle()) console.gotoxy(console.screen_columns, console.screen_rows); if (frame.cycle()) console.gotoxy(console.screen_columns, console.screen_rows);
} }
......
// $Id$ // $Id$
// vi: tabstop=4
load('sbbsdefs.js'); load('sbbsdefs.js');
load('frame.js'); load('frame.js');
...@@ -62,20 +63,53 @@ frame.cycle(); ...@@ -62,20 +63,53 @@ frame.cycle();
var key; var key;
var xtrn; var xtrn;
var high_water = 0;
console.ungetstr(KEY_UP); console.ungetstr(KEY_UP);
while (!js.terminated) { while (!js.terminated) {
key = console.getkey(); key = console.getkey();
if (key.toLowerCase() == 'q') break; if (key.toLowerCase() == 'q') break;
tree.getcmd(key); tree.getcmd(key);
function crlf() {
info_frame.cleartoeol();
info_frame.crlf();
}
if (key == KEY_UP || key == KEY_DOWN || key == KEY_HOME || key == KEY_END) { if (key == KEY_UP || key == KEY_DOWN || key == KEY_HOME || key == KEY_END) {
xtrn = tree.currentItem.__xtrn_setup; xtrn = tree.currentItem.__xtrn_setup;
info_frame.clear(); info_frame.home();
info_frame.putmsg('\x01h\x01w' + xtrn.Name + '\r\n'); info_frame.putmsg('\x01h\x01w' + xtrn.Name);
if (xtrn.Desc) info_frame.putmsg('\x01n\x01w' + xtrn.Desc + '\r\n'); crlf();
info_frame.putmsg('\r\n'); if (xtrn.Desc) {
if (xtrn.By) info_frame.putmsg('\x01h\x01cBy\x01w:\r\n\x01w' + xtrn.By + '\r\n\r\n'); info_frame.cleartoeol();
if (xtrn.Cats) info_frame.putmsg('\x01h\x01cCategories\x01w:\r\n\x01n' + xtrn.Cats + '\r\n\r\n'); info_frame.putmsg('\x01n\x01w' + xtrn.Desc);
if (xtrn.Subs) info_frame.putmsg('\x01h\x01cSubcategories\x01w:\r\n\x01n' + xtrn.Subs + '\r\n\r\n'); crlf();
}
crlf();
if (xtrn.By) {
info_frame.putmsg('\x01h\x01cBy\x01w:');
crlf();
info_frame.putmsg('\x01w' + xtrn.By);
crlf();
crlf();
}
if (xtrn.Cats) {
info_frame.putmsg('\x01h\x01cCategories\x01w:');
crlf();
info_frame.putmsg('\x01n' + xtrn.Cats);
crlf();
crlf();
}
if (xtrn.Subs) {
info_frame.putmsg('\x01h\x01cSubcategories\x01w:');
crlf();
info_frame.putmsg('\x01n' + xtrn.Subs);
crlf();
}
var y = info_frame.cursor.y;
while(high_water > y) {
crlf();
high_water--;
}
high_water = y;
} }
if (frame.cycle()) console.gotoxy(console.screen_columns, console.screen_rows); if (frame.cycle()) console.gotoxy(console.screen_columns, console.screen_rows);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment