mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Add logging for every setting model update
You can clearly see that some models are updated 4 times or so now. Contributes to issue CURA-4606.
This commit is contained in:
parent
2c5cc17b49
commit
bb7fccbd48
9 changed files with 23 additions and 7 deletions
|
@ -4,8 +4,8 @@
|
|||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty
|
||||
|
||||
from UM.Qt.ListModel import ListModel
|
||||
|
||||
from .BaseMaterialsModel import BaseMaterialsModel
|
||||
from UM.Logger import Logger
|
||||
from cura.Machines.Models.BaseMaterialsModel import BaseMaterialsModel
|
||||
|
||||
|
||||
#
|
||||
|
@ -69,6 +69,7 @@ class BrandMaterialsModel(ListModel):
|
|||
return self._extruder_position
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
global_stack = self._machine_manager.activeMachine
|
||||
if global_stack is None:
|
||||
self.setItems([])
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
from PyQt5.QtCore import Qt
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Logger import Logger
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.Util import parseBool
|
||||
|
||||
|
@ -29,6 +30,7 @@ class BuildPlateModel(ListModel):
|
|||
self._update()
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
global_stack = self._machine_manager._global_container_stack
|
||||
if not global_stack:
|
||||
self.setItems([])
|
||||
|
|
|
@ -12,7 +12,7 @@ from cura.Machines.Models.QualityProfilesDropDownMenuModel import QualityProfile
|
|||
class CustomQualityProfilesDropDownMenuModel(QualityProfilesDropDownMenuModel):
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating %s ...", self.__class__.__name__)
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
|
||||
active_global_stack = self._machine_manager.activeMachine
|
||||
if active_global_stack is None:
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from .BaseMaterialsModel import BaseMaterialsModel
|
||||
from UM.Logger import Logger
|
||||
from cura.Machines.Models.BaseMaterialsModel import BaseMaterialsModel
|
||||
|
||||
|
||||
class GenericMaterialsModel(BaseMaterialsModel):
|
||||
|
@ -21,6 +22,8 @@ class GenericMaterialsModel(BaseMaterialsModel):
|
|||
self._update()
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
|
||||
global_stack = self._machine_manager.activeMachine
|
||||
if global_stack is None:
|
||||
self.setItems([])
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtProperty
|
||||
from PyQt5.QtCore import Qt
|
||||
|
||||
from UM.Logger import Logger
|
||||
from UM.Qt.ListModel import ListModel
|
||||
|
||||
|
||||
|
@ -60,6 +61,8 @@ class MaterialManagementModel(ListModel):
|
|||
self._update()
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
|
||||
global_stack = self._machine_manager.activeMachine
|
||||
if global_stack is None:
|
||||
self.setItems([])
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
from PyQt5.QtCore import Qt
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Logger import Logger
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.Util import parseBool
|
||||
|
||||
|
@ -26,6 +27,8 @@ class NozzleModel(ListModel):
|
|||
Application.getInstance().getMachineManager().activeMaterialChanged.connect(self._update)
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
|
||||
self.items.clear()
|
||||
|
||||
variant_manager = Application.getInstance()._variant_manager
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
from PyQt5.QtCore import Qt, pyqtSlot
|
||||
|
||||
from UM.Qt.ListModel import ListModel
|
||||
|
||||
from UM.Logger import Logger
|
||||
|
||||
#
|
||||
# This the QML model for the quality management page.
|
||||
|
@ -35,6 +35,8 @@ class QualityManagementModel(ListModel):
|
|||
self._update()
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
|
||||
global_stack = self._machine_manager.activeMachine
|
||||
|
||||
quality_group_dict = self._quality_manager.getQualityGroups(global_stack)
|
||||
|
|
|
@ -46,7 +46,7 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
|||
self._update()
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating quality profile model ...")
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
|
||||
global_stack = self._machine_manager.activeMachine
|
||||
if global_stack is None:
|
||||
|
|
|
@ -69,6 +69,8 @@ class QualitySettingsModel(ListModel):
|
|||
return self._selected_quality_item
|
||||
|
||||
def _update(self):
|
||||
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))
|
||||
|
||||
if not self._selected_quality_item:
|
||||
self.setItems([])
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue