mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-02 07:11:22 -07:00
Fix coding style issues
This commit is contained in:
parent
743b403b29
commit
9267b517d6
12 changed files with 68 additions and 60 deletions
|
|
@ -109,10 +109,10 @@ class ThreeMFReader(MeshReader):
|
|||
node.setOrientation(temp_quaternion)
|
||||
|
||||
# Magical scale extraction
|
||||
S2 = temp_mat.getTransposed().multiply(temp_mat)
|
||||
scale_x = math.sqrt(S2.at(0,0))
|
||||
scale_y = math.sqrt(S2.at(1,1))
|
||||
scale_z = math.sqrt(S2.at(2,2))
|
||||
scale = temp_mat.getTransposed().multiply(temp_mat)
|
||||
scale_x = math.sqrt(scale.at(0,0))
|
||||
scale_y = math.sqrt(scale.at(1,1))
|
||||
scale_z = math.sqrt(scale.at(2,2))
|
||||
node.setScale(Vector(scale_x,scale_y,scale_z))
|
||||
|
||||
# We use a different coordinate frame, so rotate.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# Copyright (c) 2015 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
from . import ThreeMFReader
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
def getMetaData():
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ProcessSlicedObjectListJob(Job):
|
|||
|
||||
Application.getInstance().getController().activeViewChanged.connect(self._onActiveViewChanged)
|
||||
|
||||
objectIdMap = {}
|
||||
object_id_map = {}
|
||||
new_node = SceneNode()
|
||||
## Put all nodes in a dict identified by ID
|
||||
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||
|
|
@ -40,11 +40,10 @@ class ProcessSlicedObjectListJob(Job):
|
|||
if node.callDecoration("getLayerData"):
|
||||
self._scene.getRoot().removeChild(node)
|
||||
else:
|
||||
objectIdMap[id(node)] = node
|
||||
object_id_map[id(node)] = node
|
||||
Job.yieldThread()
|
||||
|
||||
settings = Application.getInstance().getMachineManager().getActiveProfile()
|
||||
layerHeight = settings.getSettingValue("layer_height")
|
||||
|
||||
center = None
|
||||
if not settings.getSettingValue("machine_center_is_zero"):
|
||||
|
|
@ -62,7 +61,7 @@ class ProcessSlicedObjectListJob(Job):
|
|||
current_layer = 0
|
||||
for object in self._message.objects:
|
||||
try:
|
||||
node = objectIdMap[object.id]
|
||||
node = object_id_map[object.id]
|
||||
except KeyError:
|
||||
continue
|
||||
|
||||
|
|
|
|||
|
|
@ -115,12 +115,17 @@ class StartSliceJob(Job):
|
|||
return str(value).encode("utf-8")
|
||||
|
||||
def _sendSettings(self, profile):
|
||||
Application.getInstance().getMachineManager().getActiveMachineInstance().setMachineSettingValue("machine_gcode_flavor", "RepRap")
|
||||
|
||||
msg = Cura_pb2.SettingList()
|
||||
settings = profile.getAllSettingValues(include_machine = True)
|
||||
start_gcode = settings["machine_start_gcode"]
|
||||
settings["material_bed_temp_prepend"] = "{material_bed_temperature}" not in start_gcode
|
||||
settings["material_print_temp_prepend"] = "{material_print_temperature}" not in start_gcode
|
||||
for key, value in settings.items():
|
||||
if key == "machine_gcode_flavor":
|
||||
print("machine_gcode_flavor", value)
|
||||
|
||||
s = msg.settings.add()
|
||||
s.name = key
|
||||
if key == "machine_start_gcode" or key == "machine_end_gcode":
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# Copyright (c) 2015 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
from . import GCodeReader
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
def getMetaData():
|
||||
|
|
|
|||
|
|
@ -54,4 +54,4 @@ class LayerViewProxy(QObject):
|
|||
active_view = self._controller.getActiveView()
|
||||
if type(active_view) == LayerView.LayerView.LayerView:
|
||||
active_view.currentLayerNumChanged.connect(self._onLayerChanged)
|
||||
active_view.maxLayersChanged.connect(self._onMaxLayersChanged)
|
||||
active_view.maxLayersChanged.connect(self._onMaxLayersChanged)
|
||||
|
|
|
|||
|
|
@ -20,17 +20,17 @@ catalog = i18nCatalog("cura")
|
|||
|
||||
# WinAPI Constants that we need
|
||||
# Hardcoded here due to stupid WinDLL stuff that does not give us access to these values.
|
||||
DRIVE_REMOVABLE = 2
|
||||
DRIVE_REMOVABLE = 2 # [CodeStyle: Windows Enum value]
|
||||
|
||||
GENERIC_READ = 2147483648
|
||||
GENERIC_WRITE = 1073741824
|
||||
GENERIC_READ = 2147483648 # [CodeStyle: Windows Enum value]
|
||||
GENERIC_WRITE = 1073741824 # [CodeStyle: Windows Enum value]
|
||||
|
||||
FILE_SHARE_READ = 1
|
||||
FILE_SHARE_WRITE = 2
|
||||
FILE_SHARE_READ = 1 # [CodeStyle: Windows Enum value]
|
||||
FILE_SHARE_WRITE = 2 # [CodeStyle: Windows Enum value]
|
||||
|
||||
IOCTL_STORAGE_EJECT_MEDIA = 2967560
|
||||
IOCTL_STORAGE_EJECT_MEDIA = 2967560 # [CodeStyle: Windows Enum value]
|
||||
|
||||
OPEN_EXISTING = 3
|
||||
OPEN_EXISTING = 3 # [CodeStyle: Windows Enum value]
|
||||
|
||||
## Removable drive support for windows
|
||||
class WindowsRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue