mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Merge WIP_onboarding
This commit is contained in:
commit
c3c9c53f13
77 changed files with 265 additions and 308 deletions
|
@ -48,8 +48,7 @@ from cura.Arranging.Arrange import Arrange
|
|||
from cura.Arranging.ArrangeObjectsJob import ArrangeObjectsJob
|
||||
from cura.Arranging.ArrangeObjectsAllBuildPlatesJob import ArrangeObjectsAllBuildPlatesJob
|
||||
from cura.Arranging.ShapeArray import ShapeArray
|
||||
from cura.MultiplyObjectsJob import MultiplyObjectsJob
|
||||
from cura.GlobalStacksModel import GlobalStacksModel
|
||||
from cura.UI.GlobalStacksModel import GlobalStacksModel
|
||||
from cura.Scene.ConvexHullDecorator import ConvexHullDecorator
|
||||
from cura.Operations.SetParentOperation import SetParentOperation
|
||||
from cura.Scene.SliceableObjectDecorator import SliceableObjectDecorator
|
||||
|
@ -68,19 +67,19 @@ from UM.Settings.SettingFunction import SettingFunction
|
|||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
|
||||
from cura.Settings.MachineNameValidator import MachineNameValidator
|
||||
|
||||
from cura.Machines.Models.BuildPlateModel import BuildPlateModel
|
||||
from cura.Machines.Models.NozzleModel import NozzleModel
|
||||
from cura.Machines.Models.QualityProfilesDropDownMenuModel import QualityProfilesDropDownMenuModel
|
||||
from cura.Machines.Models.CustomQualityProfilesDropDownMenuModel import CustomQualityProfilesDropDownMenuModel
|
||||
from cura.Machines.Models.MultiBuildPlateModel import MultiBuildPlateModel
|
||||
from cura.Machines.Models.FavoriteMaterialsModel import FavoriteMaterialsModel
|
||||
from cura.Machines.Models.GenericMaterialsModel import GenericMaterialsModel
|
||||
from cura.Machines.Models.MaterialBrandsModel import MaterialBrandsModel
|
||||
from cura.Machines.Models.QualityManagementModel import QualityManagementModel
|
||||
from cura.Machines.Models.QualitySettingsModel import QualitySettingsModel
|
||||
from cura.Machines.Models.FirstStartMachineActionsModel import FirstStartMachineActionsModel
|
||||
|
||||
from cura.Machines.Models.SettingVisibilityPresetsModel import SettingVisibilityPresetsModel
|
||||
from cura.UI.MachineModels.BuildPlateModel import BuildPlateModel
|
||||
from cura.UI.MachineModels.DiscoveredPrintersModel import DiscoveredPrintersModel
|
||||
from cura.UI.MachineModels.NozzleModel import NozzleModel
|
||||
from cura.UI.MachineModels.QualityProfilesDropDownMenuModel import QualityProfilesDropDownMenuModel
|
||||
from cura.UI.MachineModels.CustomQualityProfilesDropDownMenuModel import CustomQualityProfilesDropDownMenuModel
|
||||
from cura.UI.MachineModels.MultiBuildPlateModel import MultiBuildPlateModel
|
||||
from cura.UI.MachineModels.FavoriteMaterialsModel import FavoriteMaterialsModel
|
||||
from cura.UI.MachineModels.FirstStartMachineActionsModel import FirstStartMachineActionsModel
|
||||
from cura.UI.MachineModels.GenericMaterialsModel import GenericMaterialsModel
|
||||
from cura.UI.MachineModels.MaterialBrandsModel import MaterialBrandsModel
|
||||
from cura.UI.MachineModels.QualityManagementModel import QualityManagementModel
|
||||
from cura.UI.MachineModels.QualitySettingsModel import QualitySettingsModel
|
||||
from cura.UI.MachineModels.SettingVisibilityPresetsModel import SettingVisibilityPresetsModel
|
||||
|
||||
from cura.Machines.MachineErrorChecker import MachineErrorChecker
|
||||
|
||||
|
@ -94,30 +93,26 @@ from .AutoSave import AutoSave
|
|||
from . import PlatformPhysics
|
||||
from . import BuildVolume
|
||||
from . import CameraAnimation
|
||||
from . import PrintInformation
|
||||
from . import CuraActions
|
||||
from cura.Scene import ZOffsetDecorator
|
||||
from . import CuraSplashScreen
|
||||
from cura.UI import CuraSplashScreen, MachineActionManager, PrintInformation
|
||||
from . import PrintJobPreviewImageProvider
|
||||
from . import MachineActionManager
|
||||
|
||||
from cura.TaskManagement.OnExitCallbackManager import OnExitCallbackManager
|
||||
|
||||
from cura.Settings.MachineManager import MachineManager
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from cura.Settings.UserChangesModel import UserChangesModel
|
||||
from cura.Settings.ExtrudersModel import ExtrudersModel
|
||||
from cura.UI.UserChangesModel import UserChangesModel
|
||||
from cura.UI.ExtrudersModel import ExtrudersModel
|
||||
from cura.Settings.MaterialSettingsVisibilityHandler import MaterialSettingsVisibilityHandler
|
||||
from cura.Settings.ContainerManager import ContainerManager
|
||||
from cura.Settings.SidebarCustomMenuItemsModel import SidebarCustomMenuItemsModel
|
||||
import cura.Settings.cura_empty_instance_containers
|
||||
from cura.Settings.CuraFormulaFunctions import CuraFormulaFunctions
|
||||
|
||||
from cura.ObjectsModel import ObjectsModel
|
||||
from cura.UI.ObjectsModel import ObjectsModel
|
||||
|
||||
from cura.Machines.Models.DiscoveredPrintersModel import DiscoveredPrintersModel
|
||||
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||
from cura.PrinterOutput.NetworkMJPGImage import NetworkMJPGImage
|
||||
|
||||
from cura import ApplicationMetadata, UltimakerCloudAuthentication
|
||||
|
@ -1010,7 +1005,7 @@ class CuraApplication(QtApplication):
|
|||
qmlRegisterSingletonType(SimpleModeSettingsManager, "Cura", 1, 0, "SimpleModeSettingsManager", self.getSimpleModeSettingsManager)
|
||||
qmlRegisterSingletonType(MachineActionManager.MachineActionManager, "Cura", 1, 0, "MachineActionManager", self.getMachineActionManager)
|
||||
|
||||
qmlRegisterType(WelcomePagesModel, "Cura", 1, 0, "WelcomePageModel")
|
||||
qmlRegisterType(WelcomePagesModel, "Cura", 1, 0, "WelcomePagesModel")
|
||||
|
||||
qmlRegisterType(NetworkMJPGImage, "Cura", 1, 0, "NetworkMJPGImage")
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ from typing import Union
|
|||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||
|
||||
class FirmwareUpdater(QObject):
|
||||
firmwareProgressChanged = pyqtSignal()
|
||||
|
|
|
@ -3,14 +3,15 @@
|
|||
|
||||
from typing import TYPE_CHECKING, Set, Union, Optional
|
||||
|
||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||
from PyQt5.QtCore import QTimer
|
||||
|
||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||
from cura.PrinterOutput.ExtruderOutputModel import ExtruderOutputModel
|
||||
from cura.UI.ExtruderOutputModel import ExtruderOutputModel
|
||||
|
||||
|
||||
class GenericOutputController(PrinterOutputController):
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, QVariant, pyqtSlot
|
||||
|
||||
|
||||
class MaterialOutputModel(QObject):
|
||||
def __init__(self, guid, type, color, brand, name, parent = None):
|
||||
super().__init__(parent)
|
||||
self._guid = guid
|
||||
self._type = type
|
||||
self._color = color
|
||||
self._brand = brand
|
||||
self._name = name
|
||||
|
||||
@pyqtProperty(str, constant = True)
|
||||
def guid(self):
|
||||
return self._guid
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def type(self):
|
||||
return self._type
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def brand(self):
|
||||
return self._brand
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def color(self):
|
||||
return self._color
|
||||
|
||||
@pyqtProperty(str, constant=True)
|
||||
def name(self):
|
||||
return self._name
|
|
@ -7,7 +7,7 @@ from UM.Scene.SceneNode import SceneNode #For typing.
|
|||
from cura.API import Account
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionState, ConnectionType
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice, ConnectionState, ConnectionType
|
||||
|
||||
from PyQt5.QtNetwork import QHttpMultiPart, QHttpPart, QNetworkRequest, QNetworkAccessManager, QNetworkReply, QAuthenticator
|
||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject, QUrl, QCoreApplication
|
||||
|
|
|
@ -4,13 +4,11 @@
|
|||
from UM.Logger import Logger
|
||||
from UM.Signal import Signal
|
||||
|
||||
from typing import Union
|
||||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.ExtruderOutputModel import ExtruderOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.UI.ExtruderOutputModel import ExtruderOutputModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ from UM.FlameProfiler import pyqtSlot
|
|||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
|
||||
from cura.PrinterOutput.FirmwareUpdater import FirmwareUpdater
|
||||
from UM.FileHandler.FileHandler import FileHandler
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
|
@ -73,7 +73,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
super().__init__(device_id = device_id, parent = parent) # type: ignore # MyPy complains with the multiple inheritance
|
||||
|
||||
self._printers = [] # type: List[PrinterOutputModel]
|
||||
self._unique_configurations = [] # type: List[ConfigurationModel]
|
||||
self._unique_configurations = [] # type: List[PrinterConfigurationModel]
|
||||
|
||||
self._monitor_view_qml_path = "" # type: str
|
||||
self._monitor_component = None # type: Optional[QObject]
|
||||
|
@ -216,7 +216,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||
|
||||
# Returns the unique configurations of the printers within this output device
|
||||
@pyqtProperty("QVariantList", notify = uniqueConfigurationsChanged)
|
||||
def uniqueConfigurations(self) -> List["ConfigurationModel"]:
|
||||
def uniqueConfigurations(self) -> List["PrinterConfigurationModel"]:
|
||||
return self._unique_configurations
|
||||
|
||||
def _updateUniqueConfigurations(self) -> None:
|
|
@ -4,8 +4,8 @@ from PyQt5.QtCore import Qt, pyqtSlot, QObject
|
|||
from PyQt5.QtWidgets import QApplication
|
||||
|
||||
from UM.Scene.Camera import Camera
|
||||
from cura.ObjectsModel import ObjectsModel
|
||||
from cura.Machines.Models.MultiBuildPlateModel import MultiBuildPlateModel
|
||||
from cura.UI.ObjectsModel import ObjectsModel
|
||||
from cura.UI.MachineModels.MultiBuildPlateModel import MultiBuildPlateModel
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
|
|
|
@ -22,10 +22,10 @@ from UM.Settings.SettingFunction import SettingFunction
|
|||
from UM.Signal import postponeSignals, CompressTechnique
|
||||
|
||||
from cura.Machines.QualityManager import getMachineDefinitionIDForQualitySearch
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionType
|
||||
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
|
||||
from cura.PrinterOutput.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice, ConnectionType
|
||||
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
|
||||
from cura.UI.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
from cura.UI.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
from cura.Settings.ExtruderStack import ExtruderStack
|
||||
|
@ -106,7 +106,7 @@ class MachineManager(QObject):
|
|||
# There might already be some output devices by the time the signal is connected
|
||||
self._onOutputDevicesChanged()
|
||||
|
||||
self._current_printer_configuration = ConfigurationModel() # Indicates the current configuration setup in this printer
|
||||
self._current_printer_configuration = PrinterConfigurationModel() # Indicates the current configuration setup in this printer
|
||||
self.activeMaterialChanged.connect(self._onCurrentConfigurationChanged)
|
||||
self.activeVariantChanged.connect(self._onCurrentConfigurationChanged)
|
||||
# Force to compute the current configuration
|
||||
|
@ -174,7 +174,7 @@ class MachineManager(QObject):
|
|||
self.outputDevicesChanged.emit()
|
||||
|
||||
@pyqtProperty(QObject, notify = currentConfigurationChanged)
|
||||
def currentConfiguration(self) -> ConfigurationModel:
|
||||
def currentConfiguration(self) -> PrinterConfigurationModel:
|
||||
return self._current_printer_configuration
|
||||
|
||||
def _onCurrentConfigurationChanged(self) -> None:
|
||||
|
@ -205,7 +205,7 @@ class MachineManager(QObject):
|
|||
self.currentConfigurationChanged.emit()
|
||||
|
||||
@pyqtSlot(QObject, result = bool)
|
||||
def matchesConfiguration(self, configuration: ConfigurationModel) -> bool:
|
||||
def matchesConfiguration(self, configuration: PrinterConfigurationModel) -> bool:
|
||||
return self._current_printer_configuration == configuration
|
||||
|
||||
@pyqtProperty("QVariantList", notify = outputDevicesChanged)
|
||||
|
@ -1375,7 +1375,7 @@ class MachineManager(QObject):
|
|||
self.setActiveMachine(new_machine.getId())
|
||||
|
||||
@pyqtSlot(QObject)
|
||||
def applyRemoteConfiguration(self, configuration: ConfigurationModel) -> None:
|
||||
def applyRemoteConfiguration(self, configuration: PrinterConfigurationModel) -> None:
|
||||
if self._global_container_stack is None:
|
||||
return
|
||||
self.blurSettings.emit()
|
||||
|
@ -1678,7 +1678,9 @@ class MachineManager(QObject):
|
|||
|
||||
meta_data = global_stack.getMetaData()
|
||||
|
||||
if "um_network_key" in meta_data: # Global stack already had a connection, but it's changed.
|
||||
# Global stack previously had a connection, so here it needs to change the connection information in all
|
||||
# global stacks in that same group.
|
||||
if "um_network_key" in meta_data:
|
||||
old_network_key = meta_data["um_network_key"]
|
||||
# Since we might have a bunch of hidden stacks, we also need to change it there.
|
||||
metadata_filter = {"um_network_key": old_network_key}
|
||||
|
@ -1698,6 +1700,7 @@ class MachineManager(QObject):
|
|||
# Ensure that these containers do know that they are configured for network connection
|
||||
container.addConfiguredConnectionType(printer_device.connectionType.value)
|
||||
|
||||
else: # Global stack didn't have a connection yet, configure it.
|
||||
# Global stack previously didn't have a connection, so directly configure it.
|
||||
else:
|
||||
global_stack.setMetaDataEntry("um_network_key", printer_device.key)
|
||||
global_stack.addConfiguredConnectionType(printer_device.connectionType.value)
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
|
@ -1,29 +1,32 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import pyqtProperty, QUrl
|
||||
|
||||
from UM.Stage import Stage
|
||||
|
||||
|
||||
# Since Cura has a few pre-defined "space claims" for the locations of certain components, we've provided some structure
|
||||
# to indicate this.
|
||||
# * The StageMenuComponent is the horizontal area below the stage bar. This should be used to show stage specific
|
||||
# buttons and elements. This component will be drawn over the bar & main component.
|
||||
# * The MainComponent is the component that will be drawn starting from the bottom of the stageBar and fills the rest
|
||||
# of the screen.
|
||||
class CuraStage(Stage):
|
||||
def __init__(self, parent = None) -> None:
|
||||
super().__init__(parent)
|
||||
|
||||
@pyqtProperty(str, constant = True)
|
||||
def stageId(self) -> str:
|
||||
return self.getPluginId()
|
||||
|
||||
@pyqtProperty(QUrl, constant = True)
|
||||
def mainComponent(self) -> QUrl:
|
||||
return self.getDisplayComponent("main")
|
||||
|
||||
@pyqtProperty(QUrl, constant = True)
|
||||
def stageMenuComponent(self) -> QUrl:
|
||||
return self.getDisplayComponent("menu")
|
||||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import pyqtProperty, QUrl
|
||||
|
||||
from UM.Stage import Stage
|
||||
|
||||
|
||||
# Since Cura has a few pre-defined "space claims" for the locations of certain components, we've provided some structure
|
||||
# to indicate this.
|
||||
# * The StageMenuComponent is the horizontal area below the stage bar. This should be used to show stage specific
|
||||
# buttons and elements. This component will be drawn over the bar & main component.
|
||||
# * The MainComponent is the component that will be drawn starting from the bottom of the stageBar and fills the rest
|
||||
# of the screen.
|
||||
class CuraStage(Stage):
|
||||
def __init__(self, parent = None) -> None:
|
||||
super().__init__(parent)
|
||||
|
||||
@pyqtProperty(str, constant = True)
|
||||
def stageId(self) -> str:
|
||||
return self.getPluginId()
|
||||
|
||||
@pyqtProperty(QUrl, constant = True)
|
||||
def mainComponent(self) -> QUrl:
|
||||
return self.getDisplayComponent("main")
|
||||
|
||||
@pyqtProperty(QUrl, constant = True)
|
||||
def stageMenuComponent(self) -> QUrl:
|
||||
return self.getDisplayComponent("menu")
|
||||
|
||||
|
||||
__all__ = ["CuraStage"]
|
|
@ -4,7 +4,7 @@ from typing import Optional
|
|||
|
||||
from PyQt5.QtCore import pyqtProperty, QObject, pyqtSignal
|
||||
|
||||
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.UI.MaterialOutputModel import MaterialOutputModel
|
||||
|
||||
|
||||
class ExtruderConfigurationModel(QObject):
|
||||
|
@ -67,4 +67,4 @@ class ExtruderConfigurationModel(QObject):
|
|||
# Calculating a hash function using the position of the extruder, the material GUID and the hotend id to check if is
|
||||
# unique within a set
|
||||
def __hash__(self):
|
||||
return hash(self._position) ^ (hash(self._material.guid) if self._material is not None else hash(0)) ^ hash(self._hotend_id)
|
||||
return hash(self._position) ^ (hash(self._material.guid) if self._material is not None else hash(0)) ^ hash(self._hotend_id)
|
|
@ -2,13 +2,13 @@
|
|||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, pyqtSlot
|
||||
from cura.PrinterOutput.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
from cura.UI.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.MaterialOutputModel import MaterialOutputModel
|
||||
|
||||
|
||||
class ExtruderOutputModel(QObject):
|
|
@ -2,23 +2,25 @@
|
|||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty, QTimer
|
||||
from typing import Iterable
|
||||
from typing import Iterable, TYPE_CHECKING
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
import UM.Qt.ListModel
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.Application import Application
|
||||
import UM.FlameProfiler
|
||||
|
||||
from cura.Settings.ExtruderStack import ExtruderStack # To listen to changes on the extruders.
|
||||
if TYPE_CHECKING:
|
||||
from cura.Settings.ExtruderStack import ExtruderStack # To listen to changes on the extruders.
|
||||
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
|
||||
## Model that holds extruders.
|
||||
#
|
||||
# This model is designed for use by any list of extruders, but specifically
|
||||
# intended for drop-down lists of the current machine's extruders in place of
|
||||
# settings.
|
||||
class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||
class ExtrudersModel(ListModel):
|
||||
# The ID of the container stack for the extruder.
|
||||
IdRole = Qt.UserRole + 1
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import pyqtProperty, Qt, QTimer
|
||||
from PyQt5.QtCore import Qt, QTimer
|
||||
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.i18n import i18nCatalog
|
||||
|
||||
from cura.PrinterOutputDevice import ConnectionType
|
||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
||||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
|
||||
from cura.Settings.GlobalStack import GlobalStack
|
||||
|
||||
|
@ -17,9 +17,9 @@ class GlobalStacksModel(ListModel):
|
|||
HasRemoteConnectionRole = Qt.UserRole + 3
|
||||
ConnectionTypeRole = Qt.UserRole + 4
|
||||
MetaDataRole = Qt.UserRole + 5
|
||||
SectionNameRole = Qt.UserRole + 6 # For separating local and remote printers in the machine management page
|
||||
DiscoverySourceRole = Qt.UserRole + 6 # For separating local and remote printers in the machine management page
|
||||
|
||||
def __init__(self, parent = None):
|
||||
def __init__(self, parent = None) -> None:
|
||||
super().__init__(parent)
|
||||
|
||||
self._catalog = i18nCatalog("cura")
|
||||
|
@ -28,7 +28,7 @@ class GlobalStacksModel(ListModel):
|
|||
self.addRoleName(self.IdRole, "id")
|
||||
self.addRoleName(self.HasRemoteConnectionRole, "hasRemoteConnection")
|
||||
self.addRoleName(self.MetaDataRole, "metadata")
|
||||
self.addRoleName(self.SectionNameRole, "sectionName")
|
||||
self.addRoleName(self.DiscoverySourceRole, "discoverySource")
|
||||
self._container_stacks = []
|
||||
|
||||
self._change_timer = QTimer()
|
||||
|
@ -44,12 +44,12 @@ class GlobalStacksModel(ListModel):
|
|||
self._updateDelayed()
|
||||
|
||||
## Handler for container added/removed events from registry
|
||||
def _onContainerChanged(self, container):
|
||||
def _onContainerChanged(self, container) -> None:
|
||||
# We only need to update when the added / removed container GlobalStack
|
||||
if isinstance(container, GlobalStack):
|
||||
self._updateDelayed()
|
||||
|
||||
def _updateDelayed(self):
|
||||
def _updateDelayed(self) -> None:
|
||||
self._change_timer.start()
|
||||
|
||||
def _update(self) -> None:
|
||||
|
@ -61,7 +61,8 @@ class GlobalStacksModel(ListModel):
|
|||
has_remote_connection = False
|
||||
|
||||
for connection_type in container_stack.configuredConnectionTypes:
|
||||
has_remote_connection |= connection_type in [ConnectionType.NetworkConnection.value, ConnectionType.CloudConnection.value]
|
||||
has_remote_connection |= connection_type in [ConnectionType.NetworkConnection.value,
|
||||
ConnectionType.CloudConnection.value]
|
||||
|
||||
if container_stack.getMetaDataEntry("hidden", False) in ["True", True]:
|
||||
continue
|
||||
|
@ -73,6 +74,6 @@ class GlobalStacksModel(ListModel):
|
|||
"id": container_stack.getId(),
|
||||
"hasRemoteConnection": has_remote_connection,
|
||||
"metadata": container_stack.getMetaData().copy(),
|
||||
"sectionName": section_name})
|
||||
items.sort(key=lambda i: not i["hasRemoteConnection"])
|
||||
"discoverySource": section_name})
|
||||
items.sort(key = lambda i: not i["hasRemoteConnection"])
|
||||
self.setItems(items)
|
|
@ -12,7 +12,7 @@ from UM.PluginRegistry import PluginRegistry # So MachineAction can be added as
|
|||
if TYPE_CHECKING:
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.Settings.GlobalStack import GlobalStack
|
||||
from .MachineAction import MachineAction
|
||||
from cura.MachineAction import MachineAction
|
||||
|
||||
|
||||
## Raised when trying to add an unknown machine action as a required action
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
from UM.Logger import Logger
|
||||
|
||||
from cura.Machines.Models.QualityProfilesDropDownMenuModel import QualityProfilesDropDownMenuModel
|
||||
from cura.UI.MachineModels.QualityProfilesDropDownMenuModel import QualityProfilesDropDownMenuModel
|
||||
|
||||
|
||||
#
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from typing import Callable, List, Optional, TYPE_CHECKING
|
||||
from typing import Callable, Dict, List, Optional, TYPE_CHECKING
|
||||
|
||||
from PyQt5.QtCore import pyqtSlot, pyqtProperty, pyqtSignal, QObject
|
||||
|
||||
|
@ -81,34 +81,34 @@ class DiscoveredPrintersModel(QObject):
|
|||
def __init__(self, parent: Optional["QObject"]) -> None:
|
||||
super().__init__(parent)
|
||||
|
||||
self._discovered_printer_dict = dict()
|
||||
self._discovered_printer_by_ip_dict = dict() # type: Dict[str, DiscoveredPrinter]
|
||||
|
||||
discoveredPrintersChanged = pyqtSignal()
|
||||
|
||||
@pyqtProperty(list, notify = discoveredPrintersChanged)
|
||||
def discovered_printers(self) -> "List[DiscoveredPrinter]":
|
||||
item_list = list(x for x in self._discovered_printer_dict.values())
|
||||
item_list = list(x for x in self._discovered_printer_by_ip_dict.values())
|
||||
item_list.sort(key = lambda x: x.name)
|
||||
return item_list
|
||||
|
||||
def addDiscoveredPrinter(self, ip_address: str, key: str, name: str, create_callback: Callable[[str], None],
|
||||
machine_type: str, device) -> None:
|
||||
if ip_address in self._discovered_printer_dict:
|
||||
if ip_address in self._discovered_printer_by_ip_dict:
|
||||
Logger.log("e", "Printer with ip [%s] has already been added", ip_address)
|
||||
return
|
||||
|
||||
discovered_printer = DiscoveredPrinter(ip_address, key, name, create_callback, machine_type, device, parent = self)
|
||||
self._discovered_printer_dict[ip_address] = discovered_printer
|
||||
self._discovered_printer_by_ip_dict[ip_address] = discovered_printer
|
||||
self.discoveredPrintersChanged.emit()
|
||||
|
||||
def updateDiscoveredPrinter(self, ip_address: str,
|
||||
name: Optional[str] = None,
|
||||
machine_type: Optional[str] = None) -> None:
|
||||
if ip_address not in self._discovered_printer_dict:
|
||||
if ip_address not in self._discovered_printer_by_ip_dict:
|
||||
Logger.log("e", "Printer with ip [%s] is not known", ip_address)
|
||||
return
|
||||
|
||||
item = self._discovered_printer_dict[ip_address]
|
||||
item = self._discovered_printer_by_ip_dict[ip_address]
|
||||
|
||||
if name is not None:
|
||||
item.setName(name)
|
||||
|
@ -116,11 +116,11 @@ class DiscoveredPrintersModel(QObject):
|
|||
item.setMachineType(machine_type)
|
||||
|
||||
def removeDiscoveredPrinter(self, ip_address: str) -> None:
|
||||
if ip_address not in self._discovered_printer_dict:
|
||||
if ip_address not in self._discovered_printer_by_ip_dict:
|
||||
Logger.log("i", "Key [%s] does not exist in the discovered printers list.", ip_address)
|
||||
return
|
||||
|
||||
del self._discovered_printer_dict[ip_address]
|
||||
del self._discovered_printer_by_ip_dict[ip_address]
|
||||
self.discoveredPrintersChanged.emit()
|
||||
|
||||
@pyqtSlot("QVariant")
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from cura.Machines.Models.BaseMaterialsModel import BaseMaterialsModel
|
||||
from cura.UI.MachineModels.BaseMaterialsModel import BaseMaterialsModel
|
||||
|
||||
## Model that shows the list of favorite materials.
|
||||
class FavoriteMaterialsModel(BaseMaterialsModel):
|
|
@ -1,8 +1,7 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from UM.Logger import Logger
|
||||
from cura.Machines.Models.BaseMaterialsModel import BaseMaterialsModel
|
||||
from cura.UI.MachineModels.BaseMaterialsModel import BaseMaterialsModel
|
||||
|
||||
class GenericMaterialsModel(BaseMaterialsModel):
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty
|
||||
from PyQt5.QtCore import Qt, pyqtSignal
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.Logger import Logger
|
||||
from cura.Machines.Models.BaseMaterialsModel import BaseMaterialsModel
|
||||
from cura.UI.MachineModels.BaseMaterialsModel import BaseMaterialsModel
|
||||
|
||||
class MaterialTypesModel(ListModel):
|
||||
|
34
cura/UI/MaterialOutputModel.py
Normal file
34
cura/UI/MaterialOutputModel.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import pyqtProperty, QObject
|
||||
|
||||
|
||||
class MaterialOutputModel(QObject):
|
||||
def __init__(self, guid: str, type: str, color: str, brand: str, name: str, parent = None):
|
||||
super().__init__(parent)
|
||||
self._guid = guid
|
||||
self._type = type
|
||||
self._color = color
|
||||
self._brand = brand
|
||||
self._name = name
|
||||
|
||||
@pyqtProperty(str, constant = True)
|
||||
def guid(self) -> str:
|
||||
return self._guid
|
||||
|
||||
@pyqtProperty(str, constant = True)
|
||||
def type(self) -> str:
|
||||
return self._type
|
||||
|
||||
@pyqtProperty(str, constant = True)
|
||||
def brand(self) -> str:
|
||||
return self._brand
|
||||
|
||||
@pyqtProperty(str, constant = True)
|
||||
def color(self) -> str:
|
||||
return self._color
|
||||
|
||||
@pyqtProperty(str, constant = True)
|
||||
def name(self) -> str:
|
||||
return self._name
|
|
@ -1,6 +1,8 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
from PyQt5.QtCore import QTimer
|
||||
|
||||
from UM.Application import Application
|
||||
|
@ -10,7 +12,6 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
|||
from UM.Scene.SceneNode import SceneNode
|
||||
from UM.Scene.Selection import Selection
|
||||
from UM.i18n import i18nCatalog
|
||||
from collections import defaultdict
|
||||
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
|
@ -30,19 +31,19 @@ class ObjectsModel(ListModel):
|
|||
|
||||
self._build_plate_number = -1
|
||||
|
||||
def setActiveBuildPlate(self, nr):
|
||||
def setActiveBuildPlate(self, nr: int) -> None:
|
||||
if self._build_plate_number != nr:
|
||||
self._build_plate_number = nr
|
||||
self._update()
|
||||
|
||||
def _updateSceneDelayed(self, source):
|
||||
def _updateSceneDelayed(self, source) -> None:
|
||||
if not isinstance(source, Camera):
|
||||
self._update_timer.start()
|
||||
|
||||
def _updateDelayed(self, *args):
|
||||
def _updateDelayed(self, *args) -> None:
|
||||
self._update_timer.start()
|
||||
|
||||
def _update(self, *args):
|
||||
def _update(self, *args) -> None:
|
||||
nodes = []
|
||||
filter_current_build_plate = Application.getInstance().getPreferences().getValue("view/filter_current_build_plate")
|
||||
active_build_plate_number = self._build_plate_number
|
|
@ -5,8 +5,7 @@ import json
|
|||
import math
|
||||
import os
|
||||
import unicodedata
|
||||
import re # To create abbreviations for printer names.
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Dict, List, Optional, TYPE_CHECKING
|
||||
|
||||
from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty, pyqtSlot
|
||||
|
||||
|
@ -16,8 +15,6 @@ from UM.Scene.SceneNode import SceneNode
|
|||
from UM.i18n import i18nCatalog
|
||||
from UM.MimeTypeDatabase import MimeTypeDatabase, MimeTypeNotFoundError
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, pyqtSlot
|
||||
from typing import Optional, TYPE_CHECKING, List
|
||||
|
||||
from PyQt5.QtCore import QUrl
|
||||
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, pyqtSlot, QUrl
|
||||
from PyQt5.QtGui import QImage
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
|
||||
|
||||
|
||||
class PrintJobOutputModel(QObject):
|
||||
|
@ -25,7 +24,7 @@ class PrintJobOutputModel(QObject):
|
|||
previewImageChanged = pyqtSignal()
|
||||
compatibleMachineFamiliesChanged = pyqtSignal()
|
||||
|
||||
def __init__(self, output_controller: "PrinterOutputController", key: str = "", name: str = "", parent=None) -> None:
|
||||
def __init__(self, output_controller: "PrinterOutputController", key: str = "", name: str = "", parent = None) -> None:
|
||||
super().__init__(parent)
|
||||
self._output_controller = output_controller
|
||||
self._state = ""
|
||||
|
@ -36,7 +35,7 @@ class PrintJobOutputModel(QObject):
|
|||
self._assigned_printer = None # type: Optional[PrinterOutputModel]
|
||||
self._owner = "" # Who started/owns the print job?
|
||||
|
||||
self._configuration = None # type: Optional[ConfigurationModel]
|
||||
self._configuration = None # type: Optional[PrinterConfigurationModel]
|
||||
self._compatible_machine_families = [] # type: List[str]
|
||||
self._preview_image_id = 0
|
||||
|
||||
|
@ -70,10 +69,10 @@ class PrintJobOutputModel(QObject):
|
|||
self.previewImageChanged.emit()
|
||||
|
||||
@pyqtProperty(QObject, notify=configurationChanged)
|
||||
def configuration(self) -> Optional["ConfigurationModel"]:
|
||||
def configuration(self) -> Optional["PrinterConfigurationModel"]:
|
||||
return self._configuration
|
||||
|
||||
def updateConfiguration(self, configuration: Optional["ConfigurationModel"]) -> None:
|
||||
def updateConfiguration(self, configuration: Optional["PrinterConfigurationModel"]) -> None:
|
||||
if self._configuration != configuration:
|
||||
self._configuration = configuration
|
||||
self.configurationChanged.emit()
|
||||
|
@ -142,13 +141,13 @@ class PrintJobOutputModel(QObject):
|
|||
|
||||
@pyqtProperty(bool, notify=stateChanged)
|
||||
def isActive(self) -> bool:
|
||||
inactiveStates = [
|
||||
inactive_states = [
|
||||
"pausing",
|
||||
"paused",
|
||||
"resuming",
|
||||
"wait_cleanup"
|
||||
]
|
||||
if self.state in inactiveStates and self.timeRemaining > 0:
|
||||
if self.state in inactive_states and self.timeRemaining > 0:
|
||||
return False
|
||||
return True
|
||||
|
|
@ -6,10 +6,10 @@ from typing import List
|
|||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from cura.PrinterOutput.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
from cura.UI.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
|
||||
|
||||
class ConfigurationModel(QObject):
|
||||
class PrinterConfigurationModel(QObject):
|
||||
|
||||
configurationChanged = pyqtSignal()
|
||||
|
||||
|
@ -19,14 +19,14 @@ class ConfigurationModel(QObject):
|
|||
self._extruder_configurations = [] # type: List[ExtruderConfigurationModel]
|
||||
self._buildplate_configuration = ""
|
||||
|
||||
def setPrinterType(self, printer_type):
|
||||
def setPrinterType(self, printer_type: str) -> None:
|
||||
self._printer_type = printer_type
|
||||
|
||||
@pyqtProperty(str, fset = setPrinterType, notify = configurationChanged)
|
||||
def printerType(self) -> str:
|
||||
return self._printer_type
|
||||
|
||||
def setExtruderConfigurations(self, extruder_configurations: List["ExtruderConfigurationModel"]):
|
||||
def setExtruderConfigurations(self, extruder_configurations: List["ExtruderConfigurationModel"]) -> None:
|
||||
if self._extruder_configurations != extruder_configurations:
|
||||
self._extruder_configurations = extruder_configurations
|
||||
|
||||
|
@ -40,7 +40,7 @@ class ConfigurationModel(QObject):
|
|||
return self._extruder_configurations
|
||||
|
||||
def setBuildplateConfiguration(self, buildplate_configuration: str) -> None:
|
||||
if self._buildplate_configuration != buildplate_configuration:
|
||||
if self._buildplate_configuration != buildplate_configuration:
|
||||
self._buildplate_configuration = buildplate_configuration
|
||||
self.configurationChanged.emit()
|
||||
|
||||
|
@ -86,4 +86,4 @@ class ConfigurationModel(QObject):
|
|||
if first_extruder:
|
||||
extruder_hash &= hash(first_extruder)
|
||||
|
||||
return hash(self._printer_type) ^ extruder_hash ^ hash(self._buildplate_configuration)
|
||||
return hash(self._printer_type) ^ extruder_hash ^ hash(self._buildplate_configuration)
|
|
@ -4,12 +4,12 @@
|
|||
from PyQt5.QtCore import pyqtSignal, pyqtProperty, QObject, QVariant, pyqtSlot, QUrl
|
||||
from typing import List, Dict, Optional
|
||||
from UM.Math.Vector import Vector
|
||||
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
|
||||
from cura.PrinterOutput.ExtruderOutputModel import ExtruderOutputModel
|
||||
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
|
||||
from cura.UI.ExtruderOutputModel import ExtruderOutputModel
|
||||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ class PrinterOutputModel(QObject):
|
|||
self._controller = output_controller
|
||||
self._controller.canUpdateFirmwareChanged.connect(self._onControllerCanUpdateFirmwareChanged)
|
||||
self._extruders = [ExtruderOutputModel(printer = self, position = i) for i in range(number_of_extruders)]
|
||||
self._printer_configuration = ConfigurationModel() # Indicates the current configuration setup in this printer
|
||||
self._printer_configuration = PrinterConfigurationModel() # Indicates the current configuration setup in this printer
|
||||
self._head_position = Vector(0, 0, 0)
|
||||
self._active_print_job = None # type: Optional[PrintJobOutputModel]
|
||||
self._firmware_version = firmware_version
|
||||
|
@ -291,7 +291,7 @@ class PrinterOutputModel(QObject):
|
|||
|
||||
# Returns the configuration (material, variant and buildplate) of the current printer
|
||||
@pyqtProperty(QObject, notify = configurationChanged)
|
||||
def printerConfiguration(self) -> Optional[ConfigurationModel]:
|
||||
def printerConfiguration(self) -> Optional[PrinterConfigurationModel]:
|
||||
if self._printer_configuration.isValid():
|
||||
return self._printer_configuration
|
||||
return None
|
|
@ -10,7 +10,6 @@ from UM.Application import Application
|
|||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.i18n import i18nCatalog
|
||||
from UM.Settings.SettingFunction import SettingFunction
|
||||
|
||||
from UM.Qt.ListModel import ListModel
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
import os
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Optional, List, Dict, Any
|
||||
|
||||
from PyQt5.QtCore import QUrl, Qt
|
||||
|
||||
|
@ -25,56 +25,44 @@ class WelcomePagesModel(ListModel):
|
|||
self.addRoleName(self.PageUrlRole, "page_url")
|
||||
self.addRoleName(self.NextPageIdRole, "next_page_id")
|
||||
|
||||
self._pages = []
|
||||
self._pages = [] # type: List[Dict[str, Any]]
|
||||
|
||||
# Convenience function to get QUrl path to pages that's located in "resources/qml/WelcomePages".
|
||||
def _getBuiltinWelcomePagePath(self, page_filename: str) -> "QUrl":
|
||||
from cura.CuraApplication import CuraApplication
|
||||
return QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages", page_filename)))
|
||||
|
||||
def initialize(self) -> None:
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
# Add default welcome pages
|
||||
self._pages.append({"id": "welcome",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"WelcomeContent.qml"))),
|
||||
"page_url": self._getBuiltinWelcomePagePath("WelcomeContent.qml"),
|
||||
})
|
||||
self._pages.append({"id": "user_agreement",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"UserAgreementContent.qml"))),
|
||||
"page_url": self._getBuiltinWelcomePagePath("UserAgreementContent.qml"),
|
||||
})
|
||||
self._pages.append({"id": "whats_new",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"WhatsNewContent.qml"))),
|
||||
"page_url": self._getBuiltinWelcomePagePath("WhatsNewContent.qml"),
|
||||
})
|
||||
self._pages.append({"id": "data_collections",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"DataCollectionsContent.qml"))),
|
||||
"page_url": self._getBuiltinWelcomePagePath("DataCollectionsContent.qml"),
|
||||
})
|
||||
self._pages.append({"id": "add_printer_by_selection",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"AddPrinterBySelectionContent.qml"))),
|
||||
"page_url": self._getBuiltinWelcomePagePath("AddPrinterBySelectionContent.qml"),
|
||||
})
|
||||
self._pages.append({"id": "add_printer_by_ip",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"AddPrinterByIpContent.qml"))),
|
||||
"page_url": self._getBuiltinWelcomePagePath("AddPrinterByIpContent.qml"),
|
||||
})
|
||||
self._pages.append({"id": "machine_actions",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"FirstStartMachineActionsContent.qml"))),
|
||||
"page_url": self._getBuiltinWelcomePagePath("FirstStartMachineActionsContent.qml"),
|
||||
})
|
||||
self._pages.append({"id": "cloud",
|
||||
"page_url": QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
os.path.join("WelcomePages",
|
||||
"CloudContent.qml"))),
|
||||
"page_url": self._getBuiltinWelcomePagePath("CloudContent.qml"),
|
||||
})
|
||||
|
||||
self.setItems(self._pages)
|
||||
|
||||
def addPage(self):
|
||||
def addPage(self) -> None:
|
||||
pass
|
||||
|
||||
|
||||
|
|
|
@ -10,20 +10,17 @@ from time import time
|
|||
from typing import Any, cast, Dict, List, Optional, Set, TYPE_CHECKING
|
||||
|
||||
from UM.Backend.Backend import Backend, BackendState
|
||||
from UM.Scene.Camera import Camera
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
from UM.Signal import Signal
|
||||
from UM.Logger import Logger
|
||||
from UM.Message import Message
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
from UM.Resources import Resources
|
||||
from UM.Platform import Platform
|
||||
from UM.Qt.Duration import DurationFormat
|
||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
from UM.Settings.Interfaces import DefinitionContainerInterface
|
||||
from UM.Settings.SettingInstance import SettingInstance #For typing.
|
||||
from UM.Tool import Tool #For typing.
|
||||
from UM.Mesh.MeshData import MeshData #For typing.
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
@ -33,7 +30,7 @@ from .StartSliceJob import StartSliceJob, StartJobResult
|
|||
import Arcus
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from cura.Machines.Models.MultiBuildPlateModel import MultiBuildPlateModel
|
||||
from cura.UI.MachineModels.MultiBuildPlateModel import MultiBuildPlateModel
|
||||
from cura.Machines.MachineErrorChecker import MachineErrorChecker
|
||||
from UM.Scene.Scene import Scene
|
||||
from UM.Settings.ContainerStack import ContainerStack
|
||||
|
|
|
@ -24,7 +24,7 @@ from cura import LayerPolygon
|
|||
|
||||
import numpy
|
||||
from time import time
|
||||
from cura.Settings.ExtrudersModel import ExtrudersModel
|
||||
from cura.UI.ExtrudersModel import ExtrudersModel
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
import os.path
|
||||
from UM.Application import Application
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
from UM.Resources import Resources
|
||||
from cura.Stages.CuraStage import CuraStage
|
||||
from cura.UI.CuraStage import CuraStage
|
||||
|
||||
|
||||
## Stage for monitoring a 3D printing while it's printing.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import os.path
|
||||
from UM.Application import Application
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
from cura.Stages.CuraStage import CuraStage
|
||||
from cura.UI.CuraStage import CuraStage
|
||||
|
||||
## Stage for preparing model (slicing).
|
||||
class PrepareStage(CuraStage):
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import os.path
|
||||
|
||||
from UM.Qt.QtApplication import QtApplication
|
||||
from cura.Stages.CuraStage import CuraStage
|
||||
from cura.UI.CuraStage import CuraStage
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ from UM.Scene.SceneNode import SceneNode
|
|||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.PrinterOutput.NetworkedPrinterOutputDevice import AuthState, NetworkedPrinterOutputDevice
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutputDevice import ConnectionType
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
||||
|
||||
from .CloudOutputController import CloudOutputController
|
||||
from ..MeshFormatHandler import MeshFormatHandler
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
from typing import Union, Dict, Optional, Any
|
||||
|
||||
from cura.PrinterOutput.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
from cura.PrinterOutput.ExtruderOutputModel import ExtruderOutputModel
|
||||
from cura.UI.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
from cura.UI.ExtruderOutputModel import ExtruderOutputModel
|
||||
from .CloudClusterPrinterConfigurationMaterial import CloudClusterPrinterConfigurationMaterial
|
||||
from .BaseCloudModel import BaseCloudModel
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
from typing import List, Optional, Union, Dict, Any
|
||||
|
||||
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
|
||||
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
|
||||
from ...UM3PrintJobOutputModel import UM3PrintJobOutputModel
|
||||
from ...ConfigurationChangeModel import ConfigurationChangeModel
|
||||
from ..CloudOutputController import CloudOutputController
|
||||
|
@ -95,9 +95,9 @@ class CloudClusterPrintJobStatus(BaseCloudModel):
|
|||
return model
|
||||
|
||||
## Creates a new configuration model
|
||||
def _createConfigurationModel(self) -> ConfigurationModel:
|
||||
def _createConfigurationModel(self) -> PrinterConfigurationModel:
|
||||
extruders = [extruder.createConfigurationModel() for extruder in self.configuration or ()]
|
||||
configuration = ConfigurationModel()
|
||||
configuration = PrinterConfigurationModel()
|
||||
configuration.setExtruderConfigurations(extruders)
|
||||
return configuration
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ from typing import Optional
|
|||
|
||||
from UM.Logger import Logger
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.UI.MaterialOutputModel import MaterialOutputModel
|
||||
from .BaseCloudModel import BaseCloudModel
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
from typing import List, Union, Dict, Optional, Any
|
||||
|
||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from .CloudClusterBuildPlate import CloudClusterBuildPlate
|
||||
from .CloudClusterPrintCoreConfiguration import CloudClusterPrintCoreConfiguration
|
||||
from .BaseCloudModel import BaseCloudModel
|
||||
|
|
|
@ -19,12 +19,12 @@ from UM.Scene.SceneNode import SceneNode # For typing.
|
|||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
|
||||
from cura.PrinterOutput.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
|
||||
from cura.UI.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
from cura.PrinterOutput.NetworkedPrinterOutputDevice import AuthState, NetworkedPrinterOutputDevice
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.PrinterOutputDevice import ConnectionType
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
||||
|
||||
from .Cloud.Utils import formatTimeCompleted, formatDateCompleted
|
||||
from .ClusterUM3PrinterOutputController import ClusterUM3PrinterOutputController
|
||||
|
@ -522,7 +522,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
print_job = UM3PrintJobOutputModel(output_controller=ClusterUM3PrinterOutputController(self),
|
||||
key=data["uuid"], name= data["name"])
|
||||
|
||||
configuration = ConfigurationModel()
|
||||
configuration = PrinterConfigurationModel()
|
||||
extruders = [ExtruderConfigurationModel(position = idx) for idx in range(0, self._number_of_extruders)]
|
||||
for index in range(0, self._number_of_extruders):
|
||||
try:
|
||||
|
|
|
@ -5,7 +5,7 @@ from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
|||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
|
||||
class ClusterUM3PrinterOutputController(PrinterOutputController):
|
||||
def __init__(self, output_device):
|
||||
|
|
|
@ -18,7 +18,7 @@ from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
|
|||
from .UM3OutputDevicePlugin import UM3OutputDevicePlugin
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@ from typing import List, Optional
|
|||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice, AuthState
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.PrinterOutputDevice import ConnectionType
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.UI.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
||||
|
||||
from cura.Settings.ContainerManager import ContainerManager
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
|
|
@ -7,8 +7,8 @@ from UM.Version import Version
|
|||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
|
||||
|
||||
class LegacyUM3PrinterOutputController(PrinterOutputController):
|
||||
|
|
|
@ -5,16 +5,16 @@ from queue import Queue
|
|||
from threading import Event, Thread
|
||||
from time import time
|
||||
import os
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
|
||||
from zeroconf import Zeroconf, ServiceBrowser, ServiceStateChange, ServiceInfo
|
||||
from PyQt5.QtNetwork import QNetworkRequest, QNetworkAccessManager
|
||||
from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty, QObject
|
||||
from PyQt5.QtCore import QUrl
|
||||
from PyQt5.QtGui import QDesktopServices
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.PrinterOutputDevice import ConnectionType
|
||||
from cura.Settings.GlobalStack import GlobalStack # typing
|
||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
||||
|
||||
from UM.OutputDevice.OutputDeviceManager import ManualDeviceAdditionAttempt
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
|
@ -28,10 +28,13 @@ from UM.Version import Version
|
|||
from . import ClusterUM3OutputDevice, LegacyUM3OutputDevice
|
||||
from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager
|
||||
|
||||
from typing import Optional
|
||||
if TYPE_CHECKING:
|
||||
from cura.Settings.GlobalStack import GlobalStack
|
||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||
|
||||
i18n_catalog = i18nCatalog("cura")
|
||||
|
||||
|
||||
## This plugin handles the connection detection & creation of output device objects for the UM3 printer.
|
||||
# Zero-Conf is used to detect printers, which are saved in a dict.
|
||||
# If we discover a printer that has the same key as the active machine instance a connection is made.
|
||||
|
@ -448,7 +451,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
Logger.log("d", "Checking if cloud connection is possible...")
|
||||
|
||||
# Pre-Check: Skip if active machine already has been cloud connected or you said don't ask again
|
||||
active_machine = self._application.getMachineManager().activeMachine # type: Optional["GlobalStack"]
|
||||
active_machine = self._application.getMachineManager().activeMachine # type: Optional[GlobalStack]
|
||||
if active_machine:
|
||||
|
||||
# Check 1A: Printer isn't already configured for cloud
|
||||
|
@ -536,7 +539,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
return
|
||||
|
||||
def _onDontAskMeAgain(self, checked: bool) -> None:
|
||||
active_machine = self._application.getMachineManager().activeMachine # type: Optional["GlobalStack"]
|
||||
active_machine = self._application.getMachineManager().activeMachine # type: Optional[GlobalStack]
|
||||
if active_machine:
|
||||
active_machine.setMetaDataEntry("do_not_show_cloud_message", checked)
|
||||
if checked:
|
||||
|
|
|
@ -5,7 +5,7 @@ from typing import List
|
|||
|
||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal
|
||||
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||
from .ConfigurationChangeModel import ConfigurationChangeModel
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from unittest.mock import patch, MagicMock
|
|||
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
from cura.UltimakerCloudAuthentication import CuraCloudAPIRoot
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from ...src.Cloud import CloudApiClient
|
||||
from ...src.Cloud.CloudOutputDevice import CloudOutputDevice
|
||||
from ...src.Cloud.Models.CloudClusterResponse import CloudClusterResponse
|
||||
|
|
|
@ -13,7 +13,7 @@ from time import sleep
|
|||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||
|
||||
|
||||
class AvrFirmwareUpdater(FirmwareUpdater):
|
||||
|
|
|
@ -7,9 +7,9 @@ from UM.i18n import i18nCatalog
|
|||
from UM.Qt.Duration import DurationFormat
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionState, ConnectionType
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice, ConnectionState, ConnectionType
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.GenericOutputController import GenericOutputController
|
||||
|
||||
from .AutoDetectBaudJob import AutoDetectBaudJob
|
||||
|
|
|
@ -5,15 +5,13 @@ import threading
|
|||
import time
|
||||
import serial.tools.list_ports
|
||||
|
||||
from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
|
||||
from PyQt5.QtCore import QObject, pyqtSignal
|
||||
|
||||
from UM.Logger import Logger
|
||||
from UM.Signal import Signal, signalemitter
|
||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||
from UM.i18n import i18nCatalog
|
||||
|
||||
from cura.PrinterOutputDevice import ConnectionState
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionState
|
||||
|
||||
from . import USBPrinterOutputDevice
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
from typing import List
|
||||
|
||||
from cura.MachineAction import MachineAction
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||
|
||||
from UM.FlameProfiler import pyqtSlot
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ from typing import Tuple, List, Set, Dict
|
|||
import io
|
||||
|
||||
from UM.VersionUpgrade import VersionUpgrade
|
||||
from cura.PrinterOutputDevice import ConnectionType
|
||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
||||
|
||||
deleted_settings = {"bridge_wall_max_overhang"} # type: Set[str]
|
||||
renamed_configurations = {"connect_group_name": "group_name"} # type: Dict[str, str]
|
||||
|
|
|
@ -69,18 +69,9 @@ Item
|
|||
|
||||
property alias browsePackages: browsePackagesAction
|
||||
|
||||
property alias showOnBoarding: showOnBoarding
|
||||
|
||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
|
||||
|
||||
Controls2.Action
|
||||
{
|
||||
id: showOnBoarding
|
||||
text: catalog.i18nc("@action:inmenu", "Show On boarding")
|
||||
shortcut: "Ctrl+Alt+D"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: showTroubleShootingAction
|
||||
|
|
|
@ -58,16 +58,6 @@ UM.MainWindow
|
|||
z: stageMenu.z + 1
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.Actions.showOnBoarding
|
||||
onTriggered:
|
||||
{
|
||||
welcomeDialog.currentStep = 0
|
||||
welcomeDialog.show()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
CuraApplication.setMinimumWindowSize(UM.Theme.getSize("window_minimum_size"))
|
||||
|
|
|
@ -16,7 +16,7 @@ UM.ManagementPage
|
|||
title: catalog.i18nc("@title:tab", "Printers");
|
||||
model: Cura.GlobalStacksModel { }
|
||||
|
||||
sectionRole: "sectionName"
|
||||
sectionRole: "discoverySource"
|
||||
|
||||
activeId: Cura.MachineManager.activeMachineId
|
||||
activeIndex: activeMachineIndex()
|
||||
|
|
|
@ -23,7 +23,7 @@ ScrollView
|
|||
property string preferredCategory: "Ultimaker"
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||
|
||||
property int maxItemCountAtOnce: 10 // show at max 10 items at once, otherwise you need to scroll.
|
||||
height: maxItemCountAtOnce * UM.Theme.getSize("action_button").height
|
||||
|
@ -100,7 +100,6 @@ ScrollView
|
|||
{
|
||||
id: arrow
|
||||
anchors.left: parent.left
|
||||
//anchors.verticalCenter: label.verticalCenter
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
|
@ -162,7 +161,8 @@ ScrollView
|
|||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover")
|
||||
|
||||
Rectangle {
|
||||
Rectangle
|
||||
{
|
||||
width: parent.width / 2
|
||||
height: width
|
||||
anchors.centerIn: parent
|
||||
|
|
|
@ -56,7 +56,7 @@ Item
|
|||
anchors.right: parent.right
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AsNeeded
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||
|
||||
property int maxItemCountAtOnce: 8 // show at max 8 items at once, otherwise you need to scroll.
|
||||
height: maxItemCountAtOnce * UM.Theme.getSize("action_button").height
|
||||
|
|
|
@ -4,7 +4,7 @@ from unittest.mock import MagicMock
|
|||
from PyQt5.QtNetwork import QNetworkAccessManager
|
||||
from PyQt5.QtCore import QUrl
|
||||
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice, AuthState
|
||||
from cura.PrinterOutputDevice import ConnectionState
|
||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionState
|
||||
|
||||
|
||||
def test_properties():
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||
|
||||
test_validate_data_get_set = [
|
||||
{"attribute": "connectionText", "value": "yay"},
|
||||
|
@ -34,4 +34,4 @@ def test_getAndSet(data):
|
|||
# Attempt to set the value again
|
||||
getattr(model, "set" + attribute)(data["value"])
|
||||
# The signal should not fire again
|
||||
assert signal.emit.call_count == 1
|
||||
assert signal.emit.call_count == 1
|
|
@ -5,7 +5,7 @@ import os.path
|
|||
from UM.Preferences import Preferences
|
||||
from UM.Resources import Resources
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.Machines.Models.SettingVisibilityPresetsModel import SettingVisibilityPresetsModel
|
||||
from cura.UI.MachineModels.SettingVisibilityPresetsModel import SettingVisibilityPresetsModel
|
||||
from cura.Settings.SettingVisibilityPreset import SettingVisibilityPreset
|
||||
|
||||
setting_visibility_preset_test_settings = {"test", "zomg", "derp", "yay", "whoo"}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import pytest
|
||||
|
||||
from cura.MachineAction import MachineAction
|
||||
from cura.MachineActionManager import NotUniqueMachineActionError, UnknownMachineActionError
|
||||
from cura.UI.MachineActionManager import NotUniqueMachineActionError, UnknownMachineActionError
|
||||
from cura.Settings.GlobalStack import GlobalStack
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import functools
|
||||
|
||||
from UM.Qt.Duration import Duration
|
||||
from cura import PrintInformation
|
||||
from cura.UI import PrintInformation
|
||||
from cura.Settings.MachineManager import MachineManager
|
||||
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
|
|
@ -2,16 +2,16 @@ from unittest.mock import MagicMock
|
|||
|
||||
import pytest
|
||||
|
||||
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
|
||||
test_validate_data_get_set = [
|
||||
{"attribute": "compatibleMachineFamilies", "value": ["yay"]},
|
||||
]
|
||||
|
||||
test_validate_data_get_update = [
|
||||
{"attribute": "configuration", "value": ConfigurationModel()},
|
||||
{"attribute": "configuration", "value": PrinterConfigurationModel()},
|
||||
{"attribute": "owner", "value": "WHOO"},
|
||||
{"attribute": "assignedPrinter", "value": PrinterOutputModel(MagicMock())},
|
||||
{"attribute": "key", "value": "YAY"},
|
|
@ -4,8 +4,8 @@ from unittest.mock import MagicMock
|
|||
|
||||
import pytest
|
||||
|
||||
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
|
||||
from cura.PrinterOutput.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
|
||||
from cura.UI.ExtruderConfigurationModel import ExtruderConfigurationModel
|
||||
|
||||
test_validate_data_get_set = [
|
||||
{"attribute": "extruderConfigurations", "value": [ExtruderConfigurationModel()]},
|
||||
|
@ -16,7 +16,7 @@ test_validate_data_get_set = [
|
|||
|
||||
@pytest.mark.parametrize("data", test_validate_data_get_set)
|
||||
def test_getAndSet(data):
|
||||
model = ConfigurationModel()
|
||||
model = PrinterConfigurationModel()
|
||||
|
||||
# Convert the first letter into a capital
|
||||
attribute = list(data["attribute"])
|
|
@ -4,8 +4,8 @@ from unittest.mock import MagicMock
|
|||
|
||||
import pytest
|
||||
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.UI.PrinterOutputModel import PrinterOutputModel
|
||||
|
||||
test_validate_data_get_set = [
|
||||
{"attribute": "name", "value": "YAY"},
|
|
@ -6,11 +6,8 @@
|
|||
import unittest.mock
|
||||
import pytest
|
||||
|
||||
import Arcus #Prevents error: "PyCapsule_GetPointer called with incorrect name" with conflicting SIP configurations between Arcus and PyQt: Import Arcus and Savitar first!
|
||||
import Savitar
|
||||
from UM.Qt.QtApplication import QtApplication #QtApplication import is required, even though it isn't used.
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.MachineActionManager import MachineActionManager
|
||||
from cura.UI.MachineActionManager import MachineActionManager
|
||||
|
||||
|
||||
# Create a CuraApplication object that will be shared among all tests. It needs to be initialized.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue