Fix various typos

Found via `codespell -q 3 -S *.po,*.pot -L childs,initialy,lod,ned,te,slicable,sur,tutoriels,wont`
This commit is contained in:
luz paz 2021-09-07 11:33:54 -04:00
parent 7eeae4db87
commit d68f375e38
68 changed files with 99 additions and 100 deletions

View file

@ -33,7 +33,7 @@ configure_file(${CMAKE_SOURCE_DIR}/com.ultimaker.cura.desktop.in ${CMAKE_BINARY_
configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY) configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)
# FIXME: The new FindPython3 finds the system's Python3.6 reather than the Python3.5 that we built for Cura's environment. # FIXME: The new FindPython3 finds the system's Python3.6 rather than the Python3.5 that we built for Cura's environment.
# So we're using the old method here, with FindPythonInterp for now. # So we're using the old method here, with FindPythonInterp for now.
find_package(PythonInterp 3 REQUIRED) find_package(PythonInterp 3 REQUIRED)

View file

@ -4,7 +4,7 @@
include(CTest) include(CTest)
include(CMakeParseArguments) include(CMakeParseArguments)
# FIXME: The new FindPython3 finds the system's Python3.6 reather than the Python3.5 that we built for Cura's environment. # FIXME: The new FindPython3 finds the system's Python3.6 rather than the Python3.5 that we built for Cura's environment.
# So we're using the old method here, with FindPythonInterp for now. # So we're using the old method here, with FindPythonInterp for now.
find_package(PythonInterp 3 REQUIRED) find_package(PythonInterp 3 REQUIRED)

View file

@ -1312,9 +1312,9 @@ class CuraApplication(QtApplication):
if not isinstance(node, SceneNode): if not isinstance(node, SceneNode):
continue continue
if not node.getMeshData() and not node.callDecoration("isGroup"): if not node.getMeshData() and not node.callDecoration("isGroup"):
continue # Node that doesnt have a mesh and is not a group. continue # Node that doesn't have a mesh and is not a group.
if node.getParent() and node.getParent().callDecoration("isGroup") or node.getParent().callDecoration("isSliceable"): if node.getParent() and node.getParent().callDecoration("isGroup") or node.getParent().callDecoration("isSliceable"):
continue # Grouped nodes don't need resetting as their parent (the group) is resetted) continue # Grouped nodes don't need resetting as their parent (the group) is reset)
if not node.isSelectable(): if not node.isSelectable():
continue # i.e. node with layer data continue # i.e. node with layer data
if not node.callDecoration("isSliceable") and not node.callDecoration("isGroup"): if not node.callDecoration("isSliceable") and not node.callDecoration("isGroup"):
@ -1332,9 +1332,9 @@ class CuraApplication(QtApplication):
if not isinstance(node, SceneNode): if not isinstance(node, SceneNode):
continue continue
if not node.getMeshData() and not node.callDecoration("isGroup"): if not node.getMeshData() and not node.callDecoration("isGroup"):
continue # Node that doesnt have a mesh and is not a group. continue # Node that doesn't have a mesh and is not a group.
if node.getParent() and node.getParent().callDecoration("isGroup"): if node.getParent() and node.getParent().callDecoration("isGroup"):
continue # Grouped nodes don't need resetting as their parent (the group) is resetted) continue # Grouped nodes don't need resetting as their parent (the group) is reset)
if not node.isSelectable(): if not node.isSelectable():
continue # i.e. node with layer data continue # i.e. node with layer data
nodes.append(node) nodes.append(node)
@ -1361,9 +1361,9 @@ class CuraApplication(QtApplication):
if not isinstance(node, SceneNode): if not isinstance(node, SceneNode):
continue continue
if not node.getMeshData() and not node.callDecoration("isGroup"): if not node.getMeshData() and not node.callDecoration("isGroup"):
continue # Node that doesnt have a mesh and is not a group. continue # Node that doesn't have a mesh and is not a group.
if node.getParent() and node.getParent().callDecoration("isGroup"): if node.getParent() and node.getParent().callDecoration("isGroup"):
continue # Grouped nodes don't need resetting as their parent (the group) is resetted) continue # Grouped nodes don't need resetting as their parent (the group) is reset)
if not node.callDecoration("isSliceable") and not node.callDecoration("isGroup"): if not node.callDecoration("isSliceable") and not node.callDecoration("isGroup"):
continue # i.e. node with layer data continue # i.e. node with layer data
nodes.append(node) nodes.append(node)
@ -1390,7 +1390,7 @@ class CuraApplication(QtApplication):
continue continue
if not node.getMeshData() and not node.callDecoration("isGroup"): if not node.getMeshData() and not node.callDecoration("isGroup"):
continue # Node that doesnt have a mesh and is not a group. continue # Node that doesn't have a mesh and is not a group.
parent_node = node.getParent() parent_node = node.getParent()
if parent_node and parent_node.callDecoration("isGroup"): if parent_node and parent_node.callDecoration("isGroup"):
@ -1418,11 +1418,11 @@ class CuraApplication(QtApplication):
continue continue
if not node.getMeshData() and not node.callDecoration("isGroup"): if not node.getMeshData() and not node.callDecoration("isGroup"):
continue # Node that doesnt have a mesh and is not a group. continue # Node that doesn't have a mesh and is not a group.
parent_node = node.getParent() parent_node = node.getParent()
if parent_node and parent_node.callDecoration("isGroup"): if parent_node and parent_node.callDecoration("isGroup"):
continue # Grouped nodes don't need resetting as their parent (the group) is resetted) continue # Grouped nodes don't need resetting as their parent (the group) is reset)
if not node.isSelectable(): if not node.isSelectable():
continue # i.e. node with layer data continue # i.e. node with layer data
@ -2039,11 +2039,11 @@ class CuraApplication(QtApplication):
if not node.isEnabled(): if not node.isEnabled():
continue continue
if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"): if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"):
continue # Node that doesnt have a mesh and is not a group. continue # Node that doesn't have a mesh and is not a group.
if only_selectable and not node.isSelectable(): if only_selectable and not node.isSelectable():
continue # Only remove nodes that are selectable. continue # Only remove nodes that are selectable.
if not node.callDecoration("isSliceable") and not node.callDecoration("getLayerData") and not node.callDecoration("isGroup"): if not node.callDecoration("isSliceable") and not node.callDecoration("getLayerData") and not node.callDecoration("isGroup"):
continue # Grouped nodes don't need resetting as their parent (the group) is resetted) continue # Grouped nodes don't need resetting as their parent (the group) is reset)
nodes.append(node) nodes.append(node)
if nodes: if nodes:
from UM.Operations.GroupedOperation import GroupedOperation from UM.Operations.GroupedOperation import GroupedOperation

View file

@ -12,7 +12,7 @@ from cura.CuraApplication import CuraApplication
# Since Cura has a few pre-defined "space claims" for the locations of certain components, we've provided some structure # Since Cura has a few pre-defined "space claims" for the locations of certain components, we've provided some structure
# to indicate this. # to indicate this.
# MainComponent works in the same way the MainComponent of a stage. # MainComponent works in the same way the MainComponent of a stage.
# the stageMenuComponent returns an item that should be used somehwere in the stage menu. It's up to the active stage # the stageMenuComponent returns an item that should be used somewhere in the stage menu. It's up to the active stage
# to actually do something with this. # to actually do something with this.
class CuraView(View): class CuraView(View):
def __init__(self, parent = None, use_empty_menu_placeholder: bool = False) -> None: def __init__(self, parent = None, use_empty_menu_placeholder: bool = False) -> None:

