Allow M23 "File opened" response with no filename

This commit is contained in:
Mark Walker committed 2016-06-17 00:50:15 +00:00
1 parent 257c4ed8aa
commit ba4b7c09bf
2 files changed
+8 -4

No files matched your search

+1 -1
View File
@@ -300,7 +300,7 @@ default_settings = {
"okWithLinenumber": False,
"numExtruders": 1,
"includeCurrentToolInTemps": True,
"includeFilenameOnOpened": True,
"includeFilenameInOpened": True,
"movementSpeed": {
"x": 6000,
"y": 6000,
+7 -3
View File
@@ -1140,12 +1140,16 @@ class MachineCom(object):
elif 'File opened' in line and not self._ignore_select:
# answer to M23, at least on Marlin, Repetier and Sprinter: "File opened:%s Size:%d"
match = regex_sdFileOpened.search(line)
if match:
name = match.group("name")
size = int(match.group("size"))
else:
name = "Unknown"
size = 0
if self._sdFileToSelect:
name = self._sdFileToSelect
self._sdFileToSelect = None
else:
name = match.group("name")
self._currentFile = PrintingSdFileInformation(name, int(match.group("size")))
self._currentFile = PrintingSdFileInformation(name, size)
elif 'File selected' in line:
if self._ignore_select:
self._ignore_select = False