diff --git a/ks_includes/locales/KlipperScreen.pot b/ks_includes/locales/KlipperScreen.pot index 90649464..5c7e4fc6 100644 --- a/ks_includes/locales/KlipperScreen.pot +++ b/ks_includes/locales/KlipperScreen.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-29 17:34+0800\n" +"POT-Creation-Date: 2025-06-19 16:45+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -73,15 +73,9 @@ msgstr "" msgid "Activate" msgstr "" -msgid "Adaptive Bed Leveling" -msgstr "" - msgid "Add" msgstr "" -msgid "Add profile" -msgstr "" - msgid "Advanced" msgstr "" @@ -138,7 +132,7 @@ msgstr "" msgid "Auto" msgstr "" -msgid "Auto Calibration" +msgid "Auto Bed Leveling" msgstr "" msgid "Auto Change Nozzle" @@ -159,6 +153,9 @@ msgstr "" msgid "Auto-scroll" msgstr "" +msgid "Automatic compensation based on the data of the bed mesh" +msgstr "" + msgid "Bed Level" msgstr "" @@ -387,6 +384,9 @@ msgstr "" msgid "Fan" msgstr "" +msgid "Fast Calibration" +msgstr "" + msgid "Filament" msgstr "" @@ -414,6 +414,9 @@ msgstr "" msgid "Finding ADXL" msgstr "" +msgid "Fine Calibration" +msgstr "" + msgid "Fine Tuning" msgstr "" @@ -531,9 +534,6 @@ msgstr "" msgid "Key:" msgstr "" -msgid "Klipper Restart" -msgstr "" - msgid "Klipper has disconnected" msgstr "" @@ -580,9 +580,6 @@ msgstr "" msgid "Left:" msgstr "" -msgid "Leveling only in the actual print area" -msgstr "" - msgid "License key" msgstr "" @@ -853,9 +850,6 @@ msgstr "" msgid "Probe Offset" msgstr "" -msgid "Profile Name:" -msgstr "" - msgid "Provide KlipperScreen.log when asking for help.\n" msgstr "" @@ -1055,12 +1049,6 @@ msgstr "" msgid "System" msgstr "" -msgid "System Restart" -msgstr "" - -msgid "System Shutdown" -msgstr "" - msgid "System:" msgstr "" diff --git a/ks_includes/locales/en/LC_MESSAGES/KlipperScreen.po b/ks_includes/locales/en/LC_MESSAGES/KlipperScreen.po index 3e1abe11..7702f680 100644 --- a/ks_includes/locales/en/LC_MESSAGES/KlipperScreen.po +++ b/ks_includes/locales/en/LC_MESSAGES/KlipperScreen.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: KlipperScreen\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-31 14:57+0800\n" +"POT-Creation-Date: 2025-06-19 14:30+0800\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -65,7 +65,10 @@ msgstr "" msgid "Accept" msgstr "" -msgid "Adaptive Bed Leveling" +msgid "Activate" +msgstr "" + +msgid "Add" msgstr "" msgid "Add profile" @@ -127,7 +130,7 @@ msgstr "" msgid "Auto" msgstr "" -msgid "Auto Calibration" +msgid "Auto Bed Leveling" msgstr "" msgid "Auto Change Nozzle" @@ -148,6 +151,9 @@ msgstr "" msgid "Auto-scroll" msgstr "" +msgid "Automatic compensation based on the data of the bed mesh" +msgstr "" + msgid "Bed Level" msgstr "" @@ -229,9 +235,6 @@ msgstr "" msgid "Confirm factory reset?\n" msgstr "" -msgid "Connected" -msgstr "" - msgid "Connecting" msgstr "" @@ -287,6 +290,9 @@ msgstr "" msgid "Disable for 12hs with am / pm" msgstr "" +msgid "Disabled" +msgstr "" + msgid "Disconnect" msgstr "" @@ -301,12 +307,21 @@ msgstr "" msgid "Do you want to recover %s?" msgstr "" +msgid "Door Open Protection Mode" +msgstr "" + +msgid "Elapsed trial time:" +msgstr "" + msgid "Elapsed:" msgstr "" msgid "Emergency Stop" msgstr "" +msgid "Enable Registration Code" +msgstr "" + msgid "Enable screen power management" msgstr "" @@ -457,9 +472,6 @@ msgstr "" msgid "Host" msgstr "" -msgid "Hostname" -msgstr "" - msgid "ID" msgstr "" @@ -502,7 +514,16 @@ msgstr "" msgid "Job Status" msgstr "" -msgid "Klipper Restart" +msgid "Key is empty" +msgstr "" + +msgid "Key is invalid" +msgstr "" + +msgid "Key is valid" +msgstr "" + +msgid "Key:" msgstr "" msgid "Klipper has disconnected" @@ -551,7 +572,7 @@ msgstr "" msgid "Left:" msgstr "" -msgid "Leveling only in the actual print area" +msgid "License key" msgstr "" msgid "Limits" @@ -617,6 +638,9 @@ msgstr "" msgid "Minimum:" msgstr "" +msgid "Minus" +msgstr "" + msgid "Modified" msgstr "" @@ -677,6 +701,9 @@ msgstr "" msgid "Not Inserted" msgstr "" +msgid "Not activated" +msgstr "" + msgid "Not all screens support this" msgstr "" @@ -734,18 +761,30 @@ msgstr "" msgid "Pause" msgstr "" +msgid "Pause Print" +msgstr "" + msgid "Paused" msgstr "" msgid "Perform a full upgrade?" msgstr "" +msgid "Permanent Activation" +msgstr "" + msgid "Pins" msgstr "" +msgid "Please close the door and click Resume to proceed." +msgstr "" + msgid "Please ensure that the Probe Calibrate has been performed" msgstr "" +msgid "Please enter a key to activate" +msgstr "" + msgid "Please enter a valid number" msgstr "" @@ -788,6 +827,12 @@ msgstr "" msgid "Printer Select" msgstr "" +msgid "Printer door is opened. Please close the door and then start printing." +msgstr "" + +msgid "Printer door is opening!" +msgstr "" + msgid "Printing" msgstr "" @@ -830,6 +875,9 @@ msgstr "" msgid "Refresh" msgstr "" +msgid "Remaining Time:" +msgstr "" + msgid "Remove network" msgstr "" @@ -848,10 +896,7 @@ msgstr "" msgid "Restores your print job after a power outage" msgstr "" -msgid "Restoring Left extruder temperature, this may take some time" -msgstr "" - -msgid "Restoring Right extruder temperature, this may take some time" +msgid "Restoring activated extruder temperature, this may take some time." msgstr "" msgid "Resume" @@ -921,6 +966,9 @@ msgstr "" msgid "Send" msgstr "" +msgid "Serial Number:" +msgstr "" + msgid "Settings" msgstr "" @@ -942,6 +990,9 @@ msgstr "" msgid "Size" msgstr "" +msgid "Skip" +msgstr "" + msgid "Slicer" msgstr "" @@ -981,39 +1032,47 @@ msgstr "" msgid "Start testing the Z offset value of the second nozzle?\n" msgstr "" -msgid "Starting WiFi Association" -msgstr "" - msgid "Starting recovery for" msgstr "" msgid "Starting update for" msgstr "" +msgid "State:" +msgstr "" + msgid "System" msgstr "" -msgid "System Restart" -msgstr "" - -msgid "System Shutdown" -msgstr "" - msgid "System:" msgstr "" msgid "Temperature" msgstr "" +msgid "Test Mode" +msgstr "" + msgid "The last print job was not completed continue printing?" msgstr "" +msgid "The new value is not within the valid range." +msgstr "" + msgid "The system doesn't meet the minimum requirement" msgstr "" msgid "The system will reboot!" msgstr "" +msgid "This device is not activated and is available for trial use only" +msgstr "" + +msgid "" +"This feature allows you to customize the printer's response when door " +"opening is detected" +msgstr "" + msgid "This operation is about to print the model" msgstr "" @@ -1032,6 +1091,15 @@ msgstr "" msgid "Total:" msgstr "" +msgid "Trial" +msgstr "" + +msgid "Trial Time:" +msgstr "" + +msgid "Unknown" +msgstr "" + msgid "Unknown Heater" msgstr "" @@ -1134,6 +1202,9 @@ msgid_plural "hours" msgstr[0] "" msgstr[1] "" +msgid "license" +msgstr "" + msgid "macros that use 'rename_existing' are hidden" msgstr "" diff --git a/ks_includes/locales/zh_CN/LC_MESSAGES/KlipperScreen.mo b/ks_includes/locales/zh_CN/LC_MESSAGES/KlipperScreen.mo index 6cc1981f..571b6638 100644 Binary files a/ks_includes/locales/zh_CN/LC_MESSAGES/KlipperScreen.mo and b/ks_includes/locales/zh_CN/LC_MESSAGES/KlipperScreen.mo differ diff --git a/ks_includes/locales/zh_CN/LC_MESSAGES/KlipperScreen.po b/ks_includes/locales/zh_CN/LC_MESSAGES/KlipperScreen.po index 7c6c54af..87227511 100644 --- a/ks_includes/locales/zh_CN/LC_MESSAGES/KlipperScreen.po +++ b/ks_includes/locales/zh_CN/LC_MESSAGES/KlipperScreen.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: KlipperScreen\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-29 17:34+0800\n" +"POT-Creation-Date: 2025-06-19 16:45+0800\n" "PO-Revision-Date: 2024-06-03 19:09+0000\n" "Last-Translator: wsj20050623 <2129426599@qq.com>\n" "Language-Team: Chinese (Simplified) \n" "Language-Team: Chinese (Traditional) {}".format(_("Auto Calibration"))) + auto_calibration_label.set_markup('Auto Calibration') auto_grid = Gtk.Grid() auto_grid.attach(auto_calibration_label, 0, 0, 1, 1) auto_grid.attach(self.calibrate_btn, 1, 0, 1, 1) + manual_calibration_label = Gtk.Label(vexpand=True) + manual_calibration_label.set_markup('Manual Calibration') + + disclaimer = Gtk.Label(wrap=True, halign=Gtk.Align.CENTER) + disclaimer.set_markup('NOTE: Edit your printer.cfg to save manual calibration changes.') + input_grid = Gtk.Grid() + input_grid.attach(manual_calibration_label, 0, 0, 3, 1) + input_grid.attach(disclaimer, 0, 1, 3, 1) for i, dim_freq in enumerate(XY_FREQ): axis_lbl = Gtk.Label(hexpand=False, vexpand=True, halign=Gtk.Align.START, valign=Gtk.Align.CENTER, @@ -48,14 +56,23 @@ class Panel(ScreenPanel): scale.connect("button-release-event", self.set_opt_value, dim_freq['config']) shaper_slug = dim_freq['config'].replace('_freq_', '_type_') - self.freq_xy_combo[shaper_slug] = Gtk.ComboBoxText() - for shaper in SHAPERS: - self.freq_xy_combo[shaper_slug].append(shaper, shaper) - self.freq_xy_combo[shaper_slug].set_active(0) + menu_btn = Gtk.Button(label=SHAPERS[0]) + menu_btn.set_name("compact-combo") + menu_btn.get_style_context().add_class("combo-button") + menu_btn.connect("clicked", self.on_shaper_menu_clicked, shaper_slug) + menu_btn.set_halign(Gtk.Align.CENTER) + menu_btn.set_valign(Gtk.Align.CENTER) + menu_btn.set_margin_end(5) + self.shaper_buttons[shaper_slug] = menu_btn + + combo_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0) + combo_box.pack_start(menu_btn, True, True, 0) + arrow = Gtk.Arrow(arrow_type=Gtk.ArrowType.DOWN, shadow_type=Gtk.ShadowType.NONE) + combo_box.pack_start(arrow, False, False, 0) input_grid.attach(axis_lbl, 0, i + 2, 1, 1) input_grid.attach(scale, 1, i + 2, 1, 1) - input_grid.attach(self.freq_xy_combo[shaper_slug], 2, i + 2, 1, 1) + input_grid.attach(combo_box, 2, i + 2, 1, 1) box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) box.add(auto_grid) @@ -65,7 +82,6 @@ class Panel(ScreenPanel): self.content.add(box) pobox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) - pobox.get_style_context().add_class("measure_button") test_x = self._gtk.Button(label=_("Measure X")) test_x.connect("clicked", self.start_calibration, "x") pobox.pack_start(test_x, True, True, 5) @@ -79,6 +95,50 @@ class Panel(ScreenPanel): self.labels['popover'].add(pobox) self.labels['popover'].set_position(Gtk.PositionType.LEFT) + self.shaper_popovers = {} + for dim_freq in XY_FREQ: + shaper_slug = dim_freq['config'].replace('_freq_', '_type_') + popover = Gtk.Popover() + + grid = Gtk.Grid(column_homogeneous=True, row_spacing=2, column_spacing=2) + columns = 2 + for idx, shaper in enumerate(SHAPERS): + btn = Gtk.Button(label=shaper) + btn.set_name("compact-menu-item") + btn.get_style_context().add_class("menu-item") + btn.connect("clicked", self.on_shaper_selected, shaper_slug, shaper) + + row = idx // columns + col = idx % columns + grid.attach(btn, col, row, 1, 1) + + popover.add(grid) + self.shaper_popovers[shaper_slug] = popover + + def on_shaper_menu_clicked(self, widget, shaper_slug): + popover = self.shaper_popovers[shaper_slug] + popover.set_relative_to(widget) + popover.show_all() + + def on_shaper_selected(self, widget, shaper_slug, shaper): + self.shaper_buttons[shaper_slug].set_label(shaper) + self.shaper_popovers[shaper_slug].popdown() + self.set_input_shaper() + + def set_input_shaper(self): + shaper_freq_x = self.freq_xy_adj['shaper_freq_x'].get_value() + shaper_freq_y = self.freq_xy_adj['shaper_freq_y'].get_value() + shaper_type_x = self.shaper_buttons['shaper_type_x'].get_label() + shaper_type_y = self.shaper_buttons['shaper_type_y'].get_label() + + self._screen._ws.klippy.gcode_script( + f'SET_INPUT_SHAPER ' + f'SHAPER_FREQ_X={shaper_freq_x} ' + f'SHAPER_TYPE_X={shaper_type_x} ' + f'SHAPER_FREQ_Y={shaper_freq_y} ' + f'SHAPER_TYPE_Y={shaper_type_y}' + ) + def on_popover_clicked(self, widget): self.labels['popover'].set_relative_to(widget) self.labels['popover'].show_all() @@ -97,18 +157,7 @@ class Panel(ScreenPanel): self.calibrate_btn.set_label(_('Calibrating') + '...') def set_opt_value(self, widget, opt, *args): - shaper_freq_x = self.freq_xy_adj['shaper_freq_x'].get_value() - shaper_freq_y = self.freq_xy_adj['shaper_freq_y'].get_value() - shaper_type_x = self.freq_xy_combo['shaper_type_x'].get_active_text() - shaper_type_y = self.freq_xy_combo['shaper_type_y'].get_active_text() - - self._screen._ws.klippy.gcode_script( - f'SET_INPUT_SHAPER ' - f'SHAPER_FREQ_X={shaper_freq_x} ' - f'SHAPER_TYPE_X={shaper_type_x} ' - f'SHAPER_FREQ_Y={shaper_freq_y} ' - f'SHAPER_TYPE_Y={shaper_type_y}' - ) + self.set_input_shaper() def save_config(self): @@ -149,7 +198,7 @@ class Panel(ScreenPanel): if results: results.groupdict() self.freq_xy_adj['shaper_freq_' + results['axis']].set_value(float(results['shaper_freq'])) - self.freq_xy_combo['shaper_type_' + results['axis']].set_active(SHAPERS.index(results['shaper_type'])) + self.shaper_buttons['shaper_type_' + results['axis']].set_label(results['shaper_type']) if self.calibrating_axis == results['axis'] or (self.calibrating_axis == "both" and results['axis'] == 'y'): self.calibrate_btn.set_sensitive(True) self.calibrate_btn.set_label(_('Calibrated')) @@ -163,4 +212,4 @@ class Panel(ScreenPanel): ): results = results.groupdict() self.freq_xy_adj['shaper_freq_' + results['axis']].set_value(float(results['shaper_freq'])) - self.freq_xy_combo['shaper_type_' + results['axis']].set_active(SHAPERS.index(results['shaper_type'])) + self.shaper_buttons['shaper_type_' + results['axis']].set_label(results['shaper_type']) \ No newline at end of file diff --git a/panels/job_status.py b/panels/job_status.py index a749f635..f318c673 100644 --- a/panels/job_status.py +++ b/panels/job_status.py @@ -493,8 +493,16 @@ class Panel(ScreenPanel): for x in self._printer.get_temp_devices(): if x in data: temp = round(self._printer.get_stat(x, "temperature")) - temp_target = round(self._printer.get_stat(x, "target")) - power = round(self._printer.get_stat(x, "power") * 100) + if (target := self._printer.get_stat(x, "target")): + temp_target = round(target) + else: + temp_target = 0 + + if (target := self._printer.get_stat(x, "power")): + power = round(target * 100) + else: + power = 0 + temp_state = f"{temp}°/{temp_target}° {'{:3.0f}%'.format(power) if self._show_heater_power else ''}".strip() if x in self.buttons['extruder']: self.buttons['extruder'][x].set_label(temp_state) diff --git a/panels/zcalibrate.py b/panels/zcalibrate.py index 97c6f75a..ba79c392 100644 --- a/panels/zcalibrate.py +++ b/panels/zcalibrate.py @@ -19,6 +19,7 @@ class Panel(ScreenPanel): self.mesh_radius = None self.mesh_origin = [0, 0] self.zero_ref = [] + self.probe_z_offset = None self.z_hop_speed = 15.0 self.z_hop = 5.0 self.probe = self._printer.get_probe() @@ -249,6 +250,8 @@ class Panel(ScreenPanel): def activate(self): if self._printer.get_stat("manual_probe", "is_active"): self.buttons_calibrating() + self.probe_z_offset = None + self.widgets['zoffset'].set_text("?") else: self.buttons_not_calibrating() @@ -261,7 +264,10 @@ class Panel(ScreenPanel): if "manual_probe" in data: if data["manual_probe"]["is_active"]: self.buttons_calibrating() + if self._printer.get_stat('manual_probe', 'z_position_upper') is None: + self.probe_z_offset = self._printer.data['gcode_move']['gcode_position'][2] - 5 else: + self.probe_z_offset = None self.buttons_not_calibrating() elif action == "notify_gcode_response": if "out of range" in data.lower(): @@ -274,7 +280,10 @@ class Panel(ScreenPanel): def update_position(self, position): self.widgets['zposition'].set_text(f"Z: {position[2]:.3f}") - self.widgets['zoffset'].set_text(f"{abs(position[2] - self.z_offset):.3f}") + if self.probe_z_offset is not None: + self.widgets['zoffset'].set_text(f"{(self.probe_z_offset - position[2]):.3f}") + else: + self.widgets['zoffset'].set_text("?") def change_distance(self, widget, distance): logging.info(f"### Distance {distance}") diff --git a/styles/dark/style.css b/styles/dark/style.css index ef988248..0f3d4d61 100644 --- a/styles/dark/style.css +++ b/styles/dark/style.css @@ -367,4 +367,11 @@ textview .time { .dialog-primary { border-bottom-color: @orange-opa-100; +} + +popover, +popover button { + background-color: @pale-cyan-opa-100; + border-color: @white-opa-20; + opacity: 1; } \ No newline at end of file diff --git a/styles/light/style.css b/styles/light/style.css index 48417f8d..97b4643c 100644 --- a/styles/light/style.css +++ b/styles/light/style.css @@ -417,4 +417,10 @@ textview .time { .dialog-primary { background-color: @color1; border-bottom-color: @color1; +} + +popover, +popover button { + background-color: @color4; + border-color: @solarized-base03; } \ No newline at end of file