Merge branch 'improve/aboutDialog' into devel
Conflicts: .gitignore THIRDPARTYLICENSES.md setup.py src/octoprint/plugins/virtual_printer/virtual.py src/octoprint/server/__init__.py src/octoprint/server/util/flask.py src/octoprint/server/views.py src/octoprint/settings.py src/octoprint/templates/dialogs/about/about.jinja2 src/octoprint/templates/index.jinja2
This commit is contained in:
commit
54fe75fb4e
9 files changed
+85
-7
No files matched your search
@@ -150,7 +150,12 @@ class VirtualPrinter(object):
|
||||
|
||||
# strip checksum
|
||||
if "*" in data:
|
||||
checksum = int(data[data.rfind("*") + 1:])
|
||||
data = data[:data.rfind("*")]
|
||||
if not checksum == self._calculate_checksum(data):
|
||||
self._triggerResend(expected=self.currentLine + 1)
|
||||
continue
|
||||
|
||||
self.currentLine += 1
|
||||
elif settings().getBoolean(["devel", "virtualPrinter", "forceChecksum"]):
|
||||
self._send("Error: Missing checksum")
|
||||
@@ -388,6 +393,12 @@ class VirtualPrinter(object):
|
||||
|
||||
##~~ further helpers
|
||||
|
||||
def _calculate_checksum(self, line):
|
||||
checksum = 0
|
||||
for c in line:
|
||||
checksum ^= ord(c)
|
||||
return checksum
|
||||
|
||||
def _kill(self):
|
||||
if not self._supportM112:
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user