Add waiting on host status line indicator

This commit is contained in:
Andrew Kay
2019-09-13 23:27:08 -05:00
parent f9685bcfe6
commit d830fd2b47

View File

@@ -55,6 +55,8 @@ class TN3270Session(Session):
self.telnet = None self.telnet = None
self.emulator = None self.emulator = None
self.waiting_on_host = False
self.operator_error = None self.operator_error = None
# TODO: Should the message area be initialized here? # TODO: Should the message area be initialized here?
@@ -83,6 +85,8 @@ class TN3270Session(Session):
raise SessionDisconnectedError raise SessionDisconnectedError
self.waiting_on_host = False
self._apply() self._apply()
self._flush() self._flush()
@@ -95,7 +99,7 @@ class TN3270Session(Session):
if aid is not None: if aid is not None:
self.emulator.aid(aid) self.emulator.aid(aid)
# TODO: is this where we show the clock? self.waiting_on_host = True
#elif key == Key.RESET: #elif key == Key.RESET:
elif key == Key.BACKSPACE: elif key == Key.BACKSPACE:
self.emulator.backspace() self.emulator.backspace()
@@ -194,10 +198,12 @@ class TN3270Session(Session):
def _format_message_area(self): def _format_message_area(self):
message_area = b'' message_area = b''
if self.operator_error: if self.waiting_on_host:
if isinstance(self.operator_error, ProtectedCellOperatorError): # X SPACE CLOCK_LEFT CLOCK_RIGHT
# X SPACE ARROW_LEFT OPERATOR ARROW_RIGHT message_area = b'\xf6\x00\xf4\xf5'
message_area = b'\xf6\x00\xf8\xdb\xd8' elif isinstance(self.operator_error, ProtectedCellOperatorError):
# X SPACE ARROW_LEFT OPERATOR ARROW_RIGHT
message_area = b'\xf6\x00\xf8\xdb\xd8'
elif self.emulator.keyboard_locked: elif self.emulator.keyboard_locked:
# X SPACE SYSTEM # X SPACE SYSTEM
message_area = b'\xf6\x00' + encode_string('SYSTEM') message_area = b'\xf6\x00' + encode_string('SYSTEM')