diff --git a/src/core/atcore.h b/src/core/atcore.h index 54b3990..905e481 100644 --- a/src/core/atcore.h +++ b/src/core/atcore.h @@ -1,623 +1,623 @@ /* AtCore Copyright (C) <2016 - 2019> Authors: Tomaz Canabrava Chris Rizzitello Patrick José Pereira Lays Rodrigues This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #pragma once #include #include #include #include "ifirmware.h" #include "temperature.h" #include "atcore_export.h" class SerialLayer; class IFirmware; class QTime; /** * @brief The AtCore class * aims to provides a high level interface for serial based gcode devices
* * #### General Workflow * - Connect to a serial port with newConnection() * - Send commands to the device (pushCommand(), print(), ...) * - AtCore::close() when you are all done. * #### How AtCore Finds Plugins. * AtCore will check each directory below for plugins. * 1. QApplication::applicationDirPath/plugins (runtime) * 2. QApplication::applicationDirPath/AtCore (runtime) * 3. QApplication::applicationDirPath/../PlugIns/AtCore (runtime) * 4. Fullpath of KDE_PLUGIN_DIR (buildtime) * 5. Qt Plugin path/AtCore (runtime) * 6. ECM set KDE PLUGIN DIR (buildtime) * 7. Build Dir/plugins (buildtime) */ class ATCORE_EXPORT AtCore : public QObject { Q_OBJECT - Q_PROPERTY(QString version READ version) + Q_PROPERTY(QString version READ version CONSTANT) Q_PROPERTY(QStringList availableFirmwarePlugins READ availableFirmwarePlugins) Q_PROPERTY(int extruderCount READ extruderCount WRITE setExtruderCount NOTIFY extruderCountChanged) Q_PROPERTY(int temperatureTimerInterval READ temperatureTimerInterval WRITE setTemperatureTimerInterval NOTIFY temperatureTimerIntervalChanged); Q_PROPERTY(int serialTimerInterval READ serialTimerInterval WRITE setSerialTimerInterval NOTIFY serialTimerIntervalChanged) Q_PROPERTY(QStringList serialPorts READ serialPorts NOTIFY portsChanged) Q_PROPERTY(float percentagePrinted READ percentagePrinted NOTIFY printProgressChanged) - Q_PROPERTY(QStringList portSpeeds READ portSpeeds) + Q_PROPERTY(QStringList portSpeeds READ portSpeeds CONSTANT) Q_PROPERTY(QString connectedPort READ connectedPort) Q_PROPERTY(AtCore::STATES state READ state WRITE setState NOTIFY stateChanged) Q_PROPERTY(bool sdMount READ isSdMounted WRITE setSdMounted NOTIFY sdMountChanged) Q_PROPERTY(QStringList sdFileList READ sdFileList NOTIFY sdCardFileListChanged) friend class AtCoreTests; //Add friends as Sd Card support is extended to more plugins. friend class RepetierPlugin; friend class MarlinPlugin; //friend class SmoothiePlugin; //friend class TeacupPlugin; //friend class AprinterPlugin; //friend class SprinterPlugin; public: /** * @brief STATES enum Possible states the printer can be in */ enum STATES { DISCONNECTED, //!< Not Connected to a printer, initial state CONNECTING, //! findFirmwarePlugins(const QString &path); /** * @brief returns AtCorePrivate::sdCardReadingFileList * @return True if printer is returning sd card file list */ bool isReadingSdCardList() const; /** * @brief stops print just for sd prints used internally * @sa stop(), emergencyStop() */ void stopSdPrint(); /** * @brief New connections need to wait for the machine to be ready if it needs reboot * @param message: message from the firmware * @param fwName: fwName to load */ void waitForPrinterReboot(const QByteArray &message, const QString &fwName); /** * @brief Hold private data of AtCore. */ struct AtCorePrivate; AtCorePrivate *d; protected: /** * @brief Set the number of extruders on the machine. * @param newCount * @sa extruderCount(), extruderCountChanged(int newCount) */ void setExtruderCount(int newCount); /** * @brief Append a file to AtCorePrivate::sdCardFileList. * @param fileName: new FileName */ void appendSdCardFileList(const QString &fileName); /** * @brief Clear AtCorePrivate::sdCardFileList. */ void clearSdCardFileList(); /** * @brief Set if the sd card is mounted by the printer * @param mounted: True is mounted */ void setSdMounted(const bool mounted); /** * @brief set AtCorePrivate::sdCardReadingFileList * @param readingList set true if reading file list */ void setReadingSdCardList(bool readingList); };