Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix print adjustment settings #15

Merged
merged 3 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions display.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def execute_action(self, action):
elif action == "files_picker":
self._navigate_to_page(PAGE_FILES)
self._loop.create_task(self._load_files())

elif action.startswith("temp_heater_"):
parts = action.split("_")
self.printing_selected_heater = "_".join(parts[2:])
Expand Down Expand Up @@ -681,13 +682,23 @@ def save_temp_preset(self):
self._go_back()

def send_speed_update(self, speed_type, new_speed):
if speed_type == "print":
self.send_gcode(f"M220 S{new_speed:.0f}")
elif speed_type == "flow":
self.send_gcode(f"M221 S{new_speed:.0f}")
elif speed_type == "fan":
value = min(max(int((new_speed / 100) * 255), 0), 255)
self.send_gcode(f"M106 S{value}")
if new_speed != 1.0:
if speed_type == "print":
self.send_gcode(f"M220 S{new_speed:.0f}")
elif speed_type == "flow":
self.send_gcode(f"M221 S{new_speed:.0f}")
elif speed_type == "fan":
new_speed = int(new_speed)
value = min(max(((new_speed) / 100) * 255, 0), 255)
self.send_gcode(f"M106 S{value}")
else:
if speed_type == "print":
self.send_gcode("M220 S100")
elif speed_type == "flow":
self.send_gcode("M221 S100")
elif speed_type == "fan":
self.send_gcode("M106 S0")
#edited for more stable print interface

def _toggle_fan(self, state):
gcode = f"M106 S{'255' if state else '0'}"
Expand Down Expand Up @@ -1131,7 +1142,7 @@ def handle_status_update(self, new_data, data_mapping=None):
"output_pin Frame_Light" in new_data
and new_data["output_pin Frame_Light"]["value"] is not None
):
self.part_light_state = (
self.frame_light_state = (
int(new_data["output_pin Frame_Light"]["value"]) == 1
)
if "fan" in new_data:
Expand Down Expand Up @@ -1165,12 +1176,12 @@ def handle_status_update(self, new_data, data_mapping=None):
if "target" in new_data["extruder"]:
self.printing_target_temps["extruder"] = new_data["extruder"]["target"]
self.printer_heating_value_changed("extruder", new_data["extruder"]["target"])
if "heater_generic heater_bed" in new_data:
if "target" in new_data["heater_bed"]:
if "heater_bed" in new_data: #remove heater_generic
if "target" in new_data["heater_bed"]:
self.printing_target_temps["heater_bed"] = new_data[
"heater_generic heater_bed"
"heater_bed"
]["target"]
self.printer_heating_value_changed("heater_bed", new_data["heater_generic heater_bed"]["target"])
self.printer_heating_value_changed("heater_bed", new_data["heater_bed"]["target"])
if "heater_generic heater_bed_outer" in new_data:
if "target" in new_data["heater_generic heater_bed_outer"]:
self.printing_target_temps["heater_bed_outer"] = new_data[
Expand Down
2 changes: 1 addition & 1 deletion src/elegoo_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ async def special_page_handling(self, current_page):
await self.write('b[12].txt="Leveling"')
await self.write('b[18].txt="Screws Tilt Adjust"')
await self.write('b[19].txt="Z-Probe Offset"')
await self.write('b[19].txt="Full Bed Level"')
await self.write('b[20].txt="Full Bed Level"')
self.leveling_mode = None
elif current_page == PAGE_PRINTING_DIALOG_SPEED:
await self.write("b[3].maxval=200")
Expand Down