#include <machineinfo.h>
|
enum class | KEY {
NAME = 0
, BAUDRATE
, FIRMWARE
, MAXBEDTEMP
,
MAXEXTTEMP
, POSTPAUSE
, ISCARTESIAN
, XMAX
,
YMAX
, ZMAX
, AUTOTEMPREPORT
} |
| KEYS enum Possible keys for the printer settings. More...
|
|
|
QObject * | qmlSingletonRegister (QQmlEngine *engine, QJSEngine *scriptEngine) |
| Register The MachineInfo Singleton for QML. More...
|
|
Q_INVOKABLE QVariantMap | readProfile (const QString &profileName) const |
| Read a full profile. More...
|
|
Q_INVOKABLE QVariant | readKey (const QString &profileName, const MachineInfo::KEY key) const |
| Read a key from a profile. More...
|
|
void | storeProfile (const QMap< MachineInfo::KEY, QVariant > &profile) const |
| Store a new profile, Must be used for new profiles. More...
|
|
Q_INVOKABLE void | storeProfile (const QVariantMap &profile) const |
| Store a new profile, Must be used for new profiles or to override a profile. More...
|
|
Q_INVOKABLE bool | storeKey (const QString &profileName, const MachineInfo::KEY key, const QVariant &value) const |
| Store a key to an existing profile, Sending a key of Key::NAME will rename the profile. More...
|
|
Q_INVOKABLE bool | copyProfile (const QString &srcProfile, const QString &destProfile, bool rmSrc=false) const |
| copyies a profile and optionally deletes the src profile More...
|
|
Q_INVOKABLE bool | removeProfile (const QString &profileName) const |
| Remove a full profile. More...
|
|
QStringList | profileNames () const |
| Get a list of all the profile names. More...
|
|
Q_INVOKABLE QString | keyName (const MachineInfo::KEY key) const |
| Translate a key enum to string. More...
|
|
◆ KEY
KEYS enum Possible keys for the printer settings.
Enumerator |
---|
NAME | Profile Name.
|
BAUDRATE | Machine BAUD Rate.
|
FIRMWARE | Firmware name.
|
MAXBEDTEMP | Maximum Bed Temperature.
|
MAXEXTTEMP | Maximum Extruder Temperature.
|
POSTPAUSE | Post Pause Commands.
|
ISCARTESIAN | Is the machine Cartesian.
|
XMAX | X Size for Cartesian machines, Radius for Deltas.
|
YMAX | Y Size.
|
ZMAX | Z Size for Cartesian machines, Height for Deltas.
|
AUTOTEMPREPORT | Supports AutoTemp Reporting.
|
◆ MachineInfo() [1/2]
◆ MachineInfo() [2/2]
MachineInfo::MachineInfo |
( |
QObject * |
parent = nullptr | ) |
|
|
explicitprivate |
◆ ~MachineInfo()
MachineInfo::~MachineInfo |
( |
| ) |
|
|
privatedefault |
◆ copyProfile()
bool MachineInfo::copyProfile |
( |
const QString & |
srcProfile, |
|
|
const QString & |
destProfile, |
|
|
bool |
rmSrc = false |
|
) |
| const |
copyies a profile and optionally deletes the src profile
- Parameters
-
srcProfile | profiles Current Name |
destProfile | profiles New Name |
rmSrc | delete srcProfile (defalut false) |
- Returns
- true if successful
◆ instance()
◆ keyName()
Translate a key enum to string.
- Parameters
-
key | name of the key to be translated. |
- Returns
- key string if successful.
◆ operator=()
◆ profileNames()
QStringList MachineInfo::profileNames |
( |
| ) |
const |
Get a list of all the profile names.
- Returns
- QStringList containing the stored profile names.
◆ profilesChanged
void MachineInfo::profilesChanged |
( |
| ) |
const |
|
signal |
◆ qmlSingletonRegister()
QObject * MachineInfo::qmlSingletonRegister |
( |
QQmlEngine * |
engine, |
|
|
QJSEngine * |
scriptEngine |
|
) |
| |
◆ readKey()
QVariant MachineInfo::readKey |
( |
const QString & |
profileName, |
|
|
const MachineInfo::KEY |
key |
|
) |
| const |
Read a key from a profile.
- Parameters
-
profileName | name of the profile you want to read from. |
key | the Key you want to read |
- Returns
- The value of the requested Key
- See also
- readProfile()
◆ readProfile()
QVariantMap MachineInfo::readProfile |
( |
const QString & |
profileName | ) |
const |
Read a full profile.
- Parameters
-
profileName | name of the profile you want to read. |
- Returns
- A full map of the profile
- See also
- readKey()
◆ removeProfile()
bool MachineInfo::removeProfile |
( |
const QString & |
profileName | ) |
const |
Remove a full profile.
- Parameters
-
profileName | name of the profile you want to remove. |
- Returns
- true if successful.
◆ storeKey()
bool MachineInfo::storeKey |
( |
const QString & |
profileName, |
|
|
const MachineInfo::KEY |
key, |
|
|
const QVariant & |
value |
|
) |
| const |
Store a key to an existing profile, Sending a key of Key::NAME will rename the profile.
- Parameters
-
profileName | profile to write into |
key | The key you will write to |
value | The value you will store. |
- Returns
- true if successful
- See also
- storeProfile()
◆ storeProfile() [1/2]
void MachineInfo::storeProfile |
( |
const QMap< MachineInfo::KEY, QVariant > & |
profile | ) |
const |
Store a new profile, Must be used for new profiles.
- Parameters
-
profile | A complete machine profile or one that at very least has MachineInfo::Name and any other valid Key. |
- See also
- storeKey()
◆ storeProfile() [2/2]
void MachineInfo::storeProfile |
( |
const QVariantMap & |
profile | ) |
const |
Store a new profile, Must be used for new profiles or to override a profile.
- Parameters
-
profile | A complete machine profile or one that at very least has a profile Name and any other valid Key. |
- See also
- storeKey()
◆ decoderMap
Initial value:= {{
KEY::NAME, {QStringLiteral(
"Name"), QStringLiteral(
"ProfileName")}},
{
KEY::FIRMWARE, {QStringLiteral(
"firmware"), QStringLiteral(
"Auto-Detect")}},
{
KEY::XMAX, {QStringLiteral(
"dimensionX"), 200}},
{
KEY::YMAX, {QStringLiteral(
"dimensionY"), 200}},
{
KEY::ZMAX, {QStringLiteral(
"dimensionZ"), 180}},
@ MAXEXTTEMP
Maximum Extruder Temperature.
@ POSTPAUSE
Post Pause Commands.
@ MAXBEDTEMP
Maximum Bed Temperature.
@ XMAX
X Size for Cartesian machines, Radius for Deltas.
@ BAUDRATE
Machine BAUD Rate.
@ ZMAX
Z Size for Cartesian machines, Height for Deltas.
@ ISCARTESIAN
Is the machine Cartesian.
@ AUTOTEMPREPORT
Supports AutoTemp Reporting.
Map of MachineInfo::KEY , KeyString and DefaultValue.
◆ m_settings
QSettings* MachineInfo::m_settings = nullptr |
|
private |
m_settings our settings object.
◆ profileNames
QStringList MachineInfo::profileNames |
|
read |
The documentation for this class was generated from the following files: