0.1.2 (#40)
* fix issues related to 8dot3 filenames used in M23 command, #39 * switch to auto reporting temp and sd status
This commit is contained in:
parent
01c6cacf15
commit
cd4103cc71
@ -72,6 +72,7 @@ class BambuVirtualPrinter:
|
|||||||
|
|
||||||
self._running = True
|
self._running = True
|
||||||
self._print_status_reporter = None
|
self._print_status_reporter = None
|
||||||
|
self._print_temp_reporter = None
|
||||||
self._printer_thread = threading.Thread(
|
self._printer_thread = threading.Thread(
|
||||||
target=self._printer_worker,
|
target=self._printer_worker,
|
||||||
name="octoprint.plugins.bambu_printer.printer_state",
|
name="octoprint.plugins.bambu_printer.printer_state",
|
||||||
@ -367,8 +368,10 @@ class BambuVirtualPrinter:
|
|||||||
interval = int(matchS.group(1))
|
interval = int(matchS.group(1))
|
||||||
if interval > 0:
|
if interval > 0:
|
||||||
self.start_continuous_status_report(interval)
|
self.start_continuous_status_report(interval)
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
self.stop_continuous_status_report()
|
self.stop_continuous_status_report()
|
||||||
|
return False
|
||||||
|
|
||||||
self.report_print_job_status()
|
self.report_print_job_status()
|
||||||
return True
|
return True
|
||||||
@ -403,10 +406,39 @@ class BambuVirtualPrinter:
|
|||||||
self._processTemperatureQuery()
|
self._processTemperatureQuery()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@gcode_executor.register("M155")
|
||||||
|
def _auto_report_temperatures(self, data: str) -> bool:
|
||||||
|
matchS = re.search(r"S([0-9]+)", data)
|
||||||
|
if matchS:
|
||||||
|
interval = int(matchS.group(1))
|
||||||
|
if interval > 0:
|
||||||
|
self.start_continuous_temp_report(interval)
|
||||||
|
else:
|
||||||
|
self.stop_continuous_temp_report()
|
||||||
|
|
||||||
|
self.report_print_job_status()
|
||||||
|
return True
|
||||||
|
|
||||||
|
def start_continuous_temp_report(self, interval: int):
|
||||||
|
if self._print_temp_reporter is not None:
|
||||||
|
self._print_temp_reporter.cancel()
|
||||||
|
|
||||||
|
self._print_temp_reporter = RepeatedTimer(
|
||||||
|
interval, self._processTemperatureQuery
|
||||||
|
)
|
||||||
|
self._print_temp_reporter.start()
|
||||||
|
|
||||||
|
def stop_continuous_temp_report(self):
|
||||||
|
if self._print_temp_reporter is not None:
|
||||||
|
self._print_temp_reporter.cancel()
|
||||||
|
self._print_temp_reporter = None
|
||||||
|
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
@gcode_executor.register_no_data("M115")
|
@gcode_executor.register_no_data("M115")
|
||||||
def _report_firmware_info(self) -> bool:
|
def _report_firmware_info(self) -> bool:
|
||||||
self.sendIO("Bambu Printer Integration")
|
self.sendIO("Bambu Printer Integration")
|
||||||
|
self.sendIO("Cap:AUTOREPORT_SD_STATUS:1")
|
||||||
|
self.sendIO("Cap:AUTOREPORT_TEMP:1")
|
||||||
self.sendIO("Cap:EXTENDED_M20:1")
|
self.sendIO("Cap:EXTENDED_M20:1")
|
||||||
self.sendIO("Cap:LFN_WRITE:1")
|
self.sendIO("Cap:LFN_WRITE:1")
|
||||||
return True
|
return True
|
||||||
|
@ -85,7 +85,7 @@ class CachedFileView:
|
|||||||
return file_data
|
return file_data
|
||||||
|
|
||||||
def _get_file_by_stem_cached(self, file_stem: str, allowed_suffixes: list[str]):
|
def _get_file_by_stem_cached(self, file_stem: str, allowed_suffixes: list[str]):
|
||||||
for file_path_str in self._file_data_cache.keys():
|
for file_path_str in list(self._file_data_cache.keys()) + list(self._file_alias_cache.keys()):
|
||||||
file_path = Path(file_path_str)
|
file_path = Path(file_path_str)
|
||||||
if file_stem == file_path.with_suffix("").stem and all(
|
if file_stem == file_path.with_suffix("").stem and all(
|
||||||
suffix in allowed_suffixes for suffix in file_path.suffixes
|
suffix in allowed_suffixes for suffix in file_path.suffixes
|
||||||
|
@ -26,7 +26,7 @@ class IdleState(APrinterState):
|
|||||||
# URL to print. Root path, protocol can vary. E.g., if sd card, "ftp:///myfile.3mf", "ftp:///cache/myotherfile.3mf"
|
# URL to print. Root path, protocol can vary. E.g., if sd card, "ftp:///myfile.3mf", "ftp:///cache/myotherfile.3mf"
|
||||||
filesystem_root = (
|
filesystem_root = (
|
||||||
"file:///mnt/sdcard/"
|
"file:///mnt/sdcard/"
|
||||||
if self._printer._settings.get_boolean(["device_type"]) in ["X1", "X1C"]
|
if self._printer._settings.get(["device_type"]) in ["X1", "X1C"]
|
||||||
else "file:///"
|
else "file:///"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -14,7 +14,7 @@ plugin_package = "octoprint_bambu_printer"
|
|||||||
plugin_name = "OctoPrint-BambuPrinter"
|
plugin_name = "OctoPrint-BambuPrinter"
|
||||||
|
|
||||||
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
|
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
|
||||||
plugin_version = "0.1.1"
|
plugin_version = "0.1.2"
|
||||||
|
|
||||||
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
|
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
|
||||||
# module
|
# module
|
||||||
|
Loading…
x
Reference in New Issue
Block a user