File indexing completed on 2024-05-12 04:41:10
0001 /* AtCore KDE Libary for 3D Printers 0002 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0003 SPDX-FileCopyrightText: 2016 Tomaz Canabrava <tcanabrava@kde.org> 0004 SPDX-FileCopyrightText: 2016-2018 Chris Rizzitello <rizzitello@kde.org> 0005 SPDX-FileCopyrightText: 2016-2018 Patrick José Pereira <patrickjp@kde.org> 0006 */ 0007 0008 #pragma once 0009 0010 #include <QObject> 0011 0012 #include "ifirmware.h" 0013 /** 0014 * @brief The GrblPlugin class 0015 * Plugin for Grbl 0016 */ 0017 class GrblPlugin : public IFirmware 0018 { 0019 Q_OBJECT 0020 Q_PLUGIN_METADATA(IID "org.kde.atelier.core.firmware") 0021 Q_INTERFACES(IFirmware) 0022 0023 public: 0024 /** 0025 * @brief Create new GrblPlugin 0026 */ 0027 GrblPlugin(); 0028 ~GrblPlugin() = default; 0029 0030 /** 0031 * @brief Return Plugin name 0032 * @return Grbl 0033 */ 0034 QString name() const override; 0035 0036 /** 0037 * @brief sdSupport 0038 * @return True if plugins supports sd cards 0039 */ 0040 bool isSdSupported() const override; 0041 0042 /** 0043 * @brief Translate common commands to firmware specific command. 0044 * @param command: command to translate 0045 * @return firmware specific translated command 0046 */ 0047 QByteArray translate(const QString &command) override; 0048 0049 /** 0050 * @brief Grbl does not return anything on command execution 0051 * @param lastMessage: last message from printer 0052 */ 0053 void validateCommand(const QString &lastMessage) override; 0054 };