Allow M23 "File opened" response with no filename
This commit is contained in:
parent
257c4ed8aa
commit
ba4b7c09bf
2 changed files with 8 additions and 4 deletions
|
|
@ -300,7 +300,7 @@ default_settings = {
|
||||||
"okWithLinenumber": False,
|
"okWithLinenumber": False,
|
||||||
"numExtruders": 1,
|
"numExtruders": 1,
|
||||||
"includeCurrentToolInTemps": True,
|
"includeCurrentToolInTemps": True,
|
||||||
"includeFilenameOnOpened": True,
|
"includeFilenameInOpened": True,
|
||||||
"movementSpeed": {
|
"movementSpeed": {
|
||||||
"x": 6000,
|
"x": 6000,
|
||||||
"y": 6000,
|
"y": 6000,
|
||||||
|
|
|
||||||
|
|
@ -1140,12 +1140,16 @@ class MachineCom(object):
|
||||||
elif 'File opened' in line and not self._ignore_select:
|
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"
|
# answer to M23, at least on Marlin, Repetier and Sprinter: "File opened:%s Size:%d"
|
||||||
match = regex_sdFileOpened.search(line)
|
match = regex_sdFileOpened.search(line)
|
||||||
|
if match:
|
||||||
|
name = match.group("name")
|
||||||
|
size = int(match.group("size"))
|
||||||
|
else:
|
||||||
|
name = "Unknown"
|
||||||
|
size = 0
|
||||||
if self._sdFileToSelect:
|
if self._sdFileToSelect:
|
||||||
name = self._sdFileToSelect
|
name = self._sdFileToSelect
|
||||||
self._sdFileToSelect = None
|
self._sdFileToSelect = None
|
||||||
else:
|
self._currentFile = PrintingSdFileInformation(name, size)
|
||||||
name = match.group("name")
|
|
||||||
self._currentFile = PrintingSdFileInformation(name, int(match.group("size")))
|
|
||||||
elif 'File selected' in line:
|
elif 'File selected' in line:
|
||||||
if self._ignore_select:
|
if self._ignore_select:
|
||||||
self._ignore_select = False
|
self._ignore_select = False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue