Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/3dview/fileloader.cpp
Show All 19 Lines | 1 | /* Atelier KDE Printer Host for 3D Printing | |||
---|---|---|---|---|---|
20 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | */ | 21 | */ | ||
22 | #include <QString> | 22 | #include <QString> | ||
23 | #include <QTextStream> | 23 | #include <QTextStream> | ||
24 | #include <QVariant> | 24 | #include <QVariant> | ||
25 | #include <QVector> | 25 | #include <QVector> | ||
26 | #include <QVector4D> | 26 | #include <QVector4D> | ||
27 | #include "fileloader.h" | 27 | #include "fileloader.h" | ||
28 | 28 | | |||
29 | namespace | 29 | const QString FileLoader::_commentChar = QStringLiteral(";"); | ||
laysrodrigues: ns? can you clarify the name of this namespace, because ns short for namespace doesn't sound… | |||||
30 | { | 30 | const QStringList FileLoader::_moveCommands = {QStringLiteral("G0"), QStringLiteral("G1")}; | ||
31 | const static QString _commentChar = QStringLiteral(";"); | 31 | const QString FileLoader::_space = QStringLiteral(" "); | ||
32 | const static QStringList _moveCommands = {QStringLiteral("G0"), QStringLiteral("G1")}; | 32 | const QString FileLoader::_E = QStringLiteral("E"); | ||
33 | const static QString _space = QStringLiteral(" "); | 33 | const QString FileLoader::_X = QStringLiteral("X"); | ||
34 | const static QString _E = QStringLiteral("E"); | 34 | const QString FileLoader::_Y = QStringLiteral("Y"); | ||
35 | const static QString _X = QStringLiteral("X"); | 35 | const QString FileLoader::_Z = QStringLiteral("Z"); | ||
36 | const static QString _Y = QStringLiteral("Y"); | | |||
37 | const static QString _Z = QStringLiteral("Z"); | | |||
38 | } | | |||
39 | 36 | | |||
40 | FileLoader::FileLoader(QString &fileName, QObject *parent) : | 37 | FileLoader::FileLoader(QString &fileName, QObject *parent) : | ||
41 | QObject(parent) | 38 | QObject(parent) | ||
42 | , _file(fileName) | 39 | , _file(fileName) | ||
43 | { | 40 | { | ||
44 | } | 41 | } | ||
45 | 42 | | |||
46 | FileLoader::~FileLoader() | | |||
47 | { | | |||
48 | } | | |||
49 | | ||||
50 | void FileLoader::run() | 43 | void FileLoader::run() | ||
51 | { | 44 | { | ||
52 | QVector<QVector4D> pos; | 45 | QVector<QVector4D> pos; | ||
53 | qint64 totalSize = _file.bytesAvailable(); | 46 | qint64 totalSize = _file.bytesAvailable(); | ||
54 | qint64 stillSize = totalSize; | 47 | qint64 stillSize = totalSize; | ||
55 | 48 | | |||
56 | if (_file.open(QIODevice::ReadOnly)) { | 49 | if (_file.open(QIODevice::ReadOnly)) { | ||
57 | int lastPerc = 0; | 50 | int lastPerc = 0; | ||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |
ns? can you clarify the name of this namespace, because ns short for namespace doesn't sound clear