App:Library:FabGL:Class:Terminal

提供: robot-jp wiki
2022年3月23日 (水) 11:41時点におけるTakashi (トーク | 投稿記録)による版 (→‎Static Public Attributes)
ナビゲーションに移動検索に移動

class Terminal

ANSI-VT100互換のディスプレイ端末。

#include <terminal.h>

ストリームを継承します。

Public Member Functions

void activate (TerminalTransition transition=TerminalTransition::None)
Activates this terminal for input and output.
int available ()
Gets the number of codes available in the keyboard queue.
int availableForWrite ()
Determines number of codes that the display input queue can still accept.
bool begin (BaseDisplayController *displayController, int maxColumns=-1, int maxRows=-1, Keyboard *keyboard=nullptr)
Initializes the terminal.
Canvas * canvas ()
Gets associated canvas object.
void clear (bool moveCursor=true)
Clears the screen.
void connectLocally ()
Permits using of terminal locally.
void connectSerialPort (HardwareSerial &serialPort, bool autoXONXOFF=true)
Connects a remote host using the specified serial port.
void connectSerialPort (uint32_t baud, uint32_t config, int rxPin, int txPin, FlowControl flowControl, bool inverted=false, int rtsPin=-1, int ctsPin=-1)
Connects a remote host using UART.
bool CTSStatus ()
Reports current CTS signal status.
void deactivate ()
Deactivates this terminal.
void disableSerialPortRX (bool value)
Disables/Enables serial port RX.
void disconnectLocally ()
Avoids using of terminal locally.
void enableCursor (bool value)
Enables or disables cursor.
void end ()
Finalizes the terminal.
void flowControl (bool enableRX)
Allows/disallows host to send data.
bool flowControl ()
Checks whether host can receive data.
void flush (bool waitVSync)
Waits for all codes sent to the display has been processed.
void flush ()
Waits for all codes sent to the display has been processed.
int getColumns ()
Returns the number of columns.
int getRows ()
Returns the number of lines.
bool isActive ()
Determines if this terminal is active or not.
Keyboard * keyboard ()
Gets associated keyboard object.
void loadFont (FontInfo const *font)
Sets the font to use.
void localInsert (uint8_t c)
Injects keys into the keyboard queue.
void localWrite (uint8_t c)
Injects keys into the keyboard queue.
void localWrite (char const *str)
Injects a string of keys into the keyboard queue.
int peek ()
Reads a code from the keyboard without advancing to the next one.
void pollSerialPort ()
Pools the serial port for incoming data.
int read ()
Reads codes from keyboard.
int read (int timeOutMS)
Reads codes from keyboard specyfing timeout.
bool RTSStatus ()
Reports current RTS signal status.
void send (uint8_t c)
Like localWrite() but sends also to serial port if connected.
void send (char const *str)
Like localWrite() but sends also to serial port if connected.
void setBackgroundColor (Color color, bool setAsDefault=true)
Sets the background color.
void setColorForAttribute (CharStyle attribute, Color color, bool maintainStyle)
Selects a color for the specified attribute.
void setColorForAttribute (CharStyle attribute)
Disables color for the specified attribute.
void setForegroundColor (Color color, bool setAsDefault=true)
Sets the foreground color.
void setLogStream (Stream &stream)
Sets the stream where to output debugging logs.
void setRTSStatus (bool value)
Sets RTS signal status.
void setTerminalType (TermType value)
Sets the terminal type to emulate.
SoundGenerator * soundGenerator ()
Gets embedded sound generator.
TermInfo const & terminalType ()
Determines current terminal type.
void unRead (uint8_t c)
Injects keys into the keyboard queue.
bool waitFor (int value, int timeOutMS=-1)
Wait for a specific code from keyboard, discarding all previous codes.
size_t write (const uint8_t *buffer, size_t size)
Sends specified number of codes to the display.
size_t write (uint8_t c)
Sends a single code to the display.
bool XOFFStatus ()
Reports whether TX is active.

Public Attributes

Delegate< char const * > onUserSequence
Delegate called whenever a new user sequence has been received.
Delegate< VirtualKey *, bool > onVirtualKey
Delegate called whenever a new virtual key is received from keyboard.
Delegate< VirtualKeyItem * > onVirtualKeyItem
Delegate called whenever a new virtual key is received from keyboard, including shift states.

Static Public Attributes

static int inputConsumerTaskStackSize = 2048
Stack size of the task that processes Terminal input stream.
static int inputQueueSize = 1024
Number of characters the terminal can "write" without pause (increase if you have loss of characters in serial port).
static int keyboardReaderTaskStackSize = 2048
Stack size of the task that reads keys from keyboard and send ANSI/VT codes to output stream in Terminal.

Detailed Description

Defines a cursor.

Example1:

Example2:

Examples:

Others/KeyboardScanCodes/KeyboardScanCodes.ino, Others/KeyboardVirtualKeys/KeyboardVirtualKeys.ino, SSD1306_OLED/128x32/SimpleTerminalOut/SimpleTerminalOut.ino, SSD1306_OLED/128x64/NetworkTerminal/NetworkTerminal.ino, SSD1306_OLED/128x64/RTClock/RTClock.ino, SSD1306_OLED/128x64/SimpleTerminalOut/SimpleTerminalOut.ino, ST7789_TFT/240x240/SimpleTerminalOut/SimpleTerminalOut.ino, VGA/Altair8800/Altair8800.ino, VGA/AnsiTerminal/AnsiTerminal.ino, VGA/LoopbackTerminal/LoopbackTerminal.ino, VGA/MultitaskingCPM/MultitaskingCPM.ino, VGA/NetworkTerminal/NetworkTerminal.ino, VGA/SimpleTerminalOut/SimpleTerminalOut.ino, VGA/SimpleTextTerminalOut/SimpleTextTerminalOut.ino, and VGA/Songs/Songs.ino.

Definition at line 953 of file terminal.h.



The documentation for this struct was generated from the following file:

  • terminal.h
  • terminal.cpp



戻る