Skip to content
Snippets Groups Projects
Commit 5a1b8b8d authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

record key stats in bulk run (#64)

parent 43e87ad1
Branches
No related merge requests found
......@@ -50,6 +50,7 @@ def batch_decmcts(gcode_files, n_layers, mcts_nodes_per_layer):
env_desc2 = tu.read_env('calibrations/r1_tforms.yaml',
'calibrations/r2_tforms.yaml')
env = tu.SimEnv(env_desc=env_desc2, gui=False, home=home)
decmcts_stats = {}
for f in gcode_files:
......@@ -59,14 +60,18 @@ def batch_decmcts(gcode_files, n_layers, mcts_nodes_per_layer):
print("Runnning for model {}".format(model))
print("####################################")
try:
cs, plan = decmcts.decmcts(tracker,
env,
n_layers=n_layers,
mcts_nodes=mcts_nodes_per_layer
)
plan.visualise()
#plan.visualise()
decmcts_stats[model] = {'total_time': plan.len(),
'print_time': plan.extrusion_time()}
print(decmcts_stats[model])
except:
print("FAILED TO COMPLETE ON MODEL {}".format(model))
......
......@@ -201,6 +201,19 @@ class Plan:
return max([a[-1] for a in self.cumul_time.values()])
def extrusion_time(self):
"""
time spent extruding
"""
t = 0
for arm in self.trajs:
for traj in self.trajs[arm]:
if traj.contour is not None:
t += traj.time[-1]
return t
def load_plan(filename, gui=False):
"""
load a saved plan
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment