![]() |
NDEVR
API Documentation
|
Provides the user access to sending or receiving data to a specified connection over a terminal interface. More...
Public Member Functions | |
| TerminalDialog (QWidget *parent=nullptr) | |
| Constructs a TerminalDialog. | |
| virtual | ~TerminalDialog () |
| Destructor. | |
| void | addMessage (uint04 id, const LogMessage &message) override |
| Adds a log message to the terminal display queue. | |
| void | putData (const StringView &data) |
| Writes data to the terminal display. | |
| void | setAsLogger (InfoPipe *log) |
| Configures the terminal as a log output for an InfoPipe. | |
| void | setAutoEcho (bool auto_echo) |
| Sets whether sent commands are automatically echoed to the terminal display. | |
| void | setAutoPullData (bool set) |
| Sets whether the terminal automatically polls the connection for data. | |
| void | setCommandTermination (const StringView &termination) |
| Sets the string appended to commands when sent to the connection. | |
| void | setConnection (Connection *connection, bool add_all) |
| Sets the connection to an existing Connection object. | |
| void | setConnection (const ConnectionInfo &info) |
| Sets the connection using connection info, creating a new connection. | |
| void | setProgress (uint04, fltp04) override |
| No-op implementation of LogStream progress reporting. | |
| void | setPushDataOnEnter (bool set) |
| Sets whether pressing Enter sends the current input to the connection. | |
| Public Member Functions inherited from LogStream | |
| virtual | ~LogStream () |
| Destructor. | |
| virtual void | addMessages (uint04 id, const Buffer< LogMessage > &messages) |
| Adds multiple log messages to this stream at once. | |
| virtual void | addProgressSource (const TranslatedString &name, uint04 idx, fltp04 progress) |
| Registers a new progress source to be tracked by this stream. | |
| virtual void | allowCancel (bool) |
| Sets whether this stream allows the user to cancel an in-progress operation. | |
| virtual void | allowInput (bool) |
| Sets whether this stream allows user input during an operation. | |
| virtual void | attach (InfoPipe *stream) |
| Attaches this LogStream to the given InfoPipe so it receives log updates. | |
| void | clearLinks () |
| Detaches this LogStream from all linked InfoPipe objects and clears the link list. | |
| virtual void | detach (InfoPipe *stream) |
| Detaches this LogStream from the given InfoPipe, stopping further updates from it. | |
| bool | ignoringMessages () const |
| Returns whether this stream is currently ignoring messages. | |
| virtual void | removeProgressSource (uint04 idx) |
| Removes a previously registered progress source from this stream. | |
| void | setIgnoreMessages (bool ignore) |
| Sets whether this stream should ignore incoming messages. | |
Protected Member Functions | |
| void | contextMenuEvent (QContextMenuEvent *e) override |
| Handles context menu events for copy/paste operations. | |
| void | keyPressEvent (QKeyEvent *e) override |
| Handles key press events for terminal input. | |
| void | mouseDoubleClickEvent (QMouseEvent *e) override |
| Handles mouse double-click events for text selection. | |
| void | mousePressEvent (QMouseEvent *e) override |
| Handles mouse press events for cursor positioning. | |
| void | pullDataSlot () |
| Slot that polls the connection for new data. | |
| void | showEvent (QShowEvent *e) override |
| Handles the widget show event and starts data pulling if configured. | |
Additional Inherited Members | |
| Protected Attributes inherited from LogStream | |
| bool | m_ignore_message = false |
| Whether this stream should ignore incoming messages. | |
| Buffer< InfoPipe * > | m_linked_logs |
| Collection of InfoPipe objects this stream is listening to. | |
| Dictionary< uint04, ProgressSource > | m_progress_sources |
| Maps progress source indices to their ProgressSource data. | |
Provides the user access to sending or receiving data to a specified connection over a terminal interface.
Terminal supports ANSI escape codes as well as correct return carriage behavior. Default look is a black background with white text.
The Terminal can passively listen to a connection or actively request the connection for information using Connection::rx(). If the connection is shared by a Device that is expected to pull the data , setAutoPullData using false. If this connection needs to be actively polled, setAutoPullData using true. In addition to looking at a connection, the Terminal can also be set as a log. This can be used with logs sent by ApplicationManager to pipe the results of running an application.
Terminal fully supports ANSI escape codes: https://en.wikipedia.org/wiki/ANSI_escape_code with the exception of cursor settings.
Definition at line 30 of file TerminalDialog.h.
|
explicit |
Constructs a TerminalDialog.
| [in] | parent | The parent widget. |
|
virtual |
Destructor.
Cleans up the connection if owned.
|
overridevirtual |
Adds a log message to the terminal display queue.
| [in] | id | The message identifier. |
| [in] | message | The LogMessage to display. |
Implements LogStream.
|
overrideprotected |
Handles context menu events for copy/paste operations.
| [in] | e | The context menu event. |
|
overrideprotected |
Handles key press events for terminal input.
| [in] | e | The key event. |
|
overrideprotected |
Handles mouse double-click events for text selection.
| [in] | e | The mouse event. |
|
overrideprotected |
Handles mouse press events for cursor positioning.
| [in] | e | The mouse event. |
| void TerminalDialog::putData | ( | const StringView & | data | ) |
Writes data to the terminal display.
| [in] | data | The data string to display. |
| void TerminalDialog::setAsLogger | ( | InfoPipe * | log | ) |
| void TerminalDialog::setAutoEcho | ( | bool | auto_echo | ) |
Sets whether sent commands are automatically echoed to the terminal display.
| [in] | auto_echo | Whether to enable auto-echo. |
| void TerminalDialog::setAutoPullData | ( | bool | set | ) |
Sets whether the terminal automatically polls the connection for data.
| [in] | set | Whether to enable automatic data pulling. |
| void TerminalDialog::setCommandTermination | ( | const StringView & | termination | ) |
Sets the string appended to commands when sent to the connection.
| [in] | termination | The command termination string (e.g., newline). |
| void TerminalDialog::setConnection | ( | Connection * | connection, |
| bool | add_all ) |
Sets the connection to an existing Connection object.
| [in] | connection | The Connection to attach to. |
| [in] | add_all | Whether to display all existing data from the connection. |
| void TerminalDialog::setConnection | ( | const ConnectionInfo & | info | ) |
Sets the connection using connection info, creating a new connection.
| [in] | info | The ConnectionInfo describing the connection to establish. |
| void TerminalDialog::setPushDataOnEnter | ( | bool | set | ) |
Sets whether pressing Enter sends the current input to the connection.
| [in] | set | Whether to push data on Enter key press. |
|
overrideprotected |
Handles the widget show event and starts data pulling if configured.
| [in] | e | The show event. |