mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Convert doxygen to rst for Firmware update plugins
This commit is contained in:
parent
54d2fe95d1
commit
6ca9b4678e
3 changed files with 20 additions and 12 deletions
|
@ -18,10 +18,12 @@ from .FirmwareUpdateCheckerMessage import FirmwareUpdateCheckerMessage
|
||||||
i18n_catalog = i18nCatalog("cura")
|
i18n_catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
||||||
## This Extension checks for new versions of the firmware based on the latest checked version number.
|
|
||||||
# The plugin is currently only usable for applications maintained by Ultimaker. But it should be relatively easy
|
|
||||||
# to change it to work for other applications.
|
|
||||||
class FirmwareUpdateChecker(Extension):
|
class FirmwareUpdateChecker(Extension):
|
||||||
|
"""This Extension checks for new versions of the firmware based on the latest checked version number.
|
||||||
|
|
||||||
|
The plugin is currently only usable for applications maintained by Ultimaker. But it should be relatively easy
|
||||||
|
to change it to work for other applications.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
@ -35,8 +37,9 @@ class FirmwareUpdateChecker(Extension):
|
||||||
self._check_job = None
|
self._check_job = None
|
||||||
self._checked_printer_names = set() # type: Set[str]
|
self._checked_printer_names = set() # type: Set[str]
|
||||||
|
|
||||||
## Callback for the message that is spawned when there is a new version.
|
|
||||||
def _onActionTriggered(self, message, action):
|
def _onActionTriggered(self, message, action):
|
||||||
|
"""Callback for the message that is spawned when there is a new version."""
|
||||||
|
|
||||||
if action == FirmwareUpdateCheckerMessage.STR_ACTION_DOWNLOAD:
|
if action == FirmwareUpdateCheckerMessage.STR_ACTION_DOWNLOAD:
|
||||||
machine_id = message.getMachineId()
|
machine_id = message.getMachineId()
|
||||||
download_url = message.getDownloadUrl()
|
download_url = message.getDownloadUrl()
|
||||||
|
@ -57,13 +60,15 @@ class FirmwareUpdateChecker(Extension):
|
||||||
def _onJobFinished(self, *args, **kwargs):
|
def _onJobFinished(self, *args, **kwargs):
|
||||||
self._check_job = None
|
self._check_job = None
|
||||||
|
|
||||||
## Connect with software.ultimaker.com, load latest.version and check version info.
|
|
||||||
# If the version info is different from the current version, spawn a message to
|
|
||||||
# allow the user to download it.
|
|
||||||
#
|
|
||||||
# \param silent type(boolean) Suppresses messages other than "new version found" messages.
|
|
||||||
# This is used when checking for a new firmware version at startup.
|
|
||||||
def checkFirmwareVersion(self, container = None, silent = False):
|
def checkFirmwareVersion(self, container = None, silent = False):
|
||||||
|
"""Connect with software.ultimaker.com, load latest.version and check version info.
|
||||||
|
|
||||||
|
If the version info is different from the current version, spawn a message to
|
||||||
|
allow the user to download it.
|
||||||
|
|
||||||
|
:param silent: type(boolean) Suppresses messages other than "new version found" messages.
|
||||||
|
This is used when checking for a new firmware version at startup.
|
||||||
|
"""
|
||||||
container_name = container.definition.getName()
|
container_name = container.definition.getName()
|
||||||
if container_name in self._checked_printer_names:
|
if container_name in self._checked_printer_names:
|
||||||
return
|
return
|
||||||
|
|
|
@ -21,8 +21,9 @@ from UM.i18n import i18nCatalog
|
||||||
i18n_catalog = i18nCatalog("cura")
|
i18n_catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
||||||
## This job checks if there is an update available on the provided URL.
|
|
||||||
class FirmwareUpdateCheckerJob(Job):
|
class FirmwareUpdateCheckerJob(Job):
|
||||||
|
"""This job checks if there is an update available on the provided URL."""
|
||||||
|
|
||||||
STRING_ZERO_VERSION = "0.0.0"
|
STRING_ZERO_VERSION = "0.0.0"
|
||||||
STRING_EPSILON_VERSION = "0.0.1"
|
STRING_EPSILON_VERSION = "0.0.1"
|
||||||
ZERO_VERSION = Version(STRING_ZERO_VERSION)
|
ZERO_VERSION = Version(STRING_ZERO_VERSION)
|
||||||
|
|
|
@ -19,8 +19,10 @@ if MYPY:
|
||||||
|
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
## Upgrade the firmware of a machine by USB with this action.
|
|
||||||
class FirmwareUpdaterMachineAction(MachineAction):
|
class FirmwareUpdaterMachineAction(MachineAction):
|
||||||
|
"""Upgrade the firmware of a machine by USB with this action."""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__("UpgradeFirmware", catalog.i18nc("@action", "Update Firmware"))
|
super().__init__("UpgradeFirmware", catalog.i18nc("@action", "Update Firmware"))
|
||||||
self._qml_url = "FirmwareUpdaterMachineAction.qml"
|
self._qml_url = "FirmwareUpdaterMachineAction.qml"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue