mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
Merge branch '15.06'
This commit is contained in:
commit
032e27c68c
30 changed files with 9355 additions and 109 deletions
|
|
@ -41,7 +41,9 @@ from PyQt5.QtGui import QColor, QIcon
|
|||
|
||||
import platform
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
import configparser
|
||||
import numpy
|
||||
numpy.seterr(all="ignore")
|
||||
|
||||
|
|
@ -117,6 +119,7 @@ class CuraApplication(QtApplication):
|
|||
"id": "local_file",
|
||||
"function": self._writeToLocalFile,
|
||||
"description": self._i18n_catalog.i18nc("Save button tooltip", "Save to Disk"),
|
||||
"shortDescription": self._i18n_catalog.i18nc("Save button tooltip", "Save to Disk"),
|
||||
"icon": "save",
|
||||
"priority": 0
|
||||
})
|
||||
|
|
@ -327,7 +330,8 @@ class CuraApplication(QtApplication):
|
|||
file_name = node.getMeshData().getFileName()
|
||||
if file_name:
|
||||
job = ReadMeshJob(file_name)
|
||||
job.finished.connect(lambda j: node.setMeshData(j.getResult()))
|
||||
job._node = node
|
||||
job.finished.connect(self._reloadMeshFinished)
|
||||
job.start()
|
||||
|
||||
## Get logging data of the backend engine
|
||||
|
|
@ -428,10 +432,15 @@ class CuraApplication(QtApplication):
|
|||
|
||||
filename = os.path.join(path, node.getName()[0:node.getName().rfind(".")] + ".gcode")
|
||||
|
||||
message = Message(self._output_devices[device]["description"], 0, False, -1)
|
||||
message.show()
|
||||
|
||||
job = WriteMeshJob(filename, node.getMeshData())
|
||||
job._sdcard = device
|
||||
job._message = message
|
||||
job.start()
|
||||
job.finished.connect(self._onWriteToSDFinished)
|
||||
|
||||
return
|
||||
|
||||
def _removableDrivesChanged(self):
|
||||
|
|
@ -442,6 +451,7 @@ class CuraApplication(QtApplication):
|
|||
"id": drive,
|
||||
"function": self._writeToSD,
|
||||
"description": self._i18n_catalog.i18nc("Save button tooltip. {0} is sd card name", "Save to SD Card {0}").format(drive),
|
||||
"shortDescription": self._i18n_catalog.i18nc("Save button tooltip. {0} is sd card name", "Save to SD Card {0}").format(""),
|
||||
"icon": "save_sd",
|
||||
"priority": 1
|
||||
})
|
||||
|
|
@ -488,6 +498,9 @@ class CuraApplication(QtApplication):
|
|||
"eject",
|
||||
self._i18n_catalog.i18nc("Message action tooltip, {0} is sdcard", "Eject SD Card {0}").format(job._sdcard)
|
||||
)
|
||||
|
||||
job._message.hide()
|
||||
|
||||
message._sdcard = job._sdcard
|
||||
message.actionTriggered.connect(self._onMessageActionTriggered)
|
||||
message.show()
|
||||
|
|
@ -526,3 +539,6 @@ class CuraApplication(QtApplication):
|
|||
|
||||
Preferences.getInstance().setValue("cura/recent_files", pref)
|
||||
self.recentFilesChanged.emit()
|
||||
|
||||
def _reloadMeshFinished(self, job):
|
||||
job._node.setMeshData(job.getResult())
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ from UM.Resources import Resources
|
|||
from UM.Scene.SceneNode import SceneNode
|
||||
from UM.Qt.Duration import Duration
|
||||
|
||||
import math
|
||||
|
||||
## A class for processing and calculating minimum, currrent and maximum print time.
|
||||
#
|
||||
# This class contains all the logic relating to calculation and slicing for the
|
||||
|
|
@ -146,7 +148,9 @@ class PrintInformation(QObject):
|
|||
self._current_print_time.setDuration(time)
|
||||
self.currentPrintTimeChanged.emit()
|
||||
|
||||
self._material_amount = round(amount / 10) / 100
|
||||
# Material amount is sent as an amount of mm^3, so calculate length from that
|
||||
r = self._current_settings.getSettingValueByKey("material_diameter") / 2
|
||||
self._material_amount = round((amount / (math.pi * r ** 2)) / 1000, 2)
|
||||
self.materialAmountChanged.emit()
|
||||
|
||||
if not self._enabled:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue