File indexing completed on 2024-05-12 04:41:09
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: 2019 Chris Rizzitello <rizzitello@kde.org> 0004 */ 0005 0006 #pragma once 0007 0008 #include <QObject> 0009 #include <QVariant> 0010 0011 #include "atcore_export.h" 0012 0013 /** 0014 * @brief The Bed Deform class 0015 * 0016 * Read and hold data for the Bed Deformation of the printer 0017 */ 0018 0019 class ATCORE_EXPORT BedDeform : public QObject 0020 { 0021 Q_OBJECT 0022 Q_PROPERTY(QVariantList bedDeformationGrid READ bedDeformationGrid NOTIFY dataChanged) 0023 public: 0024 /** 0025 * @brief BedDeform Create a new bedDeform object 0026 * @param parent: Objects parent 0027 */ 0028 explicit BedDeform(QObject *parent = nullptr); 0029 0030 ~BedDeform(); 0031 /** 0032 * @brief decodeDeform Decode the deform list from the provided lines 0033 * @param rawData: raw returns containing deform data 0034 */ 0035 void decodeDeform(const QStringList &rawData); 0036 /** 0037 * @brief get bed Deform info 0038 * @return: bed Deform grid, Variant Format: QList<QList<double>> 0039 * The Inner QList<double> contains, 0040 * one row worth of offsets for the deformation grid. 0041 * the outer list is a list of rows data. 0042 * For a grid with 2x3 proble points the size of the inner list will be 2 and the outer list 3 0043 * example: QVariant(QVariantList, (QVariant(double, 0.25), QVariant(double, 0.225)) 0044 * ,QVariant(QVariantList, (QVariant(double, 0.045), QVariant(double, 0.01)) 0045 * , QVariant(QVariantList, (QVariant(double, -0.168), QVariant(double, -0.24))) 0046 */ 0047 QVariantList bedDeformationGrid(); 0048 signals: 0049 void dataChanged(const QVariantList &data); 0050 0051 private: 0052 struct BedDeformPrivate; 0053 BedDeformPrivate *d; 0054 };