Changeset View
Changeset View
Standalone View
Standalone View
src/core/atcore.h
Show All 26 Lines | |||||
27 | #include <memory> | 27 | #include <memory> | ||
28 | #include <QObject> | 28 | #include <QObject> | ||
29 | #include <QSerialPort> | 29 | #include <QSerialPort> | ||
30 | #include <QSerialPortInfo> | 30 | #include <QSerialPortInfo> | ||
31 | 31 | | |||
32 | #include "ifirmware.h" | 32 | #include "ifirmware.h" | ||
33 | #include "temperature.h" | 33 | #include "temperature.h" | ||
34 | #include "atcore_export.h" | 34 | #include "atcore_export.h" | ||
35 | #include "beddeform.h" | ||||
35 | 36 | | |||
36 | class SerialLayer; | 37 | class SerialLayer; | ||
37 | class IFirmware; | 38 | class IFirmware; | ||
38 | class QTime; | 39 | class QTime; | ||
39 | 40 | | |||
40 | /** | 41 | /** | ||
41 | * @brief The AtCore class | 42 | * @brief The AtCore class | ||
42 | * aims to provides a high level interface for serial based gcode devices<br /> | 43 | * aims to provides a high level interface for serial based gcode devices<br /> | ||
▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Line(s) | 86 | public: | |||
193 | 194 | | |||
194 | /** | 195 | /** | ||
195 | * @brief Return printed percentage | 196 | * @brief Return printed percentage | ||
196 | * @sa printProgressChanged() | 197 | * @sa printProgressChanged() | ||
197 | */ | 198 | */ | ||
198 | float percentagePrinted() const; | 199 | float percentagePrinted() const; | ||
199 | 200 | | |||
200 | /** | 201 | /** | ||
202 | * @brief The Bed Deform data as told by the Firmware. | ||||
203 | */ | ||||
204 | std::shared_ptr<BedDeform> bedDeform(); | ||||
205 | | ||||
206 | /** | ||||
201 | * @brief The temperature of the current hotend as told by the Firmware. | 207 | * @brief The temperature of the current hotend as told by the Firmware. | ||
202 | */ | 208 | */ | ||
203 | std::shared_ptr<Temperature> temperature(); | 209 | std::shared_ptr<Temperature> temperature(); | ||
204 | 210 | | |||
205 | /** | 211 | /** | ||
206 | * @brief Return the amount of miliseconds the serialTimer is set to. 0 = Disabled | 212 | * @brief Return the amount of miliseconds the serialTimer is set to. 0 = Disabled | ||
207 | */ | 213 | */ | ||
208 | int serialTimerInterval() const; | 214 | int serialTimerInterval() const; | ||
▲ Show 20 Lines • Show All 360 Lines • ▼ Show 20 Line(s) | 529 | private slots: | |||
569 | /** | 575 | /** | ||
570 | * @brief Handle serial Errors. | 576 | * @brief Handle serial Errors. | ||
571 | */ | 577 | */ | ||
572 | void handleSerialError(QSerialPort::SerialPortError error); | 578 | void handleSerialError(QSerialPort::SerialPortError error); | ||
573 | 579 | | |||
574 | private: | 580 | private: | ||
575 | 581 | | |||
576 | /** | 582 | /** | ||
577 | * @brief Load A firmware plugin | 583 | * @brief Load A firmware plugin | ||
tcanabrava: return by copy, this eliminates possible crashes. | |||||
If this is wrong we should also fix the Temperature object return. (it returns a constRef to the temperature object) rizzitello: If this is wrong we should also fix the Temperature object return. (it returns a constRef to… | |||||
QObjects are not allowing copies. So only by ref is working. I'm also having various issues storing via QSharedPtr and various smart pointers. (maybe i am doing it wrong?) rizzitello: QObjects are not allowing copies. So only by ref is working. I'm also having various issues… | |||||
patrickelectric: You can define a copy operator.
| |||||
578 | * @param fwName : name of the firmware | 584 | * @param fwName : name of the firmware | ||
579 | * @sa firmwarePlugin(), availableFirmwarePlugins() | 585 | * @sa firmwarePlugin(), availableFirmwarePlugins() | ||
580 | */ | 586 | */ | ||
581 | Q_INVOKABLE void loadFirmwarePlugin(const QString &fwName); | 587 | Q_INVOKABLE void loadFirmwarePlugin(const QString &fwName); | ||
582 | 588 | | |||
583 | /** | 589 | /** | ||
584 | * @brief True if a firmware plugin is loaded | 590 | * @brief True if a firmware plugin is loaded | ||
585 | */ | 591 | */ | ||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |
return by copy, this eliminates possible crashes.