View file

@ -59,7 +59,7 @@ class LayerPolygon:
self._vertex_count = self._mesh_line_count + numpy.sum(self._types[1:] == self._types[:-1]) self._vertex_count = self._mesh_line_count + numpy.sum(self._types[1:] == self._types[:-1])
# Buffering the colors shouldn't be necessary as it is not # Buffering the colors shouldn't be necessary as it is not
# re-used and can save alot of memory usage. # re-used and can save a lot of memory usage.
self._color_map = LayerPolygon.getColorMap() self._color_map = LayerPolygon.getColorMap()
self._colors = self._color_map[self._types] # type: numpy.ndarray self._colors = self._color_map[self._types] # type: numpy.ndarray
@ -146,7 +146,7 @@ class LayerPolygon:
# When the line type changes the index needs to be increased by 2. # When the line type changes the index needs to be increased by 2.
indices[self._index_begin:self._index_end, :] += numpy.cumsum(needed_points_list[line_mesh_mask.ravel(), 0], dtype = numpy.int32).reshape((-1, 1)) indices[self._index_begin:self._index_end, :] += numpy.cumsum(needed_points_list[line_mesh_mask.ravel(), 0], dtype = numpy.int32).reshape((-1, 1))
# Each line segment goes from it's starting point p to p+1, offset by the vertex index. # Each line segment goes from it's starting point p to p+1, offset by the vertex index.
# The -1 is to compensate for the neccecarily True value of needed_points_list[0,0] which causes an unwanted +1 in cumsum above. # The -1 is to compensate for the necessarily True value of needed_points_list[0,0] which causes an unwanted +1 in cumsum above.
indices[self._index_begin:self._index_end, :] += numpy.array([self._vertex_begin - 1, self._vertex_begin]) indices[self._index_begin:self._index_end, :] += numpy.array([self._vertex_begin - 1, self._vertex_begin])
self._build_cache_line_mesh_mask = None self._build_cache_line_mesh_mask = None

View file

@ -97,8 +97,7 @@ class MachineErrorChecker(QObject):
def startErrorCheckPropertyChanged(self, key: str, property_name: str) -> None: def startErrorCheckPropertyChanged(self, key: str, property_name: str) -> None:
"""Start the error check for property changed """Start the error check for property changed
this is separate from the startErrorCheck because it ignores a number property types
this is seperate from the startErrorCheck because it ignores a number property types
:param key: :param key:
:param property_name: :param property_name:

View file

@ -33,7 +33,7 @@ class SettingVisibilityPresetsModel(QObject):
if basic_item is not None: if basic_item is not None:
basic_visibile_settings = ";".join(basic_item.settings) basic_visibile_settings = ";".join(basic_item.settings)
else: else:
Logger.log("w", "Unable to find the basic visiblity preset.") Logger.log("w", "Unable to find the basic visibility preset.")
basic_visibile_settings = "" basic_visibile_settings = ""
self._preferences = preferences self._preferences = preferences

View file

@ -120,7 +120,7 @@ class AuthorizationService:
return self._auth_helpers.parseJWT(self._auth_data.access_token) return self._auth_helpers.parseJWT(self._auth_data.access_token)
def getAccessToken(self) -> Optional[str]: def getAccessToken(self) -> Optional[str]:
"""Get the access token as provided by the repsonse data.""" """Get the access token as provided by the response data."""
if self._auth_data is None: if self._auth_data is None:
Logger.log("d", "No auth data to retrieve the access_token from") Logger.log("d", "No auth data to retrieve the access_token from")

View file

@ -79,7 +79,7 @@ class PickingPass(RenderPass):
return -1 return -1
distance = output.pixel(px, py) # distance in micron, from in r, g & b channels distance = output.pixel(px, py) # distance in micron, from in r, g & b channels
distance = (distance & 0x00ffffff) / 1000. # drop the alpha channel and covert to mm distance = (distance & 0x00ffffff) / 1000. # drop the alpha channel and convert to mm
return distance return distance
def getPickedPosition(self, x: int, y: int) -> Vector: def getPickedPosition(self, x: int, y: int) -> Vector:

View file

@ -49,7 +49,7 @@ class FirmwareUpdater(QObject):
raise NotImplementedError("_updateFirmware needs to be implemented") raise NotImplementedError("_updateFirmware needs to be implemented")
def _cleanupAfterUpdate(self) -> None: def _cleanupAfterUpdate(self) -> None:
"""Cleanup after a succesful update""" """Cleanup after a successful update"""
# Clean up for next attempt. # Clean up for next attempt.
self._update_firmware_thread = Thread(target=self._updateFirmware, daemon=True, name = "FirmwareUpdateThread") self._update_firmware_thread = Thread(target=self._updateFirmware, daemon=True, name = "FirmwareUpdateThread")

View file

@ -414,6 +414,6 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
@pyqtProperty(str, constant = True) @pyqtProperty(str, constant = True)
def ipAddress(self) -> str: def ipAddress(self) -> str:
"""IP adress of this printer""" """IP address of this printer"""
return self._address return self._address

View file

@ -319,7 +319,7 @@ class ContainerManager(QObject):
stack.qualityChanges = quality_changes stack.qualityChanges = quality_changes
if not quality_changes or container_registry.isReadOnly(quality_changes.getId()): if not quality_changes or container_registry.isReadOnly(quality_changes.getId()):
Logger.log("e", "Could not update quality of a nonexistant or read only quality profile in stack %s", stack.getId()) Logger.log("e", "Could not update quality of a nonexistent or read only quality profile in stack %s", stack.getId())
continue continue
self._performMerge(quality_changes, stack.getTop()) self._performMerge(quality_changes, stack.getTop())

View file

@ -66,7 +66,7 @@ class CuraStackBuilder:
Logger.logException("e", "Failed to create an extruder stack for position {pos}: {err}".format(pos = position, err = str(e))) Logger.logException("e", "Failed to create an extruder stack for position {pos}: {err}".format(pos = position, err = str(e)))
return None return None
# If given, set the machine_extruder_count when creating the machine, or else the extruderList used bellow will # If given, set the machine_extruder_count when creating the machine, or else the extruderList used below will
# not return the correct extruder list (since by default, the machine_extruder_count is 1) in machines with # not return the correct extruder list (since by default, the machine_extruder_count is 1) in machines with
# settable number of extruders. # settable number of extruders.
if machine_extruder_count and 0 <= machine_extruder_count <= len(extruder_dict): if machine_extruder_count and 0 <= machine_extruder_count <= len(extruder_dict):

View file

@ -627,7 +627,7 @@ class MachineManager(QObject):
return "" return ""
return global_container_stack.getIntentCategory() return global_container_stack.getIntentCategory()
# Provies a list of extruder positions that have a different intent from the active one. # Provides a list of extruder positions that have a different intent from the active one.
@pyqtProperty("QStringList", notify=activeIntentChanged) @pyqtProperty("QStringList", notify=activeIntentChanged)
def extruderPositionsWithNonActiveIntent(self): def extruderPositionsWithNonActiveIntent(self):
global_container_stack = self._application.getGlobalContainerStack() global_container_stack = self._application.getGlobalContainerStack()

