Fix a merge issue with USBPrinting

This commit is contained in:
Arjen Hiemstra 2015-08-18 18:08:44 +02:00
parent a425036c4c
commit 7e2b89ec54

View file

@ -105,7 +105,6 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
self._firmware_file_name = None self._firmware_file_name = None
<<<<<<< HEAD
self._control_view = None self._control_view = None
onError = pyqtSignal() onError = pyqtSignal()
@ -129,12 +128,6 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
def error(self): def error(self):
return self._error_state return self._error_state
=======
self.firmwareUpdateComplete.connect(self._onFirmwareUpdateComplete)
firmwareUpdateComplete = Signal()
>>>>>>> 15.06
# TODO: Might need to add check that extruders can not be changed when it started printing or loading these settings from settings object # TODO: Might need to add check that extruders can not be changed when it started printing or loading these settings from settings object
def setNumExtuders(self, num): def setNumExtuders(self, num):
self._extruder_count = num self._extruder_count = num
@ -242,18 +235,9 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
self._is_connecting = False self._is_connecting = False
Logger.log("i", "Could not establish connection on %s, unknown reasons.", self._serial_port) Logger.log("i", "Could not establish connection on %s, unknown reasons.", self._serial_port)
return return
<<<<<<< HEAD
# If the programmer connected, we know its an atmega based version. Not all that usefull, but it does give some debugging information. # If the programmer connected, we know its an atmega based version. Not all that usefull, but it does give some debugging information.
for baud_rate in self._getBaudrateList(): # Cycle all baud rates (auto detect) for baud_rate in self._getBaudrateList(): # Cycle all baud rates (auto detect)
=======
Logger.log("d", "Starting baud rate detection...")
# If the programmer connected, we know its an atmega based version. Not all that usefull, but it does give some debugging information.
for baud_rate in self._getBaudrateList(): # Cycle all baud rates (auto detect)
Logger.log("d", "Trying baud rate %s", baud_rate)
>>>>>>> 15.06
if self._serial is None: if self._serial is None:
try: try:
self._serial = serial.Serial(str(self._serial_port), baud_rate, timeout = 3, writeTimeout = 10000) self._serial = serial.Serial(str(self._serial_port), baud_rate, timeout = 3, writeTimeout = 10000)
@ -273,10 +257,7 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
if line is None: if line is None:
self.setIsConnected(False) # Something went wrong with reading, could be that close was called. self.setIsConnected(False) # Something went wrong with reading, could be that close was called.
return return
<<<<<<< HEAD
=======
>>>>>>> 15.06
if b"T:" in line: if b"T:" in line:
self._serial.timeout = 0.5 self._serial.timeout = 0.5
sucesfull_responses += 1 sucesfull_responses += 1
@ -317,17 +298,12 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
if self._connect_thread.isAlive(): if self._connect_thread.isAlive():
try: try:
self._connect_thread.join() self._connect_thread.join()
<<<<<<< HEAD
except Exception as e: except Exception as e:
pass # This should work, but it does fail sometimes for some reason pass # This should work, but it does fail sometimes for some reason
=======
except:
pass
self._connect_thread = threading.Thread(target=self._connect) self._connect_thread = threading.Thread(target=self._connect)
self._connect_thread.daemon = True self._connect_thread.daemon = True
>>>>>>> 15.06
if self._serial is not None: if self._serial is not None:
self.setIsConnected(False) self.setIsConnected(False)
try: try:
@ -336,11 +312,8 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter):
pass pass
self._serial.close() self._serial.close()
<<<<<<< HEAD
=======
self._listen_thread = threading.Thread(target=self._listen) self._listen_thread = threading.Thread(target=self._listen)
self._listen_thread.daemon = True self._listen_thread.daemon = True
>>>>>>> 15.06
self._serial = None self._serial = None
def isConnected(self): def isConnected(self):