Changeset View
Changeset View
Standalone View
Standalone View
src/core/machineinfo.h
| Show All 26 Lines | |||||
| 27 | #include <QObject> | 27 | #include <QObject> | ||
| 28 | #include <QSettings> | 28 | #include <QSettings> | ||
| 29 | #include <QQmlEngine> | 29 | #include <QQmlEngine> | ||
| 30 | #include <QVariant> | 30 | #include <QVariant> | ||
| 31 | 31 | | |||
| 32 | class ATCORE_EXPORT MachineInfo : public QObject | 32 | class ATCORE_EXPORT MachineInfo : public QObject | ||
| 33 | { | 33 | { | ||
| 34 | Q_OBJECT | 34 | Q_OBJECT | ||
| 35 | Q_PROPERTY(QStringList profileNames READ profileNames NOTIFY profilesChanged) | ||||
| 35 | public: | 36 | public: | ||
| 36 | /** | 37 | /** | ||
| 37 | * @brief KEYS enum Possible keys for the printer settings | 38 | * @brief KEYS enum Possible keys for the printer settings | ||
| 38 | */ | 39 | */ | ||
| 39 | enum class KEY { | 40 | enum class KEY { | ||
| 40 | NAME = 0, //!< Profile Name | 41 | NAME = 0, //!< Profile Name | ||
| 41 | BAUDRATE, //!< Machine BAUD Rate | 42 | BAUDRATE, //!< Machine BAUD Rate | ||
| 42 | FIRMWARE, //!<Firmware name | 43 | FIRMWARE, //!<Firmware name | ||
| ▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | |||||
| 117 | * @return true if successful. | 118 | * @return true if successful. | ||
| 118 | */ | 119 | */ | ||
| 119 | Q_INVOKABLE bool removeProfile(const QString &profileName) const; | 120 | Q_INVOKABLE bool removeProfile(const QString &profileName) const; | ||
| 120 | 121 | | |||
| 121 | /** | 122 | /** | ||
| 122 | * @brief Get a list of all the profile names | 123 | * @brief Get a list of all the profile names | ||
| 123 | * @return QStringList containing the stored profile names. | 124 | * @return QStringList containing the stored profile names. | ||
| 124 | */ | 125 | */ | ||
| 125 | Q_INVOKABLE QStringList profileNames() const; | 126 | QStringList profileNames() const; | ||
| 126 | 127 | | |||
| 127 | /** | 128 | /** | ||
| 128 | * @brief Translate a key enum to string | 129 | * @brief Translate a key enum to string | ||
| 129 | * @param key: name of the key to be translated. | 130 | * @param key: name of the key to be translated. | ||
| 130 | * @return key string if successful. | 131 | * @return key string if successful. | ||
| 131 | */ | 132 | */ | ||
| 132 | Q_INVOKABLE QString keyName(const MachineInfo::KEY key) const; | 133 | Q_INVOKABLE QString keyName(const MachineInfo::KEY key) const; | ||
| 133 | 134 | | |||
| Show All 31 Lines | |||||