View file

@ -68,7 +68,7 @@ class SingleInstance:
Logger.log("e", "Single instance server was not created.") Logger.log("e", "Single instance server was not created.")
def _onClientConnected(self) -> None: def _onClientConnected(self) -> None:
Logger.log("i", "New connection recevied on our single-instance server") Logger.log("i", "New connection received on our single-instance server")
connection = None #type: Optional[QLocalSocket] connection = None #type: Optional[QLocalSocket]
if self._single_instance_server: if self._single_instance_server:
connection = self._single_instance_server.nextPendingConnection() connection = self._single_instance_server.nextPendingConnection()

View file

@ -56,8 +56,8 @@ class OnExitCallbackManager:
self._application.callLater(self._application.closeApplication) self._application.callLater(self._application.closeApplication)
# This is the callback function which an on-exit callback should call when it finishes, it should provide the # This is the callback function which an on-exit callback should call when it finishes, it should provide the
# "should_proceed" flag indicating whether this check has "passed", or in other words, whether quiting the # "should_proceed" flag indicating whether this check has "passed", or in other words, whether quitting the
# application should be blocked. If the last on-exit callback doesn't block the quiting, it will call the next # application should be blocked. If the last on-exit callback doesn't block the quitting, it will call the next
# registered on-exit callback if available. # registered on-exit callback if available.
def onCurrentCallbackFinished(self, should_proceed: bool = True) -> None: def onCurrentCallbackFinished(self, should_proceed: bool = True) -> None:
if not should_proceed: if not should_proceed:

View file

@ -90,7 +90,7 @@ class ObjectsModel(ListModel):
parent = node.getParent() parent = node.getParent()
if parent and parent.callDecoration("isGroup"): if parent and parent.callDecoration("isGroup"):
return False # Grouped nodes don't need resetting as their parent (the group) is resetted) return False # Grouped nodes don't need resetting as their parent (the group) is reset)
node_build_plate_number = node.callDecoration("getBuildPlateNumber") node_build_plate_number = node.callDecoration("getBuildPlateNumber")
if Application.getInstance().getPreferences().getValue("view/filter_current_build_plate") and node_build_plate_number != self._build_plate_number: if Application.getInstance().getPreferences().getValue("view/filter_current_build_plate") and node_build_plate_number != self._build_plate_number:

View file

@ -50,7 +50,7 @@ do
echo "Found Uranium branch [${URANIUM_BRANCH}]." echo "Found Uranium branch [${URANIUM_BRANCH}]."
break break
else else
echo "Could not find Uranium banch [${URANIUM_BRANCH}], try next." echo "Could not find Uranium branch [${URANIUM_BRANCH}], try next."
fi fi
done done

View file

@ -8,7 +8,7 @@ The build volume draws a cube (for rectangular build plates) that represents the
The build volume also draws a grid underneath the build volume. The grid features 1cm lines which allows the user to roughly estimate how big its print is or the distance between prints. It also features a finer 1mm line pattern within that grid. The grid is drawn as a single quad. This quad is then sent to the graphical card with a specialised shader which draws the grid pattern. The build volume also draws a grid underneath the build volume. The grid features 1cm lines which allows the user to roughly estimate how big its print is or the distance between prints. It also features a finer 1mm line pattern within that grid. The grid is drawn as a single quad. This quad is then sent to the graphical card with a specialised shader which draws the grid pattern.
For elliptical build plates, the volume bounds are drawn as two circles, one at the top and one at the bottom of the available height. The build plate grid is drawn as a tesselated circle, but with the same shader. For elliptical build plates, the volume bounds are drawn as two circles, one at the top and one at the bottom of the available height. The build plate grid is drawn as a tessellated circle, but with the same shader.
Disallowed areas Disallowed areas
---- ----

View file

@ -647,7 +647,7 @@ class CuraEngineBackend(QObject, Backend):
for node in DepthFirstIterator(self._scene.getRoot()): for node in DepthFirstIterator(self._scene.getRoot()):
if node.callDecoration("getLayerData"): if node.callDecoration("getLayerData"):
if not build_plate_numbers or node.callDecoration("getBuildPlateNumber") in build_plate_numbers: if not build_plate_numbers or node.callDecoration("getBuildPlateNumber") in build_plate_numbers:
# We can asume that all nodes have a parent as we're looping through the scene (and filter out root) # We can assume that all nodes have a parent as we're looping through the scene (and filter out root)
cast(SceneNode, node.getParent()).removeChild(node) cast(SceneNode, node.getParent()).removeChild(node)
def markSliceAll(self) -> None: def markSliceAll(self) -> None:

View file

@ -195,7 +195,7 @@ class StartSliceJob(Job):
# Remove old layer data. # Remove old layer data.
for node in DepthFirstIterator(self._scene.getRoot()): for node in DepthFirstIterator(self._scene.getRoot()):
if node.callDecoration("getLayerData") and node.callDecoration("getBuildPlateNumber") == self._build_plate_number: if node.callDecoration("getLayerData") and node.callDecoration("getBuildPlateNumber") == self._build_plate_number:
# Singe we walk through all nodes in the scene, they always have a parent. # Since we walk through all nodes in the scene, they always have a parent.
cast(SceneNode, node.getParent()).removeChild(node) cast(SceneNode, node.getParent()).removeChild(node)
break break

View file

@ -428,7 +428,7 @@ class FlavorParser:
G = self._getInt(line, "G") G = self._getInt(line, "G")
if G is not None: if G is not None:
# When find a movement, the new posistion is calculated and added to the current_path, but # When find a movement, the new position is calculated and added to the current_path, but
# don't need to create a polygon until the end of the layer # don't need to create a polygon until the end of the layer
current_position = self.processGCode(G, line, current_position, current_path) current_position = self.processGCode(G, line, current_position, current_path)
continue continue

View file

@ -3,7 +3,7 @@
from . import FlavorParser from . import FlavorParser
# This parser is intented for interpret the Marlin/Sprinter Firmware flavor # This parser is intended to interpret the Marlin/Sprinter Firmware flavor
class MarlinFlavorParser(FlavorParser.FlavorParser): class MarlinFlavorParser(FlavorParser.FlavorParser):
def __init__(self): def __init__(self):

View file

