AtCore 1.0.72
AtCore is a API to manage the serial connection between the computer and 3D Printers.
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LogWidget Class Reference

The LogWidget will display the log for the connected atcore. Create with a pointer to a new QTemporaryFile. More...

#include <logwidget.h>

Inheritance diagram for LogWidget:

Public Member Functions

 LogWidget (QTemporaryFile *tempFile, QWidget *parent=nullptr)
 
 LogWidget (QWidget *parent=nullptr)
 
void appendLog (const QString &msg)
 Add a message to the log. Should always also be connected to AtCore::atcoreMessage;.
 
void appendRLog (const QByteArray &bmsg)
 Connect to AtCore::receivedMessage.
 
void appendSLog (const QByteArray &bmsg)
 Connect to AtCore::pushedCommand.
 
bool endsWith (const QString &string)
 test if last line of log is string
 

Private Member Functions

void initialize ()
 
QString getTime ()
 Return string with actual time.
 
void savePressed ()
 save Log pressed.
 
void writeTempFile (const QString &text)
 Append text in temporary file.
 
void flushTemp ()
 flush unwritten strings to temp file
 

Private Attributes

QStringList unsyncedStrings
 
QTemporaryFile * logFile = nullptr
 
QPlainTextEdit * textLog = nullptr
 

Detailed Description

The LogWidget will display the log for the connected atcore. Create with a pointer to a new QTemporaryFile.

Constructor & Destructor Documentation

◆ LogWidget() [1/2]

LogWidget::LogWidget ( QTemporaryFile *  tempFile,
QWidget *  parent = nullptr 
)
explicit

◆ LogWidget() [2/2]

LogWidget::LogWidget ( QWidget *  parent = nullptr)
explicit

Member Function Documentation

◆ appendLog()

void LogWidget::appendLog ( const QString &  msg)

Add a message to the log. Should always also be connected to AtCore::atcoreMessage;.

Parameters
msgMessage

◆ appendRLog()

void LogWidget::appendRLog ( const QByteArray &  bmsg)

Connect to AtCore::receivedMessage.

Parameters
bmsgMessage

◆ appendSLog()

void LogWidget::appendSLog ( const QByteArray &  bmsg)

Connect to AtCore::pushedCommand.

Parameters
bmsgMessage

◆ endsWith()

bool LogWidget::endsWith ( const QString &  string)

test if last line of log is string

Parameters
stringline to test for
Returns
true if last line starts with

◆ flushTemp()

void LogWidget::flushTemp ( )
private

flush unwritten strings to temp file

◆ getTime()

QString LogWidget::getTime ( )
private

Return string with actual time.

Returns
QString

◆ initialize()

void LogWidget::initialize ( )
private

◆ savePressed()

void LogWidget::savePressed ( )
private

save Log pressed.

◆ writeTempFile()

void LogWidget::writeTempFile ( const QString &  text)
private

Append text in temporary file.

Parameters
text

Member Data Documentation

◆ logFile

QTemporaryFile* LogWidget::logFile = nullptr
private

◆ textLog

QPlainTextEdit* LogWidget::textLog = nullptr
private

◆ unsyncedStrings

QStringList LogWidget::unsyncedStrings
private

The documentation for this class was generated from the following files: