From 23e42164cb16cdbc0bc7f4a5496d349886bcafd2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 5 Sep 2018 16:05:36 +0200 Subject: [PATCH] Add total estimated time to output So that we can verify whether our re-estimation is the same as CuraEngine's original estimation. Contributes to issue CURA-5561. --- 50_inst_per_sec.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/50_inst_per_sec.py b/50_inst_per_sec.py index 7ab864a36e..4d781f4965 100644 --- a/50_inst_per_sec.py +++ b/50_inst_per_sec.py @@ -346,6 +346,7 @@ class CommandBuffer: self._detection_time_frame = lower_bound_buffer_depletion_time self._code_count_limit = self._buffer_size + self.total_time = 0.0 self.previous_feedrate = [0, 0, 0, 0] self.previous_nominal_feedrate = 0 @@ -356,6 +357,7 @@ class CommandBuffer: self._bad_frame_ranges = [] def process(self) -> None: + buf.total_time = 0.0 cmd0_idx = 0 total_frame_time = 0.0 cmd_count = 0 @@ -419,6 +421,7 @@ class CommandBuffer: for idx, cmd in enumerate(self._all_commands): cmd_count += 1 if idx > cmd0_idx or idx == 0: + buf.total_time += cmd.estimated_exec_time total_frame_time += cmd.estimated_exec_time if total_frame_time > 1: @@ -489,6 +492,7 @@ class CommandBuffer: all_lines = [str(c) for c in self._all_commands] with open(file_name, "w", encoding = "utf-8") as f: f.writelines(all_lines) + f.write(";---TOTAL ESTIMATED TIME:" + str(self.total_time)) def report(self) -> None: for item in self._bad_frame_ranges: