mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 18:59:10 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
e6c8a11017
@ -439,7 +439,6 @@ class CuraApplication(QtApplication):
|
|||||||
self.__single_instance_server = QLocalServer()
|
self.__single_instance_server = QLocalServer()
|
||||||
self.__single_instance_server.newConnection.connect(self._singleInstanceServerNewConnection)
|
self.__single_instance_server.newConnection.connect(self._singleInstanceServerNewConnection)
|
||||||
self.__single_instance_server.listen("ultimaker-cura")
|
self.__single_instance_server.listen("ultimaker-cura")
|
||||||
Logger.log("d","Single-instance: Listening on: " + repr(self.__single_instance_server.fullServerName()))
|
|
||||||
|
|
||||||
def _singleInstanceServerNewConnection(self):
|
def _singleInstanceServerNewConnection(self):
|
||||||
Logger.log("i", "New connection recevied on our single-instance server")
|
Logger.log("i", "New connection recevied on our single-instance server")
|
||||||
@ -447,11 +446,9 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
if remote_cura_connection is not None:
|
if remote_cura_connection is not None:
|
||||||
def readCommands():
|
def readCommands():
|
||||||
Logger.log("d", "Single-instance: readCommands()")
|
|
||||||
line = remote_cura_connection.readLine()
|
line = remote_cura_connection.readLine()
|
||||||
while len(line) != 0: # There is also a .canReadLine()
|
while len(line) != 0: # There is also a .canReadLine()
|
||||||
try:
|
try:
|
||||||
Logger.log("d", "Single-instance: Read command line: " + repr(line))
|
|
||||||
payload = json.loads(str(line, encoding="ASCII").strip())
|
payload = json.loads(str(line, encoding="ASCII").strip())
|
||||||
command = payload["command"]
|
command = payload["command"]
|
||||||
|
|
||||||
@ -482,11 +479,6 @@ class CuraApplication(QtApplication):
|
|||||||
line = remote_cura_connection.readLine()
|
line = remote_cura_connection.readLine()
|
||||||
|
|
||||||
remote_cura_connection.readyRead.connect(readCommands)
|
remote_cura_connection.readyRead.connect(readCommands)
|
||||||
def disconnected():
|
|
||||||
Logger.log("d", "Single-instance: Disconnected")
|
|
||||||
readCommands()
|
|
||||||
Logger.log("d", "Single-instance: Finished disconnected")
|
|
||||||
remote_cura_connection.disconnected.connect(disconnected) # Get any last commands before it is destroyed.
|
|
||||||
|
|
||||||
## Perform any checks before creating the main application.
|
## Perform any checks before creating the main application.
|
||||||
#
|
#
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2015 Ultimaker B.V.
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the AGPLv3 or higher.
|
# Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
from UM.Signal import Signal, signalemitter
|
from UM.Signal import Signal, signalemitter
|
||||||
@ -270,7 +270,7 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension):
|
|||||||
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.usb*") + glob.glob("/dev/tty.wchusb*") + glob.glob("/dev/cu.wchusb*")
|
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.usb*") + glob.glob("/dev/tty.wchusb*") + glob.glob("/dev/cu.wchusb*")
|
||||||
base_list = filter(lambda s: "Bluetooth" not in s, base_list) # Filter because mac sometimes puts them in the list
|
base_list = filter(lambda s: "Bluetooth" not in s, base_list) # Filter because mac sometimes puts them in the list
|
||||||
else:
|
else:
|
||||||
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*")
|
base_list = base_list + glob.glob("/dev/ttyUSB*") + glob.glob("/dev/ttyACM*") + glob.glob("/dev/cu.*") + glob.glob("/dev/tty.usb*") + glob.glob("/dev/tty.wchusb*") + glob.glob("/dev/cu.wchusb*") + glob.glob("/dev/rfcomm*") + glob.glob("/dev/serial/by-id/*")
|
||||||
return list(base_list)
|
return list(base_list)
|
||||||
|
|
||||||
_instance = None
|
_instance = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user