Changeset View
Changeset View
Standalone View
Standalone View
src/atcore.h
Show All 39 Lines | |||||
40 | struct AtCorePrivate; | 40 | struct AtCorePrivate; | ||
41 | 41 | | |||
42 | /** | 42 | /** | ||
43 | * @brief The AtCore class | 43 | * @brief The AtCore class | ||
44 | * aims to provides a high level interface for serial based gcode devices<br /> | 44 | * aims to provides a high level interface for serial based gcode devices<br /> | ||
45 | * | 45 | * | ||
46 | * #### General Workflow | 46 | * #### General Workflow | ||
47 | * - Connect to a serial port with initSerial() | 47 | * - Connect to a serial port with initSerial() | ||
48 | * - Auto detect the firmware with detectFirmware() | 48 | * - Firmware will be auto detected. Use loadFirmwarePLugin() to force load a firmware. | ||
49 | * - Send commands to the device (pushCommand(),print(),...) | 49 | * - Send commands to the device (pushCommand(),print(),...) | ||
50 | * - AtCore::close() when you are all done. | 50 | * - AtCore::close() when you are all done. | ||
51 | 51 | | |||
52 | * #### How AtCore Finds Plugins. | 52 | * #### How AtCore Finds Plugins. | ||
53 | * - Windows and Mac Os will always look in appdir/plugins for plugins. | 53 | * - Windows and Mac Os will always look in appdir/plugins for plugins. | ||
54 | * | 54 | * | ||
55 | * Others Search: | 55 | * Others Search: | ||
56 | * 1. Build Dir/plugins (buildtime) | 56 | * 1. Build Dir/plugins (buildtime) | ||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 84 | public: | |||
165 | * @brief Close the current serial connection | 165 | * @brief Close the current serial connection | ||
166 | * @sa initSerial(),serial(),serialPorts(),AtCore::close() | 166 | * @sa initSerial(),serial(),serialPorts(),AtCore::close() | ||
167 | */ | 167 | */ | ||
168 | Q_INVOKABLE void closeConnection(); | 168 | Q_INVOKABLE void closeConnection(); | ||
169 | 169 | | |||
170 | /** | 170 | /** | ||
171 | * @brief Main access to the loaded firmware plugin | 171 | * @brief Main access to the loaded firmware plugin | ||
172 | * @return IFirmware * to currently loaded plugin | 172 | * @return IFirmware * to currently loaded plugin | ||
173 | * @sa availableFirmwarePlugins(),loadFirmwarePlugin(),detectFirmware() | 173 | * @sa availableFirmwarePlugins(),loadFirmwarePlugin() | ||
174 | */ | 174 | */ | ||
175 | Q_INVOKABLE IFirmware *firmwarePlugin() const; | 175 | Q_INVOKABLE IFirmware *firmwarePlugin() const; | ||
176 | 176 | | |||
177 | /** | 177 | /** | ||
178 | * @brief List of available firmware plugins | 178 | * @brief List of available firmware plugins | ||
179 | * @sa loadFirmwarePlugin(),firmwarePlugin(),detectFirmware() | 179 | * @sa loadFirmwarePlugin(),firmwarePlugin() | ||
180 | */ | 180 | */ | ||
181 | QStringList availableFirmwarePlugins() const; | 181 | QStringList availableFirmwarePlugins() const; | ||
182 | 182 | | |||
183 | /** | 183 | /** | ||
184 | * @brief Load A firmware plugin | 184 | * @brief Load A firmware plugin | ||
185 | * @param fwName : name of the firmware | 185 | * @param fwName : name of the firmware | ||
186 | * @sa firmwarePlugin(),availableFirmwarePlugins(),detectFirmware() | 186 | * @sa firmwarePlugin(),availableFirmwarePlugins() | ||
187 | */ | 187 | */ | ||
188 | Q_INVOKABLE void loadFirmwarePlugin(const QString &fwName); | 188 | Q_INVOKABLE void loadFirmwarePlugin(const QString &fwName); | ||
189 | 189 | | |||
190 | /** | 190 | /** | ||
191 | * @brief Attempt to autodetect the firmware of connect serial device | | |||
192 | * @sa loadFirmwarePlugin(),availableFirmwarePlugins(),firmwarePlugin() | | |||
193 | */ | | |||
194 | Q_INVOKABLE void detectFirmware(); | | |||
195 | | ||||
196 | /** | | |||
197 | * @brief Get Printer state | 191 | * @brief Get Printer state | ||
198 | * @return State of the printer | 192 | * @return State of the printer | ||
199 | * @sa setState(),stateChanged(),AtCore::STATES | 193 | * @sa setState(),stateChanged(),AtCore::STATES | ||
200 | */ | 194 | */ | ||
201 | AtCore::STATES state(void); | 195 | AtCore::STATES state(void); | ||
202 | 196 | | |||
203 | /** | 197 | /** | ||
204 | * @brief extruderCount | 198 | * @brief extruderCount | ||
▲ Show 20 Lines • Show All 202 Lines • ▼ Show 20 Line(s) | 292 | public slots: | |||
407 | 401 | | |||
408 | /** | 402 | /** | ||
409 | * @brief Set printer to relative position mode | 403 | * @brief Set printer to relative position mode | ||
410 | * @sa setAbsolutePosition() | 404 | * @sa setAbsolutePosition() | ||
411 | */ | 405 | */ | ||
412 | Q_INVOKABLE void setRelativePosition(); | 406 | Q_INVOKABLE void setRelativePosition(); | ||
413 | 407 | | |||
414 | /** | 408 | /** | ||
415 | * @brief Disables idle hold of motors after a delay | 409 | * @brief Disable motors after a delay | ||
patrickelectric: The brief already have the exactly same text, this line should be removed. | |||||
416 | * @param delay: Seconds until idle hold is released. 0= No delay | 410 | * @param delay: Seconds until motors are disabled. 0= No delay | ||
417 | */ | 411 | */ | ||
418 | Q_INVOKABLE void setIdleHold(uint delay = 0); | 412 | Q_INVOKABLE void disableMotors(uint delay = 0); | ||
419 | 413 | | |||
420 | /** | 414 | /** | ||
421 | * @brief set the Printers speed | 415 | * @brief set the Printers speed | ||
422 | * @param speed: speed in % (default is 100); | 416 | * @param speed: speed in % (default is 100); | ||
423 | */ | 417 | */ | ||
424 | Q_INVOKABLE void setPrinterSpeed(uint speed = 100); | 418 | Q_INVOKABLE void setPrinterSpeed(uint speed = 100); | ||
425 | 419 | | |||
426 | /** | 420 | /** | ||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 462 | private slots: | |||
479 | /** | 473 | /** | ||
480 | * @brief Connect to SerialLayer::receivedCommand | 474 | * @brief Connect to SerialLayer::receivedCommand | ||
481 | * @param message: new message. | 475 | * @param message: new message. | ||
482 | */ | 476 | */ | ||
483 | void newMessage(const QByteArray &message); | 477 | void newMessage(const QByteArray &message); | ||
484 | 478 | | |||
485 | /** | 479 | /** | ||
486 | * @brief Search for firmware string in message. | 480 | * @brief Search for firmware string in message. | ||
487 | * A Helper function for detectFirmware() | 481 | * A Helper function for Firmware detection | ||
488 | * @param message | 482 | * @param message | ||
489 | */ | 483 | */ | ||
490 | void findFirmware(const QByteArray &message); | 484 | void findFirmware(const QByteArray &message); | ||
491 | 485 | | |||
492 | /** | 486 | /** | ||
493 | * @brief Search for new serial ports | 487 | * @brief Search for new serial ports | ||
494 | */ | 488 | */ | ||
495 | void locateSerialPort(); | 489 | void locateSerialPort(); | ||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |
The brief already have the exactly same text, this line should be removed.