@ -312,7 +312,7 @@ Item
} }
} }
// Specialty provider that only watches global_inherits (we cant filter on what property changed we get events // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
// so we bypass that to make a dedicated provider). // so we bypass that to make a dedicated provider).
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {

View file

@ -403,7 +403,7 @@ UM.Dialog
storeIndex: 0 storeIndex: 0
} }
// Specialty provider that only watches global_inherits (we cant filter on what property changed we get events // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
// so we bypass that to make a dedicated provider). // so we bypass that to make a dedicated provider).
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {

View file

@ -31,7 +31,7 @@
# V4.9.93: Minor bugfixes (input settings) / documentation # V4.9.93: Minor bugfixes (input settings) / documentation
# V4.9.94: Bugfix Combobox-selection; remove logger # V4.9.94: Bugfix Combobox-selection; remove logger
# V5.0: Bugfix for fall back after one layer and doubled G0 commands when using print speed tweak, Initial version for Cura 2.x # V5.0: Bugfix for fall back after one layer and doubled G0 commands when using print speed tweak, Initial version for Cura 2.x
# V5.0.1: Bugfix for calling unknown property 'bedTemp' of previous settings storage and unkown variable 'speed' # V5.0.1: Bugfix for calling unknown property 'bedTemp' of previous settings storage and unknown variable 'speed'
# V5.1: API Changes included for use with Cura 2.2 # V5.1: API Changes included for use with Cura 2.2
# V5.2.0: Wes Hanney. Added support for changing Retract Length and Speed. Removed layer spread option. Fixed issue of cumulative ChangeZ # V5.2.0: Wes Hanney. Added support for changing Retract Length and Speed. Removed layer spread option. Fixed issue of cumulative ChangeZ
# mods so they can now properly be stacked on top of each other. Applied code refactoring to clean up various coding styles. Added comments. # mods so they can now properly be stacked on top of each other. Applied code refactoring to clean up various coding styles. Added comments.
@ -657,7 +657,7 @@ class ChangeAtZProcessor:
# Indicates if the user has opted for linear move retractions or firmware retractions # Indicates if the user has opted for linear move retractions or firmware retractions
linearRetraction = True linearRetraction = True
# Indicates if we're targetting by layer or height value # Indicates if we're targeting by layer or height value
targetByLayer = True targetByLayer = True
# Indicates if we have injected our changed values for the given layer yet # Indicates if we have injected our changed values for the given layer yet
@ -1079,7 +1079,7 @@ class ChangeAtZProcessor:
else: else:
modified_gcode += line + "\n" modified_gcode += line + "\n"
# if we're targetting by layer we want to add our values just after the layer label # if we're targeting by layer we want to add our values just after the layer label
if ";LAYER:" in line: if ";LAYER:" in line:
modified_gcode += self.getInjectCode() modified_gcode += self.getInjectCode()

View file

@ -5,7 +5,7 @@
# Description: This plugin shows custom messages about your print on the Status bar... # Description: This plugin shows custom messages about your print on the Status bar...
# Please look at the 3 options # Please look at the 3 options
# - Scolling (SCROLL_LONG_FILENAMES) if enabled in Marlin and you arent printing a small item select this option. # - Scrolling (SCROLL_LONG_FILENAMES) if enabled in Marlin and you aren't printing a small item select this option.
# - Name: By default it will use the name generated by Cura (EG: TT_Test_Cube) - Type a custom name in here # - Name: By default it will use the name generated by Cura (EG: TT_Test_Cube) - Type a custom name in here
# - Max Layer: Enabling this will show how many layers are in the entire print (EG: Layer 1 of 265!) # - Max Layer: Enabling this will show how many layers are in the entire print (EG: Layer 1 of 265!)

View file

@ -195,7 +195,7 @@ class Stretcher:
i.e. it is a travel move i.e. it is a travel move
""" """
if i_pos == 0: if i_pos == 0:
return True # Begining a layer always breaks filament (for simplicity) return True # Beginning a layer always breaks filament (for simplicity)
step = layer_steps[i_pos] step = layer_steps[i_pos]
prev_step = layer_steps[i_pos - 1] prev_step = layer_steps[i_pos - 1]
if step.step_e != prev_step.step_e: if step.step_e != prev_step.step_e:

View file

@ -136,7 +136,7 @@ class RemovableDriveOutputDevice(OutputDevice):
self._stream.close() self._stream.close()
self._stream = None self._stream = None
except: except:
Logger.logException("w", "An execption occured while trying to write to removable drive.") Logger.logException("w", "An exception occurred while trying to write to removable drive.")
message = Message(catalog.i18nc("@info:status", "Could not save to removable drive {0}: {1}").format(self.getName(),str(job.getError())), message = Message(catalog.i18nc("@info:status", "Could not save to removable drive {0}: {1}").format(self.getName(),str(job.getError())),
title = catalog.i18nc("@info:title", "Error"), title = catalog.i18nc("@info:title", "Error"),
message_type = Message.MessageType.ERROR) message_type = Message.MessageType.ERROR)

View file

@ -48,7 +48,7 @@ class RemovableDrivePlugin(OutputDevicePlugin):
result = False result = False
if result: if result:
Logger.log("i", "Succesfully ejected the device") Logger.log("i", "Successfully ejected the device")
return result return result
def performEjectDevice(self, device): def performEjectDevice(self, device):

View file

@ -187,7 +187,7 @@ Item
{ {
sliderRoot.manuallyChanged = true sliderRoot.manuallyChanged = true
// don't allow the lower handle to be heigher than the upper handle // don't allow the lower handle to be higher than the upper handle
if (lowerHandle.y - (y + height) < sliderRoot.minimumRangeHandleSize) if (lowerHandle.y - (y + height) < sliderRoot.minimumRangeHandleSize)
{ {
lowerHandle.y = y + height + sliderRoot.minimumRangeHandleSize lowerHandle.y = y + height + sliderRoot.minimumRangeHandleSize

View file

@ -59,7 +59,7 @@ UM.PointingRectangle {
text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array
horizontalAlignment: TextInput.AlignHCenter horizontalAlignment: TextInput.AlignHCenter
// key bindings, work when label is currenctly focused (active handle in LayerSlider) // key bindings, work when label is currently focused (active handle in LayerSlider)
Keys.onUpPressed: sliderLabelRoot.setValue(sliderLabelRoot.value + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1)) Keys.onUpPressed: sliderLabelRoot.setValue(sliderLabelRoot.value + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
Keys.onDownPressed: sliderLabelRoot.setValue(sliderLabelRoot.value - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1)) Keys.onDownPressed: sliderLabelRoot.setValue(sliderLabelRoot.value - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))

View file

@ -190,11 +190,11 @@ Item
} }
} }
// Scrolls trough Z layers // Scrolls through Z layers
LayerSlider LayerSlider
{ {
property var preferredHeight: UM.Theme.getSize("slider_layerview_size").height property var preferredHeight: UM.Theme.getSize("slider_layerview_size").height
property double heightMargin: UM.Theme.getSize("default_margin").height * 3 // extra margin to accomodate layer number tooltips property double heightMargin: UM.Theme.getSize("default_margin").height * 3 // extra margin to accommodate layer number tooltips
property double layerSliderSafeHeight: layerSliderSafeYMax - layerSliderSafeYMin property double layerSliderSafeHeight: layerSliderSafeYMax - layerSliderSafeYMin
id: layerSlider id: layerSlider

View file

@ -37,7 +37,7 @@ class CloudPackageChecker(QObject):
self._i18n_catalog = i18nCatalog("cura") self._i18n_catalog = i18nCatalog("cura")
self._sdk_version = ApplicationMetadata.CuraSDKVersion self._sdk_version = ApplicationMetadata.CuraSDKVersion
self._last_notified_packages = set() # type: Set[str] self._last_notified_packages = set() # type: Set[str]
"""Packages for which a notification has been shown. No need to bother the user twice fo equal content""" """Packages for which a notification has been shown. No need to bother the user twice for equal content"""
# This is a plugin, so most of the components required are not ready when # This is a plugin, so most of the components required are not ready when
# this is initialized. Therefore, we wait until the application is ready. # this is initialized. Therefore, we wait until the application is ready.

View file

@ -16,7 +16,7 @@ Item
{ {
id: base id: base
// The print job which all other information is dervied from // The print job which all other information is derived from
property var printJob: null property var printJob: null
width: childrenRect.width width: childrenRect.width

View file

@ -52,11 +52,11 @@ class AvrFirmwareUpdater(FirmwareUpdater):
try: try:
programmer.programChip(hex_file) programmer.programChip(hex_file)
except SerialException as e: except SerialException as e:
Logger.log("e", "A serial port exception occured during firmware update: %s" % e) Logger.log("e", "A serial port exception occurred during firmware update: %s" % e)
self._setFirmwareUpdateState(FirmwareUpdateState.io_error) self._setFirmwareUpdateState(FirmwareUpdateState.io_error)
return return
except Exception as e: except Exception as e:
Logger.log("e", "An unknown exception occured during firmware update: %s" % e) Logger.log("e", "An unknown exception occurred during firmware update: %s" % e)
self._setFirmwareUpdateState(FirmwareUpdateState.unknown_error) self._setFirmwareUpdateState(FirmwareUpdateState.unknown_error)
return return

View file

@ -311,7 +311,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
if line == b"": if line == b"":
# An empty line means that the firmware is idle # An empty line means that the firmware is idle
# Multiple empty lines probably means that the firmware and Cura are waiting # Multiple empty lines probably means that the firmware and Cura are waiting
# for eachother due to a missed "ok", so we keep track of empty lines # for each other due to a missed "ok", so we keep track of empty lines
self._firmware_idle_count += 1 self._firmware_idle_count += 1
else: else:
self._firmware_idle_count = 0 self._firmware_idle_count = 0

View file

@ -122,7 +122,7 @@ class VersionUpgrade42to43(VersionUpgrade):
# Update version number. # Update version number.
parser["metadata"]["setting_version"] = "9" parser["metadata"]["setting_version"] = "9"
# Handle changes for the imade3d jellybox. The machine was split up into parts (eg; a 2 fan version and a single # Handle changes for the imade3d jellybox. The machine was split up into parts (eg; a 2 fan version and a single
# fan version. Perviously it used variants for this. The only upgrade we can do here is strip that variant. # fan version. Previously it used variants for this. The only upgrade we can do here is strip that variant.
# This is because we only upgrade per stack (and to fully do these changes, we'd need to switch out something # This is because we only upgrade per stack (and to fully do these changes, we'd need to switch out something
# in the global container based on changes made to the extruder stack) # in the global container based on changes made to the extruder stack)
if parser["containers"]["6"] == "imade3d_jellybox_extruder_0": if parser["containers"]["6"] == "imade3d_jellybox_extruder_0":

View file

@ -250,7 +250,7 @@ class X3DReader(MeshReader):
else: else:
nr = ns = DEFAULT_SUBDIV nr = ns = DEFAULT_SUBDIV
lau = pi / nr # Unit angle of latitude (rings) for the given tesselation lau = pi / nr # Unit angle of latitude (rings) for the given tessellation
lou = 2 * pi / ns # Unit angle of longitude (segments) lou = 2 * pi / ns # Unit angle of longitude (segments)
self.reserveFaceAndVertexCount(ns*(nr*2 - 2), 2 + (nr - 1)*ns) self.reserveFaceAndVertexCount(ns*(nr*2 - 2), 2 + (nr - 1)*ns)

View file

@ -3,7 +3,7 @@ any resources here, they will not be seen or upgraded by next versions of Cura.
If you want your (unbundled or altered) resources to work after an upgrade, If you want your (unbundled or altered) resources to work after an upgrade,
please don't put them here, but install them either; please don't put them here, but install them either;
- for materials: via the Marketplace (recommended if avialable), - for materials: via the Marketplace (recommended if available),
- by dragging a `.curapackage` file onto Cura, - by dragging a `.curapackage` file onto Cura,
- or place it in the right sub-folder in the configuration folder* for Cura. - or place it in the right sub-folder in the configuration folder* for Cura.

View file

@ -6249,7 +6249,7 @@
"mold_width": "mold_width":
{ {
"label": "Minimal Mold Width", "label": "Minimal Mold Width",
"description": "The minimal distance between the ouside of the mold and the outside of the model.", "description": "The minimal distance between the outside of the mold and the outside of the model.",
"unit": "mm", "unit": "mm",
"type": "float", "type": "float",
"minimum_value_warning": "wall_line_width_0 * 2", "minimum_value_warning": "wall_line_width_0 * 2",

View file

@ -26,7 +26,7 @@
}, },
"overrides": { "overrides": {
"machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract the filament\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positionning\n\nG28 X0 Y0 ;Home X and Y\n\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z" }, "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract the filament\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positioning\n\nG28 X0 Y0 ;Home X and Y\n\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z" },
"machine_max_feedrate_x": { "value": 500 }, "machine_max_feedrate_x": { "value": 500 },
"machine_max_feedrate_y": { "value": 500 }, "machine_max_feedrate_y": { "value": 500 },

View file

@ -27,7 +27,7 @@
[30, 40] [30, 40]
] ]
}, },
"machine_start_gcode": { "default_value": ";Start GCode by ideagen3D\n\nG1 Z15.0 F6000 ;Move the platform down 15mm\n\n;Initialize Temperature\nM140 S{material_bed_temperature_layer_0} ;heat bed and continue\nM104 S{material_print_temperature_layer_0} ;heat nozzle and continue\nM190 S{material_bed_temperature_layer_0} ;wait for bed temperature to reach inital layer temperature\nM109 S{material_print_temperature_layer_0} ;wait for hot end temperature to reach inital layer temperature\n\nG28 M420 S1 ; Home & Enable Bed Levelling\n\n;Prime the extruder\nG92 E0\nG1 X1 Y280 Z0.2 ;Prepare to Purge\nG1 Y20 Z0.2 F1500.0 E15 ;Purge line\nG92 E0" }, "machine_start_gcode": { "default_value": ";Start GCode by ideagen3D\n\nG1 Z15.0 F6000 ;Move the platform down 15mm\n\n;Initialize Temperature\nM140 S{material_bed_temperature_layer_0} ;heat bed and continue\nM104 S{material_print_temperature_layer_0} ;heat nozzle and continue\nM190 S{material_bed_temperature_layer_0} ;wait for bed temperature to reach initial layer temperature\nM109 S{material_print_temperature_layer_0} ;wait for hot end temperature to reach initial layer temperature\n\nG28 M420 S1 ; Home & Enable Bed Levelling\n\n;Prime the extruder\nG92 E0\nG1 X1 Y280 Z0.2 ;Prepare to Purge\nG1 Y20 Z0.2 F1500.0 E15 ;Purge line\nG92 E0" },
"machine_end_gcode": { "default_value": ";End GCode by ideagen3D\n\nM104 S0 ;Set nozzle temperature to 0\nM140 S0 ;Set Bed temperature to 0\n\nG92 E1 ;Prepare to retract filament\nG1 E-1 F300 ;Retract filament\nG28 X0 Y0 ;Home X and Y\nM84 ;Disable Steppers" }, "machine_end_gcode": { "default_value": ";End GCode by ideagen3D\n\nM104 S0 ;Set nozzle temperature to 0\nM140 S0 ;Set Bed temperature to 0\n\nG92 E1 ;Prepare to retract filament\nG1 E-1 F300 ;Retract filament\nG28 X0 Y0 ;Home X and Y\nM84 ;Disable Steppers" },
"gantry_height": { "value": 65 } "gantry_height": { "value": 65 }
} }

View file

@ -143,7 +143,7 @@ Button
Binding Binding
{ {
// When settting width directly, an unjust binding loop warning would be triggered, // When setting width directly, an unjust binding loop warning would be triggered,
// because button.width is part of this expression. // because button.width is part of this expression.
// Using parent.width is fine in fixedWidthMode. // Using parent.width is fine in fixedWidthMode.
target: buttonText target: buttonText

View file

@ -200,7 +200,7 @@ UM.MainWindow
} }
} }
// This is a placehoder for adding a pattern in the header // This is a placeholder for adding a pattern in the header
Image Image
{ {
id: backgroundPattern id: backgroundPattern
@ -311,8 +311,8 @@ UM.MainWindow
Toolbar Toolbar
{ {
// The toolbar is the left bar that is populated by all the tools (which are dynamicly populated by // The toolbar is the left bar that is populated by all the tools
// plugins) // (which are dynamically populated by plugins)
id: toolbar id: toolbar
property int mouseX: base.mouseX property int mouseX: base.mouseX

View file

@ -10,7 +10,7 @@ import Cura 1.0 as Cura
// Reusable component that holds an (re-colorable) icon on the left with some text on the right. // Reusable component that holds an (re-colorable) icon on the left with some text on the right.
// This component is also designed to be used with layouts. It will use the width of the text + icon as preferred width // This component is also designed to be used with layouts. It will use the width of the text + icon as preferred width
// It sets the icon size + half of the content as its minium width (in which case it will elide the text) // It sets the icon size + half of the content as its minimum width (in which case it will elide the text)
Item Item
{ {
property alias source: icon.source property alias source: icon.source

View file

@ -70,7 +70,7 @@ Item
// This id is required to find the stage buttons through Squish // This id is required to find the stage buttons through Squish
property string stageId: model.id property string stageId: model.id
// This is a trick to assure the activeStage is correctly changed. It doesn't work propertly if done in the onClicked (see CURA-6028) // This is a trick to assure the activeStage is correctly changed. It doesn't work properly if done in the onClicked (see CURA-6028)
MouseArea MouseArea
{ {
anchors.fill: parent anchors.fill: parent

View file

@ -46,7 +46,7 @@ Item
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
// There are two cases that we want to differenciate, one is when Cura is loading the configurations and the // There are two cases that we want to differentiate, one is when Cura is loading the configurations and the
// other when the connection was lost // other when the connection was lost
text: Cura.MachineManager.printerConnected ? text: Cura.MachineManager.printerConnected ?
catalog.i18nc("@label", "Loading available configurations from the printer...") : catalog.i18nc("@label", "Loading available configurations from the printer...") :

View file

@ -37,7 +37,7 @@ Menu
} }
} }
// Unassign the shortcuts when the submenu is invisible (i.e. when there is only one file provider) to avoid ambiguous shortcuts. // Unassign the shortcuts when the submenu is invisible (i.e. when there is only one file provider) to avoid ambiguous shortcuts.
// When there is a signle file provider, the openAction is assigned with the Ctrl+O shortcut instead. // When there is a single file provider, the openAction is assigned with the Ctrl+O shortcut instead.
shortcut: openFilesMenu.visible ? model.shortcut : "" shortcut: openFilesMenu.visible ? model.shortcut : ""
} }
onObjectAdded: openFilesMenu.insertItem(index, object) onObjectAdded: openFilesMenu.insertItem(index, object)

View file

@ -37,7 +37,7 @@ Item
} }
if(activePrintJob.timeTotal == 0) if(activePrintJob.timeTotal == 0)
{ {
return 0 // Prevent devision by 0 return 0 // Prevent division by 0
} }
return activePrintJob.timeElapsed / activePrintJob.timeTotal * 100 return activePrintJob.timeElapsed / activePrintJob.timeTotal * 100
} }

