Skip to content

Commit

Permalink
set the estimated number of frames
Browse files Browse the repository at this point in the history
  • Loading branch information
annie-xd-wang committed Aug 30, 2024
1 parent 337cd8f commit e9af6b1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def update_saving_config(self, model):
model : object
navigate model
"""
# TODO: number of steps
return {
"z": model.configuration["experiment"]["ConstantVelocity"][
"number_of_frames"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,26 @@ def func(*args):
widget_name
] = value
except (TypeError, ValueError):
pass
return

start_position = self.parent_controller.configuration["experiment"][
"ConstantVelocity"
]["start_position"]
end_position = self.parent_controller.configuration["experiment"][
"ConstantVelocity"
]["end_position"]
step_size = self.parent_controller.configuration["experiment"][
"ConstantVelocity"
]["step_size"]
# calculate the estimated number of frames
try:
frame_number = abs(end_position - start_position) // step_size
except:
frame_number = 1
self.variables["number_of_frames"].set(frame_number)
self.parent_controller.configuration["experiment"]["ConstantVelocity"][
"number_of_frames"
] = int(frame_number)

return func

Expand All @@ -59,7 +78,6 @@ def func(*args):
return func

def update_axis(self, *args):
print("*** update axis!")
self.parent_controller.configuration["experiment"]["ConstantVelocity"][
"axis"
] = self.variables["axis"].get()
Expand Down

0 comments on commit e9af6b1

Please sign in to comment.