It's now possible to send print jobs to cluster again

CL-541
This commit is contained in:
Jaime van Kessel 2017-11-28 12:59:54 +01:00
parent cfc6a3ad48
commit 9084dfd6bd
3 changed files with 59 additions and 17 deletions

View file

@ -21,8 +21,7 @@ from .LegacyUM3PrinterOutputController import LegacyUM3PrinterOutputController
from time import time
import json
import os # To get the username
import gzip
i18n_catalog = i18nCatalog("cura")
@ -259,16 +258,6 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
self._progress_message.hide()
self._sending_gcode = False
def __compressDataAndNotifyQt(self, data_to_append):
compressed_data = gzip.compress(data_to_append.encode("utf-8"))
self._progress_message.setProgress(-1) # Tickle the message so that it's clear that it's still being used.
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
# Pretend that this is a response, as zipping might take a bit of time.
# If we don't do this, the device might trigger a timeout.
self._last_response_time = time()
return compressed_data
def _onUploadPrintJobProgress(self, bytes_sent, bytes_total):
if bytes_total > 0:
new_progress = bytes_sent / bytes_total * 100