diff --git a/a1_swap_mod_packer/gcode.py b/a1_swap_mod_packer/gcode.py index bd13c23..b435ae6 100644 --- a/a1_swap_mod_packer/gcode.py +++ b/a1_swap_mod_packer/gcode.py @@ -120,7 +120,7 @@ def format_duration(seconds: float | None) -> str: 格式化后的时间字符串,如 "2h 30m"、"5m 20s"、"45s",未知则返回 "未知"。 """ if seconds is None: - return "未知" + return "0s" total = max(0, int(round(seconds))) hours, rem = divmod(total, 3600) minutes, secs = divmod(rem, 60) @@ -142,7 +142,7 @@ def format_filament(weight_grams: float | None, used_m: float | None = None) -> 格式化后的耗材信息字符串,未知则返回 "未知"。 """ if weight_grams is None and used_m is None: - return "未知" + return "0.00 g" parts: list[str] = [] if weight_grams is not None: parts.append(f"{weight_grams:.2f} g") diff --git a/a1_swap_mod_packer/gui.py b/a1_swap_mod_packer/gui.py index 071a313..67cfdde 100644 --- a/a1_swap_mod_packer/gui.py +++ b/a1_swap_mod_packer/gui.py @@ -423,7 +423,7 @@ class MainWindow(QMainWindow): table_layout.addWidget(self.table) # --- 合计统计标签 --- - self.total_summary_label = QLabel("合计:0 板 | 时间:未知 | 耗材:未知") + self.total_summary_label = QLabel("合计:0 板 | 时间:0s | 耗材:0.00 g") table_layout.addWidget(self.total_summary_label) file_body.addLayout(table_layout, 1)