-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add GZipUncompressor class * Add skeleton for TarFile class * Add zlib develpment package to Dockerfile * Tar archive parser & indexer * Set native text rendering * Skeleton framework for CLI storage interface * Serial port commands cleanup * Add Failable and MOTDSkipper classes * MOTDSkipper is now an operation * Add libgl-dev package to docker * Remove unnecessary symlink in Docker * Add remove operation * Saving a lot of work * GZipUncompressor cleanup & improvements * Better manifest parsing, verification & debug * Fix error while upgrading FUS * Working file tree operations * Add WriteOperation * Improved correctness * Add MkDir operation * Revert to chunk-based read operation * Working asset update from file * Improved error handling * Add message feedback * Fix compilation on Windows
- Loading branch information
Showing
56 changed files
with
2,566 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "abstractserialoperation.h" | ||
|
||
#include <QTimer> | ||
#include <QSerialPort> | ||
|
||
#include "macros.h" | ||
|
||
AbstractSerialOperation::AbstractSerialOperation(QSerialPort *serialPort, QObject *parent): | ||
AbstractOperation(parent), | ||
m_serialPort(serialPort) | ||
{} | ||
|
||
AbstractSerialOperation::~AbstractSerialOperation() | ||
{} | ||
|
||
void AbstractSerialOperation::start() | ||
{ | ||
connect(m_serialPort, &QSerialPort::readyRead, this, &AbstractSerialOperation::onSerialPortReadyRead); | ||
connect(m_serialPort, &QSerialPort::errorOccurred, this, &AbstractSerialOperation::onSerialPortError); | ||
|
||
QTimer::singleShot(0, this, &AbstractSerialOperation::begin); | ||
} | ||
|
||
void AbstractSerialOperation::finish() | ||
{ | ||
stopTimeout(); | ||
setState(BasicState::Finished); | ||
|
||
disconnect(m_serialPort, &QSerialPort::readyRead, this, &AbstractSerialOperation::onSerialPortReadyRead); | ||
disconnect(m_serialPort, &QSerialPort::errorOccurred, this, &AbstractSerialOperation::onSerialPortError); | ||
|
||
emit finished(); | ||
} | ||
|
||
QSerialPort *AbstractSerialOperation::serialPort() const | ||
{ | ||
return m_serialPort; | ||
} | ||
|
||
void AbstractSerialOperation::onSerialPortError() | ||
{ | ||
finishWithError(m_serialPort->errorString()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include "abstractoperation.h" | ||
|
||
class QSerialPort; | ||
|
||
class AbstractSerialOperation : public AbstractOperation | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
AbstractSerialOperation(QSerialPort *serialPort, QObject *parent = nullptr); | ||
virtual ~AbstractSerialOperation(); | ||
|
||
void start() override; | ||
void finish() override; | ||
|
||
protected: | ||
QSerialPort *serialPort() const; | ||
|
||
private slots: | ||
virtual void onSerialPortReadyRead() = 0; | ||
void onSerialPortError(); | ||
|
||
private: | ||
virtual bool begin() = 0; | ||
|
||
QSerialPort *m_serialPort; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include <QString> | ||
|
||
class Failable | ||
{ | ||
bool m_isError; | ||
QString m_errorString; | ||
|
||
public: | ||
Failable() { | ||
resetError(); | ||
} | ||
|
||
bool isError() const { return m_isError; } | ||
const QString &errorString() const { return m_errorString; } | ||
|
||
virtual void setError(const QString &errorMessage) { | ||
m_isError = true; | ||
m_errorString = errorMessage; | ||
} | ||
|
||
void resetError() { | ||
m_isError = false; | ||
m_errorString = QStringLiteral("No Error"); | ||
} | ||
}; | ||
|
Oops, something went wrong.