mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Use the new bits of API to add some more bits of printer application
This commit is contained in:
parent
abe19dfd9b
commit
e7a51b3bd8
1 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,8 @@ from UM.Resources import Resources
|
|||
from UM.Scene.BoxRenderer import BoxRenderer
|
||||
from UM.Scene.Selection import Selection
|
||||
|
||||
from PlatformPhysics import PlatformPhysics
|
||||
|
||||
import os.path
|
||||
|
||||
class PrinterApplication(QtApplication):
|
||||
|
@ -16,6 +18,8 @@ class PrinterApplication(QtApplication):
|
|||
super().__init__()
|
||||
self.setApplicationName('printer')
|
||||
|
||||
self._physics = None
|
||||
|
||||
def run(self):
|
||||
self._plugin_registry.loadPlugins({ "type": "Logger"})
|
||||
self._plugin_registry.loadPlugins({ "type": "StorageDevice" })
|
||||
|
@ -29,8 +33,14 @@ class PrinterApplication(QtApplication):
|
|||
controller.setCameraTool("CameraTool")
|
||||
controller.setSelectionTool("SelectionTool")
|
||||
|
||||
t = controller.getTool('TranslateTool')
|
||||
if t:
|
||||
t.setYRange(0.0, 0.0)
|
||||
|
||||
Selection.selectionChanged.connect(self.onSelectionChanged)
|
||||
|
||||
self._physics = PlatformPhysics(controller)
|
||||
|
||||
try:
|
||||
self.getMachineSettings().loadValuesFromFile(Resources.getPath(Resources.SettingsLocation, 'ultimaker2.cfg'))
|
||||
except FileNotFoundError:
|
||||
|
@ -90,6 +100,8 @@ class PrinterApplication(QtApplication):
|
|||
if Selection.getCount() > 0:
|
||||
if not self.getController().getActiveTool():
|
||||
self.getController().setActiveTool('TranslateTool')
|
||||
|
||||
self.getController().getTool('CameraTool').setOrigin(Selection.getSelectedObject(0).getGlobalPosition())
|
||||
else:
|
||||
if self.getController().getActiveTool() and self.getController().getActiveTool().getName() == 'TranslateTool':
|
||||
self.getController().setActiveTool(None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue