mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 03:04:23 +08:00
Update all usage of activeMachine to the new API
This commit is contained in:
parent
1ff3a30ede
commit
1947d773a3
@ -83,7 +83,7 @@ class CuraApplication(QtApplication):
|
||||
self._previous_active_tool = None
|
||||
self._platform_activity = False
|
||||
|
||||
self.activeMachineChanged.connect(self._onActiveMachineChanged)
|
||||
self.getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged)
|
||||
|
||||
Resources.addType(self.ResourceTypes.QmlFiles, "qml")
|
||||
Resources.addType(self.ResourceTypes.Firmware, "firmware")
|
||||
|
@ -66,7 +66,7 @@ class PrintInformation(QObject):
|
||||
self._slice_pass = None
|
||||
self._slice_reason = None
|
||||
|
||||
Application.getInstance().activeMachineChanged.connect(self._onActiveMachineChanged)
|
||||
Application.getInstance().getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged)
|
||||
self._onActiveMachineChanged()
|
||||
|
||||
Application.getInstance().getController().getScene().sceneChanged.connect(self._onSceneChanged)
|
||||
@ -179,7 +179,7 @@ class PrintInformation(QObject):
|
||||
if self._current_settings:
|
||||
self._current_settings.settingChanged.disconnect(self._onSettingChanged)
|
||||
|
||||
self._current_settings = Application.getInstance().getActiveMachine()
|
||||
self._current_settings = Application.getInstance().getMachineManager().getActiveMachineInstance()
|
||||
|
||||
if self._current_settings:
|
||||
self._current_settings.settingChanged.connect(self._onSettingChanged)
|
||||
|
@ -45,7 +45,7 @@ class CuraEngineBackend(Backend):
|
||||
self._stored_layer_data = None
|
||||
|
||||
self._settings = None
|
||||
Application.getInstance().activeMachineChanged.connect(self._onActiveMachineChanged)
|
||||
Application.getInstance().getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged)
|
||||
self._onActiveMachineChanged()
|
||||
|
||||
self._change_timer = QTimer()
|
||||
@ -71,7 +71,7 @@ class CuraEngineBackend(Backend):
|
||||
self.backendConnected.connect(self._onBackendConnected)
|
||||
|
||||
def getEngineCommand(self):
|
||||
return [Preferences.getInstance().getValue("backend/location"), "connect", "127.0.0.1:{0}".format(self._port), "-j", Resources.getPath(Resources.Settings, "fdmprinter.json"), "-vv"]
|
||||
return [Preferences.getInstance().getValue("backend/location"), "connect", "127.0.0.1:{0}".format(self._port), "-j", Resources.getPath(Resources.MachineDefinitions, "fdmprinter.json"), "-vv"]
|
||||
|
||||
## Emitted when we get a message containing print duration and material amount. This also implies the slicing has finished.
|
||||
# \param time The amount of time the print will take.
|
||||
@ -194,7 +194,7 @@ class CuraEngineBackend(Backend):
|
||||
if self._settings:
|
||||
self._settings.settingChanged.disconnect(self._onSettingChanged)
|
||||
|
||||
self._settings = Application.getInstance().getActiveMachine()
|
||||
self._settings = Application.getInstance().getMachineManager().getActiveMachineInstance()
|
||||
if self._settings:
|
||||
self._settings.settingChanged.connect(self._onSettingChanged)
|
||||
self._onChanged()
|
||||
|
Loading…
x
Reference in New Issue
Block a user