View file

@ -19,7 +19,7 @@ UM.PreferencesPage
function setDefaultLanguage(languageCode) function setDefaultLanguage(languageCode)
{ {
//loops trough the languageList and sets the language using the languageCode //loops through the languageList and sets the language using the languageCode
for(var i = 0; i < languageList.count; i++) for(var i = 0; i < languageList.count; i++)
{ {
if (languageComboBox.model.get(i).code == languageCode) if (languageComboBox.model.get(i).code == languageCode)

View file

@ -18,7 +18,7 @@ Item
property var sectionName: "" property var sectionName: ""
property var elementsModel // This can be a MaterialTypesModel or GenericMaterialsModel or FavoriteMaterialsModel property var elementsModel // This can be a MaterialTypesModel or GenericMaterialsModel or FavoriteMaterialsModel
property var hasMaterialTypes: true // It indicates wheather it has material types or not property var hasMaterialTypes: true // It indicates whether it has material types or not
property var expanded: materialList.expandedBrands.indexOf(sectionName) > -1 property var expanded: materialList.expandedBrands.indexOf(sectionName) > -1
height: childrenRect.height height: childrenRect.height

View file

@ -12,7 +12,7 @@ Button
// This is a work around for a qml issue. Since the default button uses a private implementation for contentItem // This is a work around for a qml issue. Since the default button uses a private implementation for contentItem
// (the so called IconText), which handles the mnemonic conversion (aka; ensuring that &Button) text property // (the so called IconText), which handles the mnemonic conversion (aka; ensuring that &Button) text property
// is rendered with the B underlined. Since we're also forced to mix controls 1.0 and 2.0 actions together, // is rendered with the B underlined. Since we're also forced to mix controls 1.0 and 2.0 actions together,
// we need a special property for the text of the label if we do want it to be rendered correclty, but don't want // we need a special property for the text of the label if we do want it to be rendered correctly, but don't want
// another shortcut to be added (which will cause for "QQuickAction::event: Ambiguous shortcut overload: " to // another shortcut to be added (which will cause for "QQuickAction::event: Ambiguous shortcut overload: " to
// happen. // happen.
property string labelText: "" property string labelText: ""
@ -29,7 +29,7 @@ Button
radius: UM.Theme.getSize("action_button_radius").width radius: UM.Theme.getSize("action_button_radius").width
} }
// Workarround to ensure that the mnemonic highlighting happens correctly // Workaround to ensure that the mnemonic highlighting happens correctly
function replaceText(txt) function replaceText(txt)
{ {
var index = txt.indexOf("&") var index = txt.indexOf("&")

View file

@ -203,7 +203,7 @@ Item
h -= mouse_absolute_y - base.height; h -= mouse_absolute_y - base.height;
} }
// Enforce a minimum size (again). // Enforce a minimum size (again).
// This is a bit of a hackish way to do it, but we've seen some ocasional reports that the size // This is a bit of a hackish way to do it, but we've seen some occasional reports that the size
// could get below the the minimum height. // could get below the the minimum height.
if(h < absoluteMinimumHeight) if(h < absoluteMinimumHeight)
{ {

View file

@ -169,8 +169,8 @@ Item
// Update the slider value to represent the rounded value // Update the slider value to represent the rounded value
infillSlider.value = roundedSliderValue infillSlider.value = roundedSliderValue
// Update value only if the Recomended mode is Active, // Update value only if the Recommended mode is Active,
// Otherwise if I change the value in the Custom mode the Recomended view will try to repeat // Otherwise if I change the value in the Custom mode the Recommended view will try to repeat
// same operation // same operation
var active_mode = UM.Preferences.getValue("cura/active_mode") var active_mode = UM.Preferences.getValue("cura/active_mode")

View file

@ -105,7 +105,7 @@ Item
Rectangle Rectangle
{ {
// This can (and should) be done wiht a verticalCenter. For some reason it does work in QtCreator // This can (and should) be done with a verticalCenter. For some reason it does work in QtCreator
// but not when using the exact same QML in Cura. // but not when using the exact same QML in Cura.
anchors.verticalCenter: parent ? parent.verticalCenter : undefined anchors.verticalCenter: parent ? parent.verticalCenter : undefined
anchors.horizontalCenter: parent ? parent.horizontalCenter : undefined anchors.horizontalCenter: parent ? parent.horizontalCenter : undefined

View file

@ -12,7 +12,7 @@ Button
id: base id: base
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
// To avoid overlaping with the scrollBars // To avoid overlapping with the scrollBars
anchors.rightMargin: 2 * UM.Theme.getSize("thin_margin").width anchors.rightMargin: 2 * UM.Theme.getSize("thin_margin").width
hoverEnabled: true hoverEnabled: true

View file

@ -17,7 +17,7 @@ Item
height: UM.Theme.getSize("section").height height: UM.Theme.getSize("section").height
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
// To avoid overlaping with the scrollBars // To avoid overlapping with the scrollBars
anchors.rightMargin: 2 * UM.Theme.getSize("thin_margin").width anchors.rightMargin: 2 * UM.Theme.getSize("thin_margin").width
property alias contents: controlContainer.children property alias contents: controlContainer.children

View file

@ -228,7 +228,7 @@ Item
id: definitionsModel id: definitionsModel
containerId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.id: "" containerId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.id: ""
visibilityHandler: UM.SettingPreferenceVisibilityHandler { } visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
exclude: ["machine_settings", "command_line_settings", "infill_mesh", "infill_mesh_order", "cutting_mesh", "support_mesh", "anti_overhang_mesh"] // TODO: infill_mesh settigns are excluded hardcoded, but should be based on the fact that settable_globally, settable_per_meshgroup and settable_per_extruder are false. exclude: ["machine_settings", "command_line_settings", "infill_mesh", "infill_mesh_order", "cutting_mesh", "support_mesh", "anti_overhang_mesh"] // TODO: infill_mesh settings are excluded hardcoded, but should be based on the fact that settable_globally, settable_per_meshgroup and settable_per_extruder are false.
expanded: CuraApplication.expandedCategories expanded: CuraApplication.expandedCategories
onExpandedChanged: onExpandedChanged:
{ {
@ -330,7 +330,7 @@ Item
} }
} }
// Specialty provider that only watches global_inherits (we cant filter on what property changed we get events // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
// so we bypass that to make a dedicated provider). // so we bypass that to make a dedicated provider).
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {

View file

@ -183,7 +183,7 @@ Item
borderColor: UM.Theme.getColor("lining") borderColor: UM.Theme.getColor("lining")
borderWidth: UM.Theme.getSize("default_lining").width borderWidth: UM.Theme.getSize("default_lining").width
MouseArea //Catch all mouse events (so scene doesnt handle them) MouseArea //Catch all mouse events (so scene doesn't handle them)
{ {
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.AllButtons acceptedButtons: Qt.AllButtons

View file

@ -56,7 +56,7 @@ Item
Cura.RoundedRectangle Cura.RoundedRectangle
{ {
id: contentRectangle id: contentRectangle
// Move up a bit (exaclty the width of the border) to avoid double line // Move up a bit (exactly the width of the border) to avoid double line
y: header.height - UM.Theme.getSize("default_lining").width y: header.height - UM.Theme.getSize("default_lining").width
anchors.left: header.left anchors.left: header.left
anchors.right: header.right anchors.right: header.right

View file

@ -69,9 +69,9 @@ def calc_distance(pos1, pos2):
def calc_acceleration_distance(init_speed: float, target_speed: float, acceleration: float) -> float: def calc_acceleration_distance(init_speed: float, target_speed: float, acceleration: float) -> float:
"""Given the initial speed, the target speed, and the acceleration """Given the initial speed, the target speed, and the acceleration
calculate the distance that's needed for the acceleration to finish.
calculate the distance that's neede for the acceleration to finish.
""" """
if acceleration == 0: if acceleration == 0:
return 0.0 return 0.0
return (target_speed ** 2 - init_speed ** 2) / (2 * acceleration) return (target_speed ** 2 - init_speed ** 2) / (2 * acceleration)

View file

@ -14,7 +14,7 @@ def discovered_printer() -> DiscoveredPrinter:
return DiscoveredPrinter("127.0.0.1", "zomg", "yay", None, "bleep", MagicMock()) return DiscoveredPrinter("127.0.0.1", "zomg", "yay", None, "bleep", MagicMock())
@pytest.mark.skip # TODO: This has some unknown dependency on the applicaiton / registry, which is hard to patch out. (which doesn't mean we shouldn't fix it!) @pytest.mark.skip # TODO: This has some unknown dependency on the application / registry, which is hard to patch out. (which doesn't mean we shouldn't fix it!)
def test_discoveredPrinters(discovered_printer_model): def test_discoveredPrinters(discovered_printer_model):
mocked_device = MagicMock() mocked_device = MagicMock()
cluster_size = PropertyMock(return_value = 1) cluster_size = PropertyMock(return_value = 1)

View file

@ -38,7 +38,7 @@ def test_post():
mocked_network_manager = MagicMock() mocked_network_manager = MagicMock()
output_device._manager = mocked_network_manager output_device._manager = mocked_network_manager
# Create a fake reply (we cant use a QReply, since those are abstract C++) # Create a fake reply (we can't use a QReply, since those are abstract C++)
reply = MagicMock() reply = MagicMock()
reply.operation = MagicMock(return_value=QNetworkAccessManager.PostOperation) reply.operation = MagicMock(return_value=QNetworkAccessManager.PostOperation)
reply.url = MagicMock(return_value=QUrl("127.0.0.1")) reply.url = MagicMock(return_value=QUrl("127.0.0.1"))
@ -47,7 +47,7 @@ def test_post():
mocked_callback_handler = MagicMock() mocked_callback_handler = MagicMock()
output_device.post("whatever", "omgzomg", on_finished = mocked_callback_handler.onFinished) output_device.post("whatever", "omgzomg", on_finished = mocked_callback_handler.onFinished)
# So we now fake that the request was sucesful. # So we now fake that the request was successful.
output_device._handleOnFinished(reply) output_device._handleOnFinished(reply)
# We expect to get a callback regarding this. # We expect to get a callback regarding this.
@ -60,7 +60,7 @@ def test_get():
mocked_network_manager = MagicMock() mocked_network_manager = MagicMock()
output_device._manager = mocked_network_manager output_device._manager = mocked_network_manager
# Create a fake reply (we cant use a QReply, since those are abstract C++) # Create a fake reply (we can't use a QReply, since those are abstract C++)
reply = MagicMock() reply = MagicMock()
reply.operation = MagicMock(return_value=QNetworkAccessManager.PostOperation) reply.operation = MagicMock(return_value=QNetworkAccessManager.PostOperation)
reply.url = MagicMock(return_value=QUrl("127.0.0.1")) reply.url = MagicMock(return_value=QUrl("127.0.0.1"))
@ -69,7 +69,7 @@ def test_get():
mocked_callback_handler = MagicMock() mocked_callback_handler = MagicMock()
output_device.get("whatever", on_finished=mocked_callback_handler.onFinished) output_device.get("whatever", on_finished=mocked_callback_handler.onFinished)
# So we now fake that the request was sucesful. # So we now fake that the request was successful.
output_device._handleOnFinished(reply) output_device._handleOnFinished(reply)
# We expect to get a callback regarding this. # We expect to get a callback regarding this.
@ -82,7 +82,7 @@ def test_delete():
mocked_network_manager = MagicMock() mocked_network_manager = MagicMock()
output_device._manager = mocked_network_manager output_device._manager = mocked_network_manager
# Create a fake reply (we cant use a QReply, since those are abstract C++) # Create a fake reply (we can't use a QReply, since those are abstract C++)
reply = MagicMock() reply = MagicMock()
reply.operation = MagicMock(return_value=QNetworkAccessManager.PostOperation) reply.operation = MagicMock(return_value=QNetworkAccessManager.PostOperation)
reply.url = MagicMock(return_value=QUrl("127.0.0.1")) reply.url = MagicMock(return_value=QUrl("127.0.0.1"))
@ -91,7 +91,7 @@ def test_delete():
mocked_callback_handler = MagicMock() mocked_callback_handler = MagicMock()
output_device.delete("whatever", on_finished=mocked_callback_handler.onFinished) output_device.delete("whatever", on_finished=mocked_callback_handler.onFinished)
# So we now fake that the request was sucesful. # So we now fake that the request was successful.
output_device._handleOnFinished(reply) output_device._handleOnFinished(reply)
# We expect to get a callback regarding this. # We expect to get a callback regarding this.
@ -104,7 +104,7 @@ def test_put():
mocked_network_manager = MagicMock() mocked_network_manager = MagicMock()
output_device._manager = mocked_network_manager output_device._manager = mocked_network_manager
# Create a fake reply (we cant use a QReply, since those are abstract C++) # Create a fake reply (we can't use a QReply, since those are abstract C++)
reply = MagicMock() reply = MagicMock()
reply.operation = MagicMock(return_value=QNetworkAccessManager.PostOperation) reply.operation = MagicMock(return_value=QNetworkAccessManager.PostOperation)
reply.url = MagicMock(return_value=QUrl("127.0.0.1")) reply.url = MagicMock(return_value=QUrl("127.0.0.1"))
@ -113,7 +113,7 @@ def test_put():
mocked_callback_handler = MagicMock() mocked_callback_handler = MagicMock()
output_device.put("whatever", "omgzomg", on_finished = mocked_callback_handler.onFinished) output_device.put("whatever", "omgzomg", on_finished = mocked_callback_handler.onFinished)
# So we now fake that the request was sucesful. # So we now fake that the request was successful.
output_device._handleOnFinished(reply) output_device._handleOnFinished(reply)
# We expect to get a callback regarding this. # We expect to get a callback regarding this.

View file

@ -84,12 +84,12 @@ def test_getOverridesForExtruderNoGlobalStack(setting_inheritance_manager):
def test_settingIsOverwritingInheritanceNoUserState(setting_inheritance_manager, mocked_stack): def test_settingIsOverwritingInheritanceNoUserState(setting_inheritance_manager, mocked_stack):
# Setting 1 doesn't have a user state, so it cant have an override # Setting 1 doesn't have a user state, so it can't have an override
assert not setting_inheritance_manager._settingIsOverwritingInheritance("setting_1", mocked_stack) assert not setting_inheritance_manager._settingIsOverwritingInheritance("setting_1", mocked_stack)
def test_settingIsOverwritingInheritanceNotEnabled(setting_inheritance_manager, mocked_stack): def test_settingIsOverwritingInheritanceNotEnabled(setting_inheritance_manager, mocked_stack):
# Setting 2 doesn't have a enabled, so it cant have an override # Setting 2 doesn't have a enabled, so it can't have an override
assert not setting_inheritance_manager._settingIsOverwritingInheritance("setting_2", mocked_stack) assert not setting_inheritance_manager._settingIsOverwritingInheritance("setting_2", mocked_stack)

View file

@ -15,7 +15,7 @@ Resources.addStorageType(CuraApplication.ResourceTypes.SettingVisibilityPreset,
def test_createVisibilityPresetFromLocalFile(): def test_createVisibilityPresetFromLocalFile():
# Simple creation test. This is seperated from the visibilityFromPrevious, since we can't check for the contents # Simple creation test. This is separated from the visibilityFromPrevious, since we can't check for the contents
# of the other profiles, since they might change over time. # of the other profiles, since they might change over time.
visibility_preset = SettingVisibilityPreset() visibility_preset = SettingVisibilityPreset()
@ -49,7 +49,7 @@ def test_setActivePreset():
with patch("cura.CuraApplication.CuraApplication.getInstance"): with patch("cura.CuraApplication.CuraApplication.getInstance"):
visibility_model = SettingVisibilityPresetsModel(preferences) visibility_model = SettingVisibilityPresetsModel(preferences)
visibility_model.activePresetChanged = MagicMock() visibility_model.activePresetChanged = MagicMock()
# Ensure that we start off with basic (since we didn't change anyting just yet!) # Ensure that we start off with basic (since we didn't change anything just yet!)
assert visibility_model.activePreset == "basic" assert visibility_model.activePreset == "basic"
# Everything should be the same. # Everything should be the same.

View file

@ -75,5 +75,5 @@ def test_updateMaxBuildPlate(objects_model, multi_build_plate_model):
# And check what happens if we move down again! # And check what happens if we move down again!
controller._calcMaxBuildPlate = MagicMock(return_value=2) controller._calcMaxBuildPlate = MagicMock(return_value=2)
controller.updateMaxBuildPlate(SceneNode()) controller.updateMaxBuildPlate(SceneNode())
assert controller._active_build_plate == 0 # We don't have any items anywere, so default to 0 assert controller._active_build_plate == 0 # We don't have any items anywhere, so default to 0

View file

@ -38,7 +38,7 @@ def test_addDefaultMachineActions(machine_action_manager, global_stack):
machine_action_manager.addMachineAction(action) machine_action_manager.addMachineAction(action)
# Only the actions in the definition that were registered first will be added to the machine. # Only the actions in the definition that were registered first will be added to the machine.
# For the sake of this test, all the actions were previouly added. # For the sake of this test, all the actions were previously added.
machine_action_manager.addDefaultMachineActions(global_stack) machine_action_manager.addDefaultMachineActions(global_stack)
definition_id = global_stack.getDefinition().getId() definition_id = global_stack.getDefinition().getId()