Skip to content

Commit

Permalink
Merge branch 'main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatGuyZim authored Jul 19, 2023
2 parents 3eb4d02 + 68cb603 commit 0036ffb
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 165 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ This fixes... OR This improves... -->
<!-- Check if relevant -->

- [ ] My code follows the style guidelines of this project as described in [UltiMaker Meta](https://github.com/Ultimaker/Meta) and [Cura QML best practices](https://github.com/Ultimaker/Cura/wiki/QML-Best-Practices)
- [ ] I have read the [Contribution guide](https://github.com/Ultimaker/Cura/blob/main/contributing.md)
- [ ] I have read the [Contribution guide](https://github.com/Ultimaker/Cura/blob/main/CONTRIBUTING.md)
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have uploaded any files required to test this change
- [ ] I have uploaded any files required to test this change
6 changes: 3 additions & 3 deletions cura/CrashHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from PyQt6.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QUrl
from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox, QCheckBox, QPushButton
from PyQt6.QtGui import QDesktopServices
from PyQt6.QtGui import QDesktopServices, QTextCursor

from UM.Application import Application
from UM.Logger import Logger
Expand Down Expand Up @@ -309,7 +309,7 @@ def _exceptionInfoWidget(self):
trace = "".join(trace_list)
text_area.setText(trace)
text_area.setReadOnly(True)

text_area.moveCursor(QTextCursor.MoveOperation.End) # Move cursor to end, so we see last bit of the exception
layout.addWidget(text_area)
group.setLayout(layout)

Expand Down Expand Up @@ -400,7 +400,7 @@ def _logInfoWidget(self):

text_area.setText(logdata)
text_area.setReadOnly(True)

text_area.moveCursor(QTextCursor.MoveOperation.End) # Move cursor to end, so we see last bit of the log
layout.addWidget(text_area)
group.setLayout(layout)

Expand Down
11 changes: 11 additions & 0 deletions cura/CuraApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import tempfile
import time
import platform
from typing import cast, TYPE_CHECKING, Optional, Callable, List, Any, Dict

import numpy
Expand Down Expand Up @@ -828,6 +829,8 @@ def _setLoadingHint(self, hint: str):
def run(self):
super().run()

self._log_hardware_info()

if len(ApplicationMetadata.DEPENDENCY_INFO) > 0:
Logger.debug("Using Conan managed dependencies: " + ", ".join(
[dep["recipe"]["id"] for dep in ApplicationMetadata.DEPENDENCY_INFO["installed"] if dep["recipe"]["version"] != "latest"]))
Expand Down Expand Up @@ -901,6 +904,14 @@ def run(self):

self.exec()

def _log_hardware_info(self):
hardware_info = platform.uname()
Logger.info(f"System: {hardware_info.system}")
Logger.info(f"Release: {hardware_info.release}")
Logger.info(f"Version: {hardware_info.version}")
Logger.info(f"Processor name: {hardware_info.processor}")
Logger.info(f"CPU Cores: {os.cpu_count()}")

def __setUpSingleInstanceServer(self):
if self._use_single_instance:
self._single_instance.startServer()
Expand Down
10 changes: 6 additions & 4 deletions plugins/USBPrinting/AutoDetectBaudJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, serial_port: int) -> None:
self._all_baud_rates = [115200, 250000, 500000, 230400, 76800, 57600, 38400, 19200, 9600]

def run(self) -> None:
Logger.log("d", "Auto detect baud rate started.")
Logger.debug(f"Auto detect baud rate started for {self._serial_port}")
wait_response_timeouts = [3, 15, 30]
wait_bootloader_times = [1.5, 5, 15]
write_timeout = 3
Expand All @@ -46,8 +46,7 @@ def run(self) -> None:
wait_bootloader = wait_bootloader_times[retry]
else:
wait_bootloader = wait_bootloader_times[-1]
Logger.log("d", "Checking {serial} if baud rate {baud_rate} works. Retry nr: {retry}. Wait timeout: {timeout}".format(
serial = self._serial_port, baud_rate = baud_rate, retry = retry, timeout = wait_response_timeout))
Logger.debug(f"Checking {self._serial_port} if baud rate {baud_rate} works. Retry nr: {retry}. Wait timeout: {wait_response_timeout}")

if serial is None:
try:
Expand All @@ -61,7 +60,9 @@ def run(self) -> None:
serial.baudrate = baud_rate
except ValueError:
continue
sleep(wait_bootloader) # Ensure that we are not talking to the boot loader. 1.5 seconds seems to be the magic number

# Ensure that we are not talking to the boot loader. 1.5 seconds seems to be the magic number
sleep(wait_bootloader)

serial.write(b"\n") # Ensure we clear out previous responses
serial.write(b"M105\n")
Expand All @@ -83,4 +84,5 @@ def run(self) -> None:

serial.write(b"M105\n")
sleep(15) # Give the printer some time to init and try again.
Logger.debug(f"Unable to find a working baudrate for {serial}")
self.setResult(None) # Unable to detect the correct baudrate.
152 changes: 0 additions & 152 deletions resources/qml/ColorDialog.qml

This file was deleted.

40 changes: 40 additions & 0 deletions resources/qml/Preferences/Materials/MaterialsSyncDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,51 @@ UM.Window
{
id: refreshListButton
Layout.alignment: Qt.AlignVCenter
readonly property int _AccountSyncState_SYNCING: 0
visible: Cura.API.account.syncState != _AccountSyncState_SYNCING
enabled: visible
text: catalog.i18nc("@button", "Refresh List")
iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight")
onClicked: Cura.API.account.sync(true)
}

Item
{
width: childrenRect.width
Layout.alignment: Qt.AlignVCenter
height: refreshListButton.height
visible: !refreshListButton.visible

UM.ColorImage
{
id: refreshingIcon
height: UM.Theme.getSize("action_button_icon").height
width: height
anchors.verticalCenter: refreshingLabel.verticalCenter
source: UM.Theme.getIcon("ArrowDoubleCircleRight")
color: UM.Theme.getColor("primary")

RotationAnimator
{
target: refreshingIcon
from: 0
to: 360
duration: 1000
loops: Animation.Infinite
running: true
}
}
UM.Label
{
id: refreshingLabel
anchors.left: refreshingIcon.right
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
text: catalog.i18nc("@button", "Refreshing...")
color: UM.Theme.getColor("primary")
font: UM.Theme.getFont("medium")
}
}

Cura.TertiaryButton
{
id: printerListTroubleshooting
Expand Down
6 changes: 3 additions & 3 deletions resources/qml/Preferences/Materials/MaterialsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,12 @@ Item

// popup dialog to select a new color
// if successful it sets the properties.color_code value to the new color
Cura.ColorDialog
ColorDialog
{
id: colorDialog
title: catalog.i18nc("@title", "Material color picker")
color: properties.color_code
onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color)
selectedColor: properties.color_code
onAccepted: base.setMetaDataEntry("color_code", properties.color_code, selectedColor)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RecommendedSettingSection
enableSectionSwitchVisible: platformAdhesionType.properties.enabled === "True"
enableSectionSwitchChecked: platformAdhesionType.properties.value !== "skirt" && platformAdhesionType.properties.value !== "none"
enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled
tooltipText: catalog.i18nc("@label", "Enable printing a brim or raft. This will add a flat area around or under your object which is easy to cut off afterwards.")
tooltipText: catalog.i18nc("@label", "Enable printing a brim or raft. This will add a flat area around or under your object which is easy to cut off afterwards. Disabling it results in a skirt around object by default.")

property var curaRecommendedMode: Cura.RecommendedMode {}

Expand Down
1 change: 1 addition & 0 deletions resources/setting_visibility/basic.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ support_extruder_nr
support_type
support_angle
support_offset
support_structure

[platform_adhesion]
prime_blob_enable
Expand Down

0 comments on commit 0036ffb

Please sign in